/* IV Infotech AI Sales CRM — v2: soft white cards, compact spacing, light theme, Inter.
   Rang sirf :root tokens se; components me seedhe hex kam se kam. */

:root {
  --bg: #F3F5FA;
  --surface: #FFFFFF;
  --surface-2: #F7F8FC;
  --ink: #0F172A;
  --ink-2: #1E293B;
  --ink-3: #334155;
  --muted: #5B6578;
  --faint: #8A93A6;
  --line: #E6E9F1;
  --line-2: #D9DEE8;
  --blue: #2F54EB;
  --blue-dark: #1E3FCC;
  --blue-50: #EEF2FF;
  --blue-100: #DCE4FF;
  --blue-200: #B9C8FF;
  --green: #12B76A;
  --green-ink: #067647;
  --green-bg: #DCFAE6;
  --amber: #F79009;
  --amber-ink: #B54708;
  --amber-bg: #FEF0C7;
  --amber-line: #FEC84B;
  --red: #F04438;
  --red-ink: #B42318;
  --red-bg: #FEE4E2;
  --violet-ink: #5925DC;
  --violet-bg: #EBE9FE;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 4px 14px rgba(16, 24, 40, 0.05);
  --shadow-hover: 0 2px 4px rgba(16, 24, 40, 0.05), 0 10px 24px rgba(16, 24, 40, 0.08);
  --r-lg: 16px;
  --r-md: 10px;
  --r-sm: 8px;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background:
    radial-gradient(1200px 500px at 10% -10%, #E3E9FF 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 0%, #FFF0E6 0%, transparent 55%),
    var(--bg);
  background-attachment: scroll;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 13px;
  line-height: 1.45;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "tnum";
}
a { color: var(--blue); }
a:hover { color: var(--blue-dark); }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 6px; }
svg { flex: 0 0 auto; }

.wrap { max-width: 1400px; margin: 0 auto; padding: 14px 20px 48px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- surfaces ---------- */
.card, .glass {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow);
}
.glass-soft { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.pad, .panel { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.card-head, .panel-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.card-head h2, .panel-head h2 { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; }
.sub, .panel-head .sub { font-size: 12px; color: var(--muted); }
.link-sm { font-size: 12px; font-weight: 600; text-decoration: none; }

/* ---------- top bar (sirf yahan halka glass) ---------- */
.topbar {
  position: sticky; top: 8px; z-index: 30;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px 8px 12px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-logo { width: 32px; height: 32px; border-radius: 9px; background: var(--ink); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.brand-name { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name b { font-size: 14px; }
.brand-name small { font-size: 11px; color: var(--muted); }
.nav { display: flex; flex-wrap: wrap; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; }
.nav a { display: inline-flex; align-items: center; gap: 6px; padding: 6px 11px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--ink-3); text-decoration: none; transition: background 0.15s, color 0.15s; }
.nav a:hover { background: #fff; color: var(--ink); }
.nav a[aria-current="page"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 0 0 1px var(--line); }
.nav a[aria-current="page"] svg { color: var(--blue); }
.top-right { display: flex; align-items: center; gap: 8px; }
.agent-pill { display: flex; align-items: center; gap: 7px; padding: 5px 10px; font-size: 12px; font-weight: 600; background: var(--green-bg); color: var(--green-ink); border-radius: 999px; }
.agent-pill.off { background: var(--red-bg); color: var(--red-ink); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 0 rgba(18, 183, 106, 0.5); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0.45); } 70% { box-shadow: 0 0 0 6px rgba(18, 183, 106, 0); } 100% { box-shadow: 0 0 0 0 rgba(18, 183, 106, 0); } }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--blue-50); color: var(--blue-dark); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-size: 13px; font-weight: 600; min-height: 34px; padding: 0 12px;
  border-radius: var(--r-md); border: 1px solid var(--line-2); background: #fff;
  color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  text-decoration: none; white-space: nowrap; transition: background 0.15s, border-color 0.15s, box-shadow 0.15s, transform 0.1s;
}
.btn:hover { background: var(--surface-2); border-color: #C7CEDB; color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn-primary, .btn.primary { background: var(--blue); color: #fff; border-color: var(--blue); }
.btn-primary:hover, .btn.primary:hover { background: var(--blue-dark); border-color: var(--blue-dark); color: #fff; }
.btn-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-dark:hover { background: var(--ink-2); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--muted); }
.btn.ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-lg { min-height: 38px; }
.btn.xs { min-height: 28px; padding: 0 9px; font-size: 12px; border-radius: 8px; gap: 5px; }
.icon-btn {
  font: inherit; width: 34px; height: 34px; flex: 0 0 auto; border-radius: var(--r-md); border: 1px solid var(--line-2);
  background: #fff; color: var(--ink); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none; transition: background 0.15s;
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }
.icon-btn.sm { width: 30px; height: 30px; border-radius: 8px; }
.icon-btn.accent { background: var(--blue); border-color: var(--blue); color: #fff; }
.icon-btn.accent:hover { background: var(--blue-dark); color: #fff; }

/* ---------- page head ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.eyebrow { font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }
.page-head h1 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; }
.page-head .hint { font-size: 12px; color: var(--muted); }
.stack-6 { display: flex; flex-direction: column; gap: 4px; }
.crumbs { font-size: 12px; color: var(--muted); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); text-decoration: underline; }

.flash { padding: 10px 14px; font-size: 13px; font-weight: 600; color: var(--amber-ink); background: var(--amber-bg); border: 1px solid var(--amber-line); border-radius: 12px; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60; background: var(--ink); color: #fff; padding: 9px 14px; border-radius: 10px; font-size: 13px; font-weight: 600; box-shadow: 0 10px 30px rgba(15, 23, 42, 0.25); animation: rise 0.2s var(--ease); max-width: calc(100vw - 32px); }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- dashboard: hero (date + stats) ---------- */
.hero { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: stretch; overflow: visible; }
.hero-date { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; border-right: 1px solid var(--line); }
.hero-title h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-top: 2px; white-space: nowrap; }
.date-ctrl { position: relative; display: flex; align-items: center; gap: 6px; }
.week { display: flex; gap: 2px; padding: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px; }
.day {
  width: 36px; height: 40px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-decoration: none; color: var(--ink-3); position: relative; transition: background 0.15s;
}
.day:hover { background: #fff; color: var(--ink); }
.day .dow { font-size: 10px; font-weight: 500; color: var(--faint); line-height: 1; }
.day .num { font-size: 14px; font-weight: 700; line-height: 1.3; }
.day.future .num { color: var(--faint); font-weight: 500; }
.day.today::after { content: ""; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--blue); }
.day.sel { background: var(--ink); color: #fff; }
.day.sel .dow { color: rgba(255, 255, 255, 0.7); }
.day.sel .num { color: #fff; }
.day.sel.today::after { background: #fff; }

.cal-pop { position: absolute; top: 40px; left: 0; z-index: 40; width: 296px; padding: 12px; box-shadow: 0 16px 40px rgba(16, 24, 40, 0.16); animation: pop 0.16s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-4px) scale(0.98); } to { opacity: 1; transform: none; } }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 700; font-size: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-dow { font-size: 11px; color: var(--faint); font-weight: 600; text-align: center; margin-bottom: 4px; }
.cal-cell { font-size: 12px; height: 34px; border-radius: 8px; display: flex; align-items: center; justify-content: center; text-decoration: none; font-weight: 600; background: var(--blue-50); color: var(--ink); border: 1px solid transparent; }
.cal-cell:hover { background: var(--blue-100); color: var(--ink); }
.cal-cell.future { font-weight: 400; background: transparent; color: var(--faint); }
.cal-cell.today { border-color: var(--blue); }
.cal-cell.sel { background: var(--ink); color: #fff; }
.cal-legend { display: flex; gap: 12px; margin-top: 8px; font-size: 11px; color: var(--muted); }
.cal-legend span { display: flex; align-items: center; gap: 5px; }
.lg-dot { width: 8px; height: 8px; border-radius: 3px; background: var(--blue-100); }
.lg-ring { width: 8px; height: 8px; border-radius: 3px; border: 1px solid var(--line-2); }

.stats { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.stat { padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; justify-content: center; border-left: 1px solid var(--line); min-width: 0; }
.stat:first-child { border-left: 0; }
.stat-label { font-size: 12px; color: var(--muted); font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-row { display: flex; align-items: baseline; gap: 6px; }
.stat-value { font-size: 24px; font-weight: 700; letter-spacing: -0.03em; line-height: 1.15; }
.stat-hint { font-size: 11px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-warn .stat-value { color: var(--amber-ink); }
.delta { font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.delta.up { background: var(--green-bg); color: var(--green-ink); }
.delta.down { background: var(--red-bg); color: var(--red-ink); }

/* ---------- dashboard: viz row ---------- */
.viz { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.viz-side { display: flex; flex-direction: column; gap: 14px; }
@keyframes grow { from { width: 0; } }

.funnel { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.funnel li { display: grid; grid-template-columns: 64px minmax(0, 1fr) 30px 36px; align-items: center; gap: 8px; }
.f-label { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.f-track { height: 26px; background: var(--surface-2); border-radius: 7px; overflow: hidden; }
.f-bar { display: block; height: 100%; width: var(--w); border-radius: 7px; animation: grow 0.7s var(--ease); }
.f1 { background: var(--blue-100); } .f2 { background: var(--blue-200); } .f3 { background: #7E97FA; }
.f4 { background: #5577F2; } .f5 { background: var(--blue); } .f6 { background: #1A2F8F; }
.f-val { font-size: 14px; font-weight: 700; text-align: right; }
.f-conv { font-size: 11px; font-weight: 600; color: var(--muted); text-align: right; }

.plist { display: flex; flex-direction: column; gap: 1px; margin: 0 -6px; padding: 0 6px; }
.prow { display: grid; grid-template-columns: 22px minmax(0, 118px) minmax(0, 1fr) 26px; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; text-decoration: none; color: var(--ink); transition: background 0.15s, opacity 0.15s; }
.prow:hover { background: var(--surface-2); color: var(--ink); }
.prow.on { background: var(--blue-50); box-shadow: inset 0 0 0 1px var(--blue-200); }
.prow.dim { opacity: 0.45; }
.prow.dim:hover { opacity: 1; }
.p-name { font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: flex; align-items: center; gap: 5px; }
.off-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--red); flex: 0 0 auto; }
.p-bar { position: relative; height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.p-bar span { position: absolute; left: 0; top: 0; bottom: 0; width: var(--w); border-radius: 5px; animation: grow 0.7s var(--ease); }
.b-total { background: var(--blue-100); }
.b-fit { background: #7E97FA; }
.b-sent { background: var(--blue-dark); }
.p-num { font-size: 13px; font-weight: 700; text-align: right; }
.legend-row { display: flex; gap: 12px; font-size: 11px; color: var(--muted); padding-top: 4px; border-top: 1px solid var(--line); }
.legend-row span { display: inline-flex; align-items: center; gap: 5px; }
.legend-row .lg { width: 10px; height: 6px; border-radius: 3px; display: inline-block; }

.country { display: flex; align-items: center; gap: 14px; }
.donut { width: 104px; height: 104px; border-radius: 50%; flex: 0 0 auto; position: relative; display: flex; align-items: center; justify-content: center; animation: fade 0.6s var(--ease); }
.donut::before { content: ""; position: absolute; inset: 16px; border-radius: 50%; background: #fff; }
.donut span { position: relative; display: flex; flex-direction: column; align-items: center; font-size: 10px; color: var(--muted); line-height: 1.1; }
.donut b { font-size: 18px; color: var(--ink); }
@keyframes fade { from { opacity: 0; transform: rotate(-20deg); } }
.c-legend { list-style: none; margin: 0; padding: 0; flex: 1; display: grid; grid-template-columns: 1fr; gap: 3px; min-width: 0; }
.c-legend li { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; gap: 7px; align-items: center; font-size: 12px; }
.c-legend i { width: 8px; height: 8px; border-radius: 3px; }
.c-legend b { font-weight: 700; }

.caps { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; }
.caps span { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--blue), #7E97FA); border-radius: 6px; animation: grow 0.8s var(--ease); }
.shifts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.shifts li { display: grid; grid-template-columns: 16px minmax(0, 1fr) auto; gap: 8px; align-items: start; }
.sh-dot { width: 16px; height: 16px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.sh-done .sh-dot { background: var(--green); color: #fff; }
.sh-running .sh-dot { border: 2px solid var(--blue); background: radial-gradient(circle, var(--blue) 0 3px, transparent 3.5px); }
.sh-next .sh-dot { border: 1.5px dashed var(--line-2); }
.sh-body { display: flex; flex-direction: column; min-width: 0; }
.sh-body b { font-size: 12px; }
.sh-body span { font-size: 11px; color: var(--muted); }
.sh-when { font-size: 11px; color: var(--faint); white-space: nowrap; }

.camp { display: flex; flex-direction: column; gap: 5px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; text-decoration: none; color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s; }
.camp:hover { border-color: var(--blue-200); box-shadow: var(--shadow-hover); color: var(--ink); }
.camp-top { display: flex; justify-content: space-between; gap: 8px; align-items: center; font-size: 12px; }
.camp-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- portal icons ---------- */
.picon { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 8px; background: #fff; border: 1px solid var(--line); display: inline-flex; align-items: center; justify-content: center; overflow: hidden; }
.picon img { width: 18px; height: 18px; object-fit: contain; }
.picon.sm { width: 22px; height: 22px; border-radius: 6px; }
.picon.sm img { width: 14px; height: 14px; }
.picon.lg { width: 34px; height: 34px; border-radius: 10px; }
.picon.lg img { width: 22px; height: 22px; }
.picon.xl { width: 44px; height: 44px; border-radius: 12px; }
.picon.xl img { width: 28px; height: 28px; }
.mono { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 8px; color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; }
.mono.sm { width: 22px; height: 22px; font-size: 9px; border-radius: 6px; }
.mono.xs { width: 16px; height: 16px; font-size: 7px; border-radius: 4px; letter-spacing: -0.02em; }
.mono.lg { width: 34px; height: 34px; font-size: 12px; border-radius: 10px; }
.mono.xl { width: 44px; height: 44px; font-size: 15px; border-radius: 12px; }

/* ---------- lists ---------- */
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(460px, 100%), 1fr)); gap: 14px; align-items: start; }
.count-pill { font-size: 12px; font-weight: 700; padding: 2px 9px; border-radius: 999px; background: var(--blue-50); color: var(--blue-dark); }
.count-pill.warm { background: var(--amber-bg); color: var(--amber-ink); }
.none { padding: 10px 0; font-size: 13px; color: var(--muted); }
.rows { display: flex; flex-direction: column; gap: 6px; }
.lrow { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); text-decoration: none; color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; }
.lrow:hover { border-color: var(--blue-200); box-shadow: var(--shadow-hover); color: var(--ink); transform: translateY(-1px); }
.lr-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.lr-title { font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
a.lr-title:hover { color: var(--blue); }
.lr-meta { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lr-why { font-size: 12px; color: var(--ink-3); }
.chev { color: var(--faint); display: inline-flex; }
.lrow:hover .chev { color: var(--blue); }

.mcard { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: #fff; transition: box-shadow 0.15s, border-color 0.15s; }
.mcard:hover { box-shadow: var(--shadow-hover); }
.mcard.rec { background: linear-gradient(180deg, #FFFAEB, #fff 70%); border-color: var(--amber-line); }
.mc-top { display: flex; gap: 10px; align-items: flex-start; }
.mc-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.rec-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 700; color: var(--amber-ink); background: var(--amber-bg); padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.btns { display: flex; flex-wrap: wrap; gap: 6px; }
.draft { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; line-height: 1.55; white-space: pre-line; color: var(--ink-2); animation: pop 0.16s var(--ease); }

/* old row classes (doosre pages) */
.row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); }
.row-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.row-title { font-size: 13px; font-weight: 600; }
.row-meta { font-size: 12px; color: var(--muted); }
.row-req { font-size: 12px; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

.pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; display: inline-block; }
.st-Replied, .st-Reply, .st-Won, .st-Running { color: var(--green-ink); background: var(--green-bg); }
.st-Opened, .st-Approached, .st-Scheduled { color: var(--blue-dark); background: var(--blue-50); }
.st-Sent, .st-New, .st-Done { color: var(--ink-3); background: #EEF0F5; }
.st-Bounced, .st-Lost { color: var(--red-ink); background: var(--red-bg); }
.st-Call, .st-Paused { color: var(--amber-ink); background: var(--amber-bg); }
.fit { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.fit-A { background: var(--green-bg); color: var(--green-ink); }
.fit-B { background: var(--violet-bg); color: var(--violet-ink); }
.fit-C { background: #EEF0F5; color: var(--muted); }

.empty { padding: 32px 16px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--muted); }
.empty h2 { font-size: 15px; color: var(--ink); }
.empty p { font-size: 13px; max-width: 520px; }

/* ---------- KPI tiles (campaign page) ---------- */
.kpis, .nums7 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(120px, 100%), 1fr)); gap: 10px; }
.kpi { padding: 10px 14px; display: flex; flex-direction: column; gap: 2px; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 500; }
.kpi .value { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.kpi .note { font-size: 11px; color: var(--faint); }

/* ---------- lead profile ---------- */
.profile { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.facts { padding: 12px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; font-size: 13px; }
.facts .k { color: var(--muted); font-size: 11px; }
.facts .v { font-weight: 600; }
.section { display: flex; flex-direction: column; gap: 6px; }
.section h3 { font-size: 13px; }
.section p { font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.mail { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; }
.mail .body { white-space: pre-line; line-height: 1.6; color: var(--ink-2); }
.reply-in { background: var(--green-bg); border: 1px solid #ABEFC6; border-radius: 12px; padding: 12px; font-size: 13px; line-height: 1.6; white-space: pre-line; }
.timeline { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 0; position: relative; }
.timeline li { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 5px 0; position: relative; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 4px; top: 17px; bottom: -7px; width: 2px; background: var(--line); }
.timeline .tl-label { flex: 1; font-weight: 500; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 auto; background: var(--blue); position: relative; z-index: 1; }
.tl-dot.todo { background: #fff; border: 2px solid var(--line-2); }

/* ---------- tables ---------- */
.table-box { overflow-x: auto; margin: 0 -16px; padding: 0 16px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; background: var(--surface-2); }
.tbl th:first-child { border-radius: 8px 0 0 8px; } .tbl th:last-child { border-radius: 0 8px 8px 0; }
.tbl td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr { transition: background 0.12s; }
.tbl tbody tr:hover { background: var(--surface-2); }
.cell-lead { display: flex; align-items: center; gap: 9px; min-width: 240px; }
.cell-lead a { font-weight: 600; color: var(--ink); text-decoration: none; }
.cell-lead a:hover { color: var(--blue); }
.ell { max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink-3); }

/* ---------- filters / forms ---------- */
.filters { padding: 10px 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field label, .field .lbl { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.field .help { font-size: 11px; color: var(--muted); }
.input, .select, .textarea {
  font: inherit; font-size: 13px; min-height: 34px; padding: 6px 10px; border-radius: var(--r-md);
  border: 1px solid var(--line-2); background: #fff; color: var(--ink); width: 100%; transition: border-color 0.15s, box-shadow 0.15s;
}
.textarea { min-height: 84px; resize: vertical; line-height: 1.5; }
.input:focus, .select:focus, .textarea:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 84, 235, 0.15); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }
.textarea[rows="2"] { min-height: 58px; }
.check-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); cursor: pointer; }
.check-row input { width: 16px; height: 16px; accent-color: var(--blue); }

/* settings: companies & services */
.co-switch { display: flex; flex-wrap: wrap; gap: 8px; }
.co-chip { display: inline-flex; align-items: center; gap: 10px; padding: 8px 12px 8px 8px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font: inherit; cursor: pointer; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s; }
.co-chip:hover { border-color: var(--blue-200); color: var(--ink); }
.co-chip[aria-current="true"] { border-color: var(--blue); background: var(--blue-50); box-shadow: 0 0 0 3px rgba(47, 84, 235, 0.1); }
.co-chip-txt { display: flex; flex-direction: column; line-height: 1.25; }
.co-chip-txt b { font-size: 13px; }
.co-chip-txt small { font-size: 11px; color: var(--muted); }
.co-chip.add { border-style: dashed; color: var(--muted); font-size: 13px; font-weight: 600; padding-left: 12px; gap: 6px; }
.sec { display: flex; flex-direction: column; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.sec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.sec-h { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.send-list { display: flex; flex-wrap: wrap; gap: 6px; }
.send-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; padding: 4px 4px 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-3); }
.send-chip .pill { font-size: 10px; }
.svc-list { display: flex; flex-direction: column; gap: 10px; }
.svc { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.svc-head { display: flex; align-items: center; gap: 8px; }
.svc-name.input { font-weight: 700; font-size: 14px; background: transparent; border-color: transparent; padding-left: 4px; }
.svc-name.input:hover { border-color: var(--line-2); background: #fff; }
.svc-name.input:focus { background: #fff; }
.kw-edit { display: flex; flex-direction: column; gap: 4px; }
.kw-edit .lbl { font-size: 12px; font-weight: 600; color: var(--ink-3); }
.chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; padding: 4px; min-height: 34px; border: 1px solid var(--line-2); border-radius: var(--r-md); background: #fff; }
.chips:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 84, 235, 0.15); }
.chip { display: inline-flex; align-items: center; gap: 2px; font-size: 12px; font-weight: 600; padding: 2px 2px 2px 9px; border-radius: 999px; background: var(--blue-50); color: var(--blue-dark); }
.chips.skip .chip { background: var(--red-bg); color: var(--red-ink); }
.chip button { border: 0; background: transparent; color: inherit; width: 18px; height: 18px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; opacity: 0.7; }
.chip button:hover { opacity: 1; background: rgba(15, 23, 42, 0.08); }
.chip-input { flex: 1; min-width: 160px; border: 0; outline: 0; font: inherit; font-size: 12px; padding: 4px 6px; background: transparent; color: var(--ink); }
.co-tag { display: inline-flex; align-items: center; gap: 6px; }

.cost-chip { display: flex; align-items: center; gap: 6px; padding: 8px 10px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line); text-decoration: none; color: var(--ink-3); font-size: 12px; font-weight: 600; transition: border-color 0.15s; }
.cost-chip:hover { border-color: var(--blue-200); color: var(--ink); }
.cost-chip b { font-size: 14px; color: var(--ink); }
.cost-chip .sub { margin-left: auto; font-weight: 500; }

/* costs page */
.month-lbl { font-size: 14px; min-width: 120px; text-align: center; }
.card-head .legend-row { border-top: 0; padding-top: 0; flex-wrap: wrap; }
.daychart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(18px, 1fr); gap: 4px; align-items: end; height: 170px; padding-top: 6px; overflow-x: auto; }
.dbar { height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: stretch; gap: 4px; text-decoration: none; color: var(--muted); border-radius: 6px; padding: 0 1px; }
.dbar-stack { height: var(--h); min-height: 3px; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 2px 2px; overflow: hidden; background: var(--line); transition: transform 0.15s var(--ease), box-shadow 0.15s; animation: rise-bar 0.6s var(--ease); transform-origin: bottom; }
.dbar-stack i { display: block; flex-shrink: 0; }
.dbar-day { font-size: 10px; text-align: center; font-weight: 600; }
.dbar.wk .dbar-day { color: var(--faint); }
.dbar:hover .dbar-stack { transform: scaleY(1.03); box-shadow: 0 0 0 2px var(--blue-200); }
.dbar.sel .dbar-stack { box-shadow: 0 0 0 2px var(--blue); }
.dbar.sel .dbar-day { color: var(--blue-dark); }
.empty-day .dbar-stack { background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
@keyframes rise-bar { from { transform: scaleY(0); } }
.cost-viz { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, 0.8fr); }
.cost-row { grid-template-columns: 22px minmax(0, 104px) minmax(0, 1fr) 58px; }
.cost-row .sub { font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cost-row.task { grid-template-columns: minmax(0, 150px) minmax(0, 1fr) auto; }
.cost-row.task .b-total { background: var(--blue); }
.fixed-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.fixed-list li { display: flex; justify-content: space-between; gap: 10px; }
.fixed-list li span { color: var(--ink-3); }
.fixed-list li.sum { border-top: 1px solid var(--line); padding-top: 6px; font-weight: 700; }
.tbl tr.row-sel td { background: var(--blue-50); }
[data-row].off { opacity: 0.55; }

/* nav badge (approvals waiting) */
.nav-badge { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 999px; background: var(--amber); color: #fff; font-size: 10px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

/* approvals */
.alist { display: flex; flex-direction: column; gap: 12px; }
.acard { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.acard.blocked { border: 1px solid var(--amber-line); }
.ac-top { display: flex; align-items: flex-start; gap: 10px; }
.ac-title { font-size: 15px; font-weight: 700; }
.ac-title a { color: var(--ink); text-decoration: none; }
.ac-title a:hover { color: var(--blue); }
.ac-tags { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.ac-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--ink-3); }
.ac-meta b { color: var(--muted); font-weight: 600; margin-right: 4px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.checks li { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; padding: 3px 9px; border-radius: 999px; }
.checks li.ok { background: var(--green-bg); color: var(--green-ink); }
.checks li.no { background: var(--red-bg); color: var(--red-ink); }
.checks li span { opacity: 0.85; }
.checks li.wait { background: var(--surface-2); color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line); }
.their { padding: 10px 12px; border-radius: var(--r-md); background: var(--green-bg); }
.their p { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; }

/* do-not-contact */
.dnc-add-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.dnc-search { display: flex; gap: 6px; }
.dnc-search .input { width: 220px; }
.risk-tag.blue { background: var(--blue-50); color: var(--blue-dark); }

/* users & roles */
.add-staff { margin-top: 4px; }
.add-staff summary { list-style: none; width: max-content; }
.add-staff summary::-webkit-details-marker { display: none; }
.add-staff[open] summary { margin-bottom: 10px; }
.add-staff-body { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.perm-tbl td { vertical-align: middle; }
.perm-tbl .check-row { font-size: 12px; }

/* login */
.auth { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: min(420px, 100%); padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.auth-brand { justify-content: center; }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-head h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.auth-head p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.auth-err { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: var(--r-md); background: var(--red-bg); color: var(--red-ink); font-size: 13px; font-weight: 600; }
.phone-in { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: 8px; }
.pin { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.pin input[type="password"] { width: 100%; height: 46px; text-align: center; font: inherit; font-size: 20px; font-weight: 700; border: 1px solid var(--line-2); border-radius: var(--r-md); background: #fff; color: var(--ink); transition: border-color 0.15s, box-shadow 0.15s; }
.pin input[type="password"]:focus { outline: 0; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 84, 235, 0.15); }
.auth-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.auth-row .check-row { font-size: 12px; }
.link-btn { border: 0; background: none; padding: 0; font: inherit; font-size: 12px; font-weight: 600; color: var(--blue); cursor: pointer; }
.link-btn:hover { text-decoration: underline; }
.auth-submit { width: 100%; justify-content: center; }
.auth-foot { text-align: center; font-size: 11px; color: var(--faint); }

/* settings: AI = Claude Pro login */
.ai-conn { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.ai-logo { width: 34px; height: 34px; flex: 0 0 auto; border-radius: 10px; background: var(--green-bg); color: var(--green-ink); display: inline-flex; align-items: center; justify-content: center; }
.ai-conn-txt { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.ai-conn-txt b { font-size: 14px; }
.ai-conn-txt span { font-size: 12px; color: var(--muted); }
.usage { display: flex; flex-direction: column; gap: 10px; }
.use-row { display: grid; grid-template-columns: 150px minmax(0, 1fr) 44px; align-items: center; gap: 12px; }
.use-lbl { display: flex; flex-direction: column; line-height: 1.3; }
.use-lbl b { font-size: 13px; }
.use-lbl span { font-size: 11px; color: var(--muted); }
.use-bar { position: relative; height: 10px; border-radius: 6px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.use-bar i { display: block; height: 100%; width: var(--w); border-radius: 6px; background: var(--blue); animation: grow 0.7s var(--ease); }
.use-bar.hot i { background: var(--amber); }
.use-mark { position: absolute; top: -3px; bottom: -3px; width: 2px; border-radius: 2px; background: var(--ink-3); }
.use-num { font-size: 13px; font-weight: 700; text-align: right; }

/* settings: Claude accounts */
.acc-list { display: flex; flex-direction: column; gap: 10px; }
.acc { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 12px; display: flex; flex-direction: column; gap: 10px; transition: border-color 0.15s, box-shadow 0.15s; }
.acc.on { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 84, 235, 0.1); }
.acc.out { background: var(--surface-2); }
.acc-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.acc-pick { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.acc-pick input { width: 16px; height: 16px; accent-color: var(--blue); }
.acc-name { display: flex; flex-direction: column; line-height: 1.3; }
.acc-name b { font-size: 14px; }
.acc-name span { font-size: 12px; color: var(--muted); }
.acc-foot { font-size: 11px; color: var(--faint); }

/* settings: AI models */
.prov-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 10px; }
.prov { border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); padding: 12px; display: flex; flex-direction: column; gap: 10px; transition: opacity 0.2s; }
.prov.off { opacity: 0.7; background: var(--surface-2); }
.prov-top { display: flex; align-items: center; gap: 10px; }
.prov-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.prov-name b { font-size: 14px; }
.prov-name span { font-size: 11px; color: var(--muted); }
.key-row { display: flex; gap: 6px; align-items: center; }
.key-row .input { flex: 1; min-height: 32px; }
.model-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.model-list li { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 0 8px; font-size: 12px; }
.model-list li span { color: var(--ink-3); }
.model-list li em { grid-column: 2; font-style: normal; color: var(--muted); font-size: 11px; }
.job-tbl td { vertical-align: top; }
.job-tbl .select { min-width: 230px; }
.job-tbl .tip { color: var(--ink-3); min-width: 220px; max-width: 340px; }
.job-tbl .tip svg { color: var(--amber); vertical-align: -1px; }
.job-tbl .est { text-align: right; white-space: nowrap; }
.job-tbl .est span { display: block; font-size: 12px; color: var(--muted); }
.job-tbl .est b { color: var(--ink-3); font-weight: 600; margin-right: 4px; }
.radio-card { display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px; border-radius: 11px; border: 1px solid var(--line-2); background: #fff; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.radio-card:hover { border-color: #C7CEDB; }
.radio-card:has(input:checked) { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(47, 84, 235, 0.12); }
.radio-card input { margin-top: 2px; accent-color: var(--blue); }
.radio-card b { font-size: 13px; }
.radio-card span { font-size: 12px; color: var(--muted); }
.stage-tabs { display: flex; flex-wrap: wrap; gap: 4px; }
.tabchip { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 999px; text-decoration: none; color: var(--ink-3); background: #fff; border: 1px solid var(--line); transition: background 0.15s; }
.tabchip:hover { background: var(--surface-2); color: var(--ink); }
.tabchip.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.tabchip .n { opacity: 0.65; font-weight: 500; margin-left: 4px; }
.kw-list { display: flex; flex-wrap: wrap; gap: 4px; }
.kw { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--blue-50); color: var(--blue-dark); }

/* ---------- campaigns ---------- */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 14px; }
.ccard { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; text-decoration: none; color: var(--ink); transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s; }
.ccard:hover { color: var(--ink); box-shadow: var(--shadow-hover); transform: translateY(-1px); border-color: var(--blue-200); }
.ccard h2 { font-size: 15px; }
.mini-nums { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.mini-nums div { display: flex; flex-direction: column; }
.mini-nums b { font-size: 17px; letter-spacing: -0.02em; }
.mini-nums span { font-size: 11px; color: var(--muted); }
.bar { height: 6px; border-radius: 6px; background: var(--surface-2); overflow: hidden; display: block; }
.bar i { display: block; height: 100%; background: var(--blue); border-radius: 6px; animation: grow 0.7s var(--ease); }
/* campaign detail: ek card me naam + progress + 7 numbers */
.camp-head { overflow: visible; }
.ch-top { padding: 14px 16px 8px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: flex-start; }
.ch-title { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ch-title h1 { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; }
.ch-prog { padding: 0 16px 12px; display: flex; align-items: center; gap: 10px; }
.ch-prog .bar { flex: 1; }
.ch-prog .small { white-space: nowrap; }
.stats-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.stats-6 { border-top: 1px solid var(--line); }
.report { font-size: 13px; line-height: 1.6; color: var(--ink-2); }
.src-cell { display: inline-flex; align-items: center; gap: 8px; }
.form-narrow { max-width: 920px; width: 100%; }

.src-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.src-row .nm { width: 130px; flex: 0 0 auto; }
.src-row .bar { flex: 1; height: 8px; }
.src-row b { width: 36px; text-align: right; }

/* ---------- sources ---------- */
.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 10px 14px; font-size: 12px; color: var(--ink-3); }
.legend div { display: flex; gap: 7px; align-items: flex-start; max-width: 380px; }
.risk-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; margin-top: 4px; }
.risk-green { background: var(--green); }
.risk-amber { background: var(--amber); }
.risk-red { background: var(--red); }
.risk-tag { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; }
.risk-tag.green { background: var(--green-bg); color: var(--green-ink); }
.risk-tag.amber { background: var(--amber-bg); color: var(--amber-ink); }
.risk-tag.red { background: var(--red-bg); color: var(--red-ink); }
.sgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(270px, 100%), 1fr)); gap: 10px; }
.scard { padding: 12px; display: flex; flex-direction: column; gap: 8px; transition: opacity 0.2s, box-shadow 0.15s; }
.scard:hover { box-shadow: var(--shadow-hover); }
.scard.off { opacity: 0.6; }
.scard-top { display: flex; align-items: center; gap: 9px; }
.scard-top .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.scard-top .nm b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scard-top .nm span { font-size: 11px; color: var(--muted); }
.scard .how { font-size: 12px; color: var(--ink-3); }
.scard-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding-top: 6px; border-top: 1px solid var(--line); }
.scard .today { font-size: 11px; color: var(--muted); }
.scard .today b { font-size: 15px; color: var(--ink); margin-right: 3px; }
.conn-line { display: flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600; }
.conn { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.sec-title { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }

.switch { position: relative; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-size: 11px; font-weight: 600; color: var(--muted); }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { width: 32px; height: 18px; border-radius: 999px; background: #CDD3DF; position: relative; transition: background 0.18s var(--ease); }
.switch .track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, 0.3); transition: transform 0.18s var(--ease); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(14px); }
.switch input:focus-visible + .track { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- settings ---------- */
.settings { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 14px; align-items: start; }
.side-tabs { padding: 6px; display: flex; flex-direction: column; gap: 1px; position: sticky; top: 72px; }
.side-tabs a { padding: 7px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink-3); text-decoration: none; transition: background 0.15s; }
.side-tabs a:hover { background: var(--surface-2); color: var(--ink); }
.side-tabs a[aria-current="page"] { background: var(--blue-50); color: var(--blue-dark); }
.check { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 999px; }
.check.y { background: var(--green-bg); color: var(--green-ink); }
.check.n { background: var(--red-bg); color: var(--red-ink); }
.note { font-size: 12px; color: var(--muted); }
.callout { padding: 9px 12px; border-radius: 10px; font-size: 12px; background: var(--blue-50); border: 1px solid var(--blue-100); color: var(--blue-dark); display: flex; gap: 6px; align-items: flex-start; }
.callout.warn { background: var(--amber-bg); border-color: var(--amber-line); color: var(--amber-ink); }
.list-plain { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--ink-2); }

/* ---------- responsive ---------- */
@media (max-width: 1280px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .hero-date { border-right: 0; border-bottom: 1px solid var(--line); flex-direction: row; align-items: center; justify-content: space-between; flex-wrap: wrap; }
}
@media (max-width: 1100px) {
  .viz { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .viz-side:last-child { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .profile, .settings { grid-template-columns: minmax(0, 1fr); }
  .side-tabs { position: static; flex-direction: row; flex-wrap: wrap; }
  .stats-7 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats-7 .stat:nth-child(5) { border-left: 0; }
  .stats-7 .stat:nth-child(n+5) { border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stat:nth-child(4) { border-left: 0; }
  .stat:nth-child(n+4) { border-top: 1px solid var(--line); }
  .stats-7 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stats-7 .stat:nth-child(4) { border-left: 1px solid var(--line); border-top: 0; }
  .viz, .viz-side { grid-template-columns: minmax(0, 1fr); }
  .topbar { position: static; }
}
@media (max-width: 640px) {
  .camp-top { flex-wrap: wrap; }
  .camp-top b { white-space: normal; }
  .wrap { padding: 10px 12px 40px; gap: 12px; }
  .hero-date { flex-direction: column; align-items: stretch; }
  .hero-title h1 { white-space: normal; }
  .date-ctrl { flex-wrap: wrap; }
  .week { flex: 1; justify-content: space-between; }
  .day { width: auto; flex: 1; min-width: 32px; }
  .cal-pop { width: min(296px, calc(100vw - 24px)); }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat:nth-child(n) { border-left: 0; border-top: 1px solid var(--line); }
  .stat:nth-child(even) { border-left: 1px solid var(--line); }
  .stat:nth-child(-n+2) { border-top: 0; }
  .stats-7 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-7 .stat:nth-child(4) { border-top: 1px solid var(--line); }
  .nav { width: 100%; justify-content: space-between; }
  .nav a { padding: 6px 8px; }
  .nav a .nav-txt { display: none; }
  .form-grid, .facts { grid-template-columns: minmax(0, 1fr); }
  .mini-nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prow { grid-template-columns: 22px minmax(0, 96px) minmax(0, 1fr) 26px; }
  .page-head h1 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* users & roles (database) */
.role-set { display: inline-flex; gap: 6px; align-items: center; }
.role-set .select { min-height: 32px; width: 150px; }
.new-role { display: flex; gap: 8px; max-width: 460px; }
.logout-form { display: contents; }
a.avatar { text-decoration: none; }
a.avatar:hover { box-shadow: 0 0 0 2px var(--blue-200); }
.req-text { white-space: pre-line; font-size: 13px; line-height: 1.6; color: var(--ink-2); max-height: 420px; overflow: auto; }

/* agent: grade, draft, accounts */
.acc-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12px; color: var(--ink-3); }
.acc-stats b { color: var(--ink); }
.warn-txt { color: var(--amber-ink); font-weight: 600; }
.ai-logo.bad { background: var(--red-bg); color: var(--red-ink); }
.quotes { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.quotes li { font-size: 13px; color: var(--ink-2); padding: 6px 10px; border-left: 3px solid var(--blue-200); background: var(--surface-2); border-radius: 0 8px 8px 0; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.92em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.btn.busy { opacity: 0.7; pointer-events: none; }
.mono-txt { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }
.acard .reason { flex: 1 1 160px; max-width: 260px; min-height: 34px; }

/* lead page: conversation */
.talk { display: flex; flex-direction: column; gap: 8px; }
.talk-msg { padding: 10px 12px; border-radius: var(--r-md); background: var(--green-bg); max-width: 92%; }
.talk-msg.ours { background: var(--surface-2); border: 1px solid var(--line); align-self: flex-end; }
.talk-head { font-size: 11px; color: var(--muted); }
.talk-head b { color: var(--ink-3); }
.talk-msg .req-text { max-height: 220px; margin-top: 2px; }
.their .req-text { max-height: 200px; }
.fixed-add { display: flex; gap: 6px; margin-top: 8px; }
.fixed-add .input { min-height: 32px; min-width: 0; }
.fixed-list .btn.xs { min-height: 20px; padding: 0 4px; }
a.cost-chip.card { padding: 10px 12px; }
