/* VenuMotors CRM — design system */
:root {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e6eaf0;
  --border-strong: #d3dae3;
  --text: #0f172a;
  --text-2: #334155;
  --muted: #64748b;
  --brand: #059669;
  --brand-600: #047857;
  --brand-700: #065f46;
  --brand-50: #ecfdf5;
  --brand-100: #d1fae5;
  --navy: #0b1f2a;
  --navy-2: #12303f;
  --blue: #2563eb;
  --blue-50: #eff6ff;
  --red: #dc2626;
  --red-50: #fef2f2;
  --amber: #d97706;
  --amber-50: #fffbeb;
  --violet: #7c3aed;
  --violet-50: #f5f3ff;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow: 0 1px 3px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .12);
  --shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, .28);
  --tabbar-h: 68px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  font-size: 14px;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
* { box-sizing: border-box; }
html { -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.45; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { color: var(--brand-700); }
h1 { font-size: 20px; margin: 0; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 15px; margin: 0; font-weight: 650; }
h3 { margin: 0; }
p { margin: 0; }
code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 6px; padding: 1px 6px; font-size: 12px; }
.icon { flex-shrink: 0; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.xs { font-size: 11px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.strong { font-weight: 650; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.tight { gap: 6px; }
.row.nowrap { flex-wrap: nowrap; }
.row.nowrap > input { flex: 1; min-width: 0; }
.grow { flex: 1; min-width: 0; }
.stack > * + * { margin-top: 16px; }
.stack-sm > * + * { margin-top: 8px; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hide-mobile { }
.show-mobile { display: none !important; }

/* ---------- Shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 248px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-2) 100%); color: #b8c7d1;
  padding: 20px 14px; display: flex; flex-direction: column;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 17px; padding: 4px 10px 22px; letter-spacing: -.01em; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: linear-gradient(135deg, #34d399, #059669); color: #fff; box-shadow: 0 6px 16px -6px rgba(16,185,129,.7); }
.brand-logo { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; flex-shrink: 0; box-shadow: 0 6px 16px -8px rgba(0,0,0,.6); }
.brand-logo.sm { width: 30px; height: 30px; border-radius: 8px; }
.brand small { display: block; font-size: 11px; font-weight: 500; color: #7f97a5; }
.nav-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6f8795; padding: 18px 12px 8px; font-weight: 600; }
.nav a { display: flex; align-items: center; gap: 12px; color: #c3d1da; padding: 10px 12px; border-radius: 10px; margin-bottom: 2px; font-weight: 500; transition: background .15s, color .15s; }
.nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav a.active { background: rgba(52,211,153,.14); color: #6ee7b7; }
.nav a.active .icon { color: #34d399; }
.sidebar-user { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(255,255,255,.05); }
.sidebar-user .name { color: #fff; font-weight: 600; font-size: 13px; }
.sidebar-user .role { font-size: 11px; color: #8aa1ae; }
.sidebar-user button { background: none; border: 0; color: #8aa1ae; cursor: pointer; padding: 6px; border-radius: 8px; }
.sidebar-user button:hover { color: #fff; background: rgba(255,255,255,.08); }

/* The main column is the edge of the app: nothing is allowed to push the whole page
   sideways and drag the sidebar off the screen with it. Genuinely wide content scrolls
   inside its own box — that is what .table-wrap and .preview-wrap are for.
   `clip` rather than `hidden` so the sticky topbar keeps working. */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-x: clip; }
.topbar {
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border); padding: 12px 28px; display: flex; align-items: center; gap: 12px; position: sticky; top: 0; z-index: 30;
}
.topbar .title { flex: 1; min-width: 0; }
.topbar .title small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.content { padding: 24px 28px 40px; max-width: 1320px; width: 100%; }

/* ---------- Avatar ---------- */
.avatar {
  --s: 36px; --h: 160;
  width: var(--s); height: var(--s); border-radius: 50%; flex-shrink: 0; position: relative;
  display: inline-grid; place-items: center; font-weight: 700; font-size: calc(var(--s) * .38); letter-spacing: .02em;
  color: hsl(var(--h) 60% 28%); background: hsl(var(--h) 70% 90%);
}
.avatar .dot { position: absolute; right: -1px; bottom: -1px; width: 11px; height: 11px; border-radius: 50%; background: #cbd5e1; border: 2px solid #fff; }
.avatar .dot.on { background: #22c55e; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.card-head h2 { display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px 20px; }
.grid { display: grid; gap: 16px; }
.grid.kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (min-width: 1280px) { .grid.kpis { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.grid.two { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid.main-side { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }

.kpi { position: relative; overflow: hidden; }
.kpi .kpi-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); margin-bottom: 12px; }
.kpi .label { font-size: 12px; color: var(--muted); font-weight: 600; }
.kpi .value { font-size: 28px; font-weight: 750; letter-spacing: -.02em; margin: 2px 0; line-height: 1.15; }
.kpi .value small { font-size: 14px; font-weight: 600; color: var(--muted); }
.kpi .sub { font-size: 12px; color: var(--muted); }
.kpi.green .kpi-icon { background: var(--brand-50); color: var(--brand); }
.kpi.blue .kpi-icon { background: var(--blue-50); color: var(--blue); }
.kpi.amber .kpi-icon { background: var(--amber-50); color: var(--amber); }
.kpi.red .kpi-icon { background: var(--red-50); color: var(--red); }
.kpi.violet .kpi-icon { background: var(--violet-50); color: var(--violet); }
.kpi.red .value { color: var(--red); }

/* Hero (greeting) */
.hero {
  border-radius: 20px; padding: 22px 24px; color: #fff; position: relative; overflow: hidden;
  background: radial-gradient(120% 140% at 100% 0%, #34d399 0%, #059669 38%, #064e3b 100%);
  box-shadow: 0 8px 20px -16px rgba(5,150,105,.45);
  margin-bottom: 8px;
}
.hero::after { content: ""; position: absolute; right: -40px; bottom: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); }
.hero h1 { font-size: 22px; }
.hero p { color: rgba(255,255,255,.8); margin-top: 4px; }
.hero-stats { display: flex; gap: 28px; margin-top: 18px; flex-wrap: wrap; position: relative; z-index: 1; }
.hero-stats b { display: block; font-size: 24px; font-weight: 750; }
.hero-stats span { font-size: 12px; color: rgba(255,255,255,.75); }
.hero .btn { position: relative; z-index: 1; }

/* ---------- Lists ---------- */
.list-item { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid var(--border); }
.list-item:first-child { border-top: 0; }
a.list-item { color: inherit; }
a.list-item:hover { background: var(--surface-2); }
.list-item .meta { flex: 1; min-width: 0; }
.list-item .meta .t { font-weight: 600; }
.list-item .meta .s { font-size: 12px; color: var(--muted); }
.call-ico { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex-shrink: 0; }
.call-ico.out { background: var(--brand-50); color: var(--brand); }
.call-ico.in { background: var(--blue-50); color: var(--blue); }
.call-ico.miss { background: var(--red-50); color: var(--red); }
.empty { padding: 32px 20px; text-align: center; color: var(--muted); }
.empty .icon { color: #cbd5e1; display: block; margin: 0 auto 8px; }

/* Progress bars (leaderboard) */
.meter { height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.meter > i { display: block; height: 100%; background: linear-gradient(90deg, #34d399, #059669); border-radius: 99px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 12px 16px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); font-weight: 650; white-space: nowrap; }
tbody tr:hover { background: #fbfcfd; }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cell-user { display: flex; align-items: center; gap: 10px; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: #f1f5f9; color: #475569; white-space: nowrap; }
.badge.green { background: var(--brand-50); color: var(--brand-700); }
.badge.red { background: var(--red-50); color: var(--red); }
.badge.amber { background: var(--amber-50); color: #b45309; }
.badge.blue { background: var(--blue-50); color: var(--blue); }
.badge.violet { background: var(--violet-50); color: var(--violet); }
.dir { display: inline-flex; align-items: center; gap: 4px; font-weight: 650; font-size: 12.5px; }
.dir.in { color: var(--blue); }
.dir.out { color: var(--brand); }

/* ---------- Forms ---------- */
label { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font: inherit; background: #fff; color: var(--text); transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px rgba(5,150,105,.12); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--brand); vertical-align: middle; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.field.full { grid-column: 1 / -1; }
.error { color: var(--red); font-size: 12px; margin-top: 5px; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.input-icon input { padding-left: 38px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.filters select, .filters input { width: auto; min-width: 140px; padding: 8px 10px; }
.filters .input-icon input { padding-left: 36px; }
.seg { display: inline-flex; background: #e9edf3; border-radius: 11px; padding: 3px; gap: 2px; }
.seg a { padding: 6px 12px; color: var(--text-2); border-radius: 8px; font-weight: 600; font-size: 13px; white-space: nowrap; }
.seg a.on { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 9px 16px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong); background: #fff; color: var(--text); font: inherit; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background .15s, box-shadow .15s, transform .05s; text-decoration: none;
}
.btn:hover { background: var(--surface-2); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 14px -8px rgba(5,150,105,.8); }
.btn.primary:hover { background: var(--brand-600); }
.btn.danger { background: var(--red); border-color: var(--red); color: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.white { background: #fff; border-color: #fff; color: var(--brand-700); }
.btn.sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn.lg { padding: 13px 20px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn.icon-only { padding: 8px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-call { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand-700); }
.btn-call:hover { background: var(--brand-100); color: var(--brand-700); }

/* ---------- Flash ---------- */
.flash { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; }
.flash.ok { background: var(--brand-50); color: var(--brand-700); border: 1px solid var(--brand-100); }
.flash.warn { background: var(--amber-50); color: #92400e; border: 1px solid #fde68a; }

/* ---------- Daily bars ---------- */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 160px; padding-top: 8px; }
.bars { justify-content: center; }
.bar { flex: 1; max-width: 48px; min-width: 6px; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bar .total { background: var(--brand-100); border-radius: 6px 6px 3px 3px; position: relative; min-height: 2px; }
.bar .conn { background: linear-gradient(180deg, #34d399, #059669); position: absolute; bottom: 0; left: 0; right: 0; border-radius: 6px 6px 3px 3px; }
.bar-labels { display: flex; gap: 6px; margin-top: 8px; justify-content: center; }
.bar-labels span { flex: 1; max-width: 48px; min-width: 6px; text-align: center; font-size: 10px; color: var(--muted); overflow: hidden; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }

/* ---------- Softphone ---------- */
.sp-pill { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: 999px; background: #f1f5f9; color: var(--muted); white-space: nowrap; }
.sp-pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.sp-pill.ready { background: var(--brand-50); color: var(--brand-700); }
.sp-pill.ready::before { background: #22c55e; box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
.sp-pill.busy { background: var(--blue-50); color: var(--blue); }
.sp-pill.busy::before { background: var(--blue); }
.sp-pill.error { background: var(--red-50); color: var(--red); }
.sp-pill.error::before { background: var(--red); }
.avail-select { width: auto; padding: 6px 10px; border-radius: 999px; font-size: 12.5px; font-weight: 600; }

.sp-panel {
  position: fixed; right: 24px; bottom: 24px; width: 320px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 22px; box-shadow: var(--shadow-lg); padding: 18px; z-index: 50;
}
.sp-panel[hidden] { display: none; }
.sp-panel h3 { font-size: 17px; }
.sp-display { font-size: 24px; font-weight: 650; text-align: center; letter-spacing: .04em; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; padding: 10px 4px; }
.sp-display:focus { box-shadow: none; }
.sp-call-card { text-align: center; padding: 8px 0 4px; }
.sp-call-card .avatar { margin: 6px auto 10px; }
.sp-timer { font-size: 30px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 6px 0 14px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 14px 0; }
.keypad button { height: 54px; font-size: 21px; font-weight: 600; border-radius: 50%; border: 0; background: var(--surface-2); color: var(--text); cursor: pointer; width: 54px; justify-self: center; }
.keypad button:hover { background: #e9eef4; }
.keypad button:active { background: var(--brand-100); }
.call-actions { display: flex; justify-content: center; gap: 18px; }
.round-btn { width: 56px; height: 56px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; background: var(--surface-2); color: var(--text); }
.round-btn.green { background: #22c55e; color: #fff; box-shadow: 0 10px 20px -8px rgba(34,197,94,.8); }
.round-btn.red { background: var(--red); color: #fff; box-shadow: 0 10px 20px -8px rgba(220,38,38,.8); }
.round-btn.on { background: var(--navy); color: #fff; }
.round-btn + small { display: block; }
.call-actions > div { text-align: center; font-size: 11px; color: var(--muted); }
.call-actions > div .round-btn { margin: 0 auto 4px; }

.modal-back { position: fixed; inset: 0; background: rgba(11,31,42,.5); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 60; padding: 16px; }
.modal-back[hidden] { display: none; }
.modal { background: var(--surface); border-radius: 22px; padding: 24px; width: 100%; max-width: 440px; box-shadow: var(--shadow-lg); }
.modal h3 { font-size: 18px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { margin: 0; position: relative; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span { display: inline-block; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border-strong); font-weight: 600; font-size: 12.5px; cursor: pointer; color: var(--text-2); }
.chips input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.ring { animation: ring 1s ease-in-out infinite; }
@keyframes ring { 0%,100% { transform: rotate(0); } 25% { transform: rotate(-12deg); } 75% { transform: rotate(12deg); } }
.pulse { animation: pulse 1.6s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.55); } 100% { box-shadow: 0 0 0 22px rgba(34,197,94,0); } }

/* ---------- Mobile app chrome ---------- */
.app-header { display: none; }
.tabbar { display: none; }
.sheet-back { position: fixed; inset: 0; background: rgba(11,31,42,.45); z-index: 70; }
.sheet-back[hidden] { display: none; }
.sheet { position: absolute; left: 0; right: 0; bottom: 0; background: #fff; border-radius: 22px 22px 0 0; padding: 10px 16px calc(20px + env(safe-area-inset-bottom)); }
.sheet::before { content: ""; display: block; width: 40px; height: 4px; border-radius: 4px; background: #d6dde5; margin: 0 auto 12px; }
.sheet a, .sheet button.sheet-link { display: flex; align-items: center; gap: 14px; padding: 14px 8px; color: var(--text); font-weight: 600; border-radius: 12px; width: 100%; background: none; border: 0; font: inherit; cursor: pointer; }
.sheet a:hover, .sheet button.sheet-link:hover { background: var(--surface-2); }

/* ---------- Login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.login-art {
  position: relative; overflow: hidden; color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(110% 90% at 0% 100%, #10b981 0%, #065f46 45%, #0b1f2a 100%);
}
.login-art::before, .login-art::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.06); }
.login-art::before { width: 420px; height: 420px; right: -120px; top: -120px; }
.login-art::after { width: 260px; height: 260px; left: 30%; bottom: -120px; }
.login-art h2 { font-size: 34px; line-height: 1.15; font-weight: 750; letter-spacing: -.02em; max-width: 440px; position: relative; z-index: 1; }
.login-art ul { list-style: none; padding: 0; margin: 22px 0 0; position: relative; z-index: 1; }
.login-art li { display: flex; align-items: center; gap: 10px; margin: 10px 0; color: rgba(255,255,255,.85); }
.login-art li .icon { color: #6ee7b7; }
.login-form { display: grid; place-items: center; padding: 32px 24px; }
.login-card { width: 100%; max-width: 380px; }
.login-card h1 { font-size: 26px; }
.pw-wrap { position: relative; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; color: var(--muted); padding: 8px; cursor: pointer; border-radius: 8px; }

/* ---------- Pagination ---------- */
.pager { display: flex; gap: 8px; justify-content: flex-end; padding: 14px 16px; align-items: center; border-top: 1px solid var(--border); }

/* =================== Mobile =================== */
@media (max-width: 900px) {
  body { background: var(--bg); }
  .shell { display: block; }
  .sidebar, .topbar { display: none; }
  .hide-mobile { display: none !important; }
  .show-mobile { display: block !important; }
  .btn.show-mobile { display: inline-flex !important; }
  .app-header {
    display: flex; align-items: center; gap: 10px; position: sticky; top: 0; z-index: 40;
    padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: rgba(243,245,249,.9);
    backdrop-filter: saturate(180%) blur(14px); -webkit-backdrop-filter: saturate(180%) blur(14px);
  }
  .app-header .title { flex: 1; min-width: 0; font-weight: 750; font-size: 19px; letter-spacing: -.01em; }
  .app-header .sp-pill { padding: 5px 9px; font-size: 11px; }
  .content { padding: 4px 16px calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255,255,255,.96); backdrop-filter: blur(14px); border-top: 1px solid var(--border);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: #7b8a9a; font-size: 10.5px; font-weight: 600; background: none; border: 0; font-family: inherit; cursor: pointer;
  }
  .tabbar a.active { color: var(--brand); }
  .tabbar .fab {
    width: 56px; height: 56px; border-radius: 50%; margin: -22px auto 0; display: grid; place-items: center; color: #fff;
    background: linear-gradient(135deg, #34d399, #059669); box-shadow: 0 12px 24px -8px rgba(5,150,105,.8); border: 4px solid var(--bg);
  }
  .grid.two, .grid.main-side { grid-template-columns: minmax(0, 1fr); }
  .grid.kpis { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card { border-radius: 18px; padding: 16px; }
  .kpi .value { font-size: 23px; }
  .kpi .kpi-icon { width: 34px; height: 34px; margin-bottom: 10px; }
  .hero { padding: 20px; border-radius: 22px; }
  .hero-stats { gap: 22px; }
  .filters { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; margin: 0 -16px; padding-left: 16px; padding-right: 16px; scrollbar-width: none; }
  .filters::-webkit-scrollbar { display: none; }
  .filters > * { flex-shrink: 0; }
  .filters input[type=date] { min-width: 140px; }
  .form-grid { grid-template-columns: 1fr; }
  input, select, textarea { font-size: 16px; } /* stops iOS zoom */

  /* Tables turn into cards: name on top, stats in a 3-column grid */
  table.rtable thead { display: none; }
  table.rtable, table.rtable tbody { display: block; width: 100%; }
  table.rtable tr { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
  table.rtable td { border: 0; padding: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; min-width: 0; font-size: 13px; white-space: normal; overflow-wrap: anywhere; }
  table.rtable td.primary { align-items: stretch; }
  table.rtable td::before { content: attr(data-label); color: var(--muted); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
  table.rtable td.primary { grid-column: 1 / -1; }
  table.rtable td.primary::before, table.rtable td.empty::before { display: none; }
  table.rtable td.empty { grid-column: 1 / -1; }
  table.rtable td:empty, table.rtable td.m-hide, table.rtable td.hide-mobile { display: none; }
  table.rtable td.num { text-align: left; }
  table.rtable td audio { max-width: 100% !important; width: 100%; }
  table.rtable td[data-label="Recording"], table.rtable td[data-label="Voicemail"], table.rtable td[data-label="Outcome"] { grid-column: 1 / -1; }
  .hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

  .sp-panel { left: 0; right: 0; bottom: 0; width: auto; border-radius: 24px 24px 0 0; padding: 18px 20px calc(24px + env(safe-area-inset-bottom)); }
  .keypad button { width: 64px; height: 64px; }
  .modal-back { place-items: end center; padding: 0; }
  .modal { border-radius: 24px 24px 0 0; max-width: none; padding: 22px 20px calc(24px + env(safe-area-inset-bottom)); }

  .login { grid-template-columns: 1fr; }
  .login-art { padding: calc(36px + env(safe-area-inset-top)) 24px 72px; }
  .login-art h2 { font-size: 26px; }
  .login-art ul { display: none; }
  .login-form { margin-top: -40px; padding: 0 16px 32px; place-items: start center; position: relative; z-index: 2; }
  .login-card { background: #fff; border-radius: 24px; padding: 24px 20px; box-shadow: var(--shadow); }
}

/* ---------- Leads module ---------- */
.form-section + .form-section { border-top: 1px solid var(--border); padding-top: 18px; }
.form-section-title { display: flex; align-items: center; gap: 8px; font-weight: 700; margin-bottom: 14px; color: var(--text); }
.form-section-title .icon { color: var(--brand); }

.stepper { display: flex; gap: 6px; margin: 18px 0 4px; }
.step { flex: 1; min-width: 0; }
.step i { display: block; height: 6px; border-radius: 99px; background: #e5eaf0; }
.step span { display: block; font-size: 11px; color: var(--muted); margin-top: 6px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.step.done i { background: linear-gradient(90deg, #34d399, #059669); }
.step.current span { color: var(--brand-700); }

.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px 16px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.facts span { display: block; font-size: 11px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.facts b { font-weight: 650; font-size: 13.5px; }

.board { display: grid; grid-template-columns: repeat(6, minmax(250px, 1fr)); gap: 14px; overflow-x: auto; padding-bottom: 10px; align-items: start; }
.board-col { background: #e9edf3; border-radius: 16px; padding: 10px; min-height: 200px; }
.board-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.board-head i { width: 10px; height: 10px; border-radius: 50%; }
.board-head b { flex: 1; font-size: 13px; }
.board-list { display: flex; flex-direction: column; gap: 8px; min-height: 120px; border-radius: 12px; transition: background .15s; }
.board-list.over { background: rgba(5,150,105,.08); outline: 2px dashed var(--brand); outline-offset: 2px; }
.board-card { background: #fff; border-radius: 12px; padding: 12px; box-shadow: var(--shadow-sm); border: 1px solid var(--border); cursor: grab; }
.board-card.dragging { opacity: .5; }
.board-move { width: auto; padding: 3px 6px; font-size: 11.5px; border-radius: 8px; }

.bulk-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 16px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); }
.bulk-bar select { padding: 6px 10px; }

.dropzone { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 36px 16px; border: 2px dashed var(--border-strong); border-radius: 16px; background: var(--surface-2); cursor: pointer; text-align: center; margin: 0; }
.dropzone:hover { border-color: var(--brand); background: var(--brand-50); }
.dropzone .icon { color: var(--brand); }
.dropzone input { display: none; }

.toast-stack { position: fixed; top: 16px; right: 16px; z-index: 80; display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.toast { background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--amber); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow-lg); animation: toast-in .25s ease-out; }
.toast .row { gap: 8px; }
@keyframes toast-in { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 900px) {
  .board { grid-template-columns: repeat(6, 82vw); scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 10px; }
  .board-col { scroll-snap-align: start; }
  .stepper .step span { font-size: 10px; }
  .facts { grid-template-columns: 1fr 1fr; }
  .toast-stack { left: 12px; right: 12px; top: calc(12px + env(safe-area-inset-top)); max-width: none; }
}

.live-dot { width: 9px; height: 9px; border-radius: 50%; background: #ef4444; display: inline-block; box-shadow: 0 0 0 0 rgba(239,68,68,.6); animation: live 1.6s ease-out infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.55); } 100% { box-shadow: 0 0 0 10px rgba(239,68,68,0); } }

.call-actions.compact { gap: 8px; }
.call-actions.compact .round-btn { width: 48px; height: 48px; }
.sp-transfer { background: var(--surface-2); border-radius: 14px; padding: 12px; margin: 4px 0 14px; }
.sp-transfer select, .sp-transfer input { margin-top: 6px; padding: 8px 10px; }

/* ---------- Billing ---------- */
/* The preview is a fixed-width companion, not a half of the page: at 44% it ate more
   room than the form it was previewing. */
.bill-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(340px, 400px); gap: 16px; align-items: start; }
.bill-grid > * { min-width: 0; }
.bill-side { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 16px; max-height: calc(100vh - 100px); overflow-y: auto; }
.sum-row { display: flex; justify-content: space-between; font-size: 13.5px; color: var(--text-2); }
.sum-row b { font-variant-numeric: tabular-nums; }
.sum-grand { display: flex; justify-content: space-between; align-items: baseline; padding: 12px 14px; margin-top: 6px; border-radius: 12px; background: #1b2230; color: #fff; }
.sum-grand b { font-size: 22px; color: #e8c766; font-variant-numeric: tabular-nums; }
.seg-radio { margin: 0; text-align: center; cursor: pointer; position: relative; }
.seg-radio input { position: absolute; opacity: 0; pointer-events: none; }
.seg-radio span { display: block; padding: 7px 12px; border-radius: 8px; font-weight: 600; font-size: 13px; color: var(--text-2); }
.seg-radio input:checked + span { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.seg-radio input:disabled + span { opacity: .6; }
.suggest { position: absolute; left: 0; right: 0; top: 100%; z-index: 20; background: #fff; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); margin-top: 4px; overflow: hidden; }
.suggest button { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; background: none; font: inherit; cursor: pointer; border-bottom: 1px solid var(--border); }
.suggest button:hover { background: var(--surface-2); }
.suggest button span { display: block; }
.item-row { padding: 14px 20px; border-top: 1px solid var(--border); }
.item-row:first-child { border-top: 0; }
.item-main { display: grid; grid-template-columns: minmax(0, 180px) minmax(0, 1fr) minmax(0, 1.3fr); gap: 8px; }
.i-desc-wrap { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fit-chips { display: flex; gap: 5px; }
.fit { flex: 1; padding: 4px 6px; font: inherit; font-size: 11px; font-weight: 600; cursor: pointer;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); border-radius: 7px; }
.fit:hover { color: var(--text); }
.fit.on { color: #fff; background: var(--brand); border-color: var(--brand); }
.item-nums { display: grid; gap: 8px; margin-top: 8px; align-items: end;
  grid-template-columns: minmax(0, 110px) minmax(0, 100px) minmax(0, 80px) minmax(0, 80px) minmax(0, 120px)
    minmax(0, 70px) minmax(0, 70px) minmax(0, 80px) minmax(0, 1fr) 36px; }
.item-nums label { font-size: 11px; color: var(--muted); font-weight: 600; margin: 0; }
.item-nums label input, .item-nums label select { margin-top: 3px; padding: 8px; }
.i-incl-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.i-incl-wrap input { width: 18px; height: 18px; }
.i-amount-wrap { text-align: right; display: flex; flex-direction: column; }
.i-amount { font-size: 15px; font-variant-numeric: tabular-nums; }
.share-card { border: 1px solid #f0dfa6; background: linear-gradient(135deg, #fffdf5, #fff); }
.share-card.pop { animation: pop .5s ease-out; }
@keyframes pop { 0% { transform: scale(.97); opacity: .3; } 100% { transform: none; opacity: 1; } }
.share-buttons { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.btn.wa { background: #25d366; border-color: #25d366; color: #fff; }
.btn.wa:hover { background: #1ebe5b; color: #fff; }
.email-form { display: flex; gap: 6px; flex: 1; min-width: 240px; }
.email-form input { flex: 1; min-width: 0; }
.preview-wrap { background: #e9edf3; padding: 14px; overflow-x: auto; }
.doc-preview { width: 100%; min-width: 640px; height: 1050px; border: 0; background: #fff; border-radius: 8px; box-shadow: var(--shadow); }

/* Side by side only once the form would still get its full width; below this the
   preview goes underneath, where it has the whole page instead of a sliver. */
@media (max-width: 1400px) {
  .bill-grid { grid-template-columns: 1fr; }
  .bill-side { position: static; max-height: none; overflow: visible; }
}

@media (max-width: 900px) {
  .bill-side { position: static; }
  .item-row { padding: 14px 16px; }
  .item-main { grid-template-columns: 1fr; }
  .item-nums { grid-template-columns: 1fr 1fr 1fr; }
  .i-amount-wrap { grid-column: span 2; text-align: left; }
  .share-buttons .btn { flex: 1; }
  .email-form { min-width: 100%; }
  .doc-preview { height: 900px; }
}

.preview-card .card-head { gap: 8px; }
.preview-card .card-head h2 { flex: 1; }
.preview-stage { background: #e9edf3; padding: 0; overflow: hidden; position: relative; }
.preview-stage iframe { width: 794px; height: 1123px; border: 0; background: #fff; transform-origin: 0 0; display: block; }
@media (max-width: 900px) {
  .bill-side { max-height: none; overflow: visible; }
  .preview-card .preview-stage { display: none; }
  .preview-card.open .preview-stage { display: block; }
}
.sum-details summary { cursor: pointer; color: var(--muted); }

/* ---------- Quick call outcome ---------- */
/* "What happened on the call" dropdown, shown in a list item or a table cell. */
.outcome-quick { flex-wrap: wrap; }
.outcome-quick select, .outcome-quick input { width: auto; padding: 7px 9px; font-size: 13px; }
.outcome-quick select { min-width: 150px; }
.outcome-quick input { flex: 1 1 120px; min-width: 110px; }
@media (max-width: 700px) {
  .outcome-quick { width: 100%; }
  .outcome-quick select, .outcome-quick input { flex: 1 1 100%; }
}

/* ---------- WhatsApp chat ---------- */
.chat { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px; max-height: 60vh; overflow-y: auto; background: #f6f8fa; }
.chat .bubble { max-width: min(78%, 520px); padding: 8px 11px; border-radius: 12px; background: #fff; border: 1px solid var(--border); }
.chat .bubble.in { align-self: flex-start; border-bottom-left-radius: 4px; }
.chat .bubble.out { align-self: flex-end; background: #e7f6ef; border-color: #cfe9dd; border-bottom-right-radius: 4px; }
.chat .bubble .body { white-space: pre-wrap; word-break: break-word; }
.chat .bubble .foot { margin-top: 3px; }
.chat-send { padding: 12px 20px 16px; border-top: 1px solid var(--border); }
.chat-send input[name=body] { min-width: 0; }

/* ---------- Employee ranking ---------- */
.rank-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--border); }
.rank-row:first-of-type { border-top: 0; }
.rank-pos { width: 22px; text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.rank-name { flex: 0 0 150px; font-weight: 600; font-size: 13px; }
.rank-bar { flex: 1 1 auto; display: flex; height: 12px; background: #eef1f5; border-radius: 6px; overflow: hidden; }
.rank-bar i { display: block; height: 100%; }
.rank-bar .conn { background: var(--brand); }
.rank-bar .miss { background: #f3b2b2; }
.rank-num { flex: 0 0 72px; text-align: right; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .rank-name { flex-basis: 110px; } .rank-num { flex-basis: 60px; } }

/* ---------- Challan pickers ---------- */
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px; }
.pick { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.pick input { width: 18px; height: 18px; flex: 0 0 auto; }
.pick span { display: flex; flex-direction: column; min-width: 0; }
.pick small { color: var(--muted); font-size: 11.5px; }
.pick:has(input:checked) { border-color: var(--brand); background: #f1faf6; }

/* ---------- Dial pad search ---------- */
.sp-find { margin: 10px 0 6px; }
.sp-find input { padding-left: 36px; }
.sp-results { max-height: 220px; overflow-y: auto; border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; }
.sp-result { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 9px 12px; background: #fff; border: 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.sp-result:last-child { border-bottom: 0; }
.sp-result:hover { background: #f3f7f5; }
.sp-result .n { font-weight: 600; font-size: 13.5px; }
.sp-result .s { color: var(--muted); font-size: 11.5px; }

/* Recent calls under the dial pad search, like a phone's own log. */
.sp-recent { margin-bottom: 10px; }
.sp-result { flex-direction: row; align-items: center; gap: 10px; }
.sp-result .a { width: 14px; flex: 0 0 14px; color: var(--muted); font-size: 13px; }
.sp-result.missed .a { color: var(--red, #dc2626); }
.sp-result .t { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sp-result.missed .n { color: var(--red, #dc2626); }

/* ---------- Dashboard sections ---------- */
/* The page is long; these break it into "what needs doing", "how are we going"
   and "money", so the eye has somewhere to land. */
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 26px 0 -2px; padding-top: 18px; border-top: 1px solid var(--border); }
.section-head:first-of-type { margin-top: 6px; padding-top: 0; border-top: 0; }
.section-head h2 { font-size: 17px; letter-spacing: -0.01em; margin: 0; }
.section-head span { color: var(--muted); font-size: 12.5px; }
@media (max-width: 700px) {
  .section-head { margin-top: 18px; padding-top: 14px; }
  .section-head span { display: none; }
}

/* ---------- Dashboard charts ---------- */
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1100px) { .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) { .grid.three { grid-template-columns: 1fr; } }

/* A stage of the pipeline, or one lead source: label, coloured bar, count. */
.funnel-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.funnel-row .l { flex: 0 0 96px; font-size: 12.5px; color: var(--text-2); }
.funnel-row .bar { height: 18px; border-radius: 5px; min-width: 6px; transition: width .3s; }
.funnel-row b { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 13px; }

/* The pipeline reads cold-to-warm, so a glance says where the leads are stuck. */
.stage-new { background: #60a5fa; }
.stage-contacted { background: #38bdf8; }
.stage-test_ride { background: #22c55e; }
.stage-booking { background: #16a34a; }
.stage-delivered { background: #15803d; }
.stage-lost { background: #cbd5e1; }

.src-0 { background: #6366f1; }
.src-1 { background: #8b5cf6; }
.src-2 { background: #ec4899; }
.src-3 { background: #f59e0b; }
.src-4 { background: #14b8a6; }
.src-5 { background: #64748b; }

@media (max-width: 760px) { .funnel-row .l { flex-basis: 78px; font-size: 12px; } }

/* A figure next to its change against the window before — up is good unless the
   card says otherwise (missed calls going up is not a win). */
.trend { display: inline-flex; align-items: center; gap: 5px; margin-top: 7px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; }
.trend small { font-weight: 500; opacity: .75; }
.trend.up { background: var(--brand-50); color: var(--brand-700); }
.trend.down { background: var(--red-50); color: var(--red); }

/* ---------- Line chart ---------- */
.linechart svg { width: 100%; height: 180px; display: block; overflow: visible; }
.linechart .grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.linechart .line { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.linechart .line.a { stroke: var(--brand); }
.linechart .line.b { stroke: var(--blue); }

/* ---------- Donut ---------- */
.donut-wrap { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; flex: 0 0 150px; }
.donut .track { fill: none; stroke: var(--surface-2); stroke-width: 16; }
.donut .slice { fill: none; stroke-width: 16; stroke-linecap: butt; }
.donut .d-big { text-anchor: middle; font-size: 22px; font-weight: 750; fill: var(--text); }
.donut .d-small { text-anchor: middle; font-size: 9px; fill: var(--muted); }
.donut-legend { flex: 1 1 170px; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.donut-legend > div { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; flex: 0 0 10px; }
.donut-legend .l { color: var(--text-2); }
.donut-legend .p { color: var(--muted); font-size: 11.5px; }
.donut-legend b { margin-left: auto; font-variant-numeric: tabular-nums; }

/* ---------- Softer page, in line with the dashboard reference ---------- */
:root { --radius: 18px; }
body { background: linear-gradient(180deg, #f6f7fb 0%, #f3f5f9 240px); }
.card { border-radius: var(--radius); }
.kpi .kpi-icon { width: 42px; height: 42px; border-radius: 50%; }
.kpi .value { font-size: 26px; }
.section-head h2 { font-size: 18px; }

/* Model chips in the call-outcome sheet are plain buttons, not radio labels. */
.chips button { padding: 8px 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: #fff; font: inherit; font-weight: 600; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.chips button.on { background: var(--brand); border-color: var(--brand); color: #fff; }

/* ---------- Conversion funnel ---------- */
.conv { display: flex; flex-direction: column; gap: 8px; }
.conv-step { display: flex; align-items: center; gap: 12px; }
.conv-bar {
  height: 32px; border-radius: 8px; display: flex; align-items: center; justify-content: flex-end;
  padding-right: 9px; color: #fff; font-weight: 700; font-size: 12.5px; min-width: 42px;
  background: linear-gradient(90deg, #34d399, #059669);
}
/* Each step is narrower than the one above, so the colour deepens as it narrows. */
.conv-step:nth-child(2) .conv-bar { background: linear-gradient(90deg, #38bdf8, #0284c7); }
.conv-step:nth-child(3) .conv-bar { background: linear-gradient(90deg, #818cf8, #4f46e5); }
.conv-step:nth-child(4) .conv-bar { background: linear-gradient(90deg, #c084fc, #7c3aed); }
.conv-step:nth-child(5) .conv-bar { background: linear-gradient(90deg, #f472b6, #db2777); }
.conv-step:nth-child(6) .conv-bar { background: linear-gradient(90deg, #fbbf24, #d97706); }
.conv-meta { display: flex; flex-direction: column; min-width: 0; }
.conv-meta b { font-size: 12.5px; }
.conv-meta span { font-size: 11px; color: var(--muted); }
.conv-meta span.bad { color: var(--red); font-weight: 700; }

/* The call-outcome sheet: outcome first, everything else folded away. */
.btn.block { width: 100%; justify-content: center; }
#sp-dispo-chips { margin-bottom: 2px; }

/* Link to the staff handbook, kept at the foot of the sidebar. */
.nav-help { display: flex; align-items: center; gap: 9px; margin: 8px 12px; padding: 9px 12px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: 12.5px; font-weight: 600; }
.nav-help:hover { background: var(--brand-50); color: var(--brand-700); }

/* Catalogue search results on the billing form. In the flow rather than floating: the
   items card clips its overflow, which made a dropdown invisible. */
.item-suggest { margin-top: 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; max-height: 260px; overflow-y: auto; }
.item-suggest button { display: block; width: 100%; text-align: left; padding: 10px 14px; border: 0; background: none; font: inherit; cursor: pointer; border-bottom: 1px solid var(--border); }
.item-suggest button:last-child { border-bottom: 0; }
.item-suggest button:hover { background: var(--brand-50); }
.item-suggest button.has-pic { display: grid; grid-template-columns: 44px 1fr; column-gap: 12px; align-items: center; }
.item-suggest button.has-pic img { grid-row: span 2; width: 44px; height: 44px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); background: var(--surface-2); }
.item-suggest b { display: block; font-size: 13.5px; }

/* ---------- Attendance ---------- */
.att-cam { width: 180px; height: 180px; object-fit: cover; border-radius: 50%; margin: 0 auto; background: #0b1f2a; }
.att-shot { width: 120px; height: 120px; border-radius: 50%; margin: 0 auto; background-size: cover; background-position: center; border: 3px solid var(--brand); }

/* A script error, said out loud. Nobody on a phone opens a console. */
.js-error { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 9999; display: flex; flex-direction: column; gap: 4px;
  background: #7f1d1d; color: #fff; padding: 12px 14px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 12.5px; }
.js-error span { opacity: .85; word-break: break-word; font-family: ui-monospace, Menlo, monospace; font-size: 11.5px; }
.js-error button { align-self: flex-end; background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 8px; padding: 5px 12px; font: inherit; cursor: pointer; }

/* ---------- Challans: send, count in, verify ----------
   Built for a branch manager on a phone in a godown doorway: every screen leads with
   the one thing that person has to do next, and every control is thumb-sized. */
.task-list { display: grid; gap: 10px; }
.task {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--brand);
  color: inherit; box-shadow: var(--shadow-sm); min-height: 64px;
}
.task:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.task.amber { border-left-color: var(--amber); }
.task.blue { border-left-color: var(--blue); }
.task .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; background: var(--brand-50); color: var(--brand-700); }
.task.amber .ic { background: var(--amber-50); color: #b45309; }
.task.blue .ic { background: var(--blue-50); color: var(--blue); }
.task .thumb { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--border); }
.task .body { flex: 1; min-width: 0; }
.task .t { font-weight: 650; }
.task .s { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.task .go { font-weight: 650; color: var(--brand-700); white-space: nowrap; font-size: 13px; }
.task.amber .go { color: #b45309; }
.task-group h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; margin: 0 0 10px; }

.status-hero { display: flex; align-items: center; gap: 14px; }
.status-hero .ic { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.status-hero.blue .ic { background: var(--blue-50); color: var(--blue); }
.status-hero.amber .ic { background: var(--amber-50); color: #b45309; }
.status-hero.green .ic { background: var(--brand-50); color: var(--brand-700); }
.status-hero.grey .ic { background: #f1f5f9; color: var(--muted); }
.status-hero .big { font-size: 18px; font-weight: 700; line-height: 1.25; }
.status-hero .sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.timeline { display: flex; gap: 0; margin-top: 16px; }
.timeline .step { flex: 1; position: relative; padding-top: 22px; font-size: 12px; color: var(--muted); min-width: 0; }
.timeline .step::before { content: ""; position: absolute; top: 6px; left: 0; right: 0; height: 3px; background: var(--border); }
.timeline .step::after { content: ""; position: absolute; top: 0; left: 0; width: 15px; height: 15px; border-radius: 50%; background: #fff; border: 3px solid var(--border-strong); }
.timeline .step.done::before { background: var(--brand); }
.timeline .step.done::after { background: var(--brand); border-color: var(--brand); }
.timeline .step.now::after { border-color: var(--amber); }
.timeline .step b { display: block; color: var(--text); font-size: 12.5px; }
.timeline .step span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding-right: 8px; }

.count-list { display: grid; gap: 10px; padding: 16px; }
.count-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 14px; align-items: center;
  padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface);
}
.count-card.short { border-color: #fcd34d; background: var(--amber-50); }
.count-card .name { font-weight: 650; }
.count-card .meta { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.count-card .verdict { grid-column: 1 / -1; font-size: 12.5px; font-weight: 600; color: var(--brand-700); }
.count-card.short .verdict { color: #b45309; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: 12px; overflow: hidden; background: #fff; }
.stepper button { width: 44px; border: 0; background: var(--surface-2); font-size: 20px; font-weight: 600; color: var(--text-2); cursor: pointer; }
.stepper button:active { background: var(--brand-100); }
.stepper input { width: 64px; border: 0; border-left: 1px solid var(--border); border-right: 1px solid var(--border); border-radius: 0; text-align: center; font-size: 17px; font-weight: 700; padding: 10px 4px; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.photo-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 120px; padding: 16px;
  border: 2px dashed #f59e0b; border-radius: 14px; background: var(--amber-50); color: #92400e;
  font-weight: 650; cursor: pointer; text-align: center; position: relative; overflow: hidden;
}
.photo-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-btn img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.photo-btn.has-photo { border-style: solid; border-color: var(--brand); }
.photo-btn.has-photo .again { position: absolute; bottom: 8px; right: 8px; background: rgba(15,23,42,.75); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 999px; }

.reason-grid { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.reason { position: relative; display: block; margin: 0; cursor: pointer; }
.reason input { position: absolute; opacity: 0; pointer-events: none; }
.reason span { display: block; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 12px; background: #fff; min-height: 64px; }
.reason span b { display: block; font-size: 13.5px; }
.reason span small { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.35; }
.reason input:checked + span { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 2px var(--brand-100); }
.reason input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

.evidence { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 16px; align-items: start; }
.evidence img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 14px; border: 1px solid var(--border); display: block; }
.evidence .quote { font-size: 16px; font-weight: 600; line-height: 1.4; padding: 12px 14px; border-left: 3px solid var(--amber); background: var(--amber-50); border-radius: 0 10px 10px 0; }

.sticky-actions {
  position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; background: rgba(255,255,255,.96); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  border-top: 1px solid var(--border); border-radius: 0 0 var(--radius) var(--radius);
}
.sticky-actions .btn { min-height: 46px; padding-left: 20px; padding-right: 20px; }
.send-summary { font-size: 13px; color: var(--text-2); }

@media (max-width: 900px) {
  /* Above the phone tab bar, never under it. */
  .sticky-actions { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); border-radius: 0; margin: 0 -1px; }
  .sticky-actions .btn { flex: 1; }
  .evidence { grid-template-columns: 1fr; }
  .task .go { display: none; }
}

/* Billing: which price list fills the lines — customer (MRP) or dealer. */
.price-mode { display: inline-flex; margin-left: auto; margin-right: 8px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 3px; gap: 2px; }
.price-mode button { border: 0; background: none; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 5px 12px; border-radius: 999px; cursor: pointer; }
.price-mode button.on { background: var(--brand); color: #fff; box-shadow: var(--shadow-sm); }
.price-mode button[data-mode="dealer"].on { background: #7c3aed; }
@media (max-width: 640px) { .price-mode button { padding: 5px 9px; font-size: 12px; } }

/* Dashboard: spares profit (admin). */
.sp-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; padding: 16px 20px; }
.sp-big { font-size: 24px; font-weight: 750; line-height: 1.25; letter-spacing: -.01em; }
.sp-big.pos { color: var(--brand-700); }
.sp-big.neg { color: var(--red); }
.sp-split { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 0 20px 16px; }
.sp-buyer { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.sp-buyer b { font-size: 16px; }
@media (max-width: 760px) {
    .sp-kpis { grid-template-columns: 1fr 1fr; gap: 14px; }
    .sp-split { grid-template-columns: 1fr; }
}

/* Dashboard: the owner's tiles and alert list. */
.ceo-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ceo-tile { display: block; color: inherit; padding: 16px 18px; transition: transform .12s ease, box-shadow .12s ease; border-top: 3px solid var(--tone, var(--brand)); }
.ceo-tile:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.ceo-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--tone-50, var(--brand-50)); color: var(--tone, var(--brand)); flex: none; }
.ceo-label { font-size: 12.5px; font-weight: 600; color: var(--muted); margin-top: 12px; }
.ceo-value { font-size: 26px; font-weight: 780; letter-spacing: -.02em; line-height: 1.2; margin-top: 2px; }
.ceo-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.ceo-trend { font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 999px; }
.ceo-trend.up { background: var(--brand-50); color: var(--brand-700); }
.ceo-trend.down { background: var(--red-50); color: var(--red); }
.tone-green { --tone: #059669; --tone-50: #ecfdf5; }
.tone-blue { --tone: #2563eb; --tone-50: #eff6ff; }
.tone-red { --tone: #dc2626; --tone-50: #fef2f2; }
.tone-amber { --tone: #d97706; --tone-50: #fffbeb; }
.tone-violet { --tone: #7c3aed; --tone-50: #f5f3ff; }
.ceo-tile.tone-red .ceo-value { color: #dc2626; }
.ceo-alert { color: inherit; gap: 12px; }
.ceo-alert:hover { color: inherit; }
.ceo-alert .t b { font-size: 15px; color: var(--tone); }
@media (max-width: 1100px) { .ceo-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .ceo-tiles { gap: 10px; } .ceo-tile { padding: 14px; } .ceo-value { font-size: 22px; } }

/* ==========================================================================
   Dashboard, v2 (26 Nov 2026) — "advance portal" look. Scoped to .dash so no
   other page changes. Dark command-centre header, glass tiles, soft cards,
   slim rounded meters with shares, peak-marked hour chart.
   ========================================================================== */
.dash { --d-card-r: 20px; --d-line: #e8ecf2; --d-track: #eef1f6; gap: 18px; }

/* Header */
.dash .hero {
  border-radius: 24px; padding: 26px 28px 24px; margin-bottom: 0;
  background:
    radial-gradient(60% 90% at 100% 0%, rgba(16,185,129,.35) 0%, rgba(16,185,129,0) 60%),
    radial-gradient(50% 80% at 0% 100%, rgba(59,130,246,.22) 0%, rgba(59,130,246,0) 60%),
    linear-gradient(135deg, #0b1220 0%, #0d1f2d 55%, #0b2a2a 100%);
  box-shadow: 0 30px 60px -30px rgba(2, 6, 23, .55), inset 0 1px 0 rgba(255,255,255,.06);
}
.dash .hero::after {
  content: ""; position: absolute; inset: 0; right: auto; bottom: auto; width: 100%; height: 100%; border-radius: 0;
  background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.9), transparent 70%); -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,.9), transparent 70%);
  pointer-events: none;
}
.dash .hero > * { position: relative; z-index: 1; }
.dash .hero-eyebrow { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: #6ee7b7; margin-bottom: 6px; }
.dash .hero h1 { font-size: 26px; letter-spacing: -.02em; font-weight: 800; }
.dash .hero p { color: rgba(226,232,240,.72); }
.dash .hero .btn.white { background: rgba(255,255,255,.1); color: #fff; border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(6px); }
.dash .hero .btn.white:hover { background: rgba(255,255,255,.18); }
.dash .hero-stats { gap: 12px; margin-top: 20px; }
.dash .hero-stats > div { flex: 1 1 130px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); }
.dash .hero-stats b { font-size: 24px; letter-spacing: -.02em; }

/* Owner's tiles, sitting in the header as glass */
.dash .hero .ceo-tiles { margin-top: 22px; gap: 12px; }
.dash .hero .ceo-tile, .dash .hero .ceo-tile.card:not(.flush) {
  background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.1); border-top: 1px solid rgba(255,255,255,.14);
  border-radius: 16px; box-shadow: none; padding: 14px 16px; color: #fff; position: relative; overflow: hidden;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.dash .hero .ceo-tile::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--tone); opacity: .9; }
.dash .hero .ceo-tile:hover { background: rgba(255,255,255,.1); transform: translateY(-2px); color: #fff; }
.dash .hero .ceo-ico { width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--tone) 22%, transparent); color: color-mix(in srgb, var(--tone) 55%, #fff); }
.dash .hero .ceo-label { color: rgba(226,232,240,.7); margin-top: 10px; font-weight: 500; }
.dash .hero .ceo-value { color: #fff; font-size: 24px; }
.dash .hero .ceo-tile.tone-red .ceo-value { color: #fca5a5; }
.dash .hero .ceo-sub { color: rgba(203,213,225,.6); }
.dash .hero .ceo-trend.up { background: rgba(16,185,129,.18); color: #6ee7b7; }
.dash .hero .ceo-trend.down { background: rgba(239,68,68,.18); color: #fca5a5; }

/* Filter bar */
.dash .filters { background: var(--surface); border: 1px solid var(--d-line); border-radius: 16px; padding: 8px; box-shadow: 0 1px 2px rgba(15,23,42,.04); margin: 0; }
.dash .filters .seg { background: var(--d-track); border-radius: 11px; padding: 3px; border: 0; }
.dash .filters .seg a { border-radius: 9px; }
.dash .filters .seg a.on { background: #0f172a; color: #fff; box-shadow: 0 4px 10px -4px rgba(15,23,42,.5); }

/* Section heads: a quiet label, no rule */
.dash .section-head { border-top: 0; padding-top: 0; margin: 18px 0 -4px; align-items: center; }
.dash .section-head h2 { font-size: 19px; font-weight: 800; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.dash .section-head h2::before { content: ""; width: 6px; height: 20px; border-radius: 3px; background: linear-gradient(180deg, #34d399, #059669); }
.dash .section-head span { font-size: 12.5px; }

/* Cards */
.dash .card {
  border-radius: var(--d-card-r); border: 1px solid var(--d-line);
  box-shadow: 0 1px 2px rgba(15,23,42,.04), 0 12px 32px -20px rgba(15,23,42,.18);
}
.dash .card:not(.flush) { padding: 22px; }
.dash .card-head { border-bottom-color: var(--d-line); }
.dash .card .card-head h2, .dash .card > .row h2, .dash .card h2 { font-size: 15px; font-weight: 700; letter-spacing: -.01em; }
.dash .card h2 > svg { box-sizing: content-box; padding: 7px; border-radius: 10px; background: var(--brand-50); color: var(--brand); }
.dash .card-head[style*="padding:0 0 10px"] { border-bottom: 0; padding-bottom: 14px !important; }

/* Meter rows: dot · label · slim track · count · share */
.dash .meter-row { display: grid; grid-template-columns: auto 96px minmax(0, 1fr) 54px 40px; align-items: center; gap: 10px; padding: 7px 0; }
.dash .meter-row .dot { width: 9px; height: 9px; border-radius: 50%; }
.dash .meter-row .rank { width: 20px; height: 20px; border-radius: 6px; background: var(--d-track); color: var(--muted); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.dash .meter-row .l { font-size: 13px; font-weight: 600; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash .meter-row .track { height: 8px; border-radius: 99px; background: var(--d-track); overflow: hidden; }
.dash .meter-row .track i { display: block; height: 100%; border-radius: 99px; min-width: 0; transition: width .5s cubic-bezier(.2,.8,.2,1); }
.dash .meter-row b { text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
.dash .meter-row .pct { text-align: right; font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dash .meter-row.zero .l, .dash .meter-row.zero b { color: #a3acb9; }
.dash .stack-strip { display: flex; height: 12px; border-radius: 99px; overflow: hidden; gap: 2px; margin: 2px 0 14px; background: var(--d-track); }
.dash .stack-strip i { display: block; height: 100%; }
.dash .stage-new { background: linear-gradient(90deg, #60a5fa, #3b82f6); }
.dash .stage-contacted { background: linear-gradient(90deg, #22d3ee, #0ea5e9); }
.dash .stage-test_ride { background: linear-gradient(90deg, #4ade80, #22c55e); }
.dash .stage-booking { background: linear-gradient(90deg, #22c55e, #16a34a); }
.dash .stage-delivered { background: linear-gradient(90deg, #16a34a, #15803d); }
.dash .stage-lost { background: linear-gradient(90deg, #cbd5e1, #94a3b8); }
.dash .src-0 { background: linear-gradient(90deg, #818cf8, #6366f1); }
.dash .src-1 { background: linear-gradient(90deg, #a78bfa, #8b5cf6); }
.dash .src-2 { background: linear-gradient(90deg, #f472b6, #ec4899); }
.dash .src-3 { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.dash .src-4 { background: linear-gradient(90deg, #2dd4bf, #14b8a6); }
.dash .src-5 { background: linear-gradient(90deg, #94a3b8, #64748b); }

/* Ranked bars (team, branches) */
.dash .rank-row { border-top-color: #f1f4f8; padding: 9px 0; gap: 12px; }
.dash .rank-bar { height: 8px; border-radius: 99px; background: var(--d-track); }
.dash .rank-bar .conn { background: linear-gradient(90deg, #34d399, #059669); }
.dash .rank-bar .miss { background: linear-gradient(90deg, #fecaca, #f87171); }
.dash .rank-num { font-weight: 600; }
.dash .rate-chip { flex: 0 0 auto; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.dash .rate-chip.good { background: #ecfdf5; color: #047857; }
.dash .rate-chip.mid { background: #fffbeb; color: #b45309; }
.dash .rate-chip.bad { background: #fef2f2; color: #b91c1c; }

/* Hour chart: pill bars, peak called out */
.dash .bars { gap: 5px; height: 180px; padding-top: 22px; }
.dash .bar .total { background: linear-gradient(180deg, #d1fae5, #ecfdf5); border-radius: 8px; }
.dash .bar .conn { background: linear-gradient(180deg, #34d399, #047857); border-radius: 8px; }
.dash .bar.peak .total { background: linear-gradient(180deg, #a7f3d0, #d1fae5); box-shadow: 0 0 0 2px #10b98133; }
.dash .bar.peak { position: relative; }
.dash .bar.peak::before { content: attr(data-peak) " peak"; position: absolute; top: -20px; left: 50%; transform: translateX(-50%); white-space: nowrap; font-size: 10.5px; font-weight: 700; color: #047857; background: #ecfdf5; padding: 1px 6px; border-radius: 99px; }
.dash .bar-labels span { font-weight: 500; }

/* Donut */
.dash .donut { width: 168px; height: 168px; flex-basis: 168px; filter: drop-shadow(0 8px 14px rgba(15,23,42,.08)); }
.dash .donut .track { stroke: var(--d-track); stroke-width: 14; }
.dash .donut .slice { stroke-width: 14; }
.dash .donut .d-big { font-size: 24px; font-weight: 800; letter-spacing: -.02em; }
.dash .donut-legend > div { padding: 8px 10px; border-radius: 10px; background: #f8fafc; }
.dash .donut-legend i { border-radius: 50%; }

/* KPI cards in the Calls / Money sections */
.dash .kpi { padding: 18px !important; }
.dash .kpi .kpi-icon { width: 36px; height: 36px; border-radius: 11px; }
.dash .kpi .value { font-size: 26px; font-weight: 800; }
.dash a.card.kpi:hover, .dash a.ceo-tile:hover { transform: translateY(-2px); }
.dash a.card.kpi { transition: transform .12s ease, box-shadow .12s ease; }

/* Lists and tables inside cards */
.dash .list-item { border-top-color: #f1f4f8; }
.dash .ceo-alert { padding: 13px 20px; }
.dash .ceo-alert:hover { background: #f8fafc; }
.dash .rtable th { background: #f8fafc; color: #64748b; }
.dash .badge { font-weight: 700; }

@media (max-width: 760px) {
  .dash .hero { padding: 20px 18px; border-radius: 20px; }
  .dash .hero h1 { font-size: 22px; }
  .dash .hero .ceo-tiles { gap: 8px; }
  .dash .hero .ceo-tile { padding: 12px; }
  .dash .hero .ceo-value { font-size: 19px; }
  .dash .meter-row { grid-template-columns: auto 78px minmax(0, 1fr) 44px 34px; gap: 8px; }
  .dash .bar.peak::before { display: none; }
  .dash .card:not(.flush) { padding: 16px; }
}

/* Phone "More" sheet: it now carries the whole menu, so it scrolls and is grouped. */
.sheet { max-height: 86vh; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.sheet-label { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 14px 8px 4px; border-top: 1px solid var(--border); margin-top: 6px; }

/* ==========================================================================
   WhatsApp-style chat (26 Nov 2026). Own palette so it reads like the app the
   team already uses: teal header, beige wallpaper, green outgoing bubbles.
   ========================================================================== */
.wa {
  --wa-teal: #008069; --wa-wall: #efeae2; --wa-out: #d9fdd3; --wa-in: #ffffff;
  --wa-meta: #667781; --wa-read: #53bdeb; --wa-bar: #f0f2f5; --wa-text: #111b21;
  display: flex; flex-direction: column; height: calc(100dvh - 150px); min-height: 460px;
  border-radius: 18px; overflow: hidden; border: 1px solid #d1d7db; background: var(--wa-wall);
  box-shadow: 0 1px 2px rgba(11,20,26,.06), 0 18px 40px -24px rgba(11,20,26,.3);
}
.wa-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--wa-teal); color: #fff; }
.wa-back { display: none; color: #fff; margin-left: -6px; }
.wa-avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #dfe5e7; color: #54656f; font-weight: 700; font-size: 15px; }
.wa-who { flex: 1; min-width: 0; }
.wa-name { font-weight: 600; font-size: 16px; line-height: 1.25; }
.wa-sub { font-size: 12.5px; opacity: .85; }
.wa-actions { display: flex; gap: 4px; }
.wa-actions a, .wa-actions button { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: none; border: 0; cursor: pointer; }
.wa-actions a:hover, .wa-actions button:hover { background: rgba(255,255,255,.14); color: #fff; }
.wa-claim { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px; background: #fff8e1; border-bottom: 1px solid #f3e2a9; font-size: 13px; color: #6b5a12; }

.wa-body {
  flex: 1; overflow-y: auto; padding: 14px 6% 18px; display: flex; flex-direction: column; gap: 2px;
  background-color: var(--wa-wall);
  /* A light doodle-like wallpaper, drawn here rather than borrowed. */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cg fill='none' stroke='%23d6cfc4' stroke-width='1.2' stroke-linecap='round' opacity='.55'%3E%3Ccircle cx='18' cy='20' r='6'/%3E%3Cpath d='M70 14l8 8m0-8l-8 8'/%3E%3Crect x='96' y='38' width='12' height='9' rx='2'/%3E%3Cpath d='M30 70c6-6 12 6 18 0'/%3E%3Ccircle cx='86' cy='88' r='4'/%3E%3Cpath d='M12 102l6-8 6 8z'/%3E%3Cpath d='M58 104h14M65 97v14'/%3E%3Cpath d='M100 6c2 4 6 4 8 0'/%3E%3C/g%3E%3C/svg%3E");
  scroll-behavior: smooth;
}
.wa-window { align-self: center; max-width: 88%; text-align: center; font-size: 12px; line-height: 1.4; padding: 6px 12px; border-radius: 8px; margin: 4px 0 10px; background: #fff3c4; color: #54656f; box-shadow: 0 1px .5px rgba(11,20,26,.13); }
.wa-window.open { background: #e7fce3; color: #1f6a3a; }
.wa-day { display: flex; justify-content: center; margin: 10px 0 6px; position: sticky; top: 0; z-index: 2; }
.wa-day span { background: #fff; color: #54656f; font-size: 12px; font-weight: 500; padding: 5px 12px; border-radius: 8px; box-shadow: 0 1px .5px rgba(11,20,26,.13); text-transform: uppercase; letter-spacing: .02em; }
.wa-empty { margin: auto; background: #fff; color: #54656f; padding: 8px 14px; border-radius: 8px; font-size: 13px; }

.wa-row { display: flex; margin-top: 2px; }
.wa-row.in { justify-content: flex-start; }
.wa-row.out { justify-content: flex-end; }
/* A new speaker gets the little tail and a bit of air; a run of messages does not. */
.wa-row.in + .wa-row.out, .wa-row.out + .wa-row.in, .wa-day + .wa-row, .wa-window + .wa-row { margin-top: 10px; }

.wa-bubble {
  position: relative; max-width: min(72%, 560px); padding: 6px 9px 8px; border-radius: 8px;
  color: var(--wa-text); font-size: 14.2px; line-height: 1.4; box-shadow: 0 1px .5px rgba(11,20,26,.13);
  word-wrap: break-word; overflow-wrap: anywhere;
}
.wa-row.in .wa-bubble { background: var(--wa-in); }
.wa-row.out .wa-bubble { background: var(--wa-out); }
.wa-row.in + .wa-row.in .wa-bubble::before, .wa-row.out + .wa-row.out .wa-bubble::before { display: none; }
.wa-bubble::before { content: ""; position: absolute; top: 0; width: 10px; height: 13px; }
.wa-row.in .wa-bubble { border-top-left-radius: 0; }
.wa-row.in .wa-bubble::before { left: -8px; background: var(--wa-in); clip-path: polygon(100% 0, 0 0, 100% 100%); }
.wa-row.out .wa-bubble { border-top-right-radius: 0; }
.wa-row.out .wa-bubble::before { right: -8px; background: var(--wa-out); clip-path: polygon(0 0, 100% 0, 0 100%); }
.wa-row.in + .wa-row.in .wa-bubble { border-top-left-radius: 8px; }
.wa-row.out + .wa-row.out .wa-bubble { border-top-right-radius: 8px; }

.wa-author { font-size: 12px; font-weight: 600; color: #1fa855; margin-bottom: 1px; }
.wa-tag { font-size: 11.5px; color: var(--wa-meta); margin-bottom: 2px; }
.wa-text { white-space: pre-wrap; }
/* Time and ticks sit inside the bubble, bottom-right; the float keeps a short message on one line. */
.wa-meta { float: right; display: inline-flex; align-items: center; gap: 3px; margin: 8px 0 -4px 12px; font-size: 11px; color: var(--wa-meta); white-space: nowrap; position: relative; top: 2px; }
.wa-tick { color: #8696a0; }
.wa-tick.read { color: var(--wa-read); }
.wa-fail { width: 15px; height: 15px; border-radius: 50%; background: #ea0038; color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }
.wa-bubble.failed { box-shadow: 0 0 0 1px #f5b5c3; }
.wa-error { clear: both; margin-top: 4px; font-size: 11.5px; color: #c0002c; }
.wa-img { display: block; margin: -2px -5px 4px; }
.wa-img img { display: block; max-width: 100%; max-height: 320px; border-radius: 6px; object-fit: cover; }
.wa-file { display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin-bottom: 4px; border-radius: 6px; background: rgba(11,20,26,.05); color: var(--wa-text); max-width: 280px; }
.wa-file-ico { width: 32px; height: 32px; flex: none; border-radius: 6px; display: grid; place-items: center; background: #fff; color: var(--wa-teal); }

.wa-compose { background: var(--wa-bar); padding: 8px 12px; border-top: 1px solid #e3e6e8; }
.wa-form { display: flex; align-items: flex-end; gap: 8px; }
.wa-attach { width: 42px; height: 42px; flex: none; border-radius: 50%; display: grid; place-items: center; color: #54656f; cursor: pointer; }
.wa-attach:hover { background: rgba(11,20,26,.06); }
.wa-input { flex: 1; min-width: 0; background: #fff; border-radius: 22px; padding: 4px 6px 4px 14px; display: flex; flex-direction: column; }
.wa-input textarea { border: 0; outline: 0; resize: none; background: none; padding: 7px 0; font: inherit; font-size: 15px; line-height: 1.4; color: var(--wa-text); max-height: 140px; box-shadow: none; }
.wa-file-chip { display: flex; align-items: center; gap: 8px; margin: 4px 6px 0 0; padding: 4px 10px; border-radius: 12px; background: #e7fce3; color: #1f6a3a; font-size: 12.5px; }
.wa-file-chip span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wa-file-chip button { border: 0; background: none; font-size: 18px; line-height: 1; color: inherit; cursor: pointer; }
.wa-send { width: 46px; height: 46px; flex: none; border-radius: 50%; border: 0; display: grid; place-items: center; background: #00a884; color: #fff; cursor: pointer; box-shadow: 0 2px 6px -2px rgba(0,128,105,.6); }
.wa-send:hover { background: #008f72; }
.wa-send:disabled { background: #9fd8c9; cursor: not-allowed; }
.wa-form-error { margin: 6px 4px 0; font-size: 12.5px; color: #c0002c; }
.wa-templates { margin-top: 8px; font-size: 13px; }
.wa-templates summary { cursor: pointer; color: #54656f; font-weight: 600; padding: 4px; }
.wa-templates form { margin-top: 6px; }
.wa-note { margin: 6px 4px 0; font-size: 12px; color: #667781; }

@media (max-width: 900px) {
  .wa { height: calc(100dvh - 64px - var(--tabbar-h) - env(safe-area-inset-bottom) - 20px); min-height: 380px; border-radius: 14px; margin: 0 -8px; }
  .wa-back { display: grid; }
  .wa-body { padding: 10px 10px 14px; }
  .wa-bubble { max-width: 84%; }
  .wa-head { padding: 8px 10px; gap: 8px; }
}

/* WhatsApp-style chat list */
.wa-list { background: #fff; border: 1px solid #d1d7db; border-radius: 18px; overflow: hidden; box-shadow: 0 1px 2px rgba(11,20,26,.06), 0 18px 40px -24px rgba(11,20,26,.25); }
.wa-list-head { padding: 14px 16px 10px; border-bottom: 1px solid #e9edef; }
.wa-list-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.wa-list-title b { font-size: 22px; font-weight: 700; color: #111b21; }
.wa-list-title span { font-size: 12.5px; color: #667781; }
.wa-search { display: flex; align-items: center; gap: 10px; background: #f0f2f5; border-radius: 10px; padding: 0 12px; color: #54656f; }
.wa-search input { flex: 1; border: 0; background: none; padding: 9px 0; font: inherit; font-size: 14px; outline: 0; box-shadow: none; }
.wa-search a { color: #54656f; font-size: 20px; line-height: 1; }
.wa-pills { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: none; }
.wa-pills a { flex: none; padding: 6px 13px; border-radius: 999px; background: #f0f2f5; color: #54656f; font-size: 13.5px; font-weight: 500; }
.wa-pills a.on { background: #d9fdd3; color: #008069; font-weight: 600; }
.wa-pills a i { font-style: normal; margin-left: 4px; font-size: 11.5px; background: #25d366; color: #fff; padding: 1px 6px; border-radius: 99px; }
.wa-list-note { padding: 10px 16px; background: #fff8e1; color: #6b5a12; font-size: 13px; border-bottom: 1px solid #f3e2a9; }
.wa-chat { display: flex; gap: 12px; padding: 10px 16px; color: #111b21; align-items: center; position: relative; }
.wa-chat:hover { background: #f5f6f6; color: #111b21; }
.wa-chat + .wa-chat .wa-chat-main { border-top: 1px solid #e9edef; }
.wa-chat .wa-avatar { width: 48px; height: 48px; font-size: 16px; }
.wa-chat-main { flex: 1; min-width: 0; padding: 4px 0; }
.wa-chat + .wa-chat .wa-chat-main { padding-top: 10px; margin-top: -6px; }
.wa-chat-top, .wa-chat-bottom { display: flex; align-items: center; gap: 8px; }
.wa-chat-name { flex: 1; min-width: 0; font-size: 16px; font-weight: 500; }
.wa-chat-time { flex: none; font-size: 12px; color: #667781; }
.wa-chat.unread .wa-chat-time { color: #1fa855; font-weight: 600; }
.wa-chat-last { flex: 1; min-width: 0; font-size: 14px; color: #667781; display: flex; align-items: center; gap: 3px; }
.wa-chat.unread .wa-chat-last { color: #111b21; font-weight: 500; }
.wa-chat-last .wa-tick { flex: none; }
.wa-unread { flex: none; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: #25d366; color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; }
.wa-chat-tags { display: flex; gap: 6px; margin-top: 3px; align-items: center; }
.wa-chat-tags:empty { display: none; }
.wa-open { font-size: 11.5px; color: #1fa855; }
.wa-fail.sm { width: 14px; height: 14px; font-size: 10px; flex: none; }
.wa-list-empty { padding: 40px 16px; text-align: center; color: #667781; display: grid; gap: 8px; justify-items: center; }
.wa-pager { padding: 10px 16px; border-top: 1px solid #e9edef; }
@media (max-width: 900px) {
  .wa-list { margin: 0 -8px; border-radius: 14px; }
  .wa-chat { padding: 8px 12px; }
}

/* Billing: sale reference — a missed choice shows red. */
.seg.sale-ref.invalid { box-shadow: 0 0 0 2px var(--red); }

/* "Send WhatsApp welcome" buttons (call screen, dial pad, lead page). */
.wa-w-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #b7e4d6; background: #effaf6; color: #046a53; font: inherit; font-size: 13px; font-weight: 600; padding: 7px 12px; border-radius: 999px; cursor: pointer; transition: background .15s; }
.wa-w-btn:hover { background: #dcf5ec; }
.wa-w-btn.lg { padding: 10px 16px; font-size: 14px; }
.wa-w-btn.compact { width: 36px; height: 36px; padding: 0; flex: none; border-radius: 50%; }
.wa-w-btn.wa-w-ok { background: #d9fdd3; border-color: #8fd8a5; color: #0b6b2f; }
.wa-w-btn.wa-w-err { background: #fff1f2; border-color: #fecaca; color: #b91c1c; }
#sp-wa-welcome { margin-top: 10px; }
.sp-result-wrap { display: flex; align-items: center; gap: 6px; }
.sp-result-wrap .sp-result { flex: 1; min-width: 0; }

/* ==========================================================================
   Calls page v2 (28 Nov 2026) — same command-centre look as the dashboard.
   Header tiles double as filters; the log is grouped by day like a phone's.
   ========================================================================== */
.calls-v2 .hero h1 { margin-top: 2px; }
.calls-v2 .hero .ceo-tile.on { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); box-shadow: 0 0 0 1px color-mix(in srgb, var(--tone) 60%, transparent); }
.calls-v2 .hero .ceo-tile .ceo-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.cl-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--d-line); border-radius: 16px; padding: 8px; box-shadow: 0 1px 2px rgba(15,23,42,.04); }
.cl-search { flex: 1 1 260px; display: flex; align-items: center; gap: 8px; background: var(--d-track); border-radius: 11px; padding: 0 12px; color: var(--muted); min-width: 0; }
.cl-search input { flex: 1; min-width: 0; border: 0; background: none; box-shadow: none; padding: 10px 0; font-size: 14px; outline: 0; }
.cl-clear { font-size: 20px; line-height: 1; color: var(--muted); padding: 0 2px; }
.cl-toolbar .seg { background: var(--d-track); border-radius: 11px; padding: 3px; }
.cl-toolbar .seg a { display: inline-flex; align-items: center; gap: 5px; border-radius: 9px; }
.cl-toolbar .seg a.on { background: #0f172a; color: #fff; box-shadow: 0 4px 10px -4px rgba(15,23,42,.5); }
.cl-chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.cl-chip { flex: none; padding: 7px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--text-2); background: var(--surface); border: 1px solid var(--d-line); }
.cl-chip:hover { color: var(--text); border-color: var(--border-strong); }
.cl-chip.on { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.cl-chip.red.on { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.cl-chip.amber.on { background: #fffbeb; border-color: #fde68a; color: #b45309; }

.cl-list { overflow: hidden; }
.cl-head { display: flex; justify-content: space-between; gap: 10px; padding: 14px 20px; font-size: 13px; font-weight: 700; color: var(--text-2); border-bottom: 1px solid var(--d-line); }
.cl-day { position: sticky; top: 0; z-index: 2; display: flex; align-items: baseline; gap: 10px; padding: 9px 20px; background: #f8fafc; border-bottom: 1px solid var(--d-line); }
.cl-day b { font-size: 12.5px; letter-spacing: .02em; text-transform: uppercase; color: #334155; }
.cl-day span { font-size: 12px; color: var(--muted); }

.cl-row {
  display: grid; align-items: center; gap: 0 14px; padding: 12px 20px; border-bottom: 1px solid #f1f4f8;
  grid-template-columns: 38px minmax(0, 1.6fr) minmax(0, 1.1fr) 72px minmax(0, 1fr) auto;
  grid-template-areas: "ico who emp time stat act" ". out out out out out" ". play play play play play";
  transition: background .12s;
}
.cl-row:hover { background: #fafbfd; }
.cl-row.is-missed { background: linear-gradient(90deg, #fff5f5, transparent 40%); }
.cl-ico { grid-area: ico; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.cl-ico.out { background: #ecfdf5; color: #059669; }
.cl-ico.in { background: #eff6ff; color: #2563eb; }
.cl-ico.miss { background: #fef2f2; color: #dc2626; }
.cl-who { grid-area: who; min-width: 0; }
.cl-name { font-weight: 700; font-size: 14.5px; color: var(--text); }
.cl-name a { color: inherit; }
.cl-name a:hover { color: var(--brand); }
.cl-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.show-mobile-inline { display: none; }
.cl-emp { grid-area: emp; display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text-2); }
.cl-tag { flex: none; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: #f1f5f9; color: #475569; }
.cl-time { grid-area: time; font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cl-stat { grid-area: stat; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cl-pill { font-size: 11.5px; font-weight: 700; padding: 4px 10px; border-radius: 99px; background: #f1f5f9; color: #475569; white-space: nowrap; }
.cl-pill.green { background: #ecfdf5; color: #047857; }
.cl-pill.red { background: #fef2f2; color: #b91c1c; }
.cl-pill.amber { background: #fffbeb; color: #b45309; }
.cl-pill.blue { background: #eff6ff; color: #1d4ed8; }
.cl-dur { font-size: 12.5px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.cl-actions { grid-area: act; display: flex; gap: 6px; justify-content: flex-end; }
.cl-play, .cl-callback { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; border: 1px solid var(--d-line); background: var(--surface); color: var(--text-2); cursor: pointer; transition: background .12s, color .12s, border-color .12s; }
.cl-play:hover, .cl-play.on { background: #0f172a; border-color: #0f172a; color: #fff; }
.cl-callback { background: #ecfdf5; border-color: #a7f3d0; color: #059669; }
.cl-callback:hover { background: #059669; border-color: #059669; color: #fff; }
.cl-outcome { grid-area: out; margin-top: 8px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.cl-disp { font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 8px; background: #f5f3ff; color: #6d28d9; }
.cl-note { font-size: 12.5px; color: var(--muted); font-style: italic; min-width: 0; overflow-wrap: anywhere; }
.cl-outcome .outcome-quick { flex: 1 1 auto; }
.cl-player { grid-area: play; margin-top: 8px; }
.cl-player audio { width: 100%; max-width: 420px; height: 36px; }
.cl-pager { padding: 6px 16px; }
.cl-pager:empty { display: none; }

@media (max-width: 900px) {
  .calls-v2 .hero .ceo-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cl-toolbar { padding: 8px; gap: 8px; }
  .cl-toolbar .seg { width: 100%; }
  .cl-toolbar .seg a { flex: 1; justify-content: center; }
  .cl-row {
    grid-template-columns: 38px minmax(0, 1fr) auto;
    grid-template-areas: "ico who act" ". stat stat" ". emp emp" ". out out" ". play play";
    padding: 12px 14px; gap: 0 12px;
  }
  .cl-stat, .cl-emp { margin-top: 6px; }
  .show-mobile-inline { display: inline; }
  .cl-outcome .outcome-quick { flex-wrap: wrap; }
  .cl-outcome .outcome-quick select { flex: 1 1 100%; }
  .cl-outcome .outcome-quick input { flex: 1 1 0; min-width: 0; }
  .cl-day, .cl-head { padding-left: 14px; padding-right: 14px; }
  .cl-emp { font-size: 12.5px; }
}

/* Dashboard: employee scoreboards (performance, and what each person did). */
.sb-grid { overflow-x: auto; }
.sb-row { display: grid; align-items: center; gap: 10px 14px; padding: 12px 20px; border-top: 1px solid #f1f4f8; min-width: 0; }
.sb-calls .sb-row { grid-template-columns: 30px minmax(170px, 1.8fr) repeat(6, minmax(78px, 1fr)); }
.sb-work .sb-row { grid-template-columns: minmax(170px, 1.8fr) repeat(9, minmax(64px, 1fr)); }
.sb-row.sb-labels { border-top: 0; padding-top: 10px; padding-bottom: 10px; background: #f8fafc; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #64748b; }
.sb-row:not(.sb-labels):hover { background: #fafbfd; }
.sb-rank { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--d-track); color: var(--muted); }
.sb-rank.r1 { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #78350f; }
.sb-rank.r2 { background: linear-gradient(135deg, #e2e8f0, #94a3b8); color: #1e293b; }
.sb-rank.r3 { background: linear-gradient(135deg, #fed7aa, #ea580c); color: #fff; }
.sb-who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sb-name { display: block; font-weight: 700; font-size: 14px; color: var(--text); }
a.sb-name:hover { color: var(--brand); }
.sb-branch { font-size: 12px; color: var(--muted); }
.sb-m { min-width: 0; font-variant-numeric: tabular-nums; }
.sb-m b { font-size: 15px; font-weight: 750; }
.sb-m small { display: block; font-size: 11.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; }
.sb-m.zero b { color: #c0c8d2; font-weight: 600; }
.sb-m.warn b { color: #dc2626; }
.sb-m.win b { color: #059669; }
.sb-m.money b { color: #0f172a; }
.sb-line { display: flex; align-items: center; gap: 6px; }
.sb-track { height: 6px; border-radius: 99px; background: var(--d-track); margin-top: 6px; overflow: hidden; }
.sb-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #34d399, #059669); }
.sb .rate-chip { display: inline-block; }

/* By branch: a bar for all calls with the connected share inside it. */
.br-row { padding: 10px 0; border-top: 1px solid #f1f4f8; }
.br-row:first-of-type { border-top: 0; }
.br-name { font-weight: 700; font-size: 14px; }
.br-track { height: 10px; border-radius: 99px; background: var(--d-track); margin: 8px 0 6px; overflow: hidden; }
.br-track .all { display: block; height: 100%; border-radius: 99px; background: #dbeafe; overflow: hidden; }
.br-track .conn { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #34d399, #059669); }
.br-meta { font-size: 12px; color: var(--muted); }
.br-meta b { color: var(--text-2); }

@media (max-width: 900px) {
  /* Each person becomes a card: name on top, their figures in a labelled grid. */
  .sb-labels { display: none !important; }
  .sb-row { padding: 14px 16px; gap: 8px; align-items: stretch; }
  .sb-row > .sb-who, .sb-row > .sb-rank { align-self: center; }
  .sb-calls .sb-row { grid-template-columns: 30px repeat(3, minmax(0, 1fr)); }
  .sb-calls .sb-row > .sb-who { grid-column: 2 / -1; }
  .sb-calls .sb-row > .sb-m:nth-child(3), .sb-calls .sb-row > .sb-m:nth-child(6) { grid-column-start: 2; }
  .sb-work .sb-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sb-work .sb-row > .sb-who { grid-column: 1 / -1; }
  .sb-m { background: #f8fafc; border-radius: 10px; padding: 8px 10px; }
  .sb-m::before { content: attr(data-label); display: block; font-size: 10px; font-weight: 700; letter-spacing: 0; text-transform: uppercase; color: #94a3b8; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sb-m b { font-size: 14px; }
}


/* Long lists on Home: five rows, then "Show N more" (28 Nov 2026). */
.card:not(.more-open) > .list-item.is-more, .card:not(.more-open) > div > .list-item.is-more { display: none; }
.show-more {
  display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
  padding: 12px 16px; border: 0; border-top: 1px solid #f1f4f8; background: #f8fafc;
  font: inherit; font-size: 13.5px; font-weight: 700; color: var(--brand); cursor: pointer;
}
.show-more:hover { background: #ecfdf5; }
.show-more svg { transition: transform .2s; }
.more-open > .show-more svg { transform: rotate(180deg); }

/* ==========================================================================
   Dial pad v2 (28 Nov 2026): one screen on a phone — recent calls with
   faces and coloured arrows, a big number with backspace, a phone-style
   keypad with letters, and the two extras side by side.
   ========================================================================== */
.sp-dialer { display: flex; flex-direction: column; padding: 14px 18px 18px; max-height: calc(100dvh - 32px); overflow-y: auto; overscroll-behavior: contain; }
.sp-dialer[hidden] { display: none; }
.sp-grab { display: none; width: 40px; height: 5px; border-radius: 99px; background: #d5dbe3; margin: 0 auto 10px; flex: none; }
.sp-dhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.sp-dhead h3 { font-size: 20px; font-weight: 800; letter-spacing: -.02em; }
.sp-cid { font-size: 12px; color: var(--muted); margin-top: 1px; }
.sp-x { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 0; background: #f1f5f9; color: #475569; display: grid; place-items: center; cursor: pointer; }
.sp-x:hover { background: #e2e8f0; }

.sp-dialer .sp-find { display: flex; align-items: center; gap: 8px; margin: 12px 0 8px; padding: 0 12px; border-radius: 12px; background: #f1f5f9; color: #64748b; border: 1px solid transparent; }
.sp-dialer .sp-find:focus-within { background: #fff; border-color: #a7f3d0; box-shadow: 0 0 0 3px #ecfdf5; }
.sp-dialer .sp-find input { flex: 1; min-width: 0; border: 0; background: none; box-shadow: none; padding: 11px 0; font-size: 14.5px; outline: 0; }

.sp-dialer .sp-results { border: 0; border-radius: 14px; background: #f8fafc; max-height: 32vh; padding: 4px; margin-bottom: 6px; flex: none; }
.sp-dialer .sp-recent::before { content: "Recent calls"; display: block; position: sticky; top: -4px; z-index: 1; padding: 6px 8px 4px; background: #f8fafc; font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #94a3b8; }
.sp-dialer .sp-result { background: transparent; border: 0; border-radius: 10px; padding: 7px 8px; gap: 10px; }
.sp-dialer .sp-result:hover { background: #fff; }
.sp-dialer .sp-result .av { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
  background: hsl(var(--h, 160) 70% 92%); color: hsl(var(--h, 160) 45% 32%); }
.sp-dialer .sp-result .t { flex: 1; }
.sp-dialer .sp-result .n { font-size: 14px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sp-dialer .sp-result.missed .n { color: #dc2626; }
.sp-dialer .sp-result .s { display: flex; align-items: center; gap: 4px; font-size: 12px; white-space: nowrap; overflow: hidden; }
.sp-dialer .sp-result .st { overflow: hidden; text-overflow: ellipsis; }
.sp-dialer .sp-result .a { display: inline-grid; place-items: center; width: auto; flex: none; font-style: normal; }
.sp-dialer .sp-result .a.out { color: #059669; }
.sp-dialer .sp-result .a.in { color: #2563eb; }
.sp-dialer .sp-result .a.miss { color: #dc2626; }
.sp-dialer .sp-result-wrap { gap: 4px; }
.sp-dialer .sp-result-wrap .wa-w-btn.compact { width: 34px; height: 34px; }

.sp-numrow { display: flex; align-items: center; gap: 6px; margin-top: 6px; padding: 0 4px 0 44px; border-bottom: 1px solid #eef1f5; }
.sp-dialer .sp-display { flex: 1; min-width: 0; border: 0; font-size: 28px; font-weight: 700; letter-spacing: .03em; padding: 10px 0; text-align: center; background: none; }
.sp-dialer .sp-display::placeholder { font-size: 18px; font-weight: 500; letter-spacing: 0; color: #b8c1cc; }
.sp-back { width: 40px; height: 40px; flex: none; border: 0; border-radius: 50%; background: none; color: #94a3b8; display: grid; place-items: center; cursor: pointer; touch-action: manipulation; }
.sp-back:hover, .sp-back:active { background: #f1f5f9; color: #334155; }

.sp-keys { gap: 8px 12px; margin: 12px 0 10px; }
.sp-keys button { width: 66px; height: 58px; border-radius: 20px; background: #f4f6f9; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1; font-size: 23px; font-weight: 600; transition: background .1s, transform .06s; touch-action: manipulation; }
.sp-keys button small { font-size: 9.5px; font-weight: 700; letter-spacing: .14em; color: #94a3b8; margin-top: 3px; min-height: 10px; }
.sp-keys button:active { transform: scale(.94); background: #d1fae5; }

.sp-dialer .sp-go { width: 64px; height: 64px; background: linear-gradient(180deg, #34d399, #059669); box-shadow: 0 12px 24px -10px rgba(5,150,105,.75); }
.sp-dialer .sp-go:active { transform: scale(.95); }
.sp-dfoot { display: flex; gap: 8px; margin-top: 14px; }
.sp-foot-btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 12px; border-radius: 12px; border: 1px solid #e2e8f0; background: #fff; color: #334155; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sp-foot-btn:hover { background: #f8fafc; color: #0f172a; }
.sp-foot-btn[hidden] { display: none; }

@media (max-width: 900px) {
  .sp-dialer { padding: 10px 18px calc(16px + env(safe-area-inset-bottom)); max-height: 94dvh; }
  .sp-grab { display: block; }
  .sp-keys { gap: 6px 10px; margin: 10px 0 8px; }
  .sp-keys button { width: 74px; height: 50px; justify-self: center; }
  .sp-dfoot { margin-top: 10px; }
}
@media (max-height: 760px) and (max-width: 900px) {
  .sp-dialer .sp-results { max-height: 24vh; }
  .sp-keys button { height: 48px; }
  .sp-dialer .sp-display { font-size: 24px; padding: 6px 0; }
}

/* ==========================================================================
   Call screens v2 (28 Nov 2026): a dark phone-style screen for the call in
   progress and for an incoming ring. Pulsing ring while it rings, a green
   ring once connected, glass controls, one big red end button.
   ========================================================================== */
.sp-call, .sp-ring {
  --c-glass: rgba(255,255,255,.08); --c-line: rgba(255,255,255,.12);
  color: #fff; border: 0;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(16,185,129,.28) 0%, rgba(16,185,129,0) 60%),
    radial-gradient(80% 50% at 100% 100%, rgba(59,130,246,.18) 0%, rgba(59,130,246,0) 60%),
    linear-gradient(180deg, #0b1220 0%, #0d1f2d 60%, #0a2626 100%);
}
.sp-call { width: 340px; padding: 22px 20px 20px; }
.sp-call .sp-call-card, .sp-ring { text-align: center; }
.sp-state { font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: #6ee7b7; display: flex; justify-content: center; align-items: center; gap: 6px; }
.sp-call:not(.live) .sp-state { color: #93c5fd; }
.sp-face { position: relative; width: 96px; height: 96px; margin: 16px auto 12px; display: grid; place-items: center; }
.sp-face .avatar { --s: 84px !important; font-size: 28px; box-shadow: 0 0 0 4px rgba(255,255,255,.08); }
.sp-face::before, .sp-face::after { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid rgba(147,197,253,.5); animation: sp-wave 2s ease-out infinite; }
.sp-face::after { animation-delay: 1s; }
.sp-call.live .sp-face::before, .sp-call.live .sp-face::after { animation: none; border-color: rgba(52,211,153,.7); inset: 2px; }
.sp-call.live .sp-face::after { display: none; }
.sp-face.ringing::before, .sp-face.ringing::after { border-color: rgba(52,211,153,.6); }
@keyframes sp-wave { 0% { transform: scale(.9); opacity: 1; } 100% { transform: scale(1.45); opacity: 0; } }
.sp-call h3, .sp-ring h3 { font-size: 22px; font-weight: 800; letter-spacing: -.02em; color: #fff; overflow-wrap: anywhere; }
.sp-num { font-size: 14px; color: rgba(226,232,240,.7); margin-top: 2px; font-variant-numeric: tabular-nums; }
.sp-call .sp-timer { font-size: 34px; font-weight: 300; letter-spacing: .04em; color: #fff; margin: 10px 0 12px; }
.sp-call:not(.live) .sp-timer { opacity: .35; }
.sp-call-extras { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sp-call-extras:not(:has(> :not([hidden]))) { display: none; }
.sp-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; background: var(--c-glass); border: 1px solid var(--c-line); color: #fff; font-size: 13px; font-weight: 600; }
.sp-chip:hover { background: rgba(255,255,255,.14); color: #fff; }
.sp-chip[hidden] { display: none; }
.sp-call #sp-wa-welcome { margin: 0; background: rgba(37,211,102,.16); border-color: rgba(37,211,102,.4); color: #a7f3c9; }
.sp-call #sp-wa-welcome svg { fill: #4ade80; }
.sp-call #sp-wa-welcome.wa-w-ok { background: rgba(37,211,102,.3); color: #fff; }
.sp-call #sp-wa-welcome.wa-w-err { background: rgba(239,68,68,.2); border-color: rgba(239,68,68,.5); color: #fecaca; }

.sp-ctrls { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px 0; margin: 18px 0 6px; }
.sp-ctrls > div { flex: 0 0 33.333%; text-align: center; font-size: 11.5px; font-weight: 500; color: rgba(226,232,240,.75); }
.sp-ctrls > div[hidden] { display: none; }
.sp-ctrls .round-btn { width: 56px; height: 56px; margin: 0 auto 6px; background: var(--c-glass); color: #fff; border: 1px solid var(--c-line); transition: background .12s, transform .06s; }
.sp-ctrls .round-btn:hover { background: rgba(255,255,255,.16); }
.sp-ctrls .round-btn:active { transform: scale(.94); }
.sp-ctrls .round-btn.on { background: #fff; color: #0f172a; border-color: #fff; }
.sp-end { display: flex; justify-content: center; margin-top: 12px; }
.sp-end .round-btn.red { width: 68px; height: 68px; background: linear-gradient(180deg, #f87171, #dc2626); box-shadow: 0 14px 28px -12px rgba(220,38,38,.9); }
.sp-end .round-btn.red:active { transform: scale(.95); }

.sp-call .sp-dtmf { margin: 14px 0 4px; }
.sp-call .sp-dtmf button { background: var(--c-glass); color: #fff; border: 1px solid var(--c-line); height: 50px; }
.sp-call .sp-dtmf button:active { background: rgba(52,211,153,.3); }
.sp-call .sp-transfer { background: rgba(255,255,255,.95); color: var(--text); text-align: left; margin-top: 14px; }

/* Incoming ring */
.sp-ring-back { background: rgba(2,6,23,.6); }
.sp-ring { max-width: 380px; padding: 28px 24px 30px; box-shadow: 0 30px 80px -20px rgba(2,6,23,.8); }
.sp-ring .sp-state { color: #6ee7b7; }
.sp-in-details { min-height: 18px; margin-top: 10px; font-size: 13px; color: rgba(226,232,240,.8); }
.sp-in-details .badge { margin: 2px; }
.sp-ring-actions { display: flex; justify-content: center; gap: 64px; margin-top: 28px; }
.sp-ring-actions > div { text-align: center; font-size: 12px; font-weight: 600; color: rgba(226,232,240,.8); }
.sp-ring-actions .round-btn { width: 68px; height: 68px; margin: 0 auto 8px; }
.sp-ring-actions .round-btn.red { background: linear-gradient(180deg, #f87171, #dc2626); }
.sp-ring-actions .round-btn.green { background: linear-gradient(180deg, #34d399, #059669); }

@media (max-width: 900px) {
  /* The call takes the whole phone screen, like the phone's own call screen. */
  .sp-call { top: 0; left: 0; right: 0; width: auto; border-radius: 0; display: flex; flex-direction: column; justify-content: space-between;
    padding: calc(28px + env(safe-area-inset-top)) 22px calc(28px + env(safe-area-inset-bottom)); overflow-y: auto; }
  .sp-call[hidden] { display: none; }
  .sp-call .sp-call-card { padding-top: 4vh; }
  .sp-face { width: 116px; height: 116px; margin-top: 22px; }
  .sp-face .avatar { --s: 100px !important; font-size: 32px; }
  .sp-call h3, .sp-ring h3 { font-size: 26px; }
  .sp-ctrls { gap: 18px 0; }
  .sp-ctrls .round-btn { width: 62px; height: 62px; }
  .sp-ring-back { padding: 0; place-items: stretch; }
  .sp-ring { max-width: none; border-radius: 0; display: flex; flex-direction: column; justify-content: center;
    padding: calc(28px + env(safe-area-inset-top)) 24px calc(40px + env(safe-area-inset-bottom)); }
  .sp-ring .sp-ring-actions { margin-top: auto; padding-top: 40px; }
}
.sp-in-details a { color: #6ee7b7; font-weight: 600; }

/* ==========================================================================
   Leads list v2 (28 Nov 2026): pipeline stages in the header (each one a
   filter), the filters in one bar, and each lead as a row of what matters —
   stage, model, owner, next follow-up, calls — with Call and WhatsApp to hand.
   ========================================================================== */
.leads-v2 .tone-blue { --tone: #60a5fa; }
.leads-v2 .tone-cyan { --tone: #22d3ee; }
.leads-v2 .tone-violet { --tone: #a78bfa; }
.leads-v2 .tone-green { --tone: #34d399; }
.leads-v2 .tone-teal { --tone: #2dd4bf; }
.leads-v2 .tone-grey { --tone: #94a3b8; }

.ld-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(112px, 1fr)); gap: 10px; margin-top: 20px; }
.ld-stage { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 11px 13px 13px; border-radius: 14px; color: #fff;
  background: rgba(255,255,255,.055); border: 1px solid rgba(255,255,255,.1); overflow: hidden; transition: background .12s, transform .12s; }
.ld-stage:hover { background: rgba(255,255,255,.1); color: #fff; transform: translateY(-1px); }
.ld-stage.on { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); }
.ld-stage-l { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; color: rgba(226,232,240,.75); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ld-stage-l i { width: 7px; height: 7px; border-radius: 50%; background: var(--tone, #94a3b8); flex: none; }
.ld-stage b { font-size: 21px; font-weight: 800; letter-spacing: -.02em; }
.ld-stage.zero b { color: rgba(226,232,240,.45); }
.ld-stage-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255,255,255,.06); }
.ld-stage-bar i { display: block; height: 100%; background: var(--tone, #94a3b8); }

.leads-v2 > .row.between .seg { background: var(--d-track); border-radius: 11px; }
.leads-v2 > .row.between .seg a.on { background: #0f172a; color: #fff; }

.ld-list { overflow: hidden; }
.ld-head { display: flex; align-items: center; gap: 12px; padding: 13px 20px; font-size: 13px; font-weight: 700; color: var(--text-2); border-bottom: 1px solid var(--d-line); background: #f8fafc; }
.ld-head .muted { margin-left: auto; }
.ld-check { margin: 0; display: grid; place-items: center; width: 20px; flex: none; }
.ld-check input { width: 16px; height: 16px; margin: 0; }

.ld-row { display: grid; align-items: center; gap: 8px 16px; padding: 12px 20px; border-bottom: 1px solid #f1f4f8;
  grid-template-columns: minmax(0, 1.7fr) minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 1.2fr) auto; transition: background .12s; }
.ld-list:has(.ld-check) .ld-row { grid-template-columns: 20px minmax(0, 1.7fr) minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 1.2fr) auto; }
.ld-row:hover { background: #fafbfd; }
.ld-who { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ld-name { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.ld-name a { color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.ld-name a:hover { color: var(--brand); }
.ld-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; font-variant-numeric: tabular-nums; }
.ld-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.ld-pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 8px; border-radius: 99px; font-size: 12px; font-weight: 700;
  background: color-mix(in srgb, var(--tone, #94a3b8) 14%, #fff); color: color-mix(in srgb, var(--tone, #94a3b8) 70%, #0f172a); white-space: nowrap; }
.ld-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--tone, #94a3b8); }
.ld-tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 7px; background: #f1f5f9; color: #475569; white-space: nowrap; flex: none; }
.ld-tag.amber { background: #fffbeb; color: #b45309; }
.ld-tag.blue { background: #eff6ff; color: #1d4ed8; }
.ld-tag.red { background: #fef2f2; color: #b91c1c; }
.ld-owner { display: flex; align-items: center; gap: 8px; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text-2); }
.ld-owner small { font-weight: 500; color: var(--muted); font-size: 12px; }
.ld-next { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.ld-due { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 8px; background: #f1f5f9; color: #475569; white-space: nowrap; }
.ld-due.late { background: #fef2f2; color: #b91c1c; }
.ld-due.today { background: #fffbeb; color: #b45309; }
.ld-due.later { background: #eff6ff; color: #1d4ed8; }
.ld-due.none { background: none; color: #b8c1cc; font-weight: 500; padding-left: 0; }
.ld-calls { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.ld-actions { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.ld-actions .wa-w-btn.compact { width: 34px; height: 34px; }
.ld-call { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 99px; border: 1px solid #a7f3d0; background: #ecfdf5; color: #047857; font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.ld-call:hover { background: #059669; border-color: #059669; color: #fff; }

@media (max-width: 900px) {
  .ld-stages { display: flex; overflow-x: auto; scrollbar-width: none; margin: 18px -18px 0; padding: 0 18px; gap: 8px; }
  .ld-stage { flex: 0 0 auto; min-width: 104px; }
  .ld-head { padding: 12px 14px; }
  .ld-row, .ld-list:has(.ld-check) .ld-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "who act" "meta meta" "own next";
    padding: 14px; gap: 10px 10px;
  }
  .ld-who { grid-area: who; }
  .ld-actions { grid-area: act; }
  .ld-meta { grid-area: meta; padding-left: 52px; }
  .ld-owner { grid-area: own; padding-left: 52px; font-size: 12.5px; }
  .ld-next { grid-area: next; justify-content: flex-end; }
  .ld-call { width: 38px; height: 38px; padding: 0; justify-content: center; }
  .ld-actions .wa-w-btn.compact { width: 38px; height: 38px; }
}
@media (max-width: 420px) {
  .ld-row, .ld-list:has(.ld-check) .ld-row { grid-template-areas: "who act" "meta meta" "own own" "next next"; }
  .ld-next { justify-content: flex-start; padding-left: 52px; }
}

/* ==========================================================================
   Lead details v2 (28 Nov 2026): dark header with the customer and the three
   actions, a pipeline track, fact tiles, follow-ups, and one timeline.
   ========================================================================== */
.lead-v2 .tone-blue { --tone: #60a5fa; } .lead-v2 .tone-cyan { --tone: #22d3ee; } .lead-v2 .tone-violet { --tone: #a78bfa; }
.lead-v2 .tone-green { --tone: #34d399; } .lead-v2 .tone-teal { --tone: #2dd4bf; } .lead-v2 .tone-grey { --tone: #94a3b8; }
.lv-top { display: flex; gap: 16px; align-items: center; }
.lv-top > .avatar { box-shadow: 0 0 0 4px rgba(255,255,255,.08); flex: none; }
.lv-id { min-width: 0; }
.lv-id h1 { font-size: 26px; overflow-wrap: anywhere; }
.lv-id p { margin-top: 2px; font-variant-numeric: tabular-nums; }
.lv-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.lead-v2 .hero .ld-pill { background: color-mix(in srgb, var(--tone) 22%, transparent); color: #fff; border: 1px solid color-mix(in srgb, var(--tone) 45%, transparent); }
.lv-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); color: rgba(226,232,240,.9); }
.lv-actions { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.lv-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: 12px; font: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.16); color: #fff; transition: background .12s, transform .06s; }
.lv-btn:hover { background: rgba(255,255,255,.16); color: #fff; }
.lv-btn:active { transform: scale(.97); }
.lv-btn.call { background: linear-gradient(180deg, #34d399, #059669); border-color: transparent; box-shadow: 0 10px 22px -10px rgba(5,150,105,.9); }
.lv-btn.lv-wa { background: rgba(37,211,102,.16); border-color: rgba(37,211,102,.45); color: #a7f3c9; }
.lv-btn.lv-wa.wa-w-ok { background: rgba(37,211,102,.32); color: #fff; }
.lv-btn.lv-wa.wa-w-err { background: rgba(239,68,68,.2); border-color: rgba(239,68,68,.5); color: #fecaca; }

.lv-steps { display: flex; margin-top: 22px; }
.lv-step { flex: 1; position: relative; text-align: center; font-size: 11.5px; font-weight: 600; color: rgba(226,232,240,.55); }
.lv-step::before { content: ""; position: absolute; top: 7px; left: -50%; right: 50%; height: 3px; background: rgba(255,255,255,.12); }
.lv-step:first-child::before { display: none; }
.lv-step i { position: relative; z-index: 1; display: block; width: 16px; height: 16px; margin: 0 auto 7px; border-radius: 50%; background: #1e293b; border: 2px solid rgba(255,255,255,.25); }
.lv-step.done, .lv-step.current { color: #fff; }
.lv-step.done i { background: #34d399; border-color: #34d399; }
.lv-step.done::before, .lv-step.current::before { background: #34d399; }
.lv-step.current i { background: #fff; border-color: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.3); }
.lv-lost { margin-top: 18px; display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; background: rgba(239,68,68,.16); border: 1px solid rgba(239,68,68,.4); color: #fecaca; font-weight: 600; font-size: 13.5px; }

.lv-facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.lv-fact { background: var(--surface); border: 1px solid var(--d-line); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.lv-fact span { display: block; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: #94a3b8; margin-bottom: 4px; }
.lv-fact b { font-size: 14.5px; font-weight: 700; color: var(--text); display: block; overflow-wrap: anywhere; }
.lv-fact b small { font-size: 12px; font-weight: 500; color: var(--muted); }
.lv-fact .lv-who { display: flex; align-items: center; gap: 7px; min-width: 0; }
.lv-fact .lv-none { color: #b91c1c; }
.lv-fact.red { background: #fef2f2; border-color: #fecaca; } .lv-fact.red b { color: #b91c1c; }
.lv-fact.amber { background: #fffbeb; border-color: #fde68a; } .lv-fact.amber b { color: #b45309; }
.lv-fact.blue b { color: #1d4ed8; }
.lv-fact.green { background: #ecfdf5; border-color: #a7f3d0; } .lv-fact.green b { color: #047857; }

.lv-fu { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-top: 1px solid #f1f4f8; }
.lv-fu-ico { width: 34px; height: 34px; flex: none; border-radius: 10px; display: grid; place-items: center; background: #eff6ff; color: #2563eb; }
.lv-fu.late .lv-fu-ico { background: #fef2f2; color: #dc2626; }
.lv-fu.done { opacity: .6; } .lv-fu.done .lv-fu-ico { background: #ecfdf5; color: #059669; }
.lv-fu-t { font-weight: 700; font-size: 13.5px; }
.lv-fu-s { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.lv-late { margin-left: 6px; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: #fef2f2; color: #b91c1c; }

.lv-note { display: flex; gap: 10px; align-items: flex-end; padding: 14px 20px; border-bottom: 1px solid var(--d-line); background: #fcfdfe; }
.lv-note textarea { flex: 1; min-width: 0; resize: vertical; min-height: 44px; border-radius: 12px; }
.lv-tl { position: relative; padding: 8px 20px 12px; }
.lv-tl::before { content: ""; position: absolute; left: 36px; top: 16px; bottom: 16px; width: 2px; background: #eef1f6; }
.lv-ev { position: relative; display: flex; gap: 14px; padding: 10px 0; }
.lv-dot { position: relative; z-index: 1; width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 4px #fff; }
.lv-ev.note .lv-dot { background: #fffbeb; color: #d97706; }
.lv-ev.sys .lv-dot { background: #f1f5f9; color: #64748b; }
.lv-ev .lv-dot.cl-ico { border-radius: 50%; }
.lv-body { flex: 1; min-width: 0; padding-top: 2px; }
.lv-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lv-line b { font-size: 13.5px; }
.lv-line .cl-play { width: 28px; height: 28px; }
.lv-when { font-size: 12px; color: var(--muted); margin-top: 2px; }
.lv-out { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 6px; }
.lv-ev.note .lv-text { background: #fffbeb; border: 1px solid #fef3c7; border-radius: 4px 14px 14px 14px; padding: 9px 12px; font-size: 13.5px; white-space: pre-line; color: #422006; }
.lv-ev.sys .lv-text { font-size: 13px; font-weight: 600; color: var(--text-2); white-space: pre-line; }
.lv-ev .cl-player { margin-top: 8px; }
.lv-ev .cl-player audio { width: 100%; max-width: 420px; height: 36px; }
.card:not(.more-open) > .lv-fu.is-more, .card:not(.more-open) > .lv-tl > .lv-ev.is-more { display: none; }

.lv-edit { padding: 0 !important; align-self: start; }
.lv-edit > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; cursor: pointer; font-weight: 700; font-size: 15px; }
.lv-edit > summary::-webkit-details-marker { display: none; }
.lv-edit > summary span { display: inline-flex; align-items: center; gap: 8px; }
.lv-edit > summary svg:last-child { transition: transform .2s; color: var(--muted); }
.lv-edit[open] > summary svg:last-child { transform: rotate(180deg); }
.lv-edit > form { padding: 0 20px 20px; margin-top: 0 !important; }

@media (max-width: 900px) {
  .lv-top { align-items: flex-start; }
  .lv-top > .avatar { --s: 52px !important; }
  .lv-id h1 { font-size: 22px; }
  .lv-actions { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .lv-btn { padding: 0 8px; font-size: 13px; height: 46px; }
  .lv-btn.call { grid-column: 1 / -1; height: 50px; font-size: 15px; }
  .lv-actions:has(.lv-btn.lv-wa) .lv-btn:not(.call) { grid-column: span 1; }
  .lv-actions { grid-template-columns: 1fr 1fr; }
  .lv-step span { font-size: 10px; }
  .lv-facts { grid-template-columns: 1fr 1fr; }
  .lv-note { flex-direction: column; align-items: stretch; padding: 12px 14px; }
  .lv-tl { padding: 6px 14px 10px; }
  .lv-tl::before { left: 30px; }
  .lv-fu { padding: 12px 14px; }
}

/* ==========================================================================
   Phone "More" sheet v2 (28 Nov 2026): who you are, two quick actions, then
   every page as a coloured tile in a 3-across grid, grouped like the sidebar.
   ========================================================================== */
.more-v2 { background: #f6f8fb; padding: 10px 14px calc(18px + env(safe-area-inset-bottom)); max-height: 90vh; }
.more-v2 [hidden] { display: none !important; }
.more-v2 .ms-me { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 18px; color: #fff;
  background: radial-gradient(80% 120% at 100% 0%, rgba(16,185,129,.35), transparent 60%), linear-gradient(135deg, #0b1220, #0d1f2d 60%, #0b2a2a); }
.more-v2 .ms-me .avatar { box-shadow: 0 0 0 3px rgba(255,255,255,.12); }
.more-v2 .ms-name { font-weight: 800; font-size: 16px; }
.more-v2 .ms-role { font-size: 12px; color: rgba(226,232,240,.7); margin-top: 1px; }
.more-v2 .ms-avail { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: #fff; flex: none; }
.more-v2 .ms-avail option { color: #0f172a; }

.more-v2 .ms-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.more-v2 .ms-q { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 10px; border-radius: 14px; font-weight: 700; font-size: 13.5px; width: auto; }
.more-v2 .ms-q.green { background: #059669; color: #fff; box-shadow: 0 8px 18px -10px rgba(5,150,105,.9); }
.more-v2 .ms-q.blue { background: #fff; color: #1d4ed8; border: 1px solid #dbeafe; }
.more-v2 .ms-q:hover { filter: brightness(1.05); }

.more-v2 .ms-label { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: #94a3b8; padding: 16px 4px 8px; }
.more-v2 .ms-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.more-v2 .ms-tile { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 8px; padding: 14px 6px 12px; border-radius: 16px;
  background: #fff; border: 1px solid #e8ecf2; color: var(--text); text-align: center; width: auto; font-weight: 600; transition: transform .08s, box-shadow .12s; }
.more-v2 .ms-tile:active { transform: scale(.96); }
.more-v2 .ms-tile:hover { box-shadow: 0 8px 20px -14px rgba(15,23,42,.4); background: #fff; }
.more-v2 .ms-ico { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; background: var(--t-bg, #f1f5f9); color: var(--t-fg, #475569); }
.more-v2 .ms-t { font-size: 12px; line-height: 1.25; font-weight: 600; color: #1e293b; overflow-wrap: anywhere; }
.more-v2 .tone-green { --t-bg: #ecfdf5; --t-fg: #059669; }
.more-v2 .tone-blue { --t-bg: #eff6ff; --t-fg: #2563eb; }
.more-v2 .tone-violet { --t-bg: #f5f3ff; --t-fg: #7c3aed; }
.more-v2 .tone-amber { --t-bg: #fffbeb; --t-fg: #d97706; }
.more-v2 .tone-cyan { --t-bg: #ecfeff; --t-fg: #0891b2; }
.more-v2 .tone-rose { --t-bg: #fff1f2; --t-fg: #e11d48; }
.more-v2 .tone-teal { --t-bg: #f0fdfa; --t-fg: #0d9488; }
.more-v2 .tone-indigo { --t-bg: #eef2ff; --t-fg: #4f46e5; }
.more-v2 .tone-slate { --t-bg: #f1f5f9; --t-fg: #334155; }

.more-v2 .ms-foot { margin-top: 16px; background: #fff; border: 1px solid #e8ecf2; border-radius: 16px; overflow: hidden; }
.more-v2 .ms-foot form { margin: 0; }
.more-v2 .ms-row { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 0; font-weight: 600; font-size: 14px; color: var(--text); border-top: 1px solid #f1f4f8; width: 100%; }
.more-v2 .ms-foot > :first-child.ms-row, .more-v2 .ms-foot > [hidden] + .ms-row { border-top: 0; }
.more-v2 .ms-row svg { color: #64748b; }
.more-v2 .ms-out { color: #dc2626 !important; }
.more-v2 .ms-out svg { color: #dc2626; }

/* ==========================================================================
   WhatsApp v3 (28 Nov 2026): WhatsApp Web on a computer — the chat list on
   the left, the open chat on the right, a welcome pane when none is open.
   A phone keeps one screen at a time: the list, or the chat.
   ========================================================================== */
.wa-split { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); height: calc(100dvh - 150px); min-height: 520px;
  border-radius: 18px; overflow: hidden; border: 1px solid #d1d7db; background: #fff;
  box-shadow: 0 1px 2px rgba(11,20,26,.06), 0 18px 40px -24px rgba(11,20,26,.3); }
.wa-split > .wa-list { display: flex; flex-direction: column; min-height: 0; border: 0; border-right: 1px solid #e9edef; border-radius: 0; box-shadow: none; }
.wa-split > .wa-list .wa-list-head { background: #fff; position: sticky; top: 0; z-index: 1; }
.wa-split > .wa-list .wa-chats { flex: 1; overflow-y: auto; min-height: 0; }
.wa-split > .wa { height: 100%; min-height: 0; border: 0; border-radius: 0; box-shadow: none; }
.wa-chat.active { background: #f0f2f5; }
.wa-chat.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: #00a884; }

.wa-pane-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px; gap: 6px;
  background: #f8f9fa; border-bottom: 6px solid #25d366; color: #41525d; }
.wa-empty-art { width: 112px; height: 112px; border-radius: 50%; display: grid; place-items: center; background: #fff; box-shadow: 0 12px 30px -16px rgba(11,20,26,.35); margin-bottom: 14px; }
.wa-pane-empty h2 { font-size: 24px; font-weight: 300; color: #111b21; }
.wa-pane-empty p { font-size: 14px; color: #667781; line-height: 1.6; max-width: 420px; }
.wa-empty-stats { display: flex; gap: 12px; margin: 18px 0 8px; }
.wa-empty-stats > div { min-width: 96px; padding: 12px 14px; border-radius: 14px; background: #fff; border: 1px solid #e9edef; }
.wa-empty-stats b { display: block; font-size: 22px; font-weight: 800; color: #111b21; }
.wa-empty-stats span { font-size: 12px; color: #667781; }
.wa-empty-lock { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px !important; margin-top: 14px; }

/* On a phone: the list page shows only the list; the chat page only the chat. */
@media (max-width: 1000px) {
  .wa-split { display: block; height: auto; min-height: 0; border: 0; border-radius: 0; box-shadow: none; background: none; overflow: visible; }
  .wa-split .wa-pane-empty { display: none; }
  .wa-split.is-chat > .wa-list { display: none; }
  .wa-split > .wa-list { border: 1px solid #d1d7db; border-radius: 18px; box-shadow: 0 1px 2px rgba(11,20,26,.06), 0 18px 40px -24px rgba(11,20,26,.25); }
  .wa-split > .wa { height: calc(100dvh - 150px); border: 1px solid #d1d7db; border-radius: 18px; }
  .wa-split > .wa .wa-back { display: grid; }
}
@media (max-width: 900px) {
  .wa-split > .wa-list { margin: 0 -8px; border-radius: 14px; }
  .wa-split > .wa { height: calc(100dvh - 64px - var(--tabbar-h) - env(safe-area-inset-bottom) - 20px); min-height: 380px; border-radius: 14px; margin: 0 -8px; }
}
@media (min-width: 1001px) {
  /* The list is right there, so the back arrow is not needed. */
  .wa-split > .wa .wa-back { display: none; }
}

/* ==========================================================================
   Attendance v2 (28 Nov 2026): a dark header with the clock and one big punch
   button, month tiles, and each day as a row with a bar against the shift.
   ========================================================================== */
.att-v2 .att-hero { text-align: center; padding-bottom: 26px; }
.att-clock { font-size: 56px; font-weight: 300; letter-spacing: -.02em; line-height: 1.05; margin-top: 6px; font-variant-numeric: tabular-nums; }
.att-clock small { font-size: 18px; font-weight: 600; margin-left: 6px; color: rgba(226,232,240,.7); }
.att-status { display: inline-flex; align-items: center; gap: 8px; margin-top: 12px; padding: 6px 14px; border-radius: 99px; font-size: 13.5px; font-weight: 700;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: rgba(226,232,240,.9); }
.att-status.in { background: rgba(16,185,129,.18); border-color: rgba(52,211,153,.45); color: #a7f3d0; }
.att-dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; }
.att-status.in .att-dot { background: #34d399; box-shadow: 0 0 0 4px rgba(52,211,153,.25); animation: att-blink 2s ease-in-out infinite; }
@keyframes att-blink { 50% { box-shadow: 0 0 0 7px rgba(52,211,153,.05); } }
.att-since { font-size: 13px; color: rgba(226,232,240,.65); margin-top: 6px; }
.att-stage { margin-top: 14px; }
.att-v2 .att-cam, .att-v2 .att-shot { border: 3px solid rgba(255,255,255,.25); box-shadow: 0 12px 30px -12px rgba(0,0,0,.6); }
.att-punch { display: grid; place-items: center; width: 132px; height: 132px; margin: 18px auto 0; border-radius: 50%; border: 0; cursor: pointer;
  font: inherit; font-size: 17px; font-weight: 800; color: #fff; transition: transform .08s; position: relative; }
.att-punch::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; border: 2px solid currentColor; opacity: .25; }
.att-punch.in { background: radial-gradient(circle at 30% 25%, #6ee7b7, #059669 70%); box-shadow: 0 18px 40px -14px rgba(5,150,105,.9); color: #fff; }
.att-punch.in::after { border-color: #34d399; animation: sp-wave 2.2s ease-out infinite; opacity: 1; }
.att-punch.out { background: radial-gradient(circle at 30% 25%, #fca5a5, #dc2626 70%); box-shadow: 0 18px 40px -14px rgba(220,38,38,.9); }
.att-punch.out::after { border-color: #f87171; }
.att-punch:active { transform: scale(.96); }
.att-punch:disabled { opacity: .75; cursor: progress; font-size: 12.5px; padding: 0 14px; }
.att-where { min-height: 18px; margin-top: 14px; font-size: 12.5px; color: rgba(226,232,240,.75); }
.att-err { margin-top: 8px; font-size: 13px; color: #fecaca; }
.att-note { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: rgba(226,232,240,.55); }
.att-banner { padding: 14px 16px; border-radius: 14px; background: #fffbeb; border: 1px solid #fde68a; color: #78350f; font-size: 13.5px; line-height: 1.5; }
.att-banner b { display: block; color: #92400e; }

.att-today { padding: 4px 0; }
.att-punchrow { display: flex; align-items: center; gap: 12px; padding: 10px 20px; border-top: 1px solid #f1f4f8; }
.att-punchrow:first-child { border-top: 0; }
.att-pi { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.att-pi.in { background: #ecfdf5; color: #059669; } .att-pi.out { background: #fef2f2; color: #dc2626; }
.att-pt { font-size: 13.5px; color: var(--text-2); } .att-pt b { color: var(--text); margin-right: 4px; }
.att-ps { font-size: 12px; color: var(--muted); }
.att-photo { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: #f1f5f9; color: #475569; }

.att-month { width: auto; padding: 8px 10px; border-radius: 10px; }
.att-month.dark { background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); color: #fff; color-scheme: dark; }
.att-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.att-tile { background: var(--surface); border: 1px solid var(--d-line); border-radius: 16px; padding: 14px 16px; border-top: 3px solid #cbd5e1; }
.att-tile span { display: block; font-size: 11.5px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .04em; }
.att-tile b { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.att-tile b small { font-size: 14px; font-weight: 600; color: var(--muted); }
.att-tile.green { border-top-color: #10b981; } .att-tile.blue { border-top-color: #3b82f6; }
.att-tile.amber { border-top-color: #f59e0b; } .att-tile.amber b { color: #b45309; } .att-tile.violet { border-top-color: #8b5cf6; }

.att-day { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 12px 20px; border-top: 1px solid #f1f4f8; }
.att-day:first-child { border-top: 0; }
.att-day.today { background: #f0fdf4; }
.att-date { width: 48px; text-align: center; border-radius: 12px; padding: 6px 0; background: #f1f5f9; }
.att-date b { display: block; font-size: 18px; font-weight: 800; line-height: 1.1; }
.att-date span { font-size: 10.5px; font-weight: 700; text-transform: uppercase; color: #64748b; }
.att-day.today .att-date { background: #059669; } .att-day.today .att-date b, .att-day.today .att-date span { color: #fff; }
.att-day.sun .att-date span { color: #dc2626; }
.att-io { display: flex; gap: 16px; font-size: 13px; font-weight: 600; color: var(--text-2); font-variant-numeric: tabular-nums; }
.att-io span { display: inline-flex; align-items: center; gap: 6px; }
.att-io i { width: 8px; height: 8px; border-radius: 50%; } .att-io i.in { background: #10b981; } .att-io i.out { background: #ef4444; }
.att-bar { height: 7px; border-radius: 99px; background: var(--d-track); margin-top: 7px; overflow: hidden; }
.att-bar i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #34d399, #059669); }
.att-bar.open i { background: repeating-linear-gradient(45deg, #34d399 0 6px, #6ee7b7 6px 12px); }
.att-hrs { text-align: right; }
.att-hrs b { display: block; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.att-late { display: inline-block; margin-top: 3px; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: #fffbeb; color: #b45309; }

.att-person { display: flex !important; align-items: center; gap: 10px; }
.att-person > span { display: flex; flex-direction: column; line-height: 1.2; }
.att-person small { font-size: 12px; font-weight: 500; color: var(--muted); }

@media (max-width: 900px) {
  .att-clock { font-size: 46px; }
  .att-tiles { grid-template-columns: 1fr 1fr; }
  .att-day { padding: 12px 14px; gap: 10px; grid-template-columns: 48px minmax(0, 1fr) auto; }
  .att-io { gap: 10px; font-size: 12.5px; }
  .att-punchrow { padding: 10px 14px; }
}
