/* ============================================================
   Razar CRM — app.css
   Mobile-first, light/dark via CSS custom properties.
   ============================================================ */

:root {
  --accent: #E53935;
  --accent-strong: #C62828;
  --accent-soft: rgba(229, 57, 53, 0.1);
  --on-accent: #ffffff;

  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #eef0f3;
  --surface-3: #e3e6ea;
  --text: #1b1e23;
  --text-dim: #5c6470;
  --text-faint: #8a919c;
  --border: #d9dde3;
  --shadow: 0 1px 3px rgba(16, 20, 26, 0.08), 0 4px 14px rgba(16, 20, 26, 0.06);
  --shadow-lg: 0 8px 30px rgba(16, 20, 26, 0.18);
  --overlay: rgba(18, 20, 24, 0.5);

  --ok: #2e7d32;
  --warn: #b26a00;
  --danger: #c62828;

  /* stage colors */
  --st-new-bg: #e5e7eb;        --st-new-fg: #374151;
  --st-contacted-bg: #dbeafe;  --st-contacted-fg: #1d4ed8;
  --st-meeting_scheduled-bg: #e0e7ff; --st-meeting_scheduled-fg: #4338ca;
  --st-meeting_done-bg: #ccfbf1;      --st-meeting_done-fg: #0f766e;
  --st-proposal_sent-bg: #fef3c7;     --st-proposal_sent-fg: #92400e;
  --st-negotiation-bg: #ede9fe;       --st-negotiation-fg: #6d28d9;
  --st-won-bg: #dcfce7;               --st-won-fg: #15803d;
  --st-lost-bg: #fee2e2;              --st-lost-fg: #b91c1c;

  --radius: 12px;
  --radius-sm: 8px;
  --topbar-h: 56px;
  --bottomnav-h: 60px;
  --sidebar-w: 230px;
  --max-content: 1100px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121418;
    --surface: #1c1f24;
    --surface-2: #24282f;
    --surface-3: #2d323b;
    --text: #e8eaed;
    --text-dim: #a7afba;
    --text-faint: #7a828d;
    --border: #343a44;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.55);
    --overlay: rgba(0, 0, 0, 0.6);
    --accent-soft: rgba(229, 57, 53, 0.16);

    --ok: #66bb6a;
    --warn: #ffb74d;
    --danger: #ef5350;

    --st-new-bg: #333942;               --st-new-fg: #c3c9d1;
    --st-contacted-bg: #19314f;         --st-contacted-fg: #8ab8f0;
    --st-meeting_scheduled-bg: #272a52; --st-meeting_scheduled-fg: #a5aef5;
    --st-meeting_done-bg: #0e3a36;      --st-meeting_done-fg: #6fd4c6;
    --st-proposal_sent-bg: #42320c;     --st-proposal_sent-fg: #f0c25e;
    --st-negotiation-bg: #352550;       --st-negotiation-fg: #c3a5f2;
    --st-won-bg: #103a21;               --st-won-fg: #7ed79a;
    --st-lost-bg: #46191c;              --st-lost-fg: #f09090;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
a { color: var(--accent); text-decoration: none; }
button { font: inherit; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
svg { display: block; }

/* ---------------- Login ---------------- */
.login-wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-card {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
}
.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.logo-mark {
  width: 14px; height: 14px;
  border-radius: 4px;
  background: var(--accent);
  margin-right: 10px;
}
.logo-accent { color: var(--accent); }
.login-sub {
  text-align: center;
  color: var(--text-dim);
  margin: 0 0 20px;
}

/* ---------------- Fields / forms ---------------- */
.field { display: block; margin-bottom: 14px; }
.field > span {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 5px;
}
.field input, .field select, .field textarea, .input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  outline: none;
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.field-hint { font-size: 12px; color: var(--text-faint); margin-top: 4px; }
.form-error {
  background: var(--st-lost-bg);
  color: var(--st-lost-fg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 14px;
}
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 14px; }
@media (min-width: 640px) {
  .form-grid { grid-template-columns: 1fr 1fr; }
  .form-grid .span-2 { grid-column: span 2; }
}
.req { color: var(--accent); }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  background: var(--surface-2);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: default; }
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-strong); }
.btn-outline { background: transparent; border-color: var(--border); }
.btn-danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn-danger-solid { background: var(--danger); color: #fff; }
.btn-ghost { background: transparent; color: var(--text-dim); }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: 14px; }
.btn-block { width: 100%; }
.btn .spinner { width: 16px; height: 16px; border-width: 2px; }

.icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
.icon-btn:hover { background: var(--surface-2); }

/* ---------------- Topbar ---------------- */
#topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 40;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.topbar-inner {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 0 16px;
  max-width: calc(var(--max-content) + 32px);
  margin: 0 auto;
}
.topbar-title {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.01em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bell-badge {
  position: absolute;
  top: 4px; right: 2px;
  min-width: 18px; height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---------------- Main / nav ---------------- */
#main {
  padding: calc(var(--topbar-h) + env(safe-area-inset-top) + 12px) 16px
           calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 24px);
  max-width: calc(var(--max-content) + 32px);
  margin: 0 auto;
}

#main-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 40;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  padding-bottom: env(safe-area-inset-bottom);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--bottomnav-h);
  color: var(--text-faint);
  font-size: 11px;
  font-weight: 600;
  background: none;
  border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.nav-item svg { width: 23px; height: 23px; }
.nav-item.active { color: var(--accent); }
.nav-label { line-height: 1; }
.nav-logo { display: none; }

@media (min-width: 900px) {
  #main-nav {
    top: 0; bottom: 0; right: auto;
    width: var(--sidebar-w);
    flex-direction: column;
    justify-content: flex-start;
    border-top: none;
    border-right: 1px solid var(--border);
    padding: 12px 10px;
    gap: 2px;
  }
  .nav-logo {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 800;
    padding: 10px 12px 22px;
  }
  .nav-item {
    flex: 0 0 auto;
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
    min-height: 46px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    font-size: 14px;
  }
  .nav-item:hover { background: var(--surface-2); color: var(--text); }
  .nav-item.active { background: var(--accent-soft); color: var(--accent); }
  #topbar { left: var(--sidebar-w); }
  #main { margin-left: var(--sidebar-w); padding-bottom: 40px; }
  .topbar-inner { padding: 0 16px 0 24px; }
}

/* ---------------- Cards & layout ---------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.card-title {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-faint);
  margin: 20px 0 10px;
}
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.small { font-size: 13px; }
.row-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { justify-content: space-between; }

/* ---------------- Badges & chips ---------------- */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.st-new { background: var(--st-new-bg); color: var(--st-new-fg); }
.st-contacted { background: var(--st-contacted-bg); color: var(--st-contacted-fg); }
.st-meeting_scheduled { background: var(--st-meeting_scheduled-bg); color: var(--st-meeting_scheduled-fg); }
.st-meeting_done { background: var(--st-meeting_done-bg); color: var(--st-meeting_done-fg); }
.st-proposal_sent { background: var(--st-proposal_sent-bg); color: var(--st-proposal_sent-fg); }
.st-negotiation { background: var(--st-negotiation-bg); color: var(--st-negotiation-fg); }
.st-won { background: var(--st-won-bg); color: var(--st-won-fg); }
.st-lost { background: var(--st-lost-bg); color: var(--st-lost-fg); }

.role-badge { background: var(--surface-3); color: var(--text-dim); }
.role-owner { background: var(--st-proposal_sent-bg); color: var(--st-proposal_sent-fg); }
.role-manager { background: var(--st-contacted-bg); color: var(--st-contacted-fg); }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
}
.stat-chip b { color: var(--text); font-size: 14px; }
.stat-chip .dot { width: 9px; height: 9px; border-radius: 50%; }

.svc-chip {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dim);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.svc-chip.on {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.svc-chip-static {
  min-height: 0;
  padding: 3px 10px;
  font-size: 12px;
  cursor: default;
}

/* ---------------- Stat tiles ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 640px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } }
.stat-tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
}
.stat-tile .num { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.stat-tile .lbl { font-size: 12px; font-weight: 600; color: var(--text-faint); margin-top: 2px; }

/* ---------------- Lists ---------------- */
.list-plain { margin: 0; padding: 0; list-style: none; }
.client-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  color: var(--text);
  cursor: pointer;
  min-height: 44px;
}
.client-row:hover { border-color: var(--text-faint); }
.row-name { font-weight: 700; margin-bottom: 2px; }
.row-sub { font-size: 12.5px; color: var(--text-faint); }
.row-side { text-align: right; flex-shrink: 0; }
.row-value { font-size: 12.5px; color: var(--text-dim); margin-top: 5px; font-variant-numeric: tabular-nums; }

.rem-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.rem-item.clickable { cursor: pointer; }
.rem-item.clickable:hover { border-color: var(--text-faint); }
.rem-item.done .rem-note { text-decoration: line-through; color: var(--text-faint); }
.rem-when { font-size: 12px; font-weight: 600; }
.rem-when.overdue { color: var(--danger); }
.rem-note { font-size: 14px; }
.rem-check {
  width: 22px; height: 22px;
  margin: 2px 0 0;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

/* ---------------- Timeline ---------------- */
.timeline { margin: 0; padding: 0; list-style: none; }
.tl-item { display: flex; gap: 12px; padding: 10px 0; }
.tl-item + .tl-item { border-top: 1px solid var(--border); }
.tl-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.tl-icon svg { width: 17px; height: 17px; }
.tl-body { flex: 1; min-width: 0; }
.tl-head { font-size: 13px; color: var(--text-faint); display: flex; flex-wrap: wrap; gap: 4px 8px; }
.tl-head b { color: var(--text); }
.tl-note { margin-top: 3px; white-space: pre-wrap; word-break: break-word; }
.tl-result { margin-top: 3px; font-size: 13px; color: var(--text-dim); }
.tl-result b { font-weight: 600; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.tbl td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tbl tr:last-child td { border-bottom: none; }
.tbl .num-cell { text-align: right; }
.tbl th.num-cell { text-align: right; }

/* bar chart cell */
.bar-cell { min-width: 120px; }
.bar-track {
  height: 10px;
  border-radius: 4px;
  background: var(--surface-2);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
  min-width: 2px;
}

/* ---------------- Toolbar (clients list) ---------------- */
.toolbar { display: flex; gap: 8px; margin-bottom: 12px; }
.search-wrap { position: relative; flex: 1; }
.search-wrap svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  width: 17px; height: 17px;
  color: var(--text-faint);
  pointer-events: none;
}
.search-wrap input { padding-left: 38px; }
.toolbar .icon-btn {
  width: 44px; height: 44px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
}
.toolbar .icon-btn.active { border-color: var(--accent); color: var(--accent); }
.filter-count {
  position: absolute;
  top: -5px; right: -5px;
  min-width: 17px; height: 17px;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* ---------------- FAB ---------------- */
.fab {
  position: fixed;
  right: 18px;
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 18px);
  z-index: 35;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.fab svg { width: 26px; height: 26px; }
.fab:active { transform: scale(0.96); }
@media (min-width: 900px) { .fab { bottom: 28px; } }

/* ---------------- Modal / sheet ---------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--overlay);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.modal {
  background: var(--surface);
  border-radius: var(--radius) var(--radius) 0 0;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow-y: auto;
  padding: 20px 18px calc(18px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
  animation: sheet-up 0.18s ease-out;
}
@keyframes sheet-up { from { transform: translateY(30px); opacity: 0.6; } to { transform: none; opacity: 1; } }
@media (min-width: 640px) {
  .modal-overlay { align-items: center; padding: 20px; }
  .modal { border-radius: var(--radius); }
}
.modal-title { font-size: 17px; font-weight: 700; margin: 0 0 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.modal-actions .btn { min-width: 96px; }

.sheet-option {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  text-align: left;
  font-weight: 600;
  cursor: pointer;
}
.sheet-option:hover { background: var(--surface-2); }
.sheet-option svg { width: 19px; height: 19px; color: var(--text-dim); }

/* ---------------- Toasts ---------------- */
#toast-root {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--bottomnav-h) + env(safe-area-inset-bottom) + 14px);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(92vw, 420px);
  pointer-events: none;
}
@media (min-width: 900px) { #toast-root { bottom: 24px; margin-left: calc(var(--sidebar-w) / 2); } }
.toast {
  background: var(--text);
  color: var(--bg);
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 600;
  max-width: 100%;
  animation: toast-in 0.2s ease-out;
}
.toast.err { background: var(--danger); color: #fff; }
.toast.ok { background: var(--ok); color: #fff; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------------- Spinner / states ---------------- */
.spinner {
  width: 26px; height: 26px;
  border: 3px solid var(--surface-3);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.center-state { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 16px; text-align: center; }
.center-state svg { width: 40px; height: 40px; color: var(--text-faint); }
.center-state h3 { margin: 0; font-size: 16px; }
.center-state p { margin: 0; color: var(--text-dim); font-size: 14px; }

/* ---------------- Banners ---------------- */
.banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 13px 14px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
}
.banner svg { width: 22px; height: 22px; color: var(--accent); flex-shrink: 0; margin-top: 1px; }
.banner-body { flex: 1; }
.banner-body b { display: block; margin-bottom: 2px; }
.banner-body p { margin: 0 0 8px; font-size: 13.5px; color: var(--text-dim); }
.banner .icon-btn { width: 36px; height: 36px; margin: -4px -4px 0 0; }
.ios-steps { font-size: 13.5px; color: var(--text-dim); }
.ios-steps svg { display: inline-block; vertical-align: -4px; width: 17px; height: 17px; color: var(--accent); margin: 0 2px; }

.dup-card {
  border: 1px solid var(--danger);
  border-left-width: 4px;
  background: var(--st-lost-bg);
  color: var(--st-lost-fg);
  border-radius: var(--radius);
  padding: 13px 14px;
  margin-bottom: 14px;
}
.dup-card b { display: block; margin-bottom: 3px; }
.dup-card p { margin: 0; font-size: 14px; }

/* ---------------- Client detail ---------------- */
.detail-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.detail-head h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -0.01em; }
.info-row {
  display: flex;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.info-row:last-child { border-bottom: none; }
.info-row .k { width: 110px; flex-shrink: 0; color: var(--text-faint); font-weight: 600; font-size: 13px; padding-top: 1px; }
.info-row .v { flex: 1; min-width: 0; word-break: break-word; white-space: pre-wrap; }
.tel-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.tel-link svg { width: 15px; height: 15px; }

.quick-add { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.quick-add .qa-row { display: flex; gap: 8px; }
.quick-add select { flex: 0 0 120px; }
.quick-add input { flex: 1; }

/* ---------------- Kanban ---------------- */
.kanban {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 12px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  scroll-snap-type: x proximity;
}
.kcol {
  flex: 0 0 272px;
  scroll-snap-align: start;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - var(--topbar-h) - var(--bottomnav-h) - 120px);
  min-height: 160px;
}
.kcol-head {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.kcol-head .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.kcol-head .kname { font-weight: 700; font-size: 13.5px; flex: 1; }
.kcol-head .kcount {
  background: var(--surface-3);
  border-radius: 999px;
  padding: 1px 8px;
  font-size: 12px;
  font-weight: 700;
}
.kcol-sum { padding: 6px 12px 0; font-size: 12px; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.kcol-body { flex: 1; overflow-y: auto; padding: 10px; }
.kcol-body.drag-over { background: var(--accent-soft); border-radius: 0 0 var(--radius) var(--radius); }
.kcard {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: grab;
  box-shadow: var(--shadow);
  -webkit-tap-highlight-color: transparent;
}
.kcard:active { cursor: grabbing; }
.kcard.dragging { opacity: 0.45; }
.kcard .kc-name { font-weight: 700; font-size: 14px; margin-bottom: 3px; }
.kcard .kc-sub { font-size: 12px; color: var(--text-faint); display: flex; justify-content: space-between; gap: 8px; }

/* stage dots */
.dot-new { background: #9ca3af; }
.dot-contacted { background: #3b82f6; }
.dot-meeting_scheduled { background: #6366f1; }
.dot-meeting_done { background: #14b8a6; }
.dot-proposal_sent { background: #f59e0b; }
.dot-negotiation { background: #8b5cf6; }
.dot-won { background: #22c55e; }
.dot-lost { background: #ef4444; }

/* ---------------- Notifications panel ---------------- */
.notif-overlay {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: var(--overlay);
}
.notif-panel {
  position: absolute;
  top: calc(var(--topbar-h) + env(safe-area-inset-top) + 6px);
  right: 8px;
  left: 8px;
  max-width: 420px;
  margin-left: auto;
  max-height: 72vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.notif-head {
  position: sticky;
  top: 0;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-weight: 700;
}
.notif-item {
  display: flex;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 12px 14px;
  cursor: pointer;
}
.notif-item:hover { background: var(--surface-2); }
.notif-item:last-child { border-bottom: none; }
.notif-item.unread { background: var(--accent-soft); }
.notif-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-top: 7px; flex-shrink: 0; }
.notif-dot.read-dot { background: transparent; }
.notif-item b { display: block; font-size: 14px; }
.notif-item p { margin: 2px 0 0; font-size: 13px; color: var(--text-dim); }
.notif-item time { font-size: 11.5px; color: var(--text-faint); }

/* ---------------- Users / More ---------------- */
.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
}
.user-row .u-main { flex: 1; min-width: 0; }
.user-row .u-name { font-weight: 700; }
.user-row .u-sub { font-size: 12.5px; color: var(--text-faint); }
.avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.inactive-dim { opacity: 0.55; }

.more-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}
.more-link:hover { border-color: var(--text-faint); }
.more-link svg { width: 20px; height: 20px; color: var(--text-dim); }
.more-link .chev { margin-left: auto; color: var(--text-faint); }
.more-link.danger-link, .more-link.danger-link svg { color: var(--danger); }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 46px; height: 28px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0;
  background: var(--surface-3);
  border-radius: 999px;
  transition: background 0.15s;
  cursor: pointer;
}
.switch .track::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.15s;
}
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* load more */
.load-more-wrap { display: flex; justify-content: center; padding: 10px 0 20px; }

/* utility */
.mt0 { margin-top: 0; }
.mb0 { margin-bottom: 0; }
.mt12 { margin-top: 12px; }
.w100 { width: 100%; }
