/* ==========================================================================
   Packaging CRM — Admin theme
   Palette taken from the print floor: process ink, cyan cut lines,
   magenta fold lines, kraft board.
   ========================================================================== */

:root {
  --ink: #172033;
  --ink-2: #222d45;
  --ink-3: #2f3b57;
  --ink-text: #aeb7ca;

  --paper: #eff1ee;
  --surface: #ffffff;
  --surface-2: #f7f8f6;
  --line: #dde1e3;
  --line-2: #e9ecec;

  --text: #1b2333;
  --text-2: #3d4659;
  --muted: #6a7385;

  --cyan: #0079b3;
  --cyan-bright: #10a2dc;
  --cyan-soft: #e2f2fa;
  --magenta: #c81e6a;
  --magenta-soft: #fbe8f0;
  --yellow: #a87700;
  --yellow-soft: #fff4d3;
  --kraft: #96693f;
  --kraft-soft: #f3ebe1;
  --green: #1d7f50;
  --green-soft: #e0f3e8;
  --red: #b42318;
  --red-soft: #fdeceb;

  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  --sidebar-w: 252px;
  --topbar-h: 64px;

  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --focus: 0 0 0 3px rgba(16, 162, 220, .35);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  font-feature-settings: normal;
}
a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; color: var(--text); }
p { margin: 0; }
img, svg { display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }

.icon { width: 18px; height: 18px; stroke-width: 1.75; flex-shrink: 0; }
.icon-sm { width: 15px; height: 15px; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: lining-nums; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- App shell ---------------------------------------------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh;
  background: var(--ink);
  color: var(--ink-text);
  display: flex; flex-direction: column;
  overflow-y: auto;
  z-index: 40;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  height: var(--topbar-h); padding: 0 20px;
  border-bottom: 1px solid rgba(255,255,255,.06);
  color: #fff; font-weight: 700; font-size: 16px; letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex-shrink: 0; }
.brand small { display: block; font-weight: 400; font-size: 12px; color: var(--ink-text); letter-spacing: 0; }

.nav { padding: 14px 12px 24px; display: flex; flex-direction: column; gap: 2px; }
.nav-label { font-size: 12px; color: #7d88a0; padding: 16px 10px 6px; }
.nav-label:first-child { padding-top: 4px; }
.nav a {
  position: relative;
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px; border-radius: var(--r-sm);
  color: var(--ink-text); font-weight: 500;
}
.nav a:hover { background: rgba(255,255,255,.05); color: #fff; text-decoration: none; }
.nav a.active { background: var(--ink-2); color: #fff; }
.nav a.active::before {
  content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px;
  width: 3px; border-radius: 0 3px 3px 0; background: var(--cyan-bright);
}
.nav a.active .icon { color: var(--cyan-bright); }
.nav .count {
  margin-left: auto; font-size: 12px; font-weight: 600;
  background: rgba(255,255,255,.08); color: #dfe4ee;
  padding: 1px 8px; border-radius: 999px;
}
.nav .count.hot { background: var(--magenta); color: #fff; }

.sidebar-foot { margin-top: auto; padding: 14px 16px 18px; border-top: 1px solid rgba(255,255,255,.06); }
.sidebar-foot .storage { font-size: 12px; }
.meter { height: 6px; border-radius: 99px; background: rgba(255,255,255,.08); margin-top: 8px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--cyan-bright); border-radius: inherit; }

.main { min-width: 0; display: flex; flex-direction: column; }

/* ---------- Topbar ------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 14px;
  padding: 0 28px;
  background: rgba(239, 241, 238, .88);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.icon-btn.menu-toggle { display: none; }
.search {
  position: relative; flex: 1; max-width: 440px;
}
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input {
  width: 100%; height: 38px; padding: 0 70px 0 38px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface);
}
.search input:focus { outline: none; border-color: var(--cyan-bright); box-shadow: var(--focus); }
.search kbd {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  font: 500 11px var(--font); color: var(--muted);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; background: var(--surface-2);
}
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }

.icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 38px; height: 38px; border-radius: var(--r-sm);
  border: 1px solid transparent; background: transparent; color: var(--text-2); cursor: pointer;
}
.icon-btn:hover { background: var(--surface); border-color: var(--line); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 9px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--magenta); border: 2px solid var(--paper);
}

/* Dropdowns */
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 240px; padding: 6px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: 0 12px 32px -8px rgba(23, 32, 51, .22);
  display: none;
}
.dropdown.open .dropdown-menu { display: block; }
.dropdown-menu a, .dropdown-menu button {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 8px 10px; border-radius: var(--r-sm); border: 0; background: none;
  color: var(--text); font-weight: 500; text-align: left; cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu button:hover { background: var(--surface-2); text-decoration: none; }
.dropdown-menu .sep { height: 1px; background: var(--line-2); margin: 6px 0; }
.dropdown-menu .head { padding: 8px 10px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; }
.dropdown-menu .danger { color: var(--red); }

.site-switch {
  display: flex; align-items: center; gap: 10px;
  height: 38px; padding: 0 12px 0 8px;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); cursor: pointer; font-weight: 500;
}
.site-switch:hover { border-color: #c6ccd2; }
.site-swatch { width: 22px; height: 22px; border-radius: 5px; display: grid; place-items: center; color: #fff; font-size: 11px; font-weight: 700; }
.site-option .check { margin-left: auto; color: var(--cyan); }

.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 8px 4px 4px; border-radius: var(--r-sm); border: 0; background: none; cursor: pointer; }
.user-chip:hover { background: var(--surface); }
.user-chip .who { text-align: left; line-height: 1.2; }
.user-chip .who strong { display: block; font-size: 13px; }
.user-chip .who span { font-size: 12px; color: var(--muted); }

/* Avatars */
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-grid; place-items: center; flex-shrink: 0;
  font-size: 12px; font-weight: 700; color: #fff; background: var(--ink-3);
}
.avatar.sm { width: 26px; height: 26px; font-size: 11px; }
.avatar.c1 { background: #0079b3; } .avatar.c2 { background: #c81e6a; }
.avatar.c3 { background: #96693f; } .avatar.c4 { background: #1d7f50; }
.avatar.c5 { background: #5b4bb7; } .avatar.c6 { background: #2f3b57; }
.avatar-stack { display: flex; }
.avatar-stack .avatar { border: 2px solid var(--surface); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- Page --------------------------------------------------------- */
.content { padding: 28px; max-width: 1480px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.page-head p { color: var(--muted); margin-top: 4px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s;
}
.btn:hover { text-decoration: none; border-color: #c4cad0; background: var(--surface-2); }
.btn-primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--ink-2); border-color: var(--ink-2); }
.btn-accent { background: var(--cyan); border-color: var(--cyan); color: #fff; }
.btn-accent:hover { background: #006a9d; border-color: #006a9d; }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-sm { height: 32px; padding: 0 10px; font-size: 13px; }
.btn-block { width: 100%; }

/* Panels */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); min-width: 0; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.panel-head h2 { font-size: 15px; font-weight: 700; }
.panel-head p { font-size: 13px; color: var(--muted); }
.panel-body { padding: 20px; }
.panel-foot { padding: 12px 20px; border-top: 1px solid var(--line-2); display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }

/* Grids */
.grid { display: grid; gap: 20px; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-main-side { grid-template-columns: minmax(0, 1fr) 360px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.mt-20 { margin-top: 20px; }

/* ---------- Order flow strip (dashboard signature) ----------------------- */
.flow { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.flow-step { position: relative; padding: 18px 20px 16px; min-width: 0; }
.flow-step + .flow-step { border-left: 1.5px dashed #d3a9bd; }
.flow-step .step-top { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 500; }
.flow-step .step-no {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  font-size: 11px; font-weight: 700; border: 1.5px solid currentColor;
}
.flow-step .step-count { font-size: 30px; font-weight: 700; letter-spacing: -.03em; margin-top: 10px; line-height: 1.1; }
.flow-step .step-meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.flow-step .step-bar { height: 4px; border-radius: 4px; margin-top: 14px; background: var(--line-2); overflow: hidden; }
.flow-step .step-bar span { display: block; height: 100%; border-radius: inherit; }
.flow-step.s1 .step-no, .flow-step.s1 .step-bar span { color: var(--cyan); background-color: transparent; }
.flow-step.s1 .step-bar span { background: var(--cyan); }
.flow-step.s2 .step-no { color: #5b4bb7; } .flow-step.s2 .step-bar span { background: #5b4bb7; }
.flow-step.s3 .step-no { color: var(--magenta); } .flow-step.s3 .step-bar span { background: var(--magenta); }
.flow-step.s4 .step-no { color: var(--yellow); } .flow-step.s4 .step-bar span { background: #d9a400; }
.flow-step.s5 .step-no { color: var(--kraft); } .flow-step.s5 .step-bar span { background: var(--kraft); }
.flow-step.s6 .step-no { color: var(--green); } .flow-step.s6 .step-bar span { background: var(--green); }

/* KPI */
.kpi { padding: 18px 20px; }
.kpi-label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.kpi-value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; margin-top: 6px; }
.kpi-delta { font-size: 12px; font-weight: 600; margin-top: 4px; display: inline-flex; align-items: center; gap: 4px; }
.up { color: var(--green); } .down { color: var(--red); }

/* Chart */
.chart { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding-top: 10px; }
.chart .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart .bars { display: flex; gap: 3px; align-items: flex-end; height: 100%; width: 100%; justify-content: center; }
.chart .bar { width: 42%; max-width: 16px; border-radius: 3px 3px 0 0; }
.chart .bar.a { background: var(--ink); }
.chart .bar.b { background: var(--cyan-bright); }
.chart .lbl { font-size: 12px; color: var(--muted); }
.legend { display: flex; gap: 16px; font-size: 13px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }

/* Lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--line-2); }
.list li:first-child { border-top: 0; }
.list .grow { flex: 1; min-width: 0; }
.list .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .time { font-size: 12px; color: var(--muted); white-space: nowrap; }

.timeline { list-style: none; margin: 0; padding: 4px 20px 16px; }
.timeline li { position: relative; padding: 12px 0 12px 26px; border-left: 1.5px dashed var(--line); margin-left: 7px; }
.timeline li::before { content: ""; position: absolute; left: -6px; top: 16px; width: 10px; height: 10px; border-radius: 50%; background: var(--surface); border: 2px solid var(--cyan); }
.timeline li.m::before { border-color: var(--magenta); }
.timeline li.g::before { border-color: var(--green); }
.timeline li.k::before { border-color: var(--kraft); }
.timeline .t { font-size: 12px; color: var(--muted); }

/* Badges */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; white-space: nowrap;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.plain::before { display: none; }
.b-new { background: var(--cyan-soft); color: var(--cyan); border-color: #c5e4f3; }
.b-contacted { background: #ece9fb; color: #4a3ca6; border-color: #dad4f6; }
.b-quoted { background: var(--yellow-soft); color: var(--yellow); border-color: #f4e3a8; }
.b-design { background: var(--magenta-soft); color: var(--magenta); border-color: #f5cddd; }
.b-production { background: var(--kraft-soft); color: var(--kraft); border-color: #e6d6c3; }
.b-won, .b-shipped, .b-delivered, .b-active, .b-approved { background: var(--green-soft); color: var(--green); border-color: #c4e6d2; }
.b-lost, .b-overdue, .b-inactive, .b-rejected { background: var(--red-soft); color: var(--red); border-color: #f7cfcb; }
.b-draft, .b-pending { background: var(--surface-2); color: var(--muted); }

.tag { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: var(--text-2); padding: 2px 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--line-2); white-space: nowrap; }
.tag .sw { width: 8px; height: 8px; border-radius: 2px; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 10px 16px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: #fafbfa; }
.table .who { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.table .who strong { display: block; font-weight: 600; }
.table .who div span { font-size: 12px; color: var(--muted); }
.table .right { text-align: right; }
.check { width: 16px; height: 16px; accent-color: var(--cyan); }
.spec { font-size: 13px; color: var(--text-2); line-height: 1.4; min-width: 170px; }
.spec small { display: block; color: var(--muted); font-size: 12px; }

/* Toolbar / filters */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.toolbar .search { max-width: 300px; }
.toolbar .search input { height: 36px; padding-right: 12px; }
.select {
  height: 36px; padding: 0 32px 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface);
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236a7385' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.seg { display: inline-flex; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.seg button { border: 0; background: none; height: 28px; padding: 0 12px; border-radius: 4px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(23,32,51,.08); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; overflow-x: auto; }
.tabs a { padding: 10px 14px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.on { color: var(--text); border-bottom-color: var(--ink); }
.tabs a .n { font-size: 12px; color: var(--muted); margin-left: 4px; font-weight: 500; }

.pagination { display: flex; gap: 4px; }
.pagination a { min-width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm); color: var(--text-2); font-weight: 600; border: 1px solid transparent; }
.pagination a:hover { border-color: var(--line); text-decoration: none; }
.pagination a.on { background: var(--ink); color: #fff; }

/* ---------- Kanban ------------------------------------------------------- */
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.k-col { background: #e6e9e5; border-radius: var(--r-md); padding: 10px; min-height: 420px; }
.k-col-head { display: flex; align-items: center; justify-content: space-between; padding: 4px 6px 12px; font-weight: 700; }
.k-col-head .badge { height: 22px; }
.k-card { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 10px; }
.k-card .co { font-weight: 700; }
.k-card .box { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.k-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; font-size: 12px; color: var(--muted); }
.k-card .val { font-weight: 700; color: var(--text); font-size: 14px; }

/* ---------- Inbox -------------------------------------------------------- */
.inbox { display: grid; grid-template-columns: 220px 380px minmax(0, 1fr); height: calc(100vh - var(--topbar-h) - 150px); min-height: 560px; overflow: hidden; }
.inbox-folders { border-right: 1px solid var(--line-2); padding: 14px 10px; overflow-y: auto; }
.inbox-folders a { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 500; }
.inbox-folders a:hover { background: var(--surface-2); text-decoration: none; }
.inbox-folders a.on { background: var(--cyan-soft); color: var(--cyan); }
.inbox-folders a .n { margin-left: auto; font-size: 12px; font-weight: 600; }
.inbox-folders .lbl { font-size: 12px; color: var(--muted); padding: 14px 10px 6px; }
.inbox-list { border-right: 1px solid var(--line-2); overflow-y: auto; }
.mail { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line-2); color: var(--text); cursor: pointer; }
.mail:hover { background: var(--surface-2); text-decoration: none; }
.mail.on { background: #f2f8fb; box-shadow: inset 3px 0 0 var(--cyan); }
.mail .r1 { display: flex; justify-content: space-between; gap: 10px; }
.mail .from { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail.unread .from::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan-bright); margin-right: 7px; vertical-align: 1px; }
.mail .subj { font-size: 13px; font-weight: 500; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail .prev { font-size: 13px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail .r3 { display: flex; gap: 6px; margin-top: 8px; }
.inbox-read { overflow-y: auto; display: flex; flex-direction: column; }
.read-head { padding: 18px 24px; border-bottom: 1px solid var(--line-2); }
.read-head h2 { font-size: 18px; }
.read-body { padding: 20px 24px; flex: 1; }
.msg { border: 1px solid var(--line-2); border-radius: var(--r-md); padding: 16px 18px; margin-bottom: 14px; }
.msg.me { background: var(--surface-2); }
.msg p + p { margin-top: 10px; }
.attach { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-sm); margin-top: 12px; margin-right: 8px; font-size: 13px; }
.reply { border-top: 1px solid var(--line-2); padding: 16px 24px; }
.reply textarea { width: 100%; min-height: 84px; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; resize: vertical; }
.reply textarea:focus { outline: none; border-color: var(--cyan-bright); box-shadow: var(--focus); }

/* ---------- Designs / proofs -------------------------------------------- */
.proof { overflow: hidden; }
.proof-art {
  aspect-ratio: 4 / 3; display: grid; place-items: center;
  background:
    linear-gradient(var(--line-2) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, var(--line-2) 1px, transparent 1px) 0 0 / 20px 20px,
    var(--surface-2);
  border-bottom: 1px solid var(--line-2);
}
.proof-art svg { width: 62%; height: auto; }
.proof-body { padding: 14px 16px; }
.proof-body .ttl { font-weight: 700; }
.proof-body .meta { font-size: 13px; color: var(--muted); margin-top: 2px; }
.proof-body .foot { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }

/* ---------- Websites ----------------------------------------------------- */
.site-card .top { display: flex; align-items: center; gap: 12px; }
.site-logo { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 16px; }
.site-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); }
.site-stats div strong { display: block; font-size: 18px; letter-spacing: -.01em; }
.site-stats div span { font-size: 12px; color: var(--muted); }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 4px; padding: 2px 6px; }

/* ---------- Roles matrix ------------------------------------------------- */
.matrix th, .matrix td { text-align: center; }
.matrix th:first-child, .matrix td:first-child { text-align: left; }
.matrix .grp td { background: var(--surface-2); font-weight: 700; font-size: 13px; }
.tick { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 5px; background: var(--green-soft); color: var(--green); }
.tick.no { background: transparent; color: #c4cad0; }

/* ---------- Forms -------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-weight: 600; font-size: 13px; }
.field .hint { font-size: 12px; color: var(--muted); }
.input {
  height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); width: 100%;
}
.input:focus { outline: none; border-color: var(--cyan-bright); box-shadow: var(--focus); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.form-grid .full { grid-column: 1 / -1; }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: #cdd3d8; border-radius: 99px; cursor: pointer; transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--cyan); }
.switch input:checked + span::after { transform: translateX(16px); }
.switch input:focus-visible + span { box-shadow: var(--focus); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line-2); }
.setting-row:first-child { border-top: 0; padding-top: 0; }
.setting-row strong { display: block; }
.setting-row span { font-size: 13px; color: var(--muted); }
.side-nav a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 500; }
.side-nav a:hover { background: var(--surface); text-decoration: none; }
.side-nav a.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: inset 0 0 0 1px var(--line); }

/* Alerts */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-sm); font-size: 13px; }
.alert-error { background: var(--red-soft); color: var(--red); border: 1px solid #f7cfcb; }
.alert-success { background: var(--green-soft); color: var(--green); border: 1px solid #c4e6d2; }

/* ==========================================================================
   Login
   ========================================================================== */
.auth { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; background: var(--surface); }
.auth-art {
  position: relative; overflow: hidden;
  background: var(--ink); color: #dfe4ee;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 40px 48px;
}
.auth-art .brand { padding: 0; height: auto; border: 0; }
.auth-art .dieline-wrap { flex: 1; display: grid; place-items: center; padding: 30px 0; }
.dieline { width: min(100%, 520px); height: auto; }
.dieline .cut { fill: rgba(16, 162, 220, .06); stroke: var(--cyan-bright); stroke-width: 1.6; stroke-linejoin: round; }
.dieline .fold { stroke: #e0498c; stroke-width: 1.3; stroke-dasharray: 6 5; fill: none; }
.dieline .reg { stroke: #7d88a0; stroke-width: 1; fill: none; }
.dieline .dim { fill: #7d88a0; font: 500 10px var(--font); }
.dieline .dimline { stroke: #4a5672; stroke-width: 1; }
.dieline .panel-lbl { fill: #6c7894; font: 500 10px var(--font); }
.auth-art .legend-line { display: flex; gap: 22px; font-size: 13px; color: #8e99b0; }
.auth-art .legend-line span { display: inline-flex; align-items: center; gap: 8px; }
.auth-art .legend-line i { display: inline-block; width: 22px; height: 0; border-top: 2px solid var(--cyan-bright); }
.auth-art .legend-line i.f { border-top: 2px dashed #e0498c; }
.auth-art blockquote { margin: 0; font-size: 22px; line-height: 1.35; font-weight: 500; color: #fff; max-width: 440px; letter-spacing: -.01em; }

.auth-form { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.auth-card .lead { color: var(--muted); margin-top: 6px; margin-bottom: 28px; }
.auth-card form { display: flex; flex-direction: column; gap: 18px; }
.auth-card .input { height: 44px; }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; border-radius: var(--r-sm); }
.auth-card .btn { height: 44px; font-size: 15px; }
.remember { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.remember label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.auth-foot { margin-top: 28px; font-size: 13px; color: var(--muted); }
.field-error { font-size: 12px; color: var(--red); }
.input.is-invalid { border-color: #e9a29c; }

@media (prefers-reduced-motion: no-preference) {
  .dieline .cut { stroke-dasharray: 2400; stroke-dashoffset: 2400; animation: draw 2.2s cubic-bezier(.6,.1,.3,1) .2s forwards; }
  .dieline .fold { opacity: 0; animation: fade .6s ease 1.9s forwards; }
  @keyframes draw { to { stroke-dashoffset: 0; } }
  @keyframes fade { to { opacity: 1; } }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1280px) {
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .flow-step:nth-child(4) { border-left: 0; }
  .flow-step:nth-child(n+4) { border-top: 1.5px dashed #d3a9bd; }
  .g-main-side { grid-template-columns: 1fr; }
  .inbox { grid-template-columns: 300px minmax(0, 1fr); }
  .inbox-folders { display: none; }
}
@media (max-width: 1024px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar-open .sidebar { transform: none; box-shadow: 0 0 0 100vmax rgba(23,32,51,.4); }
  .icon-btn.menu-toggle { display: inline-grid; }
  .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: 1fr; }
  .auth-art { display: none; }
  .user-chip .who { display: none; }
}
@media (max-width: 720px) {
  .content { padding: 20px 16px; }
  .topbar { padding: 0 16px; gap: 8px; }
  .search kbd, .site-switch .site-name { display: none; }
  .g-4, .g-3, .g-2, .form-grid { grid-template-columns: 1fr; }
  .flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .flow-step:nth-child(n) { border-left: 0; border-top: 1.5px dashed #d3a9bd; }
  .flow-step:nth-child(-n+2) { border-top: 0; }
  .flow-step:nth-child(even) { border-left: 1.5px dashed #d3a9bd; }
  .inbox { grid-template-columns: 1fr; height: auto; }
  .inbox-read { display: none; }
  .page-head h1 { font-size: 22px; }
}

/* Late additions */
.input.select { padding-right: 32px; }
.settings-layout { grid-template-columns: 220px minmax(0, 1fr); align-items: start; }
@media (max-width: 720px) {
  .settings-layout { grid-template-columns: 1fr; }
  .side-nav { display: flex; overflow-x: auto; gap: 4px; }
  .side-nav a { white-space: nowrap; }
}
@media (max-width: 720px) {
  .topbar .btn-accent span { display: none; }
  .topbar .btn-accent { width: 38px; padding: 0; }
  .site-switch { padding: 0 8px; }
  .site-switch > .icon-sm { display: none; }
  .search { min-width: 0; }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 14px 16px; }
  .kpi-value { font-size: 22px; }
}
@media (max-width: 720px) {
  .topbar .search input { min-width: 0; padding-right: 10px; }
  .topbar .search { flex: 1 1 0; }
}

/* ==========================================================================
   Step 2: forms, team, roles, websites
   ========================================================================== */
.page-narrow { max-width: 920px; }
.form-section { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 28px; padding: 24px 0; border-top: 1px solid var(--line); }
.form-section:first-of-type { border-top: 0; padding-top: 0; }
.form-section > header h2 { font-size: 15px; }
.form-section > header p { font-size: 13px; color: var(--muted); margin-top: 4px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 20px; border-top: 1px solid var(--line); }
.req { color: var(--magenta); }

.choice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.choice {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer;
}
.choice:hover { border-color: #c4cad0; }
.choice:has(input:checked) { border-color: var(--cyan); background: #f4fafd; }
.choice .site-swatch { width: 26px; height: 26px; }
.choice small { display: block; font-size: 12px; color: var(--muted); }

.role-option { align-items: flex-start; }
.role-option input { margin-top: 3px; }

.color-field { display: flex; gap: 10px; align-items: center; }
.color-field input[type=color] { width: 44px; height: 40px; padding: 3px; border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); cursor: pointer; }

.key-box { display: flex; gap: 8px; align-items: center; }
.key-box input { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; background: var(--surface-2); }

.empty { text-align: center; padding: 56px 20px; }
.empty .icon { width: 36px; height: 36px; color: var(--muted); margin: 0 auto 12px; }
.empty h2 { font-size: 17px; }
.empty p { color: var(--muted); margin: 6px auto 18px; max-width: 420px; }

.matrix input.check { width: 18px; height: 18px; cursor: pointer; }
.matrix th .role-head { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.matrix .lock { color: var(--muted); }
.inline { display: inline; }
.link-danger { border: 0; background: none; color: var(--red); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; }
.link-danger:hover { text-decoration: underline; }

.btn-danger { color: var(--red); border-color: #f2c4bf; }
.btn-danger:hover { background: var(--red-soft); border-color: #e9a29c; }

.profile-card { display: flex; align-items: center; gap: 16px; }
.profile-card .avatar { width: 56px; height: 56px; font-size: 18px; }

@media (max-width: 860px) {
  .form-section { grid-template-columns: 1fr; gap: 14px; }
}
.code-area { height: auto; padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.5; background: var(--surface-2); resize: vertical; white-space: pre; }
.dev-notes { font-size: 13px; color: var(--text-2); }
.dev-notes summary { cursor: pointer; font-weight: 600; color: var(--text); }
.dev-notes p { margin-top: 8px; line-height: 1.7; }

/* ==========================================================================
   Step 3: Leads
   ========================================================================== */
.textarea { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.5; }
.dims { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr 90px; gap: 8px; align-items: center; }
.dims span { color: var(--muted); }

.seg-btn { display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 12px; border-radius: 4px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.seg-btn:hover { color: var(--text); text-decoration: none; }
.seg-btn.on, .seg-btn:has(input:checked) { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(23,32,51,.08); }
.seg-btn:has(input:focus-visible) { box-shadow: var(--focus); }

.row-link { cursor: pointer; }
.row-title { display: block; color: var(--text); font-weight: 600; }
.feed .grow { flex: 1; min-width: 0; }
.row-title:hover { color: var(--cyan); }
a.k-card { display: block; color: inherit; }
a.k-card:hover { text-decoration: none; border-color: #c4cad0; }

/* Pipeline stepper on the lead page: cut line between stages */
.stepper { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.step {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 0; background: none;
  font-weight: 600; color: var(--muted); cursor: pointer; text-align: left; min-width: 0;
}
.step + .step { border-left: 1.5px dashed #d3a9bd; }
.step:hover { background: var(--surface-2); color: var(--text); }
.step .dot { width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 12px; border: 1.5px solid currentColor; }
.step.done { color: var(--green); }
.step.done .dot { background: var(--green-soft); }
.step.current { color: #fff; background: var(--ink); }
.step.current .dot { border-color: var(--cyan-bright); background: var(--cyan-bright); color: #fff; }
.step.current:hover { background: var(--ink-2); }

.specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; margin: 0; }
.specs.one { grid-template-columns: 1fr; gap: 10px; }
.specs div { min-width: 0; }
.specs dt { font-size: 12px; color: var(--muted); }
.specs dd { margin: 2px 0 0; font-weight: 600; }
.specs dd.break { word-break: break-all; font-weight: 500; }
.message-box { margin-top: 18px; padding: 14px 16px; background: var(--surface-2); border-left: 3px solid var(--kraft); border-radius: 0 var(--r-sm) var(--r-sm) 0; line-height: 1.6; }

.note-form { border-bottom: 1px solid var(--line-2); }
.feed { list-style: none; margin: 0; padding: 8px 20px 18px; }
.feed li { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.feed li:first-child { border-top: 0; }
.feed-icon { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); color: var(--muted); }
.t-note .feed-icon { background: var(--yellow-soft); color: var(--yellow); }
.t-call .feed-icon { background: var(--green-soft); color: var(--green); }
.t-status .feed-icon { background: var(--magenta-soft); color: var(--magenta); }
.t-assigned .feed-icon, .t-created .feed-icon { background: var(--cyan-soft); color: var(--cyan); }
.feed-head { display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; font-size: 13px; }
.feed-time { margin-left: auto; font-size: 12px; }
.feed-body { margin-top: 4px; font-size: 14px; color: var(--text-2); }
.feed-body.boxed { background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 12px; color: var(--text); }

.contact { display: flex; flex-direction: column; gap: 6px; }
.contact strong { font-size: 16px; }
.contact a, .contact span { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; word-break: break-all; }
.sub-title { font-size: 12px; color: var(--muted); margin: 18px 0 8px; padding-top: 14px; border-top: 1px dashed var(--line); }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.mini-list li { display: flex; align-items: center; gap: 8px; font-size: 13px; flex-wrap: wrap; }
.lost-box summary { cursor: pointer; font-weight: 600; color: var(--red); }

@media (max-width: 1100px) {
  .stepper { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .step:nth-child(4) { border-left: 0; }
  .step:nth-child(n+4) { border-top: 1.5px dashed #d3a9bd; }
}
@media (max-width: 720px) {
  .stepper { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .step:nth-child(n) { border-left: 0; border-top: 1.5px dashed #d3a9bd; }
  .step:nth-child(-n+2) { border-top: 0; }
  .step:nth-child(even) { border-left: 1.5px dashed #d3a9bd; }
  .dims { grid-template-columns: 1fr 1fr 1fr; }
  .dims span { display: none; }
  .dims select { grid-column: 1 / -1; }
  .specs { grid-template-columns: 1fr; }
}
.input.select {
  background-color: var(--surface);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236a7385' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center;
}
.connect-step h3 { font-size: 15px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.connect-step > p { margin-top: 4px; font-size: 13px; }
details.connect-step summary { cursor: pointer; }
.howto { margin: 14px 0; padding-left: 20px; display: flex; flex-direction: column; gap: 10px; font-size: 14px; }
.howto li::marker { font-weight: 700; color: var(--cyan); }
.code-block { margin: 8px 0 0; padding: 10px 12px; background: var(--ink); color: #e6ebf3; border-radius: var(--r-sm); font: 12px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace; overflow-x: auto; }

/* ==========================================================================
   Step 4: Estimates
   ========================================================================== */
.logo-field { display: flex; gap: 16px; align-items: flex-start; }
.logo-preview { width: 140px; height: 64px; flex-shrink: 0; border: 1px dashed var(--line); border-radius: var(--r-sm); display: grid; place-items: center; background: var(--surface-2); overflow: hidden; }
.logo-preview img { max-width: 120px; max-height: 48px; object-fit: contain; }
.logo-preview span { color: var(--brand); font-weight: 700; }
.file-input { font-size: 13px; display: block; margin-bottom: 6px; }
.site-logo.has-img { background: var(--surface); border: 1px solid var(--line); }
.site-logo.has-img img { max-width: 36px; max-height: 36px; object-fit: contain; }
.b-sent { background: var(--cyan-soft); color: var(--cyan); border-color: #c5e4f3; }
.b-viewed { background: #ece9fb; color: #4a3ca6; border-color: #dad4f6; }
.b-changes { background: var(--yellow-soft); color: var(--yellow); border-color: #f4e3a8; }
.b-expired, .b-superseded { background: var(--surface-2); color: var(--muted); }
.tag-on { background: var(--green-soft); color: var(--green); border-color: #c4e6d2; font-weight: 700; }
.t-feed-quote, .t-quote .feed-icon { background: #ece9fb; color: #4a3ca6; }

.money-input { position: relative; }
.money-input span { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.money-input .input { padding-left: 24px; }
.tier-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin: 22px 0 10px; padding-top: 18px; border-top: 1px dashed var(--line); }
.tier-head h3 { font-size: 14px; }
.tier-head .muted { font-size: 12px; }
.tier-table { border: 1px solid var(--line-2); border-radius: var(--r-sm); }
.tier-table td { padding: 8px 10px; }
.tier-table th { padding: 8px 10px; }
.tier-table .t-amount { font-weight: 600; white-space: nowrap; }
.textarea.internal { background: #fffbea; border-color: #f0e2b0; }
.q-aside { position: sticky; top: calc(var(--topbar-h) + 16px); }
.sum-table { width: 100%; border-collapse: collapse; }
.sum-table td { padding: 7px 0; border-bottom: 1px solid var(--line-2); }
.sum-table td strong { font-size: 15px; }
.ref-list { list-style: none; margin: 0; padding: 4px 20px 14px; }
.ref-list li { padding: 10px 0; border-top: 1px solid var(--line-2); }
.ref-list li:first-child { border-top: 0; }
.ref-tiers { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; margin-top: 4px; color: var(--text-2); }

.quote-preview { border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--line); background: #fff; }
.quote-preview .qdoc { max-width: none; }
.callout .panel-body strong { display: flex; align-items: center; gap: 8px; }
.callout .panel-body p { margin-top: 6px; font-size: 13px; }
.callout.ok { border-color: #c4e6d2; background: var(--green-soft); color: #155f3c; }
.callout.warn { border-color: #f4e3a8; background: var(--yellow-soft); color: #6b4c00; }
.pre { white-space: pre-line; }
.internal-note { background: #fffbea; border-radius: var(--r-sm); padding: 10px 12px; font-size: 13px; }
.approve-box summary { cursor: pointer; }
.tier-pick { border: 0; padding: 0; margin: 0 0 14px; }
.tier-pick legend { font-weight: 700; font-size: 13px; margin-bottom: 6px; }
.tier-pick .choice { margin-bottom: 6px; }
.tier-pick .grow { flex: 1; }

.pick-list { list-style: none; margin: 0; padding: 0; }
.pick-list li a { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line-2); color: var(--text); }
.pick-list li:first-child a { border-top: 0; }
.pick-list li a:hover { background: var(--surface-2); text-decoration: none; }
.pick-list .grow { flex: 1; min-width: 0; }
.pick-list strong { display: block; }
.pick-list .muted { font-size: 13px; }
@media (max-width: 1280px) { .q-aside { position: static; } }
[hidden] { display: none !important; }
.sum-table .right { text-align: right; }

/* Step 4b: PKR costing (team only) */
.team-only { display: inline-block; font-size: 11px; font-weight: 600; color: var(--kraft); background: var(--kraft-soft); border: 1px solid #e6d6c3; border-radius: 4px; padding: 0 6px; margin-left: 4px; vertical-align: 1px; }
.money-input.pkr span { color: var(--kraft); font-weight: 600; }
.cost-cell { background: #fbf8f4; }
.t-cost-usd { display: block; font-size: 11.5px; color: var(--muted); margin-top: 4px; min-height: 16px; }
.cost-table td, .cost-table th { padding: 8px 12px; font-size: 13px; }
.cost-table .pos { color: var(--green); font-weight: 600; }
.cost-table .neg { color: var(--red); font-weight: 600; }
.sum-cost { font-size: 12px; color: var(--muted); }
.money-input.pkr .input { padding-left: 34px; }

/* ==========================================================================
   Step 5: Designs and proofs
   ========================================================================== */
.b-unassigned { background: var(--magenta-soft); color: var(--magenta); border-color: #f5cddd; }
.b-in_progress { background: #ece9fb; color: #4a3ca6; border-color: #dad4f6; }
.b-proof_sent { background: var(--cyan-soft); color: var(--cyan); border-color: #c5e4f3; }
.b-replaced { background: var(--surface-2); color: var(--muted); }
.b-late { background: var(--red-soft); color: var(--red); border-color: #f7cfcb; }

.due { white-space: nowrap; }
.due.is-late { color: var(--red); font-weight: 600; }

.callout { border-left: 4px solid var(--line); }
.callout.ok { border-left-color: var(--green); background: #f6fbf8; }
.callout.warn { border-left-color: #d9a400; background: #fffcf2; }
.callout strong { display: flex; align-items: center; gap: 8px; }
.callout p { margin-top: 6px; color: var(--text-2); }
.pre { white-space: pre-line; }

.upload-box { border: 1.5px dashed #c9cfd4; border-radius: var(--r-md); padding: 16px; background: var(--surface-2); }
.upload-box input[type=file] { width: 100%; font-size: 13px; }
.upload-box input[type=file]::file-selector-button { font: 600 13px var(--font); border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 7px 12px; margin-right: 10px; cursor: pointer; }
.upload-box .hint { display: block; margin-top: 8px; }

.proof-card + .proof-card { border-top: 1px solid var(--line-2); }
.proof-card { padding: 18px 20px; }
.proof-card.is-old { opacity: .78; }
.proof-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.proof-head h3 { font-size: 15px; }
.proof-head .meta { font-size: 12px; color: var(--muted); margin-left: auto; }
.proof-note { margin-top: 10px; font-size: 14px; color: var(--text-2); white-space: pre-line; }
.reply-box { margin-top: 14px; padding: 12px 14px; background: var(--yellow-soft); border: 1px solid #f4e3a8; border-radius: var(--r-sm); font-size: 14px; }
.reply-box strong { display: block; font-size: 12px; color: var(--yellow); margin-bottom: 4px; }

.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.file-tile { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); color: var(--text); min-width: 0; }
.file-tile:hover { border-color: #b9c0c6; text-decoration: none; }
.file-tile .thumb { aspect-ratio: 4 / 3; display: grid; place-items: center; background:
    linear-gradient(45deg, #f1f3f1 25%, transparent 25%, transparent 75%, #f1f3f1 75%) 0 0 / 16px 16px,
    linear-gradient(45deg, #f1f3f1 25%, transparent 25%, transparent 75%, #f1f3f1 75%) 8px 8px / 16px 16px, #fff; }
.file-tile .thumb img { width: 100%; height: 100%; object-fit: contain; }
.file-tile .ext { font-weight: 700; font-size: 13px; color: var(--kraft); background: var(--kraft-soft); border-radius: 4px; padding: 4px 8px; }
.file-tile .fname { padding: 7px 9px 2px; font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-tile .fmeta { padding: 0 9px 7px; font-size: 11px; color: var(--muted); }
.file-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.file-row:first-child { border-top: 0; }
.file-row .grow { flex: 1; min-width: 0; }
.file-row .grow a { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.order-item + .order-item { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.order-item h3 { font-size: 14px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.order-item h3 .qty { font-size: 13px; color: var(--cyan); font-weight: 700; }
.order-item .specs { margin-top: 8px; }

.events { list-style: none; margin: 0; padding: 6px 20px 14px; }
.events li { padding: 9px 0; border-top: 1px solid var(--line-2); font-size: 13px; }
.events li:first-child { border-top: 0; }
.events .t { font-size: 11.5px; color: var(--muted); }
