:root {
  --bg: #f4f7f9;
  --panel: #ffffff;
  --ink: #10212d;
  --muted: #6f7f89;
  --line: #dce4e9;
  --brand: #0f766e;
  --brand-dark: #0a4f4a;
  --danger: #b42318;
  --warn: #a15c00;
  --success: #1f7a43;
  --sidebar: #0b1720;
  --sidebar-2: #122631;
  --shadow: 0 10px 28px rgba(15, 31, 42, .08);
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.auth-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; background: radial-gradient(circle at top, #17323e, #0b1720 52%); }
.auth-card { width: min(460px, 100%); background: #fff; border-radius: 22px; padding: 34px; box-shadow: 0 24px 80px rgba(0,0,0,.26); }
.auth-card h1 { margin: 14px 0 6px; font-size: 30px; }
.brand-mark { width: 68px; height: 68px; display: grid; place-items: center; border-radius: 18px; background: var(--brand); color: #fff; font-weight: 800; letter-spacing: .04em; }
.brand-mark.small { width: 44px; height: 44px; border-radius: 12px; font-size: 14px; }
.security-note { margin: 22px 0 0; font-size: 12px; color: #788892; line-height: 1.45; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 7px; font-size: 13px; font-weight: 650; color: #30434f; }
input, select, textarea { width: 100%; border: 1px solid #cfd9df; border-radius: 10px; padding: 11px 12px; background: #fff; color: var(--ink); outline: none; }
input:focus, select:focus, textarea:focus { border-color: #70a9a4; box-shadow: 0 0 0 3px rgba(15,118,110,.10); }
textarea { min-height: 88px; resize: vertical; }
.button { border: 0; border-radius: 10px; padding: 11px 14px; background: var(--brand); color: #fff; font-weight: 700; }
.button:hover { background: var(--brand-dark); }
.button.secondary { background: #e9f3f2; color: var(--brand-dark); }
.button.secondary:hover { background: #dcebea; }
.button.danger { background: #fff0ee; color: var(--danger); }
.button.ghost { background: transparent; color: inherit; border: 1px solid rgba(255,255,255,.16); }
.button.compact { padding: 8px 10px; }
.button.full { width: 100%; }
.button:disabled { opacity: .5; cursor: not-allowed; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 250px 1fr; }
.sidebar { background: var(--sidebar); color: #e8f1f4; padding: 22px 16px; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; }
.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px 22px; }
.sidebar-brand strong, .sidebar-brand span { display: block; }
.sidebar-brand span { font-size: 12px; color: #8ca1ad; margin-top: 2px; }
.sidebar nav { display: grid; gap: 6px; }
.nav-button { width: 100%; border: 0; background: transparent; color: #b8c8d0; padding: 11px 12px; text-align: left; border-radius: 10px; font-weight: 650; }
.nav-button:hover, .nav-button.active { background: var(--sidebar-2); color: #fff; }
.sidebar-foot { margin-top: auto; display: grid; gap: 14px; }
.user-card { padding: 12px; background: rgba(255,255,255,.05); border-radius: 12px; }
.user-card strong, .user-card span { display: block; }
.user-card span { color: #92a6b0; font-size: 12px; margin-top: 4px; }
.workspace { min-width: 0; }
.mobile-header { display: none; }
main { padding: 32px; max-width: 1380px; margin: 0 auto; }
.page-head { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: 30px; }
.page-head p { margin: 7px 0 0; color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); padding: 20px; }
.card h2, .card h3 { margin-top: 0; }
.grid { display: grid; gap: 18px; }
.grid.cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kpi .label { color: var(--muted); font-size: 13px; font-weight: 700; }
.kpi .value { margin-top: 10px; font-size: 30px; font-weight: 800; letter-spacing: -.02em; }
.kpi .sub { margin-top: 5px; font-size: 12px; color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid #e6edf1; vertical-align: top; }
th { color: #5c6f7a; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; }
.badge { display: inline-flex; align-items: center; padding: 5px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; background: #eef3f5; color: #455963; }
.badge.open { background: #e8f5f3; color: #0c6a63; }
.badge.closed { background: #fff4df; color: #8a5700; }
.badge.approved, .badge.synced { background: #eaf7ee; color: #1f6d3e; }
.badge.error, .variance.bad { background: #fff0ee; color: var(--danger); }
.variance.good { color: var(--success); font-weight: 800; }
.variance.bad { font-weight: 800; }
.section-stack { display: grid; gap: 18px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.drawer-card { border-left: 4px solid var(--brand); }
.drawer-meta { display: flex; gap: 18px; flex-wrap: wrap; margin: 10px 0 18px; color: var(--muted); font-size: 13px; }
.denom-grid { display: grid; grid-template-columns: repeat(5, minmax(92px, 1fr)); gap: 10px; }
.denom-grid label { background: #f6f9fa; border: 1px solid #e0e8ec; border-radius: 10px; padding: 10px; }
.denom-grid label span { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; }
.blind-note { background: #eef7f6; border: 1px solid #cae4e1; color: #355e5a; padding: 11px 13px; border-radius: 10px; font-size: 13px; margin-bottom: 14px; }
.callout { border-radius: 12px; padding: 14px; background: #f7f9fa; border: 1px solid #e0e7eb; }
.callout.warn { background: #fff8e8; border-color: #f1dfb5; }
.callout.danger { background: #fff2f0; border-color: #f0c9c3; }
.callout.success { background: #eef9f1; border-color: #c8e8d0; }
.location-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.location-checks label { display: flex; align-items: center; gap: 7px; border: 1px solid #d8e1e6; border-radius: 9px; padding: 8px 10px; font-weight: 600; }
.location-checks input { width: auto; }
hr { border: 0; border-top: 1px solid #e3eaee; margin: 20px 0; }
.toast { position: fixed; right: 20px; top: 20px; z-index: 50; max-width: min(420px, calc(100vw - 40px)); padding: 13px 15px; border-radius: 11px; color: #fff; background: #1b343f; box-shadow: 0 12px 34px rgba(0,0,0,.22); opacity: 0; transform: translateY(-8px); pointer-events: none; transition: .2s ease; }
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: #8f2017; }
.empty { text-align: center; padding: 36px 18px; color: var(--muted); }
.small-text { font-size: 12px; }
.right { text-align: right; }
@media (max-width: 1050px) {
  .grid.cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .denom-grid { grid-template-columns: repeat(3, minmax(92px, 1fr)); }
}
@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; left: -270px; width: 250px; z-index: 40; transition: left .2s ease; }
  .sidebar.open { left: 0; }
  .mobile-header { height: 62px; display: flex; align-items: center; justify-content: space-between; padding: 0 16px; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
  main { padding: 20px 14px 36px; }
  .page-head { display: block; }
  .page-head .actions { margin-top: 14px; }
  .grid.cards, .grid.two, .form-grid.two { grid-template-columns: 1fr; }
  .denom-grid { grid-template-columns: repeat(2, minmax(92px, 1fr)); }
  .auth-card { padding: 26px 22px; }
}
