/* ==========================================================================
   NEXORA AI — application shell (business dashboard + super admin + auth)
   ========================================================================== */

:root { --sidebar-w: 268px; --topbar-h: 64px; }

/* Dashboards and auth pages use Plus Jakarta Sans; Bangla falls back to Noto Sans Bengali. */
.ui { --font: "Plus Jakarta Sans", "Noto Sans Bengali", "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; font-feature-settings: normal; }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.main { min-width: 0; display: flex; flex-direction: column; }
[data-theme="dark"] .main { background: radial-gradient(1000px 520px at 100% 0%, color-mix(in oklab, var(--brand) 8%, transparent), transparent 62%); }

/* ---------- Brand ---------- */
.brand-mark { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: #fff; flex-shrink: 0; background: linear-gradient(140deg, var(--brand), color-mix(in oklab, var(--brand) 45%, #0ea5e9)); box-shadow: inset 0 1px 0 rgba(255,255,255,.3), 0 6px 14px -4px color-mix(in oklab, var(--brand) 60%, transparent); }
.brand-mark .icon { width: 18px; height: 18px; stroke-width: 2.2; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: inherit; }
/* An uploaded square logo sits on a white tile, the way app icons do; the thin ring keeps it visible on a white header. */
.brand-mark.has-image, .sidebar .brand-mark.has-image { background: #fff; overflow: hidden; box-shadow: 0 0 0 1px rgba(15, 23, 42, .08), 0 6px 14px -6px rgba(15, 23, 42, .35); }
.brand-logo { height: 30px; width: auto; }
.brand-name { font-weight: 720; font-size: 16px; letter-spacing: -.025em; line-height: 1.1; }
.brand-name small { display: block; font-size: 11px; font-weight: 550; letter-spacing: 0; color: var(--text-3); margin-top: 2px; }
.brand-name .tag { display: inline-block; font-size: 10px; font-weight: 700; letter-spacing: .04em; padding: 1px 6px; border-radius: 5px; background: var(--ink); color: #fff; vertical-align: 2px; margin-left: 4px; }
/* Logo tagline (Site settings → Brand): small spaced capitals under the name, like SOFTWARE COMPANY. */
.brand-name .brand-tagline { display: block; max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; line-height: 1.2; color: var(--text-3); margin-top: 4px; }
/* Spaced capitals don't exist in Bangla, and tracking pulls its letters apart. */
.brand-name .brand-tagline.is-bn { font-size: 11px; font-weight: 600; letter-spacing: 0; text-transform: none; line-height: 1.45; margin-top: 1px; }

/* ---------- Sidebar: deep teal in both themes ---------- */
.sidebar {
  --sb-text: #b9cac7; --sb-strong: #f5f7f2; --sb-muted: #7f9794;
  --sb-line: rgba(245, 247, 242, .085); --sb-hover: rgba(245, 247, 242, .055);
  --sb-accent: color-mix(in oklab, var(--brand) 70%, #fff);
  position: sticky; top: 0; height: 100vh; z-index: 50; display: flex; flex-direction: column;
  color: var(--sb-text); border-right: 1px solid var(--sb-line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ink) 88%, #0c4f52), color-mix(in srgb, var(--ink) 76%, #000));
}
.sidebar-brand { height: var(--topbar-h); display: flex; align-items: center; gap: 11px; padding: 0 20px; flex-shrink: 0; color: var(--sb-strong); border-bottom: 1px solid var(--sb-line); }
.sidebar-brand:hover { color: var(--sb-strong); }
.sidebar .brand-name { color: var(--sb-strong); font-size: 16.5px; }
.sidebar .brand-name small { color: var(--sb-muted); font-size: 9.5px; font-weight: 700; letter-spacing: .17em; text-transform: uppercase; margin-top: 5px; }
.sidebar .brand-name .tag { background: color-mix(in oklab, var(--brand) 85%, #000); }
.sidebar .brand-mark { width: 36px; height: 36px; border-radius: 11px; box-shadow: inset 0 1px 0 rgba(255,255,255,.28), 0 0 0 1px rgba(255,255,255,.07), 0 10px 20px -8px color-mix(in oklab, var(--brand) 75%, transparent); }

.biz-switch { margin: 14px 12px 2px; }
.biz-switch > button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--sb-line); border-radius: 12px; background: rgba(245, 247, 242, .04); cursor: pointer; text-align: left; font-family: var(--font); color: var(--sb-strong); transition: border-color .15s, background .15s; }
.biz-switch > button:hover { border-color: rgba(245, 247, 242, .18); background: rgba(245, 247, 242, .07); }
.biz-switch .biz-name { font-weight: 650; font-size: 13.5px; line-height: 1.2; }
.biz-switch .biz-plan { font-size: 11.5px; color: var(--sb-muted); }
.biz-switch > button .muted-2 { color: var(--sb-muted); }
.biz-switch .dropdown-menu { left: 0; right: 0; }

/* Menu: always-visible main links, then sections that fold away */
.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 12px 20px; scrollbar-width: thin; scrollbar-color: rgba(245, 247, 242, .14) transparent; }
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(245, 247, 242, .14); border: 0; border-radius: 6px; }
.nav-main { display: flex; flex-direction: column; gap: 2px; padding-bottom: 12px; margin-bottom: 10px; border-bottom: 1px solid var(--sb-line); }
.nav-group + .nav-group { margin-top: 2px; }
.nav-group-toggle { width: 100%; display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 10px 0 12px; border: 0; border-radius: 9px; background: none; cursor: pointer; text-align: left; font-family: var(--font); color: var(--sb-muted); transition: background .15s, color .15s; }
.nav-group-toggle:hover { background: var(--sb-hover); color: var(--sb-text); }
.nav-group-toggle:focus-visible { outline: 2px solid var(--sb-accent); outline-offset: -2px; }
.nav-group-label { flex: 1; min-width: 0; font-size: 10.5px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
.nav-group.is-open > .nav-group-toggle { color: var(--sb-text); }
.nav-group-count { min-width: 20px; height: 18px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 99px; background: var(--brand); color: #fff; font-size: 10.5px; font-weight: 750; }
.nav-group-count.hot { background: #ef4444; }
.nav-group.is-open .nav-group-count { display: none; }
.nav-group-chevron { width: 15px; height: 15px; transition: transform .26s var(--ease), color .15s; }
.nav-group.is-open .nav-group-chevron { transform: rotate(180deg); color: var(--sb-accent); }
.nav-group-items { display: grid; grid-template-rows: 1fr; }
.nav-group-inner { min-height: 0; overflow: hidden; }
.nav-group-list { display: flex; flex-direction: column; gap: 2px; padding: 2px 0 8px; }
/* Folding needs script to unfold again, so it only applies once JS is running. */
.js .nav-group-items { grid-template-rows: 0fr; transition: grid-template-rows .26s var(--ease); }
.js .nav-group.is-open .nav-group-items { grid-template-rows: 1fr; }
.js .nav-group:not(.is-open) .nav-group-inner { visibility: hidden; transition: visibility 0s .26s; }
.no-anim .nav-group-items, .no-anim .nav-group-inner, .no-anim .nav-group-chevron { transition: none !important; }

.nav-item { position: relative; display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px; border-radius: 10px; color: var(--sb-text); font-weight: 560; font-size: 13.5px; transition: background .15s, color .15s; }
.nav-item .icon { width: 17px; height: 17px; color: var(--sb-muted); transition: color .15s; }
.nav-item:hover { background: var(--sb-hover); color: var(--sb-strong); }
.nav-item:hover .icon { color: var(--sb-text); }
.nav-item.is-active { background: color-mix(in oklab, var(--brand) 17%, transparent); color: var(--sb-accent); font-weight: 650; }
.nav-item.is-active .icon { color: var(--sb-accent); }
.nav-item.is-active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--sb-accent); }
.nav-item:focus-visible { outline: 2px solid var(--sb-accent); outline-offset: -2px; }
.nav-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-item .nav-ext { width: 13px; height: 13px; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; display: inline-grid; place-items: center; font-size: 11px; font-weight: 650; background: var(--surface-3); color: var(--text-2); }
.nav-badge.hot { background: var(--red); color: #fff; }
.nav-badge.brand { background: var(--brand); color: #fff; }
[data-theme="dark"] .nav-badge.hot { background: #e5484d; }
.sidebar .nav-badge { background: rgba(245, 247, 242, .1); color: var(--sb-strong); font-weight: 700; }
.sidebar .nav-badge.hot { background: #ef4444; color: #fff; }

/* Footer: credits, then quick actions */
.sidebar-foot { padding: 12px; border-top: 1px solid var(--sb-line); flex-shrink: 0; display: flex; flex-direction: column; gap: 10px; }
.sidebar-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sidebar-actions form { display: contents; }
.sb-btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid rgba(245, 247, 242, .15); background: transparent; color: var(--sb-strong); font: 600 12.5px var(--font); white-space: nowrap; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.sb-btn:hover { background: rgba(245, 247, 242, .07); border-color: color-mix(in oklab, var(--brand) 55%, transparent); color: var(--sb-strong); }
.sb-btn .icon { width: 15px; height: 15px; }
.sb-btn.danger { color: #f19a9a; border-color: rgba(239, 106, 106, .36); }
.sb-btn.danger:hover { background: rgba(239, 106, 106, .12); border-color: rgba(239, 106, 106, .6); color: #ffc2c2; }
.credit-card { position: relative; display: block; overflow: hidden; padding: 14px; border-radius: 14px; color: #e8f6ef; border: 1px solid rgba(245, 247, 242, .09); background: radial-gradient(130% 140% at 100% 0%, color-mix(in oklab, var(--brand) 36%, transparent), transparent 62%), rgba(245, 247, 242, .035); transition: border-color .15s; }
.credit-card:hover { color: #e8f6ef; border-color: color-mix(in oklab, var(--brand) 50%, transparent); }
.credit-card::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px); background-size: 16px 16px; mask-image: linear-gradient(to bottom left, #000, transparent 70%); pointer-events: none; }
.credit-card .lbl { display: block; font-size: 10.5px; font-weight: 700; letter-spacing: .13em; text-transform: uppercase; color: var(--sb-muted); }
.credit-card .val { display: block; font-size: 24px; font-weight: 800; letter-spacing: -.03em; margin-top: 4px; color: #fff; font-variant-numeric: tabular-nums; }
.credit-card .meter { display: block; background: rgba(255,255,255,.12); height: 6px; margin-top: 10px; }
.credit-card .meter > span { background: linear-gradient(90deg, #4ade80, var(--brand)); }
.credit-card.is-low .meter > span { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.credit-card .go { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12.5px; font-weight: 650; color: var(--sb-accent); }

/* ---------- Topbar ---------- */
.topbar { position: sticky; top: 0; z-index: 40; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 28px; background: color-mix(in oklab, var(--bg) 84%, transparent); backdrop-filter: saturate(1.5) blur(14px); -webkit-backdrop-filter: saturate(1.5) blur(14px); border-bottom: 1px solid var(--border); }
.menu-toggle { display: none; }
.topbar-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--text-3); white-space: nowrap; }
.topbar-title .crumb { font-weight: 550; }
.topbar-title .crumb-sep { width: 14px; height: 14px; color: var(--text-4); }
.topbar-title .here { font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; }
.search-trigger { display: flex; align-items: center; gap: 10px; height: 38px; width: min(320px, 32vw); padding: 0 7px 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--field); color: var(--text-4); font: 500 13.5px var(--font); cursor: pointer; transition: border-color .15s; }
.search-trigger:hover { border-color: var(--border-strong); color: var(--text-3); }
.search-trigger kbd { margin-left: auto; border-radius: 999px; padding: 0 8px; }
.topbar-right { display: flex; align-items: center; gap: 6px; }
.credit-pill { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 620; font-size: 13px; font-variant-numeric: tabular-nums; }
.credit-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.credit-pill.low .dot { background: #f59e0b; box-shadow: 0 0 0 3px rgba(245, 158, 11, .2); }
.credit-pill:hover { border-color: var(--border-strong); color: var(--text); }
.user-btn { display: flex; align-items: center; gap: 9px; padding: 3px 8px 3px 3px; border-radius: 999px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--text); font-family: var(--font); }
.user-btn:hover { background: var(--surface); border-color: var(--border); }
.user-btn .avatar-sm { --size: 32px; }
.user-btn .u-name { font-weight: 650; font-size: 13px; line-height: 1.15; text-align: left; }
.user-btn .u-role { font-size: 11px; color: var(--text-3); }
.demo-pill { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px; border-radius: 999px; font-size: 12px; font-weight: 650; background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-bd); }

.announce { display: flex; align-items: center; gap: 10px; padding: 10px 28px; font-size: 13px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); color: var(--text); }
.announce .icon { color: var(--brand-600); }
.announce.warning { background: var(--amber-bg); border-color: var(--amber-bd); } .announce.warning .icon { color: var(--amber); }
.announce.danger { background: var(--red-bg); border-color: var(--red-bd); } .announce.danger .icon { color: var(--red); }
.announce.success { background: var(--green-bg); border-color: var(--green-bd); }
.announce a { font-weight: 600; margin-left: 4px; }

/* ---------- Page ---------- */
.content { padding: 30px 32px 60px; width: 100%; max-width: 1380px; margin: 0 auto; }
.content.narrow { max-width: 980px; }
.content.flush { padding: 0; max-width: none; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; margin-bottom: 24px; flex-wrap: wrap; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--text-3); margin-bottom: 8px; }
.breadcrumbs a { color: var(--text-3); } .breadcrumbs a:hover { color: var(--text); }
.breadcrumbs .icon { width: 13px; height: 13px; color: var(--text-4); }
.page-title { font-size: 26px; font-weight: 760; letter-spacing: -.03em; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.page-sub { color: var(--text-3); margin-top: 6px; font-size: 14px; max-width: 760px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.usage-chip { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12.5px; color: var(--text-2); font-weight: 550; }
.usage-chip .meter { width: 70px; height: 6px; }
.card-title .icon { color: var(--brand-600); }

/* ---------- Stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.stats.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 14px; padding: 18px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-xs); color: inherit; transition: transform .22s var(--ease), border-color .22s, box-shadow .22s; }
a.stat:hover { transform: translateY(-3px); border-color: color-mix(in oklab, var(--brand) 45%, var(--border)); box-shadow: var(--shadow); color: inherit; }
.stat-main { position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; min-width: 0; }
.stat-body { min-width: 0; }
.stat-icon { width: 46px; height: 46px; border-radius: 13px; flex-shrink: 0; display: grid; place-items: center; background: var(--brand-50); color: var(--brand-600); border: 1px solid var(--brand-100); }
.stat-icon .icon { width: 21px; height: 21px; }
.stat-icon.blue { background: var(--blue-bg); color: var(--blue); border-color: var(--blue-bd); }
.stat-icon.violet { background: var(--violet-bg); color: var(--violet); border-color: var(--violet-bd); }
.stat-icon.amber { background: var(--amber-bg); color: var(--amber); border-color: var(--amber-bd); }
.stat-icon.red { background: var(--red-bg); color: var(--red); border-color: var(--red-bd); }
.stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.035em; line-height: 1.05; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat-value small { font-size: 13px; font-weight: 600; color: var(--text-3); letter-spacing: 0; margin-left: 4px; }
.stat-label { color: var(--text-3); font-size: 12.5px; font-weight: 600; margin-top: 6px; }
.stat-foot { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border-strong); font-size: 12px; color: var(--text-3); }
.stat-go { width: 14px; height: 14px; margin-left: auto; color: var(--text-4); transition: transform .2s var(--ease), color .2s; }
a.stat:hover .stat-go { transform: translateX(3px); color: var(--brand-600); }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 650; font-size: 12px; padding: 1px 6px; border-radius: 6px; }
.delta.up { color: var(--green); background: var(--green-bg); } .delta.down { color: var(--red); background: var(--red-bg); }
.delta .icon { width: 12px; height: 12px; stroke-width: 2.4; }
.stat-foot .spark { width: 72px; height: 22px; margin-left: auto; opacity: .95; pointer-events: none; }
.stat-foot .spark + .stat-go { margin-left: 8px; }

/* ---------- Charts ---------- */
.chart { position: relative; height: 260px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.chart .gl { stroke: var(--border); stroke-dasharray: 3 4; }
.chart .ax { fill: var(--text-4); font-size: 11px; font-family: var(--font); }
.chart-tip { position: absolute; pointer-events: none; z-index: 5; min-width: 130px; padding: 8px 10px; border-radius: 10px; background: var(--text); color: var(--surface); font-size: 12px; box-shadow: var(--shadow-lg); transform: translate(-50%, calc(-100% - 12px)); opacity: 0; transition: opacity .12s; white-space: nowrap; }
.chart-tip.is-visible { opacity: 1; }
.chart-tip .t { font-weight: 650; margin-bottom: 4px; opacity: .8; }
.chart-tip .r { display: flex; align-items: center; gap: 6px; }
.chart-tip .r i, .legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-3); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.donut-wrap { display: flex; align-items: center; gap: 22px; }
.donut { width: 150px; height: 150px; flex-shrink: 0; position: relative; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut-center strong { display: block; font-size: 22px; font-weight: 740; letter-spacing: -.03em; }
.donut-center span { font-size: 11.5px; color: var(--text-3); }
.bar-list { display: flex; flex-direction: column; gap: 12px; flex: 1; min-width: 0; }
.bar-row .bar-top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; gap: 8px; }
.bar-row .bar-top span:first-child { color: var(--text-2); font-weight: 550; }
.bar-row .bar-top span:last-child { color: var(--text-3); font-variant-numeric: tabular-nums; }
.bar-row .meter { height: 7px; }

/* ---------- List toolbar ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.toolbar .input-icon { width: min(320px, 100%); }
.toolbar .input { height: 36px; }
.toolbar .select { width: auto; min-width: 140px; height: 36px; font-size: 13px; }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.bulk-bar { display: none; align-items: center; gap: 12px; padding: 8px 16px; background: var(--brand-50); border-bottom: 1px solid var(--brand-100); font-size: 13px; font-weight: 550; }
.bulk-bar.is-visible { display: flex; }

/* ---------- Detail lists ---------- */
.kv { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 10px 14px; font-size: 13px; margin: 0; }
.kv dt { color: var(--text-3); }
.kv dd { margin: 0; color: var(--text); word-break: break-word; }
.list-rows > * { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border-bottom: 1px solid var(--border); }
.list-rows > *:last-child { border-bottom: 0; }
a.list-row { color: inherit; } a.list-row:hover { background: var(--surface-2); color: inherit; }

/* ---------- Settings layout ---------- */
.settings-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; align-items: start; }
.settings-nav { position: sticky; top: calc(var(--topbar-h) + 24px); display: flex; flex-direction: column; gap: 2px; padding: 8px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-xs); }
.settings-nav a { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 12px; border-radius: 10px; color: var(--text-2); font-weight: 560; font-size: 13.5px; }
.settings-nav a .icon { width: 16px; height: 16px; color: var(--text-4); }
.settings-nav a:hover { background: var(--hover); color: var(--text); }
.settings-nav a.is-active { background: var(--brand-50); color: var(--brand-700); font-weight: 650; }
.settings-nav a.is-active .icon { color: var(--brand-600); }
.form-actions { position: sticky; bottom: 0; z-index: 5; display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; margin-top: 0; background: color-mix(in oklab, var(--surface) 88%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ---------- Inbox ---------- */
.inbox { display: grid; grid-template-columns: 360px minmax(0, 1fr) 310px; height: calc(100vh - var(--topbar-h)); background: var(--surface); }
.inbox-list { border-right: 1px solid var(--border); display: flex; flex-direction: column; min-height: 0; }
.inbox-list-head { padding: 16px 16px 12px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.inbox-list-head h2 { font-size: 17px; }
.inbox-list-head .segmented { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.inbox-list-head .segmented a { padding: 0 6px; }
.conv-items { overflow-y: auto; flex: 1; }
.conv-item { position: relative; display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--border); color: inherit; }
.conv-item:hover { background: var(--surface-2); color: inherit; }
.conv-item.is-active { background: var(--brand-50); }
.conv-item.is-active::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--brand); }
.conv-main { flex: 1; min-width: 0; }
.conv-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.conv-name { font-weight: 620; color: var(--text); font-size: 13.5px; }
.conv-time { font-size: 11.5px; color: var(--text-4); white-space: nowrap; }
.conv-snippet { color: var(--text-3); font-size: 12.5px; margin-top: 2px; }
.conv-tags { display: flex; gap: 6px; margin-top: 6px; align-items: center; }
.ch { position: relative; }
.ch-dot { position: absolute; right: -2px; bottom: -2px; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--surface); color: #fff; }
.ch-dot .icon { width: 9px; height: 9px; stroke-width: 2.6; }
.ch-widget { background: var(--brand); } .ch-messenger { background: #0866ff; } .ch-whatsapp { background: #25d366; } .ch-email { background: #f59e0b; } .ch-api { background: #6938ef; } .ch-playground { background: #667085; }
.thread { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--bg); }
.thread-head { min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 10px 20px; background: var(--surface); border-bottom: 1px solid var(--border); }
.thread-head .t-name { font-weight: 650; font-size: 15px; }
.thread-head .t-sub { font-size: 12.5px; color: var(--text-3); }
.thread-body { flex: 1; overflow-y: auto; padding: 24px clamp(16px, 3vw, 36px); display: flex; flex-direction: column; gap: 14px; }
.day-sep { align-self: center; font-size: 11.5px; font-weight: 600; color: var(--text-4); text-transform: uppercase; letter-spacing: .05em; }
.msg { display: flex; gap: 10px; max-width: min(78%, 680px); }
.msg-customer { align-self: flex-start; }
.msg-assistant, .msg-agent { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar { margin-top: 2px; }
.msg-col { display: flex; flex-direction: column; min-width: 0; }
.msg-assistant .msg-col, .msg-agent .msg-col { align-items: flex-end; }
.bubble { padding: 10px 14px; border-radius: 18px; font-size: 14px; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: var(--shadow-xs); }
.msg-customer .bubble { background: var(--surface); border: 1px solid var(--border); border-top-left-radius: 6px; color: var(--text); }
.msg-assistant .bubble { background: linear-gradient(160deg, var(--brand), var(--brand-600)); color: #fff; border-top-right-radius: 6px; }
.msg-agent .bubble { background: var(--ink); color: #eaf4f1; border-top-right-radius: 6px; }
[data-theme="dark"] .msg-assistant .bubble { background: linear-gradient(160deg, var(--brand), color-mix(in oklab, var(--brand) 78%, #000)); }
[data-theme="dark"] .msg-agent .bubble { background: #1d4f6a; }
.msg-meta { font-size: 11.5px; color: var(--text-4); margin-top: 5px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.msg-system { align-self: center; display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; }
.msg-system .icon { width: 13px; height: 13px; }
.chip { display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 7px; border-radius: 6px; background: var(--surface); border: 1px solid var(--border); font-size: 11px; font-weight: 550; color: var(--text-3); }
.chip .icon { width: 11px; height: 11px; }
.chip-warn { background: var(--amber-bg); border-color: var(--amber-bd); color: var(--amber); }
.chip-red { background: var(--red-bg); border-color: var(--red-bd); color: var(--red); }
.typing { display: inline-flex; gap: 4px; padding: 14px 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--text-4); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }
.composer { padding: 14px clamp(16px, 3vw, 36px) 18px; background: var(--surface); border-top: 1px solid var(--border); }
.composer-box { display: flex; gap: 8px; align-items: flex-end; border: 1px solid var(--border-strong); border-radius: 16px; padding: 7px 7px 7px 14px; background: var(--field); box-shadow: var(--shadow-xs); transition: border-color .15s, box-shadow .15s; }
.composer-box:focus-within { border-color: var(--brand); box-shadow: var(--ring); }
.composer-box textarea { flex: 1; border: 0; outline: 0; resize: none; font: 14px/1.5 var(--font); background: transparent; color: var(--text); max-height: 160px; min-height: 24px; padding: 6px 0; }
.composer-hint { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; font-size: 12px; color: var(--text-4); }
.composer-locked { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 13px; color: var(--text-2); }
.inbox-side { border-left: 1px solid var(--border); overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 22px; }
.side-title { font-size: 11.5px; font-weight: 650; text-transform: uppercase; letter-spacing: .06em; color: var(--text-4); margin-bottom: 10px; }
.inbox-empty { display: grid; place-items: center; height: 100%; }

/* ---------- Playground ---------- */
.playground { display: grid; grid-template-columns: minmax(0, 1fr) 400px; height: calc(100vh - var(--topbar-h)); background: var(--surface); }
.playground .thread { border-right: 1px solid var(--border); }
.debug { overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; background: var(--surface); }
.trace { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.trace-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-size: 12.5px; font-weight: 620; }
.trace-body { padding: 10px 12px; font-size: 12.5px; color: var(--text-2); }
.trace pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-size: 11.5px; max-height: 220px; overflow: auto; }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.metric { padding: 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); }
.metric b { display: block; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
.metric span { font-size: 11px; color: var(--text-3); }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.suggestion { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text-2); font: 500 13px var(--font); cursor: pointer; }
.suggestion:hover { border-color: var(--brand); color: var(--brand-700); background: var(--brand-50); }

/* ---------- Onboarding checklist ---------- */
.checklist { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.check-step { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); color: inherit; transition: border-color .15s, box-shadow .15s, transform .15s; }
.check-step:hover { border-color: var(--border-strong); box-shadow: var(--shadow); color: inherit; transform: translateY(-2px); }
.check-step .num { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-strong); font-size: 12px; font-weight: 700; color: var(--text-3); }
.check-step.is-done .num { background: var(--brand); border-color: var(--brand); color: #fff; }
.check-step h4 { font-size: 14px; }
.check-step p { font-size: 12.5px; color: var(--text-3); }
.hero-card { position: relative; overflow: hidden; border-radius: 18px; padding: 24px; color: #e9f6f0; border: 1px solid rgba(255, 255, 255, .07); background: radial-gradient(80% 140% at 100% 0%, color-mix(in oklab, var(--brand) 50%, transparent), transparent 60%), radial-gradient(60% 120% at 0% 100%, rgba(14, 165, 233, .22), transparent 60%), var(--ink); }
.hero-card h2 { color: #fff; font-size: 20px; }
.hero-card p { color: rgba(233, 246, 240, .78); }
.hero-card .check-step h4 { color: var(--text); }
.hero-card .check-step p { color: var(--text-3); }
.hero-card .grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 28px 28px; mask-image: radial-gradient(ellipse at top right, #000, transparent 70%); pointer-events: none; }
.hero-card > * { position: relative; }

/* ---------- Plan cards (billing) ---------- */
.plan-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.plan-card { position: relative; display: flex; flex-direction: column; gap: 12px; padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: var(--surface); }
.plan-card.is-current { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.plan-card .price { font-size: 26px; font-weight: 740; letter-spacing: -.03em; }
.plan-card .price small { font-size: 13px; color: var(--text-3); font-weight: 500; }
.plan-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--text-2); }
.plan-card li { display: flex; gap: 8px; align-items: flex-start; }
.plan-card li .icon { width: 15px; height: 15px; color: var(--brand-600); margin-top: 2px; }
.package { position: relative; display: flex; flex-direction: column; gap: 4px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.package:hover { border-color: var(--border-strong); }
.package input { position: absolute; opacity: 0; }
.package:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
.package .credits { font-size: 20px; font-weight: 740; letter-spacing: -.02em; }
.package .ribbon { position: absolute; top: -9px; right: 12px; }

/* ---------- Command palette ---------- */
.cmdk .modal-dialog { max-width: 560px; align-self: start; margin-top: 12vh; }
.cmdk-input { width: 100%; height: 52px; border: 0; border-bottom: 1px solid var(--border); padding: 0 18px; font: 450 15px var(--font); background: transparent; color: var(--text); outline: 0; }
.cmdk-list { max-height: 360px; overflow-y: auto; padding: 6px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; color: var(--text-2); font-size: 13.5px; }
.cmdk-item .icon { color: var(--text-4); }
.cmdk-item.is-active, .cmdk-item:hover { background: var(--brand-50); color: var(--text); }
.cmdk-item small { margin-left: auto; color: var(--text-4); font-size: 11.5px; }

/* ---------- Auth ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); background: var(--surface); }
.auth-aside { position: relative; overflow: hidden; padding: 36px 48px; display: flex; flex-direction: column; color: #e6f3ee; background: radial-gradient(900px 520px at 0% -10%, color-mix(in oklab, var(--brand) 45%, transparent), transparent 60%), radial-gradient(700px 480px at 110% 110%, rgba(14, 165, 233, .28), transparent 60%), var(--ink); }
.auth-aside .grid-bg { position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.055) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px); background-size: 44px 44px; mask-image: radial-gradient(ellipse at 40% 40%, #000 20%, transparent 72%); }
.auth-aside > * { position: relative; }
.auth-aside .brand-name, .auth-aside .brand-name small { color: #fff; }
.auth-aside .brand-name small { opacity: .7; }
.auth-aside h2 { color: #fff; font-size: clamp(26px, 2.6vw, 34px); font-weight: 720; letter-spacing: -.035em; line-height: 1.15; max-width: 520px; }
.auth-aside p.lead { color: rgba(230, 243, 238, .78); font-size: 15px; max-width: 480px; margin-top: 12px; }
.auth-points { display: flex; flex-direction: column; gap: 10px; margin-top: 22px; }
.auth-points div { display: flex; gap: 10px; align-items: center; font-size: 14px; color: rgba(230, 243, 238, .9); }
.auth-points .icon { width: 18px; height: 18px; color: #4ade80; }
.auth-main { display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 40px 24px; position: relative; }
[data-theme="dark"] .auth-main { background: radial-gradient(700px 420px at 100% 0%, color-mix(in oklab, var(--brand) 9%, transparent), transparent 62%), var(--bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card.wide { max-width: 560px; }
.auth-title { font-size: 26px; font-weight: 740; letter-spacing: -.035em; }
.auth-sub { color: var(--text-3); margin-top: 6px; font-size: 14.5px; }
.auth-foot { margin-top: 22px; text-align: center; font-size: 13.5px; color: var(--text-3); }
.auth-top { position: absolute; top: 20px; right: 24px; display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--text-3); }
.divider-text { display: flex; align-items: center; gap: 12px; color: var(--text-4); font-size: 12px; margin: 18px 0; }
.divider-text::before, .divider-text::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.demo-logins { margin-top: 18px; padding: 12px; border-radius: 12px; background: var(--surface-2); border: 1px dashed var(--border-strong); font-size: 12.5px; color: var(--text-3); }
.demo-logins button { background: none; border: 0; padding: 0; color: var(--brand-600); font: 600 12.5px var(--font); cursor: pointer; }

/* Mock chat card (auth aside + landing) */
.mock-chat { width: 100%; max-width: 420px; border-radius: 20px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); backdrop-filter: blur(12px); padding: 14px; box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .5); }
.mock-head { display: flex; align-items: center; gap: 10px; padding: 4px 4px 12px; border-bottom: 1px solid rgba(255, 255, 255, .1); }
.mock-head strong { color: #fff; font-size: 14px; display: block; }
.mock-head span { font-size: 12px; color: rgba(230, 243, 238, .65); display: flex; align-items: center; gap: 6px; }
.mock-head span::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #4ade80; }
.mock-body { display: flex; flex-direction: column; gap: 10px; padding: 14px 4px 4px; }
.mock-msg { max-width: 82%; padding: 9px 13px; border-radius: 16px; font-size: 13.5px; line-height: 1.5; }
.mock-msg.in { align-self: flex-start; background: rgba(255, 255, 255, .1); color: #f1f7f5; border-top-left-radius: 5px; }
.mock-msg.out { align-self: flex-end; background: var(--brand); color: #fff; border-top-right-radius: 5px; }
.mock-src { align-self: flex-end; display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.mock-src span { font-size: 11px; color: rgba(230, 243, 238, .75); border: 1px solid rgba(255, 255, 255, .16); border-radius: 6px; padding: 2px 7px; display: inline-flex; gap: 4px; align-items: center; }
.mock-src .icon { width: 11px; height: 11px; }

/* ---------- Misc ---------- */
.nav-overlay { display: none; }
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-dark { display: block; }
[data-theme="dark"] .theme-icon-light { display: none; }
.dot-live { width: 8px; height: 8px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px var(--green-bg); display: inline-block; }
.dot-off { width: 8px; height: 8px; border-radius: 50%; background: var(--text-4); display: inline-block; }
.key-reveal { padding: 14px; border-radius: 12px; border: 1px solid var(--amber-bd); background: var(--amber-bg); }
.inline-form { display: inline; }

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
  .inbox { grid-template-columns: 360px minmax(0, 1fr); }
  .inbox-side { display: none; }
  .playground { grid-template-columns: minmax(0, 1fr) 340px; }
  .stats.cols-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .checklist { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .settings-nav { position: static; flex-direction: row; overflow-x: auto; }
  .settings-nav a { white-space: nowrap; }
}
@media (max-width: 960px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 284px; transform: translateX(-100%); transition: transform .25s var(--ease); box-shadow: var(--shadow-lg); z-index: 95; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .nav-overlay { display: block; position: fixed; inset: 0; background: rgba(1, 20, 22, .55); z-index: 90; }
  .menu-toggle { display: inline-flex; }
  .topbar { padding: 0 14px; }
  .topbar-title .crumb, .topbar-title .crumb-sep { display: none; }
  .search-trigger { width: 38px; padding: 0; justify-content: center; }
  .search-trigger span, .search-trigger kbd, .user-btn .u-meta { display: none; }
  .announce { padding: 10px 16px; }
  .content { padding: 20px 16px 48px; }
  .auth { grid-template-columns: minmax(0, 1fr); }
  .auth-aside { display: none; }
  .playground { grid-template-columns: minmax(0, 1fr); }
  .playground .debug { display: none; }
  .inbox { grid-template-columns: minmax(0, 1fr); }
  .inbox.has-thread .inbox-list { display: none; }
  .inbox:not(.has-thread) .thread { display: none; }
}
/* ---------- Small helpers ---------- */
.reveal-wrap { position: relative; }
.reveal-wrap .input { padding-right: 44px; }
.reveal-wrap .btn { position: absolute; right: 4px; top: 4px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.pick-grid .package { align-items: flex-start; gap: 8px; padding: 12px 14px; }
.pick-grid .package .stat-icon { width: 30px; height: 30px; border-radius: 9px; }
.pick-grid .package .stat-icon .icon { width: 16px; height: 16px; }
.pick-grid .package strong { font-size: 13px; font-weight: 620; color: var(--text); }
.section-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-title h2 { font-size: 16px; }
.mini-list > * { display: flex; align-items: center; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--border); color: inherit; }
.mini-list > *:last-child { border-bottom: 0; }
a.mini-row:hover { background: var(--surface-2); color: inherit; }
.mini-list .grow { flex: 1; min-width: 0; }
.mini-list .title { font-weight: 600; color: var(--text); font-size: 13.5px; }
.mini-list .sub { font-size: 12.5px; color: var(--text-3); }
.health { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); font-size: 13px; }
.health:last-child { border-bottom: 0; }
.health .grow { flex: 1; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); gap: 16px; }
/* Single columns use minmax(0, 1fr): a plain 1fr grows to fit nowrap text and pushes the page sideways. */
@media (max-width: 1100px) { .grid-main { grid-template-columns: minmax(0, 1fr); } }

@media (max-width: 560px) {
  .stats, .checklist { grid-template-columns: minmax(0, 1fr); }
  .page-title { font-size: 21px; }
  .topbar { gap: 8px; }
  .credit-pill { display: none; }
}


/* ---- Photos and voice notes inside a chat bubble ---------------------- */
.bubble .shot { display: block; margin-bottom: 6px; }
.bubble .shot img { display: block; max-width: 220px; max-height: 260px; width: auto; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.bubble audio { display: block; width: 230px; max-width: 100%; margin-bottom: 6px; }
.bubble .said { font-size: 12px; font-style: italic; color: var(--muted); margin-bottom: 6px; }
.msg-customer .bubble .said { color: inherit; opacity: .75; }

.composer-files { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 0 8px; }
.composer-file { position: relative; display: flex; align-items: center; gap: 8px; max-width: 220px; padding: 5px 26px 5px 5px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); font-size: 12px; color: var(--muted); }
.composer-file img { width: 34px; height: 34px; border-radius: 7px; object-fit: cover; display: block; }
.composer-file .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.composer-file .rm { position: absolute; top: 3px; right: 3px; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: var(--line); color: var(--ink); font-size: 12px; line-height: 1; cursor: pointer; }
.composer-file.is-uploading { opacity: .55; }

/* Dashboard: how ready the agent's knowledge is */
.readiness-head { display: flex; gap: 20px; align-items: center; }
.readiness-text { flex: 1; min-width: 0; }
.readiness-score { width: 84px; height: 84px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; align-content: center; border: 6px solid var(--brand); line-height: 1; }
.readiness-score strong { font-size: 22px; font-weight: 750; }
.readiness-score span { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.readiness-score.mid { border-color: #f59e0b; }
.readiness-score.low { border-color: var(--red); }
.readiness-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.readiness-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; color: inherit; text-decoration: none; transition: border-color .15s, background .15s; }
.readiness-item:hover { border-color: var(--brand); background: var(--brand-50); }
.readiness-item > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.readiness-item strong { font-size: 14px; }
.readiness-item small { font-size: 12px; color: var(--text-3); }
.readiness-points { flex-shrink: 0; font-size: 12px; font-weight: 700; color: var(--brand-600); background: var(--brand-50); border-radius: 999px; padding: 3px 8px; }
@media (max-width: 760px) {
  .readiness-head { flex-direction: column; align-items: flex-start; }
  .readiness-list { grid-template-columns: minmax(0, 1fr); }
}

/* Notification bell */
.bell-btn { position: relative; }
.bell-dot { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px; background: var(--red); color: #fff; font-size: 10px; font-weight: 700; line-height: 16px; text-align: center; }
.dropdown-wide { width: 320px; max-width: calc(100vw - 32px); }
.alert-item { align-items: flex-start; gap: 10px; }
.alert-item > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.alert-item strong { font-size: 13px; font-weight: 640; }
.alert-item small { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row.unread { background: var(--brand-50); }
.list-icon { display: grid; place-items: center; width: 30px; height: 30px; flex-shrink: 0; border-radius: 9px; background: var(--surface-2); color: var(--text-3); }
.list-main { flex: 1; min-width: 0; }

/* Insights: word bars and the hour strip */
.bar-row { display: flex; align-items: center; gap: 12px; padding: 5px 0; }
.bar-label { width: 130px; flex-shrink: 0; font-size: 13.5px; font-weight: 560; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { flex: 1; height: 10px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-600), var(--brand)); }
.bar-value { width: 40px; text-align: right; font-size: 12.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.hours { display: flex; align-items: flex-end; gap: 3px; height: 110px; }
.hour-bar { flex: 1; display: flex; align-items: flex-end; height: 100%; }
.hour-bar > span { width: 100%; border-radius: 4px 4px 0 0; background: var(--brand); opacity: .75; }
.hour-bar:hover > span { opacity: 1; }

/* Lead interest */
.heat { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .2px; }
.heat-hot { background: #FEE2E2; color: #B91C1C; }
.heat-warm { background: #FEF3C7; color: #92400E; }
.heat-cold { background: var(--surface-2); color: var(--text-3); }
:root:not([data-theme="light"]) .heat-hot, [data-theme="dark"] .heat-hot { background: rgba(239,68,68,.16); color: #FCA5A5; }
:root:not([data-theme="light"]) .heat-warm, [data-theme="dark"] .heat-warm { background: rgba(245,158,11,.16); color: #FCD34D; }

/* Automation steps */
.step-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.step-num { display: grid; place-items: center; width: 26px; height: 26px; flex-shrink: 0; border-radius: 50%; background: var(--brand-50); color: var(--brand-700); font-size: 12px; font-weight: 700; }
.step-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; }
