:root {
  --bg: #0d0f12;
  --panel: #16191f;
  --panel-2: #1d212a;
  --border: #2a2f3a;
  --text: #e8eaf0;
  --muted: #8b93a7;
  --accent: #4f7cff;
  --accent-2: #7aa2ff;
  --green: #34c98e;
  --amber: #e8b339;
  --red: #e2564f;
  font-size: 15px;
}
* { box-sizing: border-box; margin: 0; }
body {
  background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
.hidden { display: none !important; }
code { background: var(--panel-2); padding: 1px 5px; border-radius: 4px; font-size: 0.85em; }

/* ---------- auth gate ---------- */
.auth-gate { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.auth-card { text-align: center; background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 48px 56px; }
.auth-card h1 { font-size: 28px; letter-spacing: 2px; }
.auth-card h1 span, .logo span { color: var(--accent-2); font-weight: 300; }
.auth-card p { color: var(--muted); margin: 10px 0 24px; }
.auth-card { width: 380px; padding: 44px 44px 40px; }
.auth-card input { width: 100%; text-align: center; margin-bottom: 12px; }
.auth-card .btn { width: 100%; justify-content: center; }
.auth-card #signin-link-btn { margin-top: 10px; }

/* ---------- SKU chip editor ---------- */
.sku-editor { margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.chips:empty { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 3px 6px 3px 10px; font-size: 12px;
}
.chip-x {
  background: none; border: 0; color: var(--muted); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0 3px;
}
.chip-x:hover { color: var(--red); }
.sku-editor .row { gap: 8px; align-items: center; }
.sku-editor input { margin: 0; }
.sku-editor .btn { white-space: nowrap; }

/* ---------- claim line items ---------- */
.lines-scroll { overflow-x: auto; }
table.lines { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
table.lines th { text-align: left; color: var(--muted); font-weight: 500; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.4px; padding: 0 6px 6px; white-space: nowrap; }
table.lines td { padding: 3px 6px; border-top: 1px solid var(--border); }
table.lines .num, table.lines th.num { text-align: right; }
table.lines input { margin: 0; padding: 5px 7px; font-size: 13px; min-width: 70px; }
table.lines td:nth-child(2) input { min-width: 180px; }
table.lines tfoot td { border-top: 1px solid var(--border); color: var(--muted); padding-top: 8px; }
.line-x { font-size: 16px; }

/* ---------- evidence checklist ---------- */
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 18px; margin-bottom: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); cursor: pointer; }
.check input { width: auto; margin: 0; }
@media (max-width: 900px) { .checks { grid-template-columns: 1fr; } }
.auth-msg { color: var(--red); font-size: 13px; margin-top: 12px; line-height: 1.4; }
.auth-tick { font-size: 34px; color: var(--accent-2); margin-bottom: 4px; }
.auth-sent p { margin: 10px 0 18px; }
.auth-sent strong { color: var(--text); font-weight: 600; }

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.sidebar {
  background: var(--panel); border-right: 1px solid var(--border);
  padding: 20px 14px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh;
}
.logo { font-weight: 700; letter-spacing: 2px; font-size: 17px; padding: 4px 10px 18px; }
.sidebar a {
  color: var(--muted); text-decoration: none; padding: 9px 10px; border-radius: 8px;
  display: flex; align-items: center; gap: 8px; font-weight: 500;
}
.sidebar a:hover { background: var(--panel-2); color: var(--text); }
.sidebar a.active { background: var(--panel-2); color: var(--text); }
.sidebar a.accent { color: var(--accent-2); margin-top: 10px; }
.sidebar-foot { margin-top: auto; color: var(--muted); font-size: 12px; display: flex; flex-direction: column; gap: 8px; padding: 0 10px; }
.badge { background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; margin-left: auto; }

main { padding: 28px 34px; max-width: 1100px; min-width: 0; }
h2 { font-size: 21px; margin-bottom: 18px; }
h3 { font-size: 15px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; margin: 22px 0 10px; }

/* ---------- cards, lists, tables ---------- */
.card { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 16px 18px; margin-bottom: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.row .grow { flex: 1; }
.muted { color: var(--muted); font-size: 13px; }
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border-bottom: 1px solid var(--border); cursor: pointer;
}
.list-item:hover { background: var(--panel-2); }
.list-item:last-child { border-bottom: none; }
.list-wrap { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.pill { font-size: 11px; padding: 2px 9px; border-radius: 10px; border: 1px solid var(--border); color: var(--muted); white-space: nowrap; }
.pill.b2b { color: var(--accent-2); border-color: var(--accent); }
.pill.overdue { color: var(--red); border-color: var(--red); }
.pill.today { color: var(--amber); border-color: var(--amber); }
.money { color: var(--green); font-weight: 600; }

/* ---------- forms ---------- */
input, select, textarea {
  background: var(--panel-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 9px 12px; font: inherit; width: 100%;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); }
label { display: block; font-size: 12px; color: var(--muted); margin: 12px 0 5px; font-weight: 600; }
.btn {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.ghost { background: none; }
.btn.small { padding: 4px 10px; font-size: 12px; }
.btn.danger { color: var(--red); }
.btn.danger:hover { border-color: var(--red); background: rgba(226,86,79,0.08); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }

/* ---------- kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(170px, 1fr)); gap: 12px; overflow-x: auto; }
.kanban .col { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 10px; min-height: 200px; }
.kanban .col h4 { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 4px 6px 10px; }
.deal-card { background: var(--panel-2); border: 1px solid var(--border); border-radius: 9px; padding: 10px 12px; margin-bottom: 8px; }
.deal-card .name { font-weight: 600; font-size: 13.5px; }
.deal-card select { margin-top: 8px; padding: 4px 8px; font-size: 12px; }

/* ---------- timeline ---------- */
.timeline { border-left: 2px solid var(--border); margin-left: 8px; padding-left: 20px; }
.timeline .t-item { position: relative; padding-bottom: 18px; }
.timeline .t-item::before {
  content: ''; position: absolute; left: -26px; top: 5px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--border);
}
.timeline .t-item.order::before { background: var(--green); }
.timeline .t-item.email::before { background: var(--accent); }
.timeline .t-item.call::before { background: var(--amber); }
.timeline .t-item.note::before { background: var(--muted); }

/* ---------- misc ---------- */
.demo-banner {
  position: fixed; bottom: 14px; right: 14px; background: var(--amber); color: #201a05;
  padding: 8px 14px; border-radius: 8px; font-size: 12.5px; font-weight: 600;
}
.demo-banner code { background: rgba(0,0,0,0.15); color: inherit; }
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.stat .num { font-size: 24px; font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: 12px; margin-top: 2px; }
.search-results { background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; margin-top: 4px; max-height: 200px; overflow-y: auto; }
.search-results div { padding: 8px 12px; cursor: pointer; }
.search-results div:hover { background: var(--panel); }
.empty { color: var(--muted); padding: 30px; text-align: center; }
@media (max-width: 900px) {
  .shell { display: block; }
  .sidebar {
    position: sticky; top: 0; z-index: 10; height: auto;
    flex-direction: row; flex-wrap: wrap; align-items: center; gap: 2px;
    padding: 10px 12px; border-right: none; border-bottom: 1px solid var(--border);
  }
  .logo { padding: 4px 10px 4px 6px; font-size: 15px; }
  .sidebar a { padding: 7px 10px; font-size: 13.5px; }
  .sidebar a.accent { margin-top: 0; }
  .sidebar-foot { margin: 0 0 0 auto; flex-direction: row; align-items: center; padding: 0; }
  .sidebar-foot #user-email { display: none; }
  main { padding: 20px; }
  .form-grid, .stat-row { grid-template-columns: 1fr 1fr; }
}
