/* ============================================================
   Brightronix — Construction OS
   Light, warm, modern SaaS dashboard
   ============================================================ */

:root {
  --bg: #f6f5f1;
  --bg-soft: #faf9f6;
  --surface: #ffffff;
  --surface-2: #fbfaf7;
  --border: #ece9e1;
  --border-strong: #ddd9cc;
  --border-soft: #f1efe8;

  --ink: #16140f;
  --ink-2: #2a2620;
  --muted: #6f6a5e;
  --muted-2: #8e8a7d;
  --muted-3: #b1ada1;

  --orange: #ff5b2c;
  --orange-soft: #fff1eb;
  --orange-tint: #ffe3d4;
  --orange-ink: #c33d12;

  --teal: #1aa68a;
  --teal-soft: #defaf2;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --amber: #d97706;
  --amber-soft: #fef3c7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --blue: #2563eb;
  --blue-soft: #dbeafe;

  /* Stage colors — mirrors STAGES color values in screens-business.jsx — keep in sync */
  --stage-lead:        #94a3b8;
  --stage-qualified:   #3b82f6;
  --stage-proposal:    #f59e0b;
  --stage-negotiation: #7c3aed;
  --stage-won:         #16a34a;
  --stage-lost:        #dc2626;

  /* Gantt project accents — mirrors p3.color etc. in screens-projects-views.jsx — keep in sync */
  --gantt-purple: #a855f7;

  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-card: 0 1px 0 rgba(20, 18, 12, 0.02), 0 1px 2px rgba(20, 18, 12, 0.04);
  --shadow-pop: 0 8px 24px -8px rgba(20, 18, 12, 0.12), 0 2px 6px rgba(20, 18, 12, 0.06);
  --shadow-elev: 0 16px 48px -12px rgba(20, 18, 12, 0.18);

  --font-sans: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Instrument Sans", "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
  font-size: 14px;
  line-height: 1.5;
  text-wrap: pretty;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }
input:focus, button:focus, select:focus { outline: none; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  grid-template-rows: 100vh;
  height: 100vh;
  width: 100vw;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
}

.sb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 22px 18px;
}
.sb-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: linear-gradient(135deg, #ff7548 0%, #ff5b2c 60%, #e6420f 100%);
  display: grid;
  place-items: center;
  color: white;
  position: relative;
  box-shadow: 0 6px 14px -6px rgba(255, 91, 44, 0.55), inset 0 1px 0 rgba(255,255,255,0.3);
}
.sb-brand-mark::after {
  content: "";
  position: absolute;
  inset: auto -3px -3px auto;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  background: var(--ink);
  border: 2.5px solid var(--surface);
}
.sb-brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.sb-brand-name {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.sb-brand-sub {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--muted-2);
  text-transform: uppercase;
  margin-top: 3px;
}

.sb-search {
  margin: 4px 16px 14px;
  position: relative;
}
.sb-search input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px 9px 34px;
  font-size: 13px;
  color: var(--ink);
  transition: border-color .15s, background .15s;
}
.sb-search input::placeholder { color: var(--muted-2); }
.sb-search input:focus { border-color: var(--border-strong); background: var(--surface); }
.sb-search svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  color: var(--muted-2);
}
.sb-search kbd {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--muted-2);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 1px 5px;
  border-radius: 4px;
}

.sb-section {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--muted-2);
  padding: 6px 22px 8px;
  text-transform: uppercase;
}

.sb-nav { padding: 0 12px; flex: 1; overflow-y: auto; }
.sb-nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 8px 12px;
  border-radius: 9px;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 1px;
  transition: background .12s, color .12s;
  position: relative;
}
.sb-nav-item svg { width: 17px; height: 17px; flex-shrink: 0; color: var(--muted-2); transition: color .12s; }
.sb-nav-item:hover { background: var(--bg); color: var(--ink); }
.sb-nav-item:hover svg { color: var(--muted); }
.sb-nav-item.active {
  background: var(--orange-soft);
  color: var(--orange-ink);
}
.sb-nav-item.active svg { color: var(--orange); }
.sb-nav-item.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--orange);
}
.sb-nav-badge {
  margin-left: auto;
  background: var(--ink);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  min-width: 18px;
  text-align: center;
}
.sb-nav-item.active .sb-nav-badge { background: var(--orange); }
.sb-nav-dot {
  margin-left: auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--orange);
}

.sb-lang {
  display: flex;
  gap: 6px;
  padding: 12px 22px 8px;
  border-top: 1px solid var(--border-soft);
}
.sb-lang-btn {
  flex: 1;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
  cursor: pointer;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease;
}
.sb-lang-btn:hover { background: var(--bg-soft); color: var(--ink-2); }
.sb-lang-btn.active {
  background: var(--ink);
  color: white;
  border-color: var(--ink);
}

.sb-user {
  margin: 12px 14px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background .12s, border-color .12s;
}
.sb-user:hover { background: var(--bg); border-color: var(--border-strong); }
.sb-user-av {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a3a2a, #2a221a);
  display: grid; place-items: center;
  color: #f6e4cf;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  border: 2px solid var(--surface);
  box-shadow: 0 0 0 1px var(--border);
  position: relative;
}
.sb-user-av::after {
  content: "";
  position: absolute;
  bottom: -1px; right: -1px;
  width: 10px; height: 10px;
  background: var(--green);
  border: 2px solid var(--surface);
  border-radius: 50%;
}
.sb-user-meta { flex: 1; min-width: 0; line-height: 1.2; }
.sb-user-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.sb-user-time { font-size: 11px; color: var(--muted-2); margin-top: 2px; font-variant-numeric: tabular-nums; }
.sb-user-chev { color: var(--muted-2); }

/* ============================================================
   MAIN AREA
   ============================================================ */
.main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  height: 100%;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.tb-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin-right: 14px;
}
.tb-spacer { flex: 1; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .12s, background .12s;
  white-space: nowrap;
}
.chip:hover { border-color: var(--border-strong); background: var(--surface-2); }
.chip svg { width: 14px; height: 14px; color: var(--muted-2); }
.chip-label { color: var(--muted); font-size: 11px; letter-spacing: 0.06em; font-weight: 600; text-transform: uppercase; }
.chip .chev { color: var(--muted-2); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: border-color .12s, background .12s;
  position: relative;
}
.icon-btn:hover { border-color: var(--border-strong); background: var(--surface-2); }
.icon-btn svg { width: 16px; height: 16px; }
.icon-btn.alert {
  background: linear-gradient(135deg, #ff7548, #ff5b2c);
  color: white;
  border-color: transparent;
}
.icon-btn.alert .alert-num {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--ink);
  color: white;
  font-size: 9.5px;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 999px;
  border: 2px solid var(--surface);
  line-height: 1.2;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-2);
  cursor: pointer;
}
.toggle:hover { border-color: var(--border-strong); }
.toggle-sw {
  position: relative;
  width: 32px; height: 18px;
  border-radius: 999px;
  background: var(--border-strong);
  transition: background .15s;
}
.toggle-sw::after {
  content: "";
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: white;
  transition: transform .15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle.on .toggle-sw { background: var(--teal); }
.toggle.on .toggle-sw::after { transform: translateX(14px); }

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  background: var(--ink);
  color: white;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background .12s, transform .08s;
  white-space: nowrap;
}
.btn-primary:hover { background: #000; }
.btn-primary:active { transform: translateY(1px); }
.btn-primary svg { width: 15px; height: 15px; }
.btn-primary.orange { background: var(--orange); }
.btn-primary.orange:hover { background: var(--orange-ink); }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: color .12s, background .12s;
}
.btn-ghost:hover { color: var(--ink); background: var(--surface-2); }
.btn-ghost svg { width: 14px; height: 14px; }

.view-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--bg);
  padding: 3px;
  border-radius: 10px;
  margin-left: 8px;
}
.view-tab {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
}
.view-tab:hover { color: var(--ink); }
.view-tab.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-card);
}
.view-tab.active svg { color: var(--orange); }
.view-tab svg { color: var(--muted-2); }

/* ============================================================
   PAGE CONTENT
   ============================================================ */
.page {
  flex: 1;
  overflow-y: auto;
  padding: 28px 32px 80px;
}
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 24px;
}
.page-h {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  margin: 0 0 4px;
}
.page-sub { color: var(--muted); font-size: 13px; margin: 0; }

.section-h {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 12px;
}

.kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--muted-2);
  text-transform: uppercase;
}

/* ============================================================
   CARDS / STATS
   ============================================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
.card-pad { padding: 20px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
  position: relative;
}
.stat-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
}
.stat-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted-2);
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-ic {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--muted);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.stat-ic svg { width: 14px; height: 14px; }
.stat-ic.orange { background: var(--orange-soft); color: var(--orange); }
.stat-ic.green  { background: var(--green-soft); color: var(--green); }
.stat-ic.blue   { background: var(--blue-soft); color: var(--blue); }
.stat-ic.amber  { background: var(--amber-soft); color: var(--amber); }
.stat-ic.red    { background: var(--red-soft); color: var(--red); }

.stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stat-unit {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 4px;
}
.stat-foot {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px;
  color: var(--muted-2);
  min-width: 0;
}
.stat-pill {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.stat-pill.up   { color: #146c2e; background: var(--green-soft); }
.stat-pill.down { color: #991b1b; background: var(--red-soft); }
.stat-pill.flat { color: var(--muted); background: var(--bg); }
.stat-pill svg { width: 11px; height: 11px; }
.stat-foot .sub {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

/* ============================================================
   CRITICAL / URGENT BANNER
   ============================================================ */
.critical-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.critical-section::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--red), var(--orange), var(--amber));
}
.critical-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.critical-head .pulse {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.4);
  animation: pulse-dot 2s infinite;
}
@keyframes pulse-dot {
  0% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(220, 38, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); }
}
.critical-head .title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.critical-head .count {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
}
.critical-head .all {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 4px;
}
.critical-head .all:hover { color: var(--ink); }

.critical-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.crit-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all .15s;
  background: var(--surface-2);
  display: flex; flex-direction: column;
  position: relative;
  overflow: hidden;
}
.crit-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.crit-card .ic-row {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 10px;
}
.crit-card .ic {
  width: 30px; height: 30px;
  border-radius: 8px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.crit-card .badge {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 999px;
}
.crit-card .num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  font-variant-numeric: tabular-nums;
}
.crit-card .lab {
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 500;
  line-height: 1.35;
  margin-bottom: 10px;
}
.crit-card .lab .target { font-weight: 600; color: var(--ink); }
.crit-card .action {
  margin-top: auto;
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
}
.crit-card .action svg { width: 12px; height: 12px; }

.crit-card.red    { background: linear-gradient(180deg, var(--red-soft) 0%, var(--surface) 60%); }
.crit-card.red .ic    { background: var(--red); color: white; }
.crit-card.red .badge { background: rgba(220,38,38,0.12); color: #991b1b; }
.crit-card.red .action { color: #991b1b; }

.crit-card.orange { background: linear-gradient(180deg, var(--orange-soft) 0%, var(--surface) 60%); }
.crit-card.orange .ic    { background: var(--orange); color: white; }
.crit-card.orange .badge { background: var(--orange-tint); color: var(--orange-ink); }
.crit-card.orange .action { color: var(--orange-ink); }

.crit-card.amber  { background: linear-gradient(180deg, var(--amber-soft) 0%, var(--surface) 60%); }
.crit-card.amber .ic    { background: var(--amber); color: white; }
.crit-card.amber .badge { background: rgba(217,119,6,0.12); color: #92400e; }
.crit-card.amber .action { color: #92400e; }

.crit-card.blue   { background: linear-gradient(180deg, var(--blue-soft) 0%, var(--surface) 60%); }
.crit-card.blue .ic     { background: var(--blue); color: white; }
.crit-card.blue .badge  { background: rgba(37,99,235,0.12); color: #1e40af; }
.crit-card.blue .action { color: #1e40af; }

/* ============================================================
   WORKER LOG (Time Tracking)
   ============================================================ */
.worker-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.worker-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--orange);
}
.worker-card.muted::before { background: var(--amber); opacity: .5; }
.worker-card.idle::before { background: var(--border-strong); }

.worker-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.worker-head.no-border { border-bottom: 0; padding-bottom: 18px; }
.av {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: #c4baa3;
  flex-shrink: 0;
  display: grid; place-items: center;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}
.av.sm { width: 28px; height: 28px; font-size: 11px; }
.av.xs { width: 22px; height: 22px; font-size: 10px; }
.av.lg { width: 48px; height: 48px; font-size: 15px; }
.av.bg-1 { background: linear-gradient(135deg, #d3c4a4, #a18968); color: #4a3a20; }
.av.bg-2 { background: linear-gradient(135deg, #c5d4b8, #7d9a6a); color: #2a3a20; }
.av.bg-3 { background: linear-gradient(135deg, #d4b8b8, #a17070); color: #4a2020; }
.av.bg-4 { background: linear-gradient(135deg, #b8c5d4, #6a8aa1); color: #20304a; }
.av.bg-5 { background: linear-gradient(135deg, #d4c0b8, #b08068); color: #4a2a20; }
.av.bg-6 { background: linear-gradient(135deg, #d4d0b8, #b0a868); color: #4a4220; }

.worker-name {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
  margin-bottom: 1px;
}
.worker-role {
  font-size: 12px;
  color: var(--muted);
}
.worker-totals {
  display: flex;
  gap: 32px;
  margin-left: auto;
  align-items: flex-start;
}
.worker-totals-group { display: flex; flex-direction: column; gap: 6px; }
.worker-totals-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--ink-2); font-weight: 500;
}
.worker-totals-title .dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.worker-totals-title .dot.green { background: var(--green); }
.worker-totals-title .dot.red { background: var(--red); }
.worker-totals-row { display: flex; gap: 28px; padding-left: 16px; }
.worker-totals-row .col { display: flex; flex-direction: column; gap: 3px; }
.worker-totals-row .col .l { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; color: var(--muted-2); text-transform: uppercase; }
.worker-totals-row .col .v { font-size: 13px; font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }

.worker-alert {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--orange-soft);
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--orange-ink);
}
.worker-alert .pill {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px;
  background: var(--surface);
  border: 1px solid var(--orange-tint);
  color: var(--orange-ink);
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}
.worker-alert .pill:hover { background: var(--orange); color: white; border-color: var(--orange); }

.worker-day {
  padding: 14px 20px 4px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.worker-day .day-title { font-weight: 600; color: var(--ink); font-size: 14px; }
.worker-day .day-sub { font-size: 12px; color: var(--muted); }
.worker-day .approve {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 600;
  color: var(--teal);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.worker-day .approve .check {
  width: 18px; height: 18px; border-radius: 5px;
  background: var(--teal); display: grid; place-items: center;
  color: white;
}
.worker-day .approve .check svg { width: 12px; height: 12px; }

.log-table { padding: 6px 20px 20px; }
.log-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr 1fr 1.4fr 1.2fr 110px;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
  align-items: center;
}
.log-row:last-child { border-bottom: 0; }
.log-row.head {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-soft);
}
.log-row .l { font-size: 10px; font-weight: 600; letter-spacing: 0.12em; color: var(--muted-2); text-transform: uppercase; }
.log-row .v { font-size: 13px; color: var(--ink); font-weight: 500; }
.log-row .v.mono { font-variant-numeric: tabular-nums; }
.log-row .v .pin { color: var(--muted-2); display: inline-flex; align-items: center; gap: 4px; }
.log-row .v .pin svg { width: 11px; height: 11px; }
.log-row .v .tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--bg);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
}
.log-actions { display: flex; gap: 6px; justify-content: flex-end; }
.act-btn {
  width: 28px; height: 28px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: grid; place-items: center;
  color: var(--muted);
  cursor: pointer;
  transition: all .12s;
}
.act-btn:hover { background: var(--bg); color: var(--ink); border-color: var(--border-strong); }
.act-btn.check-on {
  background: var(--teal);
  border-color: var(--teal);
  color: white;
}
.act-btn svg { width: 13px; height: 13px; }

.worker-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 20px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border-soft);
}
.worker-footer .add-time {
  margin-left: auto;
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--ink-2);
  font-weight: 600;
  cursor: pointer;
}
.worker-footer .add-time:hover { color: var(--orange); }
.worker-footer .show-less {
  display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer;
  font-weight: 500;
}
.worker-footer .show-less:hover { color: var(--ink); }

.no-time {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 20px;
}
.no-time .info { flex: 1; font-size: 13px; color: var(--muted); }
.no-time .add {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600;
  color: var(--ink-2);
  cursor: pointer;
  letter-spacing: 0.02em;
}
.no-time .add:hover { color: var(--orange); }

/* ============================================================
   TASK CARDS
   ============================================================ */
.task-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  margin-bottom: 14px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.task-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--orange);
}
.task-card.in-progress::before { background: var(--amber); }
.task-card.completed::before { background: var(--green); }
.task-card.upcoming::before { background: var(--border-strong); }

.task-head {
  display: grid;
  grid-template-columns: 80px repeat(6, 1fr);
  gap: 18px;
  padding: 18px 22px 16px;
  align-items: center;
}
.task-status {
  width: 56px; height: 56px;
  border-radius: 12px;
  display: grid; place-items: center;
  position: relative;
}
.task-status.urgent { background: var(--orange); color: white; }
.task-status.urgent svg { width: 22px; height: 22px; }
.task-status.progress {
  background: var(--ink);
  color: white;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  position: relative;
}
.task-status.progress .ring {
  position: absolute;
  inset: 0;
  border-radius: 12px;
}
.task-status.done {
  background: var(--green);
  color: white;
}
.task-status.done svg { width: 24px; height: 24px; }
.task-status.upcoming {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border);
}

.task-meta-col { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.task-meta-col .l { font-size: 9.5px; font-weight: 600; letter-spacing: 0.14em; color: var(--muted-2); text-transform: uppercase; }
.task-meta-col .v { font-size: 13px; font-weight: 600; color: var(--ink); }
.task-meta-col .v.big { font-family: var(--font-display); font-size: 17px; letter-spacing: -0.01em; }
.task-meta-col .v.muted-y { color: var(--muted-2); }
.task-meta-col .v.warn { color: var(--orange-ink); }

.task-title-row {
  display: flex; align-items: center; gap: 12px;
  padding: 0 22px 12px;
}
.task-title-icon {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--orange-soft);
  display: grid; place-items: center;
  color: var(--orange);
  flex-shrink: 0;
}
.task-title-icon svg { width: 14px; height: 14px; }
.task-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
}
.task-id {
  background: var(--bg);
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}
.task-help {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border);
  display: grid; place-items: center;
  color: var(--muted-2);
  font-size: 10px;
  cursor: help;
}

.task-info {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 0.8fr;
  gap: 24px;
  padding: 4px 22px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.info-block .l {
  font-size: 10px; font-weight: 600; letter-spacing: 0.14em;
  color: var(--muted-2); text-transform: uppercase; margin-bottom: 8px;
}
.info-line {
  display: flex; align-items: center; gap: 8px;
  margin: 4px 0;
  font-size: 13px; color: var(--ink-2);
}
.info-line svg { width: 13px; height: 13px; color: var(--muted-2); flex-shrink: 0; }
.info-line a { color: var(--blue); text-decoration: none; }
.info-line a:hover { text-decoration: underline; }

.task-details {
  display: grid;
  grid-template-columns: 0.7fr 1fr 0.8fr 0.8fr 1.2fr 1.2fr;
  gap: 18px;
  padding: 16px 22px 18px;
}
.detail-col .l {
  font-size: 10px; font-weight: 600; letter-spacing: 0.14em;
  color: var(--muted-2); text-transform: uppercase; margin-bottom: 8px;
}
.detail-col .v { font-size: 13px; color: var(--ink); font-weight: 500; }
.duration-chip {
  display: inline-flex; align-items: center;
  padding: 5px 10px;
  background: var(--bg);
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}
.av-row { display: flex; }
.av-row .av { margin-left: -8px; border: 2px solid var(--surface); }
.av-row .av:first-child { margin-left: 0; }
.av-row .more {
  margin-left: -8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--surface);
  display: grid; place-items: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
}

.task-notes {
  padding: 14px 22px 16px;
  border-top: 1px solid var(--border-soft);
}
.task-notes .l {
  font-size: 10px; font-weight: 600; letter-spacing: 0.14em;
  color: var(--muted-2); text-transform: uppercase; margin-bottom: 8px;
}
.task-notes ul { margin: 0; padding-left: 18px; }
.task-notes li { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 3px 0; }

.task-steps { display: flex; flex-direction: column; gap: 7px; }
.step-row {
  display: flex; align-items: center; gap: 9px;
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
}
.step-cb {
  width: 16px; height: 16px;
  border: 1.5px solid var(--border-strong);
  border-radius: 4px;
  display: grid; place-items: center;
  background: var(--surface);
  transition: all .12s;
  flex-shrink: 0;
}
.step-cb.checked {
  background: var(--orange);
  border-color: var(--orange);
  color: white;
}
.step-cb.checked svg { width: 11px; height: 11px; }
.step-row.checked { color: var(--muted); text-decoration: line-through; }

.task-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
}
.task-footer .show-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: var(--muted);
  cursor: pointer;
}
.task-footer .show-toggle:hover { color: var(--ink); }
.task-footer .right-actions {
  margin-left: auto;
  display: flex; gap: 6px;
}

/* ============================================================
   PIPELINE (Kanban)
   ============================================================ */
.pipeline {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 280px;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 20px;
}
.pipe-col {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  display: flex; flex-direction: column;
  gap: 10px;
}
.pipe-col-head {
  display: flex; align-items: center; gap: 8px;
  padding: 0 4px 6px;
}
.pipe-col-head .dot {
  width: 8px; height: 8px; border-radius: 50%;
}
.pipe-col-head .name {
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.pipe-col-head .count {
  font-size: 11.5px; color: var(--muted-2); font-weight: 500;
}
.pipe-col-head .sum {
  margin-left: auto;
  font-size: 11px; color: var(--muted); font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.lead-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  cursor: grab;
  transition: box-shadow .12s, transform .12s;
}
.lead-card:hover { box-shadow: var(--shadow-pop); transform: translateY(-1px); }
.lead-card .head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 8px; margin-bottom: 6px;
}
.lead-card .title { font-weight: 600; font-size: 13.5px; color: var(--ink); line-height: 1.3; }
.lead-card .val { font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--orange); font-variant-numeric: tabular-nums; }
.lead-card .sub { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.lead-card .meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.lead-card .meta .tag {
  background: var(--bg); padding: 2px 7px; border-radius: 5px;
  font-size: 10.5px; color: var(--muted); font-weight: 500;
}

/* ============================================================
   TABLES (Estimates, Invoices, Customers)
   ============================================================ */
.table-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}
.table thead th {
  text-align: left;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--muted-2);
  text-transform: uppercase;
  padding: 14px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.table tbody td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 13px;
  color: var(--ink-2);
  vertical-align: middle;
}
.table tbody tr:hover td { background: var(--bg-soft); }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody td.num { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }
.table tbody td.id { font-family: var(--font-mono); font-size: 12px; color: var(--muted); }
.table .row-title { font-weight: 600; color: var(--ink); }
.table .row-sub { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.status-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.status-pill .dot { width: 6px; height: 6px; border-radius: 50%; }
.status-pill.paid { background: var(--green-soft); color: #146c2e; }
.status-pill.paid .dot { background: var(--green); }
.status-pill.sent { background: var(--blue-soft); color: #1e40af; }
.status-pill.sent .dot { background: var(--blue); }
.status-pill.draft { background: var(--bg); color: var(--muted); }
.status-pill.draft .dot { background: var(--muted-2); }
.status-pill.overdue { background: var(--red-soft); color: #991b1b; }
.status-pill.overdue .dot { background: var(--red); }
.status-pill.approved { background: var(--green-soft); color: #146c2e; }
.status-pill.approved .dot { background: var(--green); }
.status-pill.pending { background: var(--amber-soft); color: #92400e; }
.status-pill.pending .dot { background: var(--amber); }
.status-pill.rejected { background: var(--red-soft); color: #991b1b; }
.status-pill.rejected .dot { background: var(--red); }
.status-pill.active { background: var(--green-soft); color: #146c2e; }
.status-pill.active .dot { background: var(--green); }
.status-pill.on-hold { background: var(--amber-soft); color: #92400e; }
.status-pill.on-hold .dot { background: var(--amber); }

/* ============================================================
   PROJECTS GRID
   ============================================================ */
.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: box-shadow .15s, transform .15s;
  cursor: pointer;
}
.project-card:hover { box-shadow: var(--shadow-pop); transform: translateY(-2px); }
.project-cover {
  height: 130px;
  background: linear-gradient(135deg, #e8dfc8, #c4b896);
  position: relative;
  overflow: hidden;
}
.project-cover.bg-1 { background: linear-gradient(135deg, #ddd2b9, #a8997a); }
.project-cover.bg-2 { background: linear-gradient(135deg, #b9c8d2, #7a9aa8); }
.project-cover.bg-3 { background: linear-gradient(135deg, #d2b9b9, #a87a7a); }
.project-cover-pat {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.06) 1px, transparent 1px);
  background-size: 20px 20px;
}
.project-cover-icon {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  color: rgba(255,255,255,0.6);
}
.project-cover-icon svg { width: 56px; height: 56px; }
.project-cover-tag {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(20,18,12,0.78);
  color: white;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
}
.project-body { padding: 16px; }
.project-name { font-weight: 600; font-size: 14.5px; color: var(--ink); margin: 0 0 4px; }
.project-addr { font-size: 12px; color: var(--muted); margin: 0 0 14px; }
.project-stats { display: flex; gap: 16px; }
.project-stat { font-size: 11px; color: var(--muted); }
.project-stat strong { display: block; font-size: 14px; color: var(--ink); margin-bottom: 1px; font-family: var(--font-display); font-weight: 600; }
.project-progress {
  margin-top: 14px;
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}
.project-progress .fill { height: 100%; background: var(--orange); border-radius: inherit; }

/* ============================================================
   TIMELINE VIEW
   ============================================================ */
.timeline-list { display: flex; flex-direction: column; gap: 18px; }
.timeline-project {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.tl-stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.tl-head {
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--border-soft);
}
.tl-title {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.tl-title .name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.tl-title .code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 500;
}
.tl-stats {
  display: flex;
  align-items: flex-start;
  gap: 26px;
  flex-wrap: wrap;
}
.tl-sep {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 0 4px;
}
.tl-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tl-stat-v {
  font-size: 13.5px; font-weight: 600; color: var(--ink);
  font-variant-numeric: tabular-nums;
  display: flex; align-items: center; gap: 8px;
}
.tl-stat-l { font-size: 11.5px; color: var(--muted); font-weight: 500; }
.tl-stat-s { font-size: 11px; color: var(--muted-2); margin-top: 2px; }
.overdue-badge {
  display: inline-flex; align-items: center;
  background: var(--red);
  color: white;
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}

.tl-strip {
  display: flex;
  align-items: stretch;
  gap: 6px;
  padding: 16px 22px 18px;
  overflow-x: auto;
}
.tl-day {
  flex: 0 0 188px;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  background: var(--surface-2);
  display: flex; flex-direction: column;
  gap: 8px;
  min-height: 220px;
}
.tl-day.current {
  border-color: var(--orange);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--orange-tint), 0 4px 16px -4px rgba(255,91,44,0.18);
}
.tl-day-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 2px 2px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 4px;
}
.tl-day-head .d { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.tl-day-head .h { font-size: 11px; color: var(--muted); font-weight: 500; }
.tl-task {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 10px;
  display: flex; flex-direction: column;
  gap: 6px;
  cursor: pointer;
  transition: box-shadow .12s, transform .12s;
}
.tl-task:hover { box-shadow: var(--shadow-pop); transform: translateY(-1px); }
.tl-task-title {
  display: flex; align-items: flex-start; gap: 6px;
  font-size: 12px; font-weight: 600; color: var(--ink);
  line-height: 1.3;
}
.tl-task-title svg { color: var(--orange); margin-top: 1px; flex-shrink: 0; }
.tl-task-row {
  display: flex; align-items: center; gap: 6px;
  font-size: 11px; color: var(--ink-2);
}
.tl-task-row.muted { color: var(--muted); }
.tl-task-row.muted svg { color: var(--muted-2); }
.tl-task-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 2px;
}
.tl-task-foot .comments {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 10.5px; color: var(--muted-2); font-weight: 500;
}
.tl-task-foot .st {
  display: grid; place-items: center;
  width: 16px; height: 16px;
  border-radius: 50%;
  color: white;
}
.tl-task-foot .st.done { background: var(--green); }
.tl-task-foot .st.alert { background: var(--orange); }
.tl-task-foot .st.progress { background: var(--blue); }
.tl-task-foot .st.scheduled { background: var(--muted-3); }

.tl-arrow {
  display: grid; place-items: center;
  color: var(--muted-3);
  align-self: flex-start;
  padding-top: 28px;
}
.tl-end {
  flex-shrink: 0;
  display: grid; place-items: center;
  padding: 0 8px;
}
.tl-end-ring {
  width: 90px; height: 90px;
  border-radius: 50%;
  border: 1.5px dashed var(--border-strong);
  display: grid; place-items: center;
  text-align: center;
  color: var(--muted);
  background: var(--surface-2);
}
.tl-end-ring .lab { font-size: 10.5px; font-weight: 600; color: var(--ink-2); letter-spacing: 0.04em; }
.tl-end-ring .d { font-size: 11px; color: var(--muted); margin-top: 4px; font-weight: 500; }

/* ============================================================
   GANTT VIEW
   ============================================================ */
.gantt-list { display: flex; flex-direction: column; gap: 18px; }
.gantt-project {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}
.gantt-stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; }
.gantt-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 22px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.gantt-head .name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.gantt-head .dropdown {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
}
.gantt-head .dropdown:hover { background: var(--bg); color: var(--ink); }
.gantt-head .actions {
  margin-left: auto;
  display: flex; gap: 6px;
}

.gantt-grid {
  display: grid;
  grid-template-columns: 480px 1fr;
  min-height: 240px;
}
.gantt-table {
  border-right: 1px solid var(--border);
  background: var(--surface);
}
.gantt-table-head {
  display: grid;
  grid-template-columns: 1.6fr 0.5fr 0.7fr 0.9fr 0.9fr 0.5fr;
  gap: 8px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  text-transform: uppercase;
}
.gantt-table-row {
  display: grid;
  grid-template-columns: 1.6fr 0.5fr 0.7fr 0.9fr 0.9fr 0.5fr;
  gap: 8px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12px;
  color: var(--ink-2);
  align-items: center;
  height: 36px;
}
.gantt-table-row .ev-name {
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.gantt-table-row .d { color: var(--muted); font-variant-numeric: tabular-nums; }
.gantt-table-row.add-new {
  display: flex; align-items: center; gap: 6px;
  color: var(--muted-2);
  font-size: 12px;
  cursor: pointer;
  border-bottom: 0;
}
.gantt-table-row.add-new:hover { color: var(--orange); background: var(--bg-soft); }

.gantt-timeline {
  background: var(--surface);
  overflow-x: auto;
  position: relative;
}
.gantt-cal-head {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--border-soft);
  background: var(--surface-2);
  min-width: 720px;
}
.gantt-week {
  border-right: 1px solid var(--border-soft);
  padding: 6px 0 4px;
}
.gantt-week:last-child { border-right: 0; }
.gantt-week .wk-l {
  font-size: 11px; font-weight: 500; color: var(--ink-2);
  padding: 0 10px 4px;
}
.gantt-week .wk-d {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.gantt-week .wk-d span {
  font-size: 10px;
  color: var(--muted-2);
  text-align: center;
  font-weight: 500;
  padding: 2px 0;
}
.gantt-week .wk-d span.today {
  color: var(--orange);
  font-weight: 700;
}

.gantt-rows {
  position: relative;
  min-width: 720px;
}
.today-line {
  position: absolute;
  top: 0; bottom: 0;
  width: 1.5px;
  background: var(--orange);
  z-index: 1;
  opacity: 0.4;
}
.today-line::before {
  content: "";
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--orange);
}
.gantt-row {
  position: relative;
  height: 36px;
  border-bottom: 1px solid var(--border-soft);
}
.gantt-bar {
  position: absolute;
  top: 6px;
  height: 24px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-size: 11.5px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  z-index: 2;
  transition: transform .12s, box-shadow .12s;
}
.gantt-bar:hover { transform: translateY(-1px); box-shadow: var(--shadow-card); }
.gantt-arrow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

/* ============================================================
   MONTH VIEW
   ============================================================ */
.month-list { display: flex; flex-direction: column; gap: 14px; position: relative; }
.month-project {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: visible;
}
.m-stripe { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; border-radius: 3px 0 0 3px; }
.m-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px 10px;
}
.m-head .name {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.m-actions { margin-left: auto; display: flex; gap: 5px; }

.m-strip {
  display: flex;
  align-items: stretch;
  padding: 0 22px 16px;
  overflow-x: auto;
  position: relative;
}
.m-month-lab {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--muted-2);
  align-self: flex-start;
  padding: 6px 14px 6px 0;
  flex-shrink: 0;
  min-width: 70px;
}
.m-days {
  display: flex;
  flex: 1;
  min-width: 0;
}
.m-day-col {
  flex: 1 0 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}
.m-day-num {
  display: flex; align-items: baseline; gap: 3px;
  font-size: 10.5px;
  color: var(--muted-2);
  padding: 2px 0;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.m-day-num .n { color: var(--ink-2); font-weight: 600; }
.m-day-cell {
  width: 100%;
  display: flex; align-items: center; justify-content: center;
  padding: 6px 2px;
  min-height: 34px;
  position: relative;
}
.m-pill {
  display: inline-flex; align-items: center;
  padding: 2px 7px;
  background: var(--bg);
  color: var(--ink);
  border-radius: 5px;
  font-size: 10px;
  font-weight: 600;
  cursor: pointer;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  transition: transform .12s;
}
.m-pill:hover { transform: translateY(-1px); }
.m-pill.early    { background: rgba(22, 163, 74, 0.18); color: #146c2e; }
.m-pill.mid      { background: rgba(59, 130, 246, 0.15); color: #1e40af; }
.m-pill.late     { background: rgba(94, 102, 234, 0.18); color: #4338ca; }
.m-pill.end      { background: rgba(220, 38, 38, 0.16); color: #991b1b; }
.m-pill.today {
  background: var(--orange);
  color: white;
  box-shadow: 0 4px 12px -4px rgba(255,91,44,0.5);
}
.m-add {
  width: 18px; height: 18px;
  border-radius: 5px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--muted-3);
  font-size: 12px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: all .12s;
}
.m-add:hover { border-color: var(--orange); color: var(--orange); border-style: solid; }
.m-edge {
  font-size: 9.5px;
  color: var(--muted-2);
  margin-right: 4px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.m-today-pin {
  position: absolute;
  top: -22px;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex; align-items: center; gap: 3px;
  background: var(--ink);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  z-index: 3;
  white-space: nowrap;
}
.m-today-pin::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid var(--ink);
}

.m-pop {
  position: absolute;
  z-index: 10;
  top: 60px;
  left: 26%;
  width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-elev);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.m-pop-head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--muted-2);
  text-transform: uppercase;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border-soft);
}
.m-pop-slide {
  width: 100%;
  background: var(--blue-soft);
  color: #1e40af;
  border-radius: 8px;
  padding: 8px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer;
}
.m-pop-slide:hover { background: rgba(37,99,235,0.18); }
.m-pop-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: 8px;
  cursor: grab;
}
.m-pop-item:hover { background: var(--bg-soft); }
.m-pop-item.active { background: var(--surface); box-shadow: 0 0 0 1px var(--orange-tint), var(--shadow-card); }
.m-pop-item .grip { color: var(--muted-3); }
.m-pop-item .meta { min-width: 0; }
.m-pop-item .t {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: var(--ink); font-weight: 600;
}
.m-pop-item .t svg { color: var(--orange); }
.m-pop-item .n { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.m-pop-item .ti { font-size: 10.5px; color: var(--muted-2); margin-top: 1px; }

/* ============================================================
   ESTIMATE GRID (rich cards)
   ============================================================ */
.est-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
}
@media (max-width: 1180px) {
  .est-stats-row { grid-template-columns: 1fr; gap: 18px; }
}
.est-stat-group {
  display: flex; flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.est-stat-group .gl {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--muted-2);
  text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
}
.est-stat-group .gl .ct {
  background: var(--bg);
  color: var(--ink-2);
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  letter-spacing: 0.04em;
}
.est-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.est-mini {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color .12s, transform .12s;
}
.est-mini:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.est-mini .v {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.est-mini .row {
  display: flex; align-items: center; gap: 5px;
  margin-top: 6px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.est-mini .dot { width: 6px; height: 6px; border-radius: 50%; }
.est-mini.accepted .row { color: #146c2e; }
.est-mini.accepted .dot { background: var(--green); }
.est-mini.pending .row { color: #92400e; }
.est-mini.pending .dot { background: var(--amber); }
.est-mini.overdue .row { color: #991b1b; }
.est-mini.overdue .dot { background: var(--red); }

.est-filter-row {
  display: flex; gap: 10px; margin-bottom: 16px; align-items: center;
}
.est-filter-row .chip { background: var(--surface); }
.est-filter-row .grow { flex: 1; }

.est-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.est-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow .15s, transform .15s;
}
.est-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.est-card::before {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 3px;
}
.est-card.accepted::before { background: var(--green); }
.est-card.pending::before  { background: var(--amber); }
.est-card.overdue::before  { background: var(--red); }
.est-card.rejected::before { background: var(--muted-3); }
.est-card.approved::before { background: var(--green); }

.est-card-head {
  padding: 14px 16px 12px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--border-soft);
}
.est-card-head .id { font-weight: 600; font-size: 14px; color: var(--ink); }
.est-card-head .more {
  margin-left: auto;
  color: var(--muted-2);
}
.est-card-body { padding: 14px 16px; }
.est-card .client {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 12px;
}
.est-card .est-total-l {
  font-size: 11px;
  color: var(--muted-2);
  font-weight: 500;
}
.est-card .est-total-v {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  margin: 2px 0 14px;
}
.est-card .grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 12px;
}
.est-card .grid-2 .l { font-size: 11px; color: var(--muted-2); font-weight: 500; }
.est-card .grid-2 .v { font-size: 13px; color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }
.est-card .est-sub-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.est-card .est-sub-head .h {
  font-size: 12.5px; font-weight: 600; color: var(--ink);
}
.est-card .est-sub-head .meta { font-size: 11px; color: var(--muted); }
.est-card .est-sub-head .meta .id-line { font-family: var(--font-mono); }
.est-card .est-lines { display: flex; flex-direction: column; }
.est-line {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 0;
  font-size: 12.5px;
  border-bottom: 1px solid var(--border-soft);
}
.est-line:last-child { border-bottom: 0; }
.est-line .lab { color: var(--ink-2); }
.est-line .val { font-weight: 600; color: var(--ink); font-variant-numeric: tabular-nums; }
.est-line:hover { color: var(--orange-ink); }

.status-pill.accepted { background: var(--green-soft); color: #146c2e; }
.status-pill.accepted .dot { background: var(--green); }

/* ============================================================
   SCHEDULE / CALENDAR
   ============================================================ */
.cal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.cal-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
}
.cal-hdr {
  padding: 14px 12px;
  border-bottom: 1px solid var(--border);
  border-right: 1px solid var(--border-soft);
  background: var(--surface-2);
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.04em;
}
.cal-hdr.day-num strong {
  display: block; font-size: 18px;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 600;
  margin-top: 2px;
}
.cal-hdr.day-num.today strong { color: var(--orange); }
.cal-time {
  padding: 8px;
  font-size: 10.5px;
  color: var(--muted-2);
  border-bottom: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.cal-cell {
  border-bottom: 1px solid var(--border-soft);
  border-right: 1px solid var(--border-soft);
  min-height: 64px;
  position: relative;
  padding: 4px;
}
.cal-event {
  position: absolute;
  left: 4px; right: 4px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.3;
  border-left: 3px solid;
  background: var(--surface);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  z-index: 1;
}
.cal-event:hover { z-index: 2; transform: scale(1.02); }
.cal-event .et { font-weight: 600; color: var(--ink); margin-bottom: 2px; }
.cal-event .es { font-size: 10.5px; color: var(--muted); }
.cal-event.ev-orange { background: var(--orange-soft); border-left-color: var(--orange); }
.cal-event.ev-teal { background: var(--teal-soft); border-left-color: var(--teal); }
.cal-event.ev-blue { background: var(--blue-soft); border-left-color: var(--blue); }
.cal-event.ev-amber { background: var(--amber-soft); border-left-color: var(--amber); }
.cal-event.ev-green { background: var(--green-soft); border-left-color: var(--green); }

/* ============================================================
   PHOTOS / FILES grid
   ============================================================ */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.photo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
}
.photo-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-pop); }
.photo-thumb {
  aspect-ratio: 4/3;
  position: relative;
  background: linear-gradient(135deg, #c8b896, #8a7a58);
}
.photo-thumb.t1 { background: linear-gradient(135deg, #d4c4a0, #9a8868); }
.photo-thumb.t2 { background: linear-gradient(135deg, #a6c4d4, #6a8aa8); }
.photo-thumb.t3 { background: linear-gradient(135deg, #d4b8a6, #a87868); }
.photo-thumb.t4 { background: linear-gradient(135deg, #b8d4b8, #6a9a6a); }
.photo-thumb.t5 { background: linear-gradient(135deg, #d4c8b8, #a89868); }
.photo-thumb.t6 { background: linear-gradient(135deg, #c4b4d4, #8868a8); }
.photo-thumb .overlay {
  position: absolute; inset: 0;
  background-image: linear-gradient(180deg, transparent 50%, rgba(0,0,0,0.5));
}
.photo-thumb .tag {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(20,18,12,0.78);
  backdrop-filter: blur(8px);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
}
.photo-thumb .ic {
  position: absolute;
  inset: 0;
  display: grid; place-items: center;
  color: rgba(255,255,255,0.5);
}
.photo-thumb .ic svg { width: 36px; height: 36px; }
.photo-body { padding: 10px 12px; }
.photo-name { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.photo-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ============================================================
   MAP
   ============================================================ */
.map-wrap {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  height: calc(100vh - 180px);
}
.map-canvas {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.map-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 30%, rgba(255,91,44,0.04), transparent 50%),
    radial-gradient(ellipse at 70% 70%, rgba(37,99,235,0.04), transparent 50%),
    linear-gradient(135deg, #f0ede2, #e8e4d4);
}
.map-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(20,18,12,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(20,18,12,0.05) 1px, transparent 1px);
  background-size: 40px 40px;
}
.map-road {
  position: absolute;
  background: rgba(255,255,255,0.6);
  border-radius: 2px;
}
.map-pin {
  position: absolute;
  transform: translate(-50%, -100%);
  cursor: pointer;
  z-index: 2;
}
.map-pin .pin-bub {
  background: var(--ink);
  color: white;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: var(--shadow-pop);
}
.map-pin.active .pin-bub { background: var(--orange); }
.map-pin .pin-tail {
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--ink);
  margin: -1px auto 0;
}
.map-pin.active .pin-tail { border-top-color: var(--orange); }

.map-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.map-list-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
}
.map-list-body { flex: 1; overflow-y: auto; }
.map-list-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-soft);
  cursor: pointer;
  transition: background .12s;
}
.map-list-item:hover { background: var(--bg-soft); }
.map-list-item.active { background: var(--orange-soft); border-left: 3px solid var(--orange); padding-left: 13px; }
.map-list-item .ti { font-weight: 600; font-size: 13px; color: var(--ink); display: flex; align-items: center; gap: 6px; }
.map-list-item .ti .dot { width: 7px; height: 7px; border-radius: 50%; }
.map-list-item .ad { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.map-list-item .crw { font-size: 11px; color: var(--muted-2); margin-top: 4px; display: flex; align-items: center; gap: 5px; }

/* ============================================================
   REPORTS
   ============================================================ */
.report-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.chart-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-card);
}
.chart-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.chart-head .title { font-family: var(--font-display); font-size: 15px; font-weight: 600; color: var(--ink); }
.chart-head .toggles { display: flex; gap: 6px; }
.seg-toggle {
  display: inline-flex;
  background: var(--bg);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}
.seg-toggle button {
  padding: 5px 11px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  transition: all .12s;
}
.seg-toggle button.active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-card); font-weight: 600; }
.seg-toggle button:hover:not(.active) { color: var(--ink); }

.legend {
  display: flex; gap: 16px; margin-top: 18px;
  font-size: 12px; color: var(--muted);
}
.legend .item { display: flex; align-items: center; gap: 6px; }
.legend .dot { width: 9px; height: 9px; border-radius: 3px; }

.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut-meta { flex: 1; }
.donut-row {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 12px;
}
.donut-row:last-child { border-bottom: 0; }
.donut-row .dot { width: 8px; height: 8px; border-radius: 50%; }
.donut-row .lab { flex: 1; color: var(--ink-2); }
.donut-row .val { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink); }

/* ============================================================
   DASHBOARD
   ============================================================ */
.dash-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}
.dash-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.dash-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.dash-action {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: all .15s;
  display: flex; flex-direction: column; gap: 10px;
}
.dash-action:hover {
  border-color: var(--orange-tint);
  background: linear-gradient(180deg, var(--surface), var(--orange-soft));
  transform: translateY(-2px);
}
.dash-action .ic {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--bg);
  display: grid; place-items: center;
  color: var(--ink-2);
}
.dash-action:hover .ic { background: var(--orange); color: white; }
.dash-action .ic svg { width: 18px; height: 18px; }
.dash-action .lab { font-size: 13px; font-weight: 600; color: var(--ink); }
.dash-action .sub { font-size: 11px; color: var(--muted); }

.activity-item {
  display: flex; gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
}
.activity-item:last-child { border-bottom: 0; }
.activity-item .ic-circle {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: grid; place-items: center;
  flex-shrink: 0;
  background: var(--bg);
  color: var(--muted);
}
.activity-item .ic-circle.orange { background: var(--orange-soft); color: var(--orange); }
.activity-item .ic-circle.green { background: var(--green-soft); color: var(--green); }
.activity-item .ic-circle.blue { background: var(--blue-soft); color: var(--blue); }
.activity-item .ic-circle svg { width: 14px; height: 14px; }
.activity-item .body { flex: 1; min-width: 0; }
.activity-item .text { font-size: 13px; color: var(--ink-2); }
.activity-item .text strong { color: var(--ink); font-weight: 600; }
.activity-item .meta { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }

/* ============================================================
   MISC
   ============================================================ */
.empty {
  padding: 60px 20px;
  text-align: center;
  color: var(--muted);
}
.empty svg { width: 40px; height: 40px; color: var(--muted-3); margin-bottom: 12px; }

.flex { display: flex; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.items-center { align-items: center; }
.between { justify-content: space-between; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.flex-1 { flex: 1; }
.ml-auto { margin-left: auto; }

/* ============================================================
   POLISH PASS — 2026-05-18 (audit: demo-polish-audit-2026-05-18.md)
   ============================================================ */

/* Polish 1: dashboard stat-card icon tiles → neutral.
   The crit panel above already carries the 4-color semantic
   message; stat-card semantic tones competing below is the
   loudest cohesion violation. Trend pills keep their color. */
.stat-ic,
.stat-ic.orange,
.stat-ic.green,
.stat-ic.blue,
.stat-ic.amber,
.stat-ic.red,
.stat-ic.teal {
  background: var(--bg-soft) !important;
  color: var(--ink-2) !important;
}

/* Polish 2: bigger, tighter crit-card numbers — the most
   important numbers on the page should hit hardest. */
.crit-card .num {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.95;
  font-feature-settings: "tnum";
  color: var(--ink);
  margin: 6px 0 8px;
}

/* Map canvas — real Leaflet container.
   Leaflet draws its own tiles; we just provide a sized, rounded box. */
.map-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 480px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-soft);
}

/* Polish 5: universal table row hover — three tables currently
   set cursor:pointer with no feedback. Opt out with .no-hover. */
table tbody tr {
  transition: background 100ms ease;
}
table tbody tr:hover {
  background: var(--bg-soft);
  cursor: pointer;
}
table tbody tr.no-hover:hover {
  background: transparent;
  cursor: default;
}

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 999px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--muted-3); }

/* Notifications */
.toast-stack {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}
.toast {
  background: var(--ink);
  color: white;
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-elev);
  animation: toast-in .25s ease-out;
  max-width: 360px;
}
.toast svg { width: 16px; height: 16px; color: var(--orange); }
@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   MOBILE — hamburger + drawer + breakpoints
   ============================================================ */
.tb-menu {
  display: none;
  width: 36px; height: 36px;
  border-radius: 8px;
  align-items: center; justify-content: center;
  color: var(--ink-2);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  margin-right: 4px;
}
.tb-menu:hover { background: var(--bg-soft); border-color: var(--border); }

.drawer-scrim {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 40;
}

@media (max-width: 899px) {
  .app {
    grid-template-columns: 1fr;
    grid-template-rows: 100vh;
  }
  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: 280px;
    transform: translateX(-100%);
    transition: transform 220ms ease;
    z-index: 50;
    box-shadow: 0 0 0 1px var(--border), 24px 0 48px -16px rgba(0,0,0,0.18);
  }
  .sidebar.sb-open { transform: translateX(0); }
  .tb-menu { display: inline-flex; }
  body[data-drawer-open="true"] .drawer-scrim {
    opacity: 1;
    pointer-events: auto;
  }
  .topbar { flex-wrap: wrap; row-gap: 8px; }
}

@media (max-width: 720px) {
  .topbar { padding: 12px 16px; }
  .page { padding: 18px 16px 64px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  /* Map: stack canvas above list on small screens */
  .map-wrap {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(360px, 55vh) 1fr;
    height: auto;
  }
  .map-canvas { min-height: 360px; }
  .map-list { max-height: 45vh; }
}

/* ============================================================
   Leaflet map customizations — orange pins matching brand
   ============================================================ */
.leaflet-container {
  font-family: var(--font-sans);
  background: var(--bg-soft);
}
.brx-map-pin {
  background: transparent !important;
  border: 0 !important;
}
.brx-map-pin-inner {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--orange);
  border: 3px solid #fff;
  box-shadow: 0 4px 14px -2px rgba(255, 91, 44, 0.55);
  cursor: pointer;
  transition: transform 140ms ease;
}
.brx-map-pin-inner:hover {
  transform: scale(1.15);
}
.brx-map-pin-estimate,
.brx-map-pin-scheduled {
  background: var(--amber, #d97706);
}
.brx-map-pin-on-hold {
  background: var(--muted-3, #94a3b8);
}
.leaflet-popup-content-wrapper {
  border-radius: 12px;
  padding: 4px 6px;
}
.leaflet-popup-content {
  margin: 8px 12px;
  font-size: 13px;
  line-height: 1.4;
}
.brx-map-popup-title {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}
.brx-map-popup-meta {
  font-size: 11.5px;
  color: var(--muted);
}
.leaflet-control-zoom a {
  background: var(--surface);
  color: var(--ink-2);
  border-color: var(--border);
}
.leaflet-control-attribution {
  font-size: 10px;
  background: rgba(255,255,255,0.85);
}
