
    :root{
      --ink:#0f172a;
      --muted:#64748b;
      --bg:#f4f7fb;
      --panel:#ffffff;
      --nav-1:#0b2032;
      --nav-2:#071827;
      --nav-3:#061321;
      --teal:#1fb77a;
      --teal-dark:#0f8b62;
      --teal-soft:#e3f7ee;
      --orange:#f06423;
      --orange-dark:#b8480f;
      --orange-soft:#fde8de;
      --blue:#3b82f6;
      --blue-soft:#eaf2ff;
      --red:#ef4444;
      --red-soft:#fff0f0;
      --purple:#7c3aed;
      --purple-soft:#f1edff;
      --line:#d9e2ec;
      --shadow: 0 24px 70px rgba(6,19,33,.16);
      --shadow2: 0 10px 30px rgba(6,19,33,.08);
      --radius: 24px;
      --radius2: 18px;
      --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    *{ box-sizing:border-box; }
    html{ scroll-behavior:smooth; }
    body{
      margin:0;
      min-height:100vh;
      font-family:var(--font);
      color:var(--ink);
      background:#f3f6fa;
      overflow-x:hidden;
    }
    button, input, select, textarea{ font:inherit; }
    button{ cursor:pointer; }
    a{ color:inherit; }
    .page{ width:min(1680px, 96vw); margin:26px auto 40px; }

    .lucide{ width:18px; height:18px; display:block; stroke-width:2.1; }

    .app-shell{ display:grid; grid-template-columns:272px 1fr 380px; gap:0; border:1px solid var(--line); box-shadow:var(--shadow2); border-radius:var(--radius); }

    /* ============================ SIDEBAR ============================ */
    .sidebar{
      background:linear-gradient(180deg, var(--nav-1), var(--nav-2) 60%, var(--nav-3));
      border-radius:var(--radius) 0 0 var(--radius);
      min-height:900px;
      padding:20px 16px;
      position:sticky;
      top:22px;
    }
    .brand-lockup{ display:flex; align-items:center; gap:12px; padding:6px 8px 20px; margin-bottom:10px; border-bottom:1px solid rgba(255,255,255,.10); }
    .logo{ width:40px; height:40px; flex:none; background-image:url("../assets/craftworks-mark.png"); background-size:contain; background-repeat:no-repeat; background-position:center; }
    .brand-text strong{ display:block; font-size:15px; font-weight:900; letter-spacing:.04em; color:#ffffff; }
    .brand-text span{ display:block; font-size:11px; font-weight:700; color:#7fe0bb; letter-spacing:.01em; margin-top:2px; }

    .nav-group-title{ margin:16px 10px 8px; color:#5f7488; text-transform:uppercase; letter-spacing:.12em; font-size:10.5px; font-weight:900; }
    .nav-item{ width:100%; border:0; text-align:left; display:flex; align-items:center; gap:12px; padding:11px 12px; margin:4px 0; border-radius:14px; color:#aebccb; font-size:14px; font-weight:600; position:relative; background:transparent; transition:.15s background, .15s color; }
    .nav-item:hover{ background:rgba(255,255,255,.06); color:#fff; }
    .nav-item.active{ color:#eafff3; background:rgba(31,183,122,.20); box-shadow:inset 0 0 0 1px rgba(31,183,122,.35); font-weight:800; }
    .nav-icon{ width:28px; height:28px; border-radius:9px; background:rgba(255,255,255,.06); display:grid; place-items:center; flex:none; color:#9fb0c1; }
    .nav-item.active .nav-icon{ background:rgba(31,183,122,.28); color:#7fe0bb; }
    .badge{ margin-left:auto; background:var(--orange); color:#fff; font-size:11px; font-weight:900; min-width:22px; height:22px; border-radius:999px; display:grid; place-items:center; padding:0 6px; }
    .nav-item.active .badge{ background:rgba(255,255,255,.20); }
    .badge.admin-badge{ background:rgba(255,255,255,.10); color:#aebccb; font-size:10px; font-weight:900; }
    .nav-item.active .badge.admin-badge{ background:rgba(255,255,255,.20); color:#fff; }

    .profile{ display:flex; align-items:center; gap:12px; padding:14px 10px 4px; margin-top:14px; border-top:1px solid rgba(255,255,255,.10); }
    .avatar{ width:40px; height:40px; border-radius:13px; display:grid; place-items:center; background:linear-gradient(135deg, var(--orange), #fb923c); color:#fff; font-weight:900; flex:none; font-size:13px; }
    .profile strong{ display:block; font-size:13px; color:#fff; }
    .profile span{ display:block; font-size:11.5px; color:#8296a9; }
    .version-tag{ text-align:center; margin-top:12px; font-size:10.5px; font-weight:700; color:#48576a; letter-spacing:.03em; }

    /* ============================ MAIN / RAIL SHELLS ============================ */
    .main{ background:var(--panel); padding:26px; min-height:900px; }
    .quote-rail{ background:var(--panel); border-left:1px solid var(--line); border-radius:0 var(--radius) var(--radius) 0; padding:20px; min-height:900px; position:sticky; top:22px; }

    .welcome{ display:flex; justify-content:space-between; gap:20px; align-items:flex-start; margin-bottom:22px; }
    .welcome h2{ margin:0; font-size:30px; letter-spacing:-.04em; line-height:1.08; font-weight:800; }
    .welcome p{ margin:7px 0 0; color:var(--muted); font-size:14px; }
    .header-actions{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
    .weather-chip{ display:inline-flex; gap:9px; align-items:center; padding:9px 14px; border-radius:999px; background:var(--bg); border:1px solid var(--line); color:#425064; font-size:13px; font-weight:700; }
    .weather-chip .lucide{ color:var(--orange); width:17px; height:17px; }
    .weather-chip .weather-cond{ color:var(--muted); font-weight:600; }
    .icon-btn{ position:relative; width:40px; height:40px; border-radius:13px; background:var(--bg); border:1px solid var(--line); display:grid; place-items:center; color:#425064; flex:none; }
    .icon-btn .badge{ position:absolute; top:-6px; right:-6px; margin-left:0; }
    .btn-pill-primary{ border:0; display:inline-flex; align-items:center; gap:7px; background:linear-gradient(135deg, var(--teal), #0f8b62); color:#fff; padding:11px 16px; border-radius:999px; font-weight:800; font-size:13px; box-shadow:0 10px 20px rgba(31,183,122,.24); }

    /* ============================ MODULE SWITCHER ============================ */
    .module-switcher{ display:grid; grid-template-columns:1fr 1fr; gap:12px; margin:0 0 20px; }
    .module-card{ border:1px solid var(--line); border-radius:22px; padding:18px; background:linear-gradient(135deg,#fff,#f8fbff); position:relative; overflow:hidden; cursor:pointer; transition:.18s transform, .18s box-shadow, .18s border-color; }
    .module-card:hover{ transform:translateY(-2px); border-color:#caefe8; box-shadow:0 18px 36px rgba(16,32,51,.10); }
    .module-card:after{ content:""; position:absolute; width:120px; height:120px; right:-40px; bottom:-40px; border-radius:999px; background:rgba(31,183,122,.10); }
    .module-card.quote:after{ background:rgba(240,100,35,.14); }
    .module-card h3{ margin:0 0 7px; font-size:19px; letter-spacing:-.03em; font-weight:800; }
    .module-card p{ margin:0; color:var(--muted); font-size:13px; line-height:1.5; position:relative; z-index:1; }
    .module-icon{ width:40px; height:40px; border-radius:14px; display:grid; place-items:center; margin-bottom:12px; position:relative; z-index:1; }

    /* ============================ KPI CARDS ============================ */
    .kpi-grid{ display:grid; grid-template-columns:repeat(4, minmax(0,1fr)); gap:14px; margin-bottom:20px; }
    .kpi{ background:var(--panel); border:1px solid var(--line); border-radius:20px; padding:16px; box-shadow:0 8px 20px rgba(16,32,51,.04); }
    .kpi-top{ display:flex; justify-content:space-between; align-items:center; color:#8592a3; font-size:11px; font-weight:800; letter-spacing:.03em; }
    .kpi-icon{ width:34px; height:34px; border-radius:11px; display:grid; place-items:center; }
    .kpi h3{ margin:10px 0 2px; font-size:28px; letter-spacing:-.03em; font-weight:800; }
    .kpi p{ margin:0; color:var(--muted); font-size:12.5px; }
    .teal{ background:var(--teal-soft); color:var(--teal-dark); }
    .orange,.amber{ background:var(--orange-soft); color:var(--orange-dark); }
    .blue{ background:var(--blue-soft); color:#1d62c8; }
    .red{ background:var(--red-soft); color:#c91f1f; }
    .purple{ background:var(--purple-soft); color:#5b21b6; }

    .section-head{ display:flex; align-items:center; justify-content:space-between; margin:6px 0 13px; gap:12px; }
    .section-head h3{ margin:0; letter-spacing:-.03em; font-size:17px; font-weight:800; display:flex; align-items:center; gap:9px; }
    .section-head h3 .lucide{ color:var(--teal-dark); width:19px; height:19px; }
    .view-link,.link-button{ color:var(--teal-dark); font-weight:800; font-size:12.5px; border:0; background:transparent; padding:0; }
    .work-grid{ display:grid; grid-template-columns:1.05fr .95fr; gap:16px; margin-bottom:16px; }
    .wide-grid{ display:grid; grid-template-columns:1.05fr .95fr; gap:16px; margin-bottom:16px; }
    .card{ background:var(--panel); border:1px solid var(--line); border-radius:22px; padding:18px; box-shadow:0 8px 20px rgba(16,32,51,.04); }

    /* ============================ ROWS (jobs, crew, tasks, materials, alerts) ============================ */
    .job-row,.crew-row,.note-row,.alert-row,.task-row,.material-row{ display:flex; gap:13px; align-items:center; padding:12px 0; border-bottom:1px solid #edf2f7; }
    .job-row:last-child,.crew-row:last-child,.note-row:last-child,.alert-row:last-child,.task-row:last-child,.material-row:last-child{ border-bottom:0; }
    .clickable-row{ cursor:pointer; border-radius:16px; padding-left:6px; padding-right:6px; margin-left:-6px; margin-right:-6px; }
    .clickable-row:hover{ background:#f8fbfd; }
    .row-dot{ width:36px; height:36px; border-radius:12px; display:grid; place-items:center; flex:none; font-weight:900; font-size:12.5px; }
    .row-dot .lucide{ width:17px; height:17px; }
    .row-dot.teal{ background:var(--teal-soft); color:var(--teal-dark); }
    .row-dot.amber,.row-dot.orange{ background:var(--orange-soft); color:var(--orange-dark); }
    .row-dot.blue{ background:var(--blue-soft); color:#1d62c8; }
    .row-dot.red{ background:var(--red-soft); color:#c91f1f; }
    .row-text{ min-width:0; }
    .row-text strong{ display:block; font-size:14px; font-weight:700; }
    .row-text span{ color:var(--muted); font-size:12.5px; }
    .tag{ margin-left:auto; border-radius:999px; padding:7px 11px; font-size:11px; font-weight:800; white-space:nowrap; border:0; }
    .tag.good{ background:var(--teal-soft); color:var(--teal-dark); }
    .tag.warn{ background:var(--orange-soft); color:var(--orange-dark); }
    .tag.info{ background:var(--blue-soft); color:#215eb1; }
    .tag.ready{ background:var(--orange-soft); color:var(--orange-dark); }
    .tag.redtag{ background:var(--red-soft); color:#c91f1f; }
    .avatars{ display:flex; margin-left:auto; }
    .mini-avatar{ width:27px; height:27px; border-radius:999px; background:linear-gradient(135deg,#dbeafe,#fff); border:2px solid #fff; margin-left:-7px; display:grid; place-items:center; font-size:9.5px; font-weight:900; color:#2460a9; }

    /* ============================ MAP ============================ */
    .site-map{ height:222px; border-radius:20px; background:linear-gradient(90deg, rgba(59,130,246,.08) 1px, transparent 1px),linear-gradient(0deg, rgba(59,130,246,.08) 1px, transparent 1px),linear-gradient(135deg, #edf7ff, #f9fff8); background-size:34px 34px; position:relative; overflow:hidden; border:1px solid #dfeaf5; }
    .road{ position:absolute; height:14px; width:120%; left:-10%; top:46%; background:rgba(113,128,150,.16); transform:rotate(-16deg); border-radius:999px; }
    .road.two{ top:68%; transform:rotate(24deg); }
    .map-pin{ position:absolute; width:30px; height:30px; border-radius:999px 999px 999px 4px; background:var(--teal); border:3px solid white; box-shadow:0 10px 20px rgba(16,32,51,.20); display:grid; place-items:center; color:#fff; transform:rotate(45deg); }
    .map-pin .lucide{ transform:rotate(-45deg); width:14px; height:14px; }
    .map-pin.orange{ background:var(--orange); }
    .p1{ left:20%; top:34%; } .p2{ left:60%; top:52%; } .p3{ left:75%; top:24%; }

    /* ============================ DONUT / PROGRESS ============================ */
    .progress-overview{ display:flex; align-items:center; gap:20px; padding-bottom:16px; margin-bottom:14px; border-bottom:1px solid var(--line); }
    .donut{ flex:none; }
    .donut-label strong{ display:block; font-size:26px; font-weight:900; letter-spacing:-.03em; }
    .donut-label span{ display:block; color:var(--muted); font-size:12.5px; font-weight:700; margin-top:2px; }
    .progress-item{ margin:14px 0; }
    .progress-item:first-child{ margin-top:0; }
    .progress-label{ display:flex; justify-content:space-between; font-size:13px; font-weight:700; margin-bottom:8px; }
    .bar{ height:9px; background:#edf2f7; border-radius:999px; overflow:hidden; }
    .bar span{ display:block; height:100%; border-radius:999px; background:linear-gradient(90deg,var(--teal),#2dd4bf); }
    .bar.warn span{ background:linear-gradient(90deg,var(--orange),#fb923c); }

    /* ============================ QUOTE RAIL / FIELD NOTES ============================ */
    .quote-banner{ padding:18px; border-radius:22px; color:white; background:radial-gradient(circle at 20% 0%, rgba(255,255,255,.20), transparent 35%),linear-gradient(135deg, var(--orange), #b8480f); box-shadow:0 14px 28px rgba(240,100,35,.22); margin-bottom:16px; }
    .quote-banner h3{ margin:0; font-size:20px; letter-spacing:-.03em; font-weight:800; }
    .quote-banner p{ margin:7px 0 0; color:#fff2e0; font-size:13px; line-height:1.45; }
    .quote-card{ background:#fff; border:1px solid var(--line); border-radius:20px; padding:14px; margin-bottom:12px; box-shadow:0 8px 20px rgba(16,32,51,.05); }
    .thumb-row{ display:flex; gap:9px; margin:10px 0 12px; }
    .thumb{ height:56px; flex:1; border-radius:13px; background:linear-gradient(135deg, rgba(31,183,122,.16), rgba(59,130,246,.10)); position:relative; overflow:hidden; display:grid; place-items:center; color:rgba(16,32,51,.28); }
    .thumb .lucide{ width:19px; height:19px; }
    .thumb img{ width:100%; height:100%; object-fit:cover; display:block; position:absolute; inset:0; }
    .thumb.has-img .lucide{ display:none; }
    .quote-meta{ display:flex; align-items:center; justify-content:space-between; gap:8px; }
    .quote-meta strong{ font-size:14px; font-weight:700; }
    .quote-meta span{ display:block; margin-top:2px; color:var(--muted); font-size:12px; }
    .mini-list{ margin-top:12px; display:grid; gap:9px; }
    .mini-check{ display:flex; align-items:center; gap:9px; color:#405166; font-size:13px; font-weight:700; }
    .check-dot{ width:22px; height:22px; border-radius:8px; background:var(--teal-soft); color:var(--teal-dark); display:grid; place-items:center; flex:none; }
    .check-dot .lucide{ width:13px; height:13px; }
    .tag-chip{ display:inline-flex; align-items:center; gap:6px; background:var(--blue-soft); color:#1d62c8; border-radius:999px; padding:6px 11px; font-size:11.5px; font-weight:800; }

    /* ============================ TOOLBAR / FORMS ============================ */
    .toolbar{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin-bottom:16px; }
    .input,.select,.textarea{ width:100%; border:1px solid var(--line); background:#fff; border-radius:14px; padding:12px 13px; outline:none; color:var(--ink); }
    .textarea{ min-height:104px; resize:vertical; }
    .input:focus,.select:focus,.textarea:focus{ border-color:#a8e9cd; box-shadow:0 0 0 4px rgba(31,183,122,.10); }
    .field{ display:grid; gap:6px; }
    .field label{ color:#506077; font-size:11.5px; font-weight:800; text-transform:uppercase; letter-spacing:.05em; }
    .form-grid{ display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:12px; }
    .form-grid.three{ grid-template-columns:repeat(3, minmax(0,1fr)); }
    .form-full{ grid-column:1 / -1; }
    .button-row{ display:flex; gap:10px; flex-wrap:wrap; margin-top:12px; }
    .btn{ border:0; border-radius:999px; padding:11px 16px; font-size:13px; font-weight:800; background:var(--teal); color:white; box-shadow:0 10px 18px rgba(31,183,122,.20); display:inline-flex; align-items:center; gap:7px; }
    .btn.secondary{ background:#eef3f5; color:#33495a; box-shadow:none; }
    .btn.amber{ background:var(--orange); box-shadow:0 10px 18px rgba(240,100,35,.22); }
    .btn.red{ background:var(--red); box-shadow:none; }
    .btn.ghost{ background:#fff; color:#506077; border:1px solid var(--line); box-shadow:none; }
    .split-actions{ display:flex; gap:10px; align-items:center; justify-content:space-between; flex-wrap:wrap; }
    .searchbox{ flex:1; min-width:230px; position:relative; }
    .searchbox input{ padding-left:40px; }
    .searchbox .search-icon{ position:absolute; left:13px; top:11px; color:#7c8a9b; }
    .empty{ border:1px dashed #ccd8e4; border-radius:18px; padding:22px; color:var(--muted); text-align:center; background:#fafcff; }
    .timeline{ display:grid; gap:10px; }
    .timeline-item{ display:grid; grid-template-columns:auto 1fr auto; gap:12px; align-items:start; padding:12px; border:1px solid var(--line); border-radius:16px; background:#fff; }
    .timeline-item small{ color:var(--muted); display:block; margin-top:4px; }
    .checkbox{ width:21px; height:21px; border-radius:7px; accent-color:var(--teal); }
    .completed strong{ text-decoration:line-through; color:#8a98aa; }
    .completed .row-text span{ color:#9aa7b7; }
    .weather-box{ background:linear-gradient(135deg,#f8fcff,#effbf8); border:1px solid var(--line); border-radius:22px; padding:16px; }
    .weather-main{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
    .weather-temp{ font-size:32px; font-weight:900; letter-spacing:-.04em; }
    .forecast-strip{ display:grid; grid-template-columns:repeat(3,1fr); gap:8px; }
    .forecast-day{ padding:10px; background:#fff; border:1px solid var(--line); border-radius:14px; font-size:12px; }
    .forecast-day strong{ display:block; margin-bottom:4px; }
    .weather-controls{ display:flex; gap:8px; margin-top:12px; flex-wrap:wrap; }
    .weather-controls input{ flex:1; min-width:160px; }
    .small-note{ color:var(--muted); font-size:12px; line-height:1.45; }

    .modal-backdrop{ position:fixed; inset:0; background:rgba(8,25,39,.42); display:none; align-items:center; justify-content:center; padding:20px; z-index:50; }
    .modal-backdrop.show{ display:flex; }
    .modal-card{ width:min(720px,96vw); max-height:92vh; overflow:auto; border-radius:26px; padding:22px; background:#fff; box-shadow:var(--shadow); }
    .modal-head{ display:flex; justify-content:space-between; align-items:flex-start; gap:16px; margin-bottom:16px; }
    .modal-head h3{ margin:0; font-size:22px; letter-spacing:-.03em; font-weight:800; }
    .modal-head p{ margin:6px 0 0; color:var(--muted); }
    .close{ width:36px; height:36px; border-radius:12px; border:1px solid var(--line); background:#fff; font-weight:900; }
    .toast{ position:fixed; right:22px; bottom:22px; background:var(--ink); color:white; padding:13px 16px; border-radius:16px; box-shadow:var(--shadow); z-index:80; transform:translateY(18px); opacity:0; pointer-events:none; transition:.22s; max-width:360px; }
    .toast.show{ transform:translateY(0); opacity:1; }
    .toast strong{ display:block; margin-bottom:2px; }
    .toast span{ color:#b9cbd3; font-size:13px; }

    @media (max-width: 1320px){
      .app-shell{ grid-template-columns:230px 1fr; }
      .quote-rail{ grid-column:1 / -1; position:static; min-height:auto; border-left:0; border-top:1px solid var(--line); border-radius:0 0 var(--radius) var(--radius); }
      .quote-grid-mobile{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
    }
    @media (max-width: 900px){
      .app-shell{ grid-template-columns:1fr; gap:20px; background:transparent; border:0; box-shadow:none; }
      .sidebar{ position:static; min-height:auto; border-right:0; border-radius:var(--radius); border:1px solid var(--line); box-shadow:var(--shadow2); }
      .main{ border-radius:var(--radius); border:1px solid var(--line); box-shadow:var(--shadow2); }
      .quote-rail{ border-radius:var(--radius); border:1px solid var(--line); box-shadow:var(--shadow2); border-top:0; }
      .kpi-grid,.work-grid,.wide-grid,.module-switcher,.quote-grid-mobile,.form-grid,.form-grid.three,.forecast-strip{ grid-template-columns:1fr; }
      .welcome{ flex-direction:column; }
      .header-actions{ justify-content:flex-start; width:100%; }
      .welcome h2{ font-size:26px; }
      .progress-overview{ flex-direction:column; align-items:flex-start; }
    }
    @media (max-width: 560px){
      .page{ width:94vw; margin-top:14px; }
      .header-actions{ flex-wrap:wrap; }
      .main,.quote-rail,.sidebar{ padding:16px; border-radius:20px; }
      .job-row,.crew-row,.alert-row,.task-row,.material-row{ align-items:flex-start; }
      .tag{ margin-left:0; }
      .timeline-item{ grid-template-columns:1fr; }
    }

/* ===================================================================
   v0.19 — Desktop concept alignment rebuild
   Target: the main desktop app inside the approved PNG, not the promo shell.
   =================================================================== */
:root{
  --cw-ink:#111827;
  --cw-muted:#667085;
  --cw-line:#e4e7ec;
  --cw-card:#ffffff;
  --cw-page:#f8fafc;
  --cw-navy:#071321;
  --cw-navy-2:#0a1928;
  --cw-green:#159f73;
  --cw-green-dark:#08744f;
  --cw-green-soft:#e8f8f0;
  --cw-orange:#f06423;
  --cw-orange-soft:#fff1e8;
  --cw-blue:#2d7ff9;
  --cw-blue-soft:#eaf3ff;
}
html,body{ width:100%; min-height:100%; height:100%; overflow:hidden; background:var(--cw-navy); }
body{ font-family:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; }
.page{ width:100vw; height:100vh; margin:0; padding:0; }
.app-shell{
  width:100%;
  height:100%;
  display:grid;
  grid-template-columns:184px minmax(0, 1fr);
  gap:0;
  border:0;
  border-radius:0;
  box-shadow:none;
  background:var(--cw-page);
  overflow:hidden;
}
.quote-rail{ display:none !important; }
.sidebar{
  position:relative;
  top:auto;
  min-height:100vh;
  height:100vh;
  border-radius:0;
  padding:25px 13px 16px;
  background:linear-gradient(180deg,#071321 0%,#071827 56%,#06101b 100%);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.brand-lockup{
  display:flex;
  align-items:center;
  gap:10px;
  padding:0 2px 20px 4px;
  margin:0 0 8px;
  border-bottom:0;
}
.logo{ width:36px; height:36px; flex:0 0 36px; }
.brand-text{ display:block; min-width:0; }
.brand-text strong{
  display:block;
  color:#ffffff;
  font-size:14px;
  line-height:1.05;
  font-weight:900;
  letter-spacing:-.02em;
  white-space:nowrap;
}
.brand-text span{
  display:block;
  margin-top:3px;
  color:#46d59e;
  font-size:8.5px;
  line-height:1.1;
  font-weight:800;
  letter-spacing:.01em;
  white-space:nowrap;
}
.nav-group-title{ display:none; }
.nav-item{
  height:42px;
  padding:0 11px;
  margin:2px 0;
  border-radius:8px;
  gap:11px;
  color:#dbe5ee;
  font-size:13px;
  font-weight:600;
  letter-spacing:0;
}
.nav-item:hover{ background:rgba(255,255,255,.055); color:#fff; }
.nav-item.active{
  background:rgba(27,178,122,.13);
  color:#22c78c;
  box-shadow:inset 0 0 0 1px rgba(34,199,140,.04);
}
.nav-icon{ width:20px; height:20px; border-radius:0; background:transparent; color:currentColor; }
.nav-icon .lucide{ width:17px; height:17px; stroke-width:2.05; }
.nav-item .badge{ min-width:19px; height:19px; font-size:10px; padding:0 6px; background:#f06423; }
.badge.admin-badge{ display:none; }
.profile{
  margin-top:auto;
  padding:14px 8px 6px;
  border-top:1px solid rgba(255,255,255,.08);
}
.avatar{ width:34px; height:34px; border-radius:999px; background:linear-gradient(135deg,#f06423,#f7931e); font-size:11px; }
.profile strong{ color:#fff; font-size:12px; line-height:1.1; }
.profile span{ color:#93a4b8; font-size:10.5px; }
.version-tag{ display:none; }
.main{
  min-height:100vh;
  height:100vh;
  overflow:auto;
  background:var(--cw-page);
  padding:34px 38px 32px;
  color:var(--cw-ink);
}
.main::-webkit-scrollbar{ width:10px; }
.main::-webkit-scrollbar-thumb{ background:#d7dee8; border-radius:999px; border:3px solid var(--cw-page); }
.welcome{ margin-bottom:20px; align-items:center; }
.welcome h2{ font-size:26px; line-height:1.05; font-weight:850; color:#101828; letter-spacing:-.035em; }
.welcome p{ margin-top:7px; font-size:13.5px; color:#667085; }
.header-actions{ gap:13px; }
.weather-chip{
  border:0;
  border-radius:0;
  padding:0 17px 0 0;
  background:transparent;
  border-right:1px solid #e3e8ef;
  font-size:13px;
  color:#101828;
}
.weather-chip strong{ font-weight:800; }
.weather-chip .weather-cond{ display:block; font-size:11px; margin-left:4px; color:#667085; }
.weather-chip .lucide{ color:#f2b01e; width:23px; height:23px; fill:rgba(242,176,30,.35); }
.icon-btn{ width:36px; height:36px; border:0; background:transparent; color:#475467; border-radius:10px; }
.btn-pill-primary{ display:none; }

/* Dashboard layout */
.cw-kpis{
  display:grid;
  grid-template-columns:repeat(4,minmax(170px,1fr));
  gap:14px;
  margin:0 0 22px;
}
.cw-kpi{
  min-height:92px;
  background:#fff;
  border:1px solid var(--cw-line);
  border-radius:8px;
  box-shadow:0 10px 24px rgba(16,24,40,.045);
  padding:16px 15px 14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
}
.cw-kpi span{ display:block; font-size:12px; font-weight:780; color:#344054; margin-bottom:8px; }
.cw-kpi strong{ display:block; font-size:25px; line-height:1; font-weight:900; letter-spacing:-.04em; color:#111827; }
.cw-kpi small{ display:block; margin-top:7px; color:#667085; font-size:11px; font-weight:600; }
.cw-kpi small b{ color:#f06423; }
.cw-kpi em{ width:47px; height:47px; border-radius:15px; display:grid; place-items:center; flex:none; font-style:normal; }
.cw-kpi em.green{ background:var(--cw-green-soft); color:var(--cw-green-dark); }
.cw-kpi em.amber{ background:#fff4df; color:#e18a00; }
.cw-kpi em.blue{ background:var(--cw-blue-soft); color:#2d7ff9; }
.cw-kpi em .lucide{ width:22px; height:22px; stroke-width:2.1; }
.cw-board{ display:grid; grid-template-columns:minmax(560px,1.7fr) minmax(350px,.95fr); gap:24px; align-items:start; }
.cw-section-title{ margin:3px 0 14px; font-weight:850; letter-spacing:-.025em; color:#101828; }
.cw-section-title span{ display:flex; align-items:center; gap:9px; font-size:16px; }
.cw-section-title .lucide{ width:19px; height:19px; }
.cw-section-title.ops .lucide{ color:var(--cw-green); }
.cw-section-title.quote{ color:var(--cw-orange); }
.cw-section-title.quote .lucide{ color:var(--cw-orange); }
.cw-card-grid.two{ display:grid; grid-template-columns:minmax(0,1.1fr) minmax(0,.95fr); gap:14px; margin-bottom:14px; }
.cw-card-grid.lower{ display:grid; grid-template-columns:minmax(0,.95fr) minmax(0,1fr); gap:14px; margin-top:14px; }
.cw-card{
  background:#fff;
  border:1px solid var(--cw-line);
  border-radius:8px;
  padding:15px 16px;
  box-shadow:0 10px 24px rgba(16,24,40,.045);
}
.cw-card.compact{ min-height:166px; }
.cw-card-head{ display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:10px; }
.cw-card-head h3{ margin:0; font-size:14px; font-weight:850; color:#101828; letter-spacing:-.01em; display:flex; align-items:center; gap:7px; }
.view-link{ color:#2472bd; font-size:11.5px; font-weight:800; }
.cw-count{ background:#fee9e7; color:#e0442e; border-radius:999px; padding:4px 8px; font-style:normal; font-size:10.5px; font-weight:800; }
.cw-count.orange{ background:#fff1e8; color:#f06423; }
.warning-dot{ color:#ff553d; display:grid; place-items:center; }
.warning-dot .lucide{ width:15px; height:15px; }
.cw-schedule-row,.cw-crew-row,.cw-site-row,.cw-quote-row,.cw-note-mini{
  display:flex;
  align-items:center;
  gap:10px;
  padding:8px 0;
  border-bottom:1px solid #eff2f6;
}
.cw-schedule-row:last-child,.cw-crew-row:last-child,.cw-site-row:last-child,.cw-quote-row:last-child,.cw-note-mini:last-child{ border-bottom:0; }
.cw-schedule-row{ justify-content:space-between; }
.cw-schedule-row strong,.cw-crew-row strong,.cw-site-row strong,.cw-quote-row strong,.cw-note-mini strong{ display:block; font-size:12px; font-weight:850; color:#172033; line-height:1.25; }
.cw-schedule-row span,.cw-crew-row span,.cw-quote-row span,.cw-note-mini span{ display:block; color:#667085; font-size:11px; line-height:1.25; margin-top:2px; }
.cw-more{ border:0; background:transparent; color:#667085; padding:9px 0 0; font-weight:700; font-size:11px; }
.cw-pill{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  padding:4px 8px;
  font-size:10px;
  line-height:1;
  font-weight:850;
  font-style:normal;
  white-space:nowrap;
}
.cw-pill.good{ background:#e7f8ef; color:#08744f; }
.cw-pill.warn{ background:#fff0dd; color:#c76400; }
.cw-pill.info{ background:#eaf3ff; color:#2472bd; }
.cw-pill.ready{ background:#fff0dd; color:#f06423; }
.cw-mini-avatars{ display:flex; margin-left:auto; padding-left:8px; }
.cw-mini-avatars span{ width:22px; height:22px; border-radius:999px; margin-left:-6px; border:2px solid #fff; background:linear-gradient(135deg,#ffe3d1,#d9fff0); display:grid; place-items:center; color:#344054; font-size:8px; font-weight:900; }
.cw-crew-row > b{ min-width:25px; text-align:right; font-size:11px; color:#101828; }
.active-sites{ padding-bottom:10px; }
.cw-sites-split{ display:grid; grid-template-columns:minmax(250px,.92fr) minmax(360px,1.08fr); gap:15px; align-items:stretch; }
.cw-site-row{ padding:9px 0; }
.cw-site-row small{ display:block; color:#667085; font-size:10.5px; margin-top:2px; }
.cw-site-row .cw-pill{ margin-left:auto; }
.cw-site-icon{ width:34px; height:34px; border-radius:10px; display:grid; place-items:center; flex:none; }
.cw-site-icon.green{ background:#e8f8f0; color:#159f73; }
.cw-site-icon.amber{ background:#fff4df; color:#ef9f20; }
.cw-site-icon .lucide{ width:17px; height:17px; }
.cw-map{
  min-height:125px;
  border-radius:7px;
  overflow:hidden;
  border:1px solid #e5eaf0;
  position:relative;
  background:
    linear-gradient(90deg, rgba(203,213,225,.35) 1px, transparent 1px),
    linear-gradient(0deg, rgba(203,213,225,.35) 1px, transparent 1px),
    linear-gradient(135deg,#eef4fb,#f7fbff 42%,#edf8f1);
  background-size:42px 42px;
}
.cw-map:before,.cw-map:after{ content:""; position:absolute; height:12px; width:130%; left:-12%; background:rgba(148,163,184,.23); border-radius:999px; }
.cw-map:before{ top:47%; transform:rotate(-17deg); }
.cw-map:after{ top:66%; transform:rotate(20deg); }
.map-marker{ position:absolute; width:17px; height:17px; border-radius:999px; background:var(--cw-green); border:4px solid #fff; box-shadow:0 6px 14px rgba(17,24,39,.18); z-index:2; }
.map-marker.orange{ background:var(--cw-orange); }
.map-marker.m1{ left:27%; top:46%; }
.map-marker.m2{ left:62%; top:31%; }
.map-marker.m3{ left:82%; top:59%; }
.cw-map button{ position:absolute; right:10px; bottom:9px; width:24px; height:24px; border:1px solid #d0d7e2; border-radius:5px; background:#fff; color:#475467; font-weight:900; z-index:3; }
.cw-alert{ width:100%; border:0; background:#fff; display:grid; grid-template-columns:52px 1fr 18px; align-items:center; gap:10px; padding:8px 0; border-bottom:1px solid #eff2f6; color:#344054; text-align:left; }
.cw-alert:last-child{ border-bottom:0; }
.cw-alert time{ font-size:10.5px; color:#667085; }
.cw-alert span{ font-size:11.5px; font-weight:750; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; }
.cw-alert .lucide{ width:14px; height:14px; }
.cw-progress-wrap{ display:grid; grid-template-columns:102px 1fr; gap:16px; align-items:center; }
.cw-ring{ position:relative; width:92px; height:92px; display:grid; place-items:center; }
.cw-ring .donut{ position:absolute; inset:4px; }
.cw-ring strong{ position:absolute; top:33px; font-size:16px; font-weight:900; letter-spacing:-.03em; }
.cw-ring span{ position:absolute; top:53px; font-size:8.5px; color:#667085; font-weight:800; }
.cw-progress-row{ display:grid; grid-template-columns:1fr 36px; align-items:center; column-gap:8px; margin:8px 0; }
.cw-progress-row span{ overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-size:11px; color:#475467; font-weight:650; }
.cw-progress-row b{ font-size:10.5px; color:#344054; text-align:right; }
.cw-progress{ grid-column:1 / -1; height:4px; margin-top:5px; background:#edf2f7; border-radius:999px; overflow:hidden; }
.cw-progress i{ display:block; height:100%; background:linear-gradient(90deg,#159f73,#28c891); border-radius:999px; }
.cw-quotes{ min-width:0; }
.quote-prep{ margin-bottom:14px; }
.cw-quote-row{ align-items:flex-start; padding:11px 0; }
.cw-quote-row > div:nth-child(2){ min-width:0; flex:1; }
.cw-quote-row small{ display:block; color:#667085; font-size:10.5px; margin-top:3px; }
.cw-photo{ width:72px; height:54px; border-radius:7px; flex:none; background-size:cover; background-position:center; box-shadow:inset 0 0 0 1px rgba(255,255,255,.22); }
.cw-note-photo{ width:48px; height:48px; border-radius:7px; flex:none; background-size:cover; background-position:center; }
.photo-1{ background-image:linear-gradient(135deg,rgba(14,26,42,.25),rgba(21,159,115,.18)),linear-gradient(135deg,#6b7a88,#d7d1c2 48%,#52616f); }
.photo-2{ background-image:linear-gradient(135deg,rgba(240,100,35,.22),rgba(14,26,42,.20)),linear-gradient(45deg,#9b6a3f,#d9b17e 45%,#45535f); }
.photo-3{ background-image:linear-gradient(135deg,rgba(14,26,42,.24),rgba(45,127,249,.12)),linear-gradient(135deg,#b8a891,#69584a 52%,#d3d0c7); }
.cw-note-mini{ align-items:flex-start; padding:10px 0; }
.cw-note-mini > div:last-child{ min-width:0; }
.cw-note-mini span{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; line-height:1.3; }
.cw-note-mini small{ display:block; margin-top:4px; color:#667085; font-size:10.5px; }

/* Keep non-dashboard pages usable in the rebuilt shell */
.main > .kpi-grid,.main > .work-grid,.main > .wide-grid,.main > .card,.main > .toolbar{ max-width:none; }
.card{ border-radius:9px; box-shadow:0 10px 24px rgba(16,24,40,.045); }
.btn{ border-radius:9px; }
.input,.select,.textarea{ border-radius:9px; }
.modal-card{ border-radius:18px; }

@media (min-width:1500px){
  .app-shell{ grid-template-columns:196px minmax(0, 1fr); }
  .main{ padding:38px 46px 36px; }
  .cw-board{ grid-template-columns:minmax(740px,1.75fr) minmax(440px,.95fr); gap:28px; }
  .cw-card-grid.two{ grid-template-columns:1.08fr .95fr; gap:16px; }
  .cw-kpis{ gap:16px; }
  .cw-card{ padding:16px 18px; }
}
@media (max-width:1180px){
  html,body{ overflow:auto; }
  .page{ height:auto; min-height:100vh; }
  .app-shell{ min-height:100vh; height:auto; grid-template-columns:170px minmax(0,1fr); }
  .sidebar{ min-height:100vh; height:auto; }
  .main{ height:auto; min-height:100vh; overflow:visible; padding:26px; }
  .cw-board{ grid-template-columns:1fr; }
  .cw-sites-split{ grid-template-columns:1fr; }
  .cw-map{ min-height:180px; }
}
@media (max-width:760px){
  .app-shell{ grid-template-columns:1fr; }
  .sidebar{ height:auto; min-height:auto; padding:14px; flex-direction:row; flex-wrap:wrap; gap:6px; }
  .brand-lockup{ width:100%; padding:0 0 8px; }
  .nav-item{ width:auto; flex:1 1 135px; }
  .profile{ width:100%; margin-top:6px; }
  .main{ padding:18px; }
  .welcome{ align-items:flex-start; flex-direction:column; }
  .cw-kpis,.cw-card-grid.two,.cw-card-grid.lower{ grid-template-columns:1fr; }
}

/* v0.19 density pass — make the dashboard fit inside a 900px desktop viewport */
@media (min-width:1181px){
  .main{ padding:28px 38px 26px; }
  .welcome{ margin-bottom:16px; }
  .cw-kpis{ margin-bottom:18px; }
  .cw-kpi{ min-height:80px; padding:13px 15px; }
  .cw-kpi strong{ font-size:23px; }
  .cw-kpi em{ width:40px; height:40px; border-radius:13px; }
  .cw-card{ padding:13px 15px; }
  .cw-card.compact{ min-height:144px; }
  .cw-card-head{ margin-bottom:8px; }
  .cw-section-title{ margin-bottom:12px; }
  .cw-card-grid.two{ margin-bottom:12px; }
  .cw-card-grid.lower{ margin-top:12px; }
  .cw-schedule-row,.cw-crew-row,.cw-site-row,.cw-quote-row,.cw-note-mini{ padding:6px 0; }
  .cw-sites-split{ gap:13px; }
  .cw-map{ min-height:108px; }
  .cw-photo{ width:70px; height:49px; }
  .cw-note-photo{ width:44px; height:44px; }
  .cw-alert{ padding:6px 0; }
  .cw-progress-wrap{ grid-template-columns:96px 1fr; gap:13px; }
  .cw-ring{ width:86px; height:86px; }
  .cw-progress-row{ margin:6px 0; }
}

/* ===================================================================
   AUTH GATE (v0.21 — additive only, no existing rules touched)
   =================================================================== */
.hidden{ display:none !important; }

.auth-gate{
  position:fixed; inset:0; z-index:100;
  display:flex; align-items:center; justify-content:center;
  background:radial-gradient(circle at 20% 0%, rgba(31,183,122,.10), transparent 40%), var(--bg, #f4f7fb);
  padding:20px;
}
.auth-card{
  width:min(420px, 100%);
  background:var(--panel, #fff);
  border:1px solid var(--line, #d9e2ec);
  border-radius:var(--radius2, 18px);
  box-shadow:var(--shadow, 0 24px 70px rgba(6,19,33,.16));
  padding:32px 28px 28px;
  text-align:center;
}
.auth-logo{
  width:48px; height:48px; margin:0 auto 14px;
  background-image:url("../assets/craftworks-mark.png");
  background-size:contain; background-repeat:no-repeat; background-position:center;
}
.auth-title{ margin:0; font-size:22px; font-weight:900; letter-spacing:-.03em; color:var(--ink, #0f172a); }
.auth-subtitle{ margin:6px 0 22px; color:var(--muted, #64748b); font-size:13px; }
.auth-tabs{ display:flex; gap:8px; background:var(--bg, #f4f7fb); border-radius:999px; padding:4px; margin-bottom:20px; }
.auth-tab{
  flex:1; border:0; background:transparent; padding:9px 12px; border-radius:999px;
  font-size:13px; font-weight:800; color:var(--muted, #64748b); cursor:pointer;
}
.auth-tab.active{ background:var(--teal-dark, #0f8b62); color:#fff; }
.auth-form{ display:grid; gap:14px; text-align:left; }
.auth-form .field label{
  display:block; margin-bottom:6px; color:#506077; font-size:11.5px; font-weight:800;
  text-transform:uppercase; letter-spacing:.05em;
}
.auth-submit{ width:100%; justify-content:center; margin-top:4px; }
.auth-message{ min-height:18px; margin-top:14px; font-size:12.5px; color:var(--red, #ef4444); }
.auth-message.info{ color:var(--teal-dark, #0f8b62); }

.auth-logout-btn{
  margin-left:auto; flex:none; width:32px; height:32px; border-radius:10px;
  border:0; background:rgba(255,255,255,.08); color:inherit; display:grid; place-items:center;
  cursor:pointer; opacity:.75;
}
.auth-logout-btn:hover{ opacity:1; }
.auth-logout-btn .lucide{ width:16px; height:16px; }
.profile{ position:relative; }
