/* Helaplus CRM — aligned to the platform's emerald/slate design system
   (styles/helaplus-ui.css + styles/custom.css on the core portal) */
:root {
    --primary: #14322a;
    --primary-light: #1a4a36;
    --primary-deep: #0f2a22;
    --secondary: #4ade80;
    --accent: #c8860a;
    --text: #1e293b;
    --text-muted: #64748b;
    --bg: #f1f5f4;
    --surface: #ffffff;
    --border: #e2e8f0;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #d97706;
    --info: #0284c7;
    --radius: 10px;
    --radius-card: 14px;
    --radius-input: 8px;
    --card-shadow: 0 1px 3px rgba(15,42,34,.08), 0 8px 24px rgba(15,42,34,.06);
    --header-height: 60px;
    --sidebar-width: 250px;
    --font-body: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    --font-display: 'Inter Tight', Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---------- Top bar — light breadcrumb bar (Bond-style) ---------- */
.topbar {
    position: fixed; top: 0; left: var(--sidebar-width); right: 0;
    height: var(--header-height);
    background: #fff; border-bottom: 1px solid var(--border);
    display: flex; align-items: center; padding: 0 24px; gap: 10px;
    z-index: 100;
}
.topbar .spacer { flex: 1; }
.crumbs { font-size: 13px; color: var(--text-muted); display: flex; gap: 8px; align-items: center; }
.crumbs b { color: var(--text); font-weight: 600; }
.crumb-sep { color: #cbd5e1; }
.pill {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; font-weight: 600; color: var(--text);
    border: 1px solid var(--border); border-radius: 20px;
    padding: 6px 14px; text-decoration: none; background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.pill:hover { border-color: #cbd5e1; box-shadow: 0 1px 4px rgba(15,42,34,.08); }
.pill-alert { color: #b91c1c; border-color: #fecaca; background: #fef2f2; }
.btn-dark {
    background: var(--primary); color: #fff; border: 1px solid var(--primary);
    border-radius: 8px; padding: 8px 16px; font-size: 13px; font-weight: 600;
    font-family: inherit; text-decoration: none; display: inline-flex; align-items: center; gap: 4px;
    transition: background-color .15s ease; cursor: pointer;
}
.btn-dark:hover { background: var(--primary-light); }
.btn-dark.btn-block { display: flex; justify-content: center; width: 100%; margin-top: 14px; }

/* ---------- Sidebar — light Bond-style rail ---------- */
.sidebar {
    position: fixed; top: 0; bottom: 0; left: 0;
    width: var(--sidebar-width);
    background: #fbfdfc;
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    overflow-y: auto;
    display: flex; flex-direction: column;
}
.side-logo {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 8px 14px; text-decoration: none;
}
.side-logo-mark {
    width: 30px; height: 30px; border-radius: 9px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1a4a36, #0f2a22);
    color: var(--secondary); font-family: var(--font-display);
    font-weight: 800; font-size: 15px;
}
.side-logo-text {
    font-family: var(--font-display); font-size: 16px; font-weight: 600;
    color: var(--text); letter-spacing: -.01em;
}
.side-logo-text b { font-weight: 800; color: var(--primary); }
.side-search {
    display: flex; align-items: center; gap: 8px;
    margin: 0 4px 14px; padding: 8px 12px;
    background: #fff; border: 1px solid var(--border); border-radius: 9px;
    color: var(--text-muted);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.side-search:focus-within { border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(74,222,128,.15); }
.side-search input {
    border: 0; background: transparent; flex: 1; min-width: 0;
    font-size: 13px; font-family: inherit; color: var(--text); outline: none;
}
.side-search input::placeholder { color: #94a3b8; }
.side-search kbd {
    font-size: 10px; font-family: inherit; color: var(--text-muted);
    border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px;
}
.side-nav { flex: 1; }
.sidebar a, .sidebar .side-nav a {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 12px; margin: 1px 4px; border-radius: 8px;
    color: #334155; text-decoration: none; font-size: 13.5px; font-weight: 500;
    transition: color .15s ease, background-color .15s ease;
}
.sidebar a:hover { color: var(--primary); background: #eef4f1; }
.sidebar a.active {
    color: #fff; background: var(--primary);
    box-shadow: 0 2px 8px rgba(15,42,34,.25);
}
.sidebar .nav-ico { width: 15px; height: 15px; flex: none; opacity: .7; }
.sidebar a.active .nav-ico { opacity: 1; }
.sidebar .nav-label {
    padding: 16px 12px 6px; font-size: 10px; text-transform: uppercase;
    letter-spacing: .1em; font-weight: 700; color: #94a3b8;
}
.nav-badge {
    margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: var(--secondary); color: var(--primary);
    font-size: 10.5px; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
}
.sidebar a.active .nav-badge { background: var(--secondary); color: var(--primary); }
.side-user {
    display: flex; align-items: center; gap: 10px;
    margin-top: 12px; padding: 10px 10px 10px 12px;
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
}
.side-avatar { width: 30px; height: 30px; font-size: 11px; }
.side-user-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.side-user-meta b { font-size: 13px; color: var(--text); }
.side-user-meta span { font-size: 11px; color: var(--text-muted); }
.side-logout {
    border: 0; background: transparent; cursor: pointer;
    color: var(--text-muted); padding: 6px; border-radius: 8px;
    transition: color .15s ease, background-color .15s ease;
}
.side-logout:hover { color: var(--danger); background: #fef2f2; }

/* ---------- Content ---------- */
.main { margin-left: var(--sidebar-width); padding-top: var(--header-height); }
.content { padding: 28px; }
.page-title {
    font-family: var(--font-display);
    font-size: 22px; font-weight: 800; letter-spacing: -.02em;
    color: var(--primary); margin: 0 0 18px;
}
.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    margin-bottom: 20px;
    box-shadow: var(--card-shadow);
}
.card-header {
    padding: 14px 20px; border-bottom: 1px solid var(--border);
    font-family: var(--font-display);
    font-weight: 700; color: var(--primary); font-size: 15px; letter-spacing: -.01em;
    display: flex; align-items: center; justify-content: space-between;
}
.card-body { padding: 20px; }

/* ---------- Grid / forms ---------- */
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) { .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } }

.form-row { display: flex; align-items: flex-start; margin-bottom: 16px; }
.form-row .form-label {
    width: 190px; text-align: right; padding: 9px 16px 0 0;
    font-weight: 600; font-size: 13px; color: var(--text); flex-shrink: 0;
}
.form-row .form-label .req { color: var(--danger); }
.form-row .form-field { flex: 1; max-width: 480px; }
@media (max-width: 700px) { .form-row { flex-direction: column; } .form-row .form-label { text-align: left; padding: 0 0 4px; width: auto; } }

.input, select.input, textarea.input {
    width: 100%; padding: 9px 12px; border: 1px solid var(--border);
    border-radius: var(--radius-input); font-size: 14px; font-family: inherit;
    background: #fff; color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus { outline: none; border-color: var(--secondary); box-shadow: 0 0 0 3px rgba(74,222,128,.15); }
textarea.input { min-height: 90px; }
.hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.error-text { color: var(--danger); font-size: 12px; margin-top: 4px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block; padding: 8px 16px; border-radius: var(--radius);
    border: 1px solid transparent; font-size: 13px; font-weight: 600;
    cursor: pointer; text-decoration: none; font-family: inherit;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn-primary:hover, .btn-primary:focus { background: var(--primary-light); border-color: var(--primary-light); color: #fff; }
.btn-secondary { background: var(--secondary); border-color: var(--secondary); color: var(--primary-deep); }
.btn-secondary:hover { background: #86efac; border-color: #86efac; }
.btn-accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-accent:hover { background: #a96f08; border-color: #a96f08; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-outline { background: #fff; color: var(--primary); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: var(--radius-input); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-group { display: inline-flex; gap: 8px; }

/* ghost button for use on the dark topbar */
.btn-ghost-dark { background: rgba(255,255,255,.06); color: rgba(255,255,255,.85); border-color: rgba(255,255,255,.18); }
.btn-ghost-dark:hover { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.3); }

/* ---------- Tables — slate neutrals like the platform ---------- */
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table th {
    text-align: left; padding: 11px 15px; background: #f8fafc;
    border-bottom: 1px solid var(--border); color: var(--text-muted);
    font-weight: 600; font-size: 12px; white-space: nowrap;
}
.table td { padding: 11px 15px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table tr:hover td { background: rgba(74,222,128,.05); }
.table a { color: var(--primary); font-weight: 600; }
.table a:hover { color: var(--primary-light); }

/* ---------- Badges — platform pill language ---------- */
.badge {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
}
.badge-active, .badge-sent, .badge-delivered, .badge-active-cust { background: rgba(74,222,128,.18); color: #166534; }
.badge-draft, .badge-pending, .badge-queued, .badge-paused { background: #fef3c7; color: #92400e; }
.badge-inactive, .badge-failed, .badge-rejected, .badge-cancelled, .badge-suppressed { background: #fee2e2; color: #991b1b; }
.badge-completed, .badge-dry_run { background: #e0f2fe; color: #075985; }
.badge-sending { background: #ede9fe; color: #5b21b6; }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 16px; font-size: 13.5px; border: 1px solid transparent; }
.alert-success { background: rgba(74,222,128,.14); color: #166534; border-color: rgba(74,222,128,.35); }
.alert-danger { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.alert-warning { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.alert-info { background: #e0f2fe; color: #075985; border-color: #bae6fd; }

/* ---------- Stats — platform hp-stat language ---------- */
.stat { padding: 18px; }
.stat .stat-value {
    font-family: var(--font-display);
    font-size: 26px; font-weight: 800; letter-spacing: -.02em;
    color: var(--primary); line-height: 1.15;
}
.stat .stat-label { font-size: 12.5px; font-weight: 500; color: var(--text-muted); margin-top: 3px; }

/* ---------- Misc ---------- */
.message-preview {
    background: #f8fafc; border: 1px solid var(--border); border-radius: var(--radius);
    padding: 12px 14px; font-size: 13.5px; white-space: pre-wrap; line-height: 1.5;
}
.mono { font-family: 'SF Mono', Menlo, Consolas, monospace; font-size: 12px; }
.muted { color: var(--text-muted); }
.right { text-align: right; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.pagination { display: flex; gap: 4px; list-style: none; padding: 0; margin: 16px 0 0; }
.pagination a, .pagination span {
    padding: 5px 11px; border: 1px solid var(--border); border-radius: var(--radius-input);
    font-size: 12px; text-decoration: none; color: var(--primary); background: #fff; font-weight: 600;
}
.pagination .active span { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ---------- Login — platform hp-login two-panel ---------- */
.login-wrap { min-height: 100vh; display: flex; }

.login-brand {
    flex: 1.15;
    background: linear-gradient(160deg, #0f2a22 0%, #14322a 55%, #1a4a36 100%);
    color: #fff;
    padding: 56px 64px;
    display: flex; flex-direction: column; justify-content: space-between; gap: 48px;
    min-height: 100vh;
}
.login-brand-logo {
    font-family: var(--font-display);
    font-size: 24px; font-weight: 800; letter-spacing: -.02em;
    color: rgba(255,255,255,.55);
}
.login-brand-logo span { color: var(--secondary); }
.login-brand-pitch h1 {
    font-family: var(--font-display);
    font-size: 40px; font-weight: 800; line-height: 1.12; letter-spacing: -.02em;
    margin: 0 0 26px; color: #fff;
}
.login-brand-rule {
    width: 72px; height: 1px; margin-bottom: 14px;
    background: linear-gradient(90deg, var(--accent), rgba(200,134,10,.25));
}
.login-brand-tagline {
    font-size: 13px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase;
    color: rgba(255,255,255,.72);
}
.login-brand-foot { font-size: 12px; color: #94a3b8; }
.login-brand-foot a { color: var(--accent); font-weight: 600; text-decoration: none; }

.login-formside {
    flex: 1; display: flex; align-items: center; justify-content: center;
    background: var(--bg); padding: 40px;
}
.login-card {
    background: #fff; border-radius: var(--radius-card); padding: 40px;
    width: 100%; max-width: 380px;
    box-shadow: 0 8px 40px rgba(15,42,34,.10);
    border: 1px solid var(--border);
}
.login-card-title {
    font-family: var(--font-display);
    font-size: 22px; font-weight: 800; color: var(--primary);
}
.login-card-sub { font-size: 13px; color: var(--text-muted); margin: 2px 0 22px; }
.login-field { margin-bottom: 14px; }
.login-field input {
    width: 100%; padding: 10px 14px; box-sizing: border-box;
    border: 1px solid var(--border); border-radius: var(--radius-input);
    font-size: 14px; font-family: inherit; background: #fff; color: var(--text);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.login-field input:focus {
    outline: none; border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(74,222,128,.15);
}
.login-submit {
    width: 100%; margin-top: 8px; padding: 12px;
    font-size: 15px; font-weight: 700; font-family: inherit;
    border-radius: var(--radius-input); border: 1px solid var(--primary);
    background: var(--primary); color: #fff; cursor: pointer;
    transition: background-color .15s ease;
}
.login-submit:hover { background: var(--primary-light); border-color: var(--primary-light); }

@media (max-width: 860px) {
    .login-brand { display: none; }
    .login-card { max-width: 420px; }
}

/* ---------- Dashboard — Bond-style analytics layout ---------- */
.hero {
    display: flex; align-items: flex-end; justify-content: space-between;
    margin-bottom: 22px; gap: 16px; flex-wrap: wrap;
}
.hero-date {
    font-size: 11px; font-weight: 700; letter-spacing: .14em;
    text-transform: uppercase; color: var(--text-muted); margin-bottom: 4px;
}
.hero-title {
    font-family: var(--font-display); font-size: 32px; font-weight: 800;
    letter-spacing: -.03em; color: var(--text); margin: 0;
}
.hero-sub { font-size: 13.5px; color: var(--text-muted); margin: 4px 0 0; }
.hero-sub b { color: var(--text); }
.hero-actions { display: flex; gap: 10px; }

/* KPI cards with sparklines */
.kpi-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
    margin-bottom: 16px;
}
.kpi { padding: 16px 18px 14px; }
.kpi-label {
    font-size: 10.5px; font-weight: 700; letter-spacing: .1em;
    text-transform: uppercase; color: var(--text-muted);
}
.kpi-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.kpi-value {
    font-family: var(--font-display); font-size: 26px; font-weight: 800;
    letter-spacing: -.02em; color: var(--text); margin-top: 10px;
    display: flex; align-items: center; gap: 7px; flex-wrap: wrap;
}
.kpi-sub { margin-top: 2px; font-size: 12px; color: var(--text-muted); }
.kpi-sub-inline { font-size: 11px; font-weight: 500; color: inherit; opacity: .6; }
.spark { width: 110px; height: 36px; flex: none; }
.chip {
    display: inline-flex; align-items: center;
    padding: 2px 7px; border-radius: 20px; font-weight: 700; font-size: 11px;
    font-family: var(--font-body); letter-spacing: 0;
}
.chip.up { color: #15803d; background: rgba(74,222,128,.2); }
.chip.down { color: #b91c1c; background: rgba(239,68,68,.12); }

/* main grid */
.dash-grid {
    display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 14px; margin-bottom: 16px; align-items: stretch;
}
.dash-grid.bottom { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }

.chart-card { padding: 20px 22px; display: flex; flex-direction: column; }
.chart-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.chart-title { font-size: 15px; font-weight: 700; color: var(--text); }
.chart-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }
.chart-big {
    font-family: var(--font-display); font-size: 30px; font-weight: 800;
    letter-spacing: -.02em; color: var(--text); margin-top: 14px;
    display: flex; align-items: center; gap: 10px;
}
.period-pills { display: flex; gap: 4px; background: #f1f5f4; padding: 3px; border-radius: 20px; }
.period-pill {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    padding: 5px 14px; border-radius: 16px; text-decoration: none;
    transition: all .15s ease;
}
.period-pill:hover { color: var(--text); }
.period-pill.on { background: var(--primary); color: #fff; }
.chart-legend { display: flex; gap: 16px; margin-top: 6px; font-size: 12px; color: var(--text-muted); }
.chart-legend span { display: inline-flex; align-items: center; gap: 7px; }
.lg-line { width: 18px; height: 0; border-top: 2.5px solid var(--primary); display: inline-block; }
.lg-line.lg-dash { border-top: 2px dashed var(--accent); }
.area-chart.tall { width: 100%; height: 240px; display: block; margin-top: 8px; }
.axis-label { font-size: 9px; fill: #94a3b8; font-family: var(--font-body); }
.chart-meta {
    display: flex; gap: 34px; margin-top: 14px; padding-top: 12px;
    border-top: 1px solid #eef2f1;
}
.chart-meta > div { display: flex; flex-direction: column; }
.chart-meta span { font-size: 11px; color: var(--text-muted); }
.chart-meta b { font-size: 14px; color: var(--text); font-weight: 700; margin-top: 1px; }

/* today's campaigns (schedule) */
.sched-card { padding: 18px 20px; display: flex; flex-direction: column; }
.sched { list-style: none; margin: 10px 0 0; padding: 0; flex: 1; }
.sched li {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid #f1f5f4;
}
.sched li:last-child { border-bottom: 0; }
.sched-time {
    font-size: 11.5px; font-weight: 700; color: var(--text); width: 40px; flex: none;
    display: flex; flex-direction: column; line-height: 1.3;
}
.sched-time span { font-weight: 500; color: var(--text-muted); }
.sched-body { flex: 1; min-width: 0; }
.sched-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sched-sub { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.tag {
    font-size: 10px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
    padding: 3px 9px; border-radius: 20px; flex: none;
}
.tag-internal { background: #eef4f1; color: var(--primary); }
.tag-call { background: rgba(74,222,128,.2); color: #15803d; }
.tag-lead { background: rgba(74,222,128,.2); color: #15803d; }
.sched-foot {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 12px; padding-top: 12px; border-top: 1px solid #eef2f1;
    font-size: 12px; color: var(--text-muted);
}
.sched-foot b { color: var(--text); }

/* mini campaign cards */
.mini-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 16px; }
.mini { padding: 14px 16px; text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
.mini:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(15,42,34,.12); }
.mini-label { display: flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600; color: var(--text-muted); }
.mini-label .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--secondary); flex: none; }
.mini-value { font-family: var(--font-display); font-size: 22px; font-weight: 800; color: var(--text); margin-top: 8px; letter-spacing: -.02em; }
.mini-bar { height: 4px; border-radius: 2px; background: #eef2f1; margin-top: 10px; overflow: hidden; }
.mini-bar i { display: block; height: 100%; background: var(--primary); border-radius: 2px; }
.mini-dark { background: var(--primary); border-color: var(--primary); }
.mini-dark .mini-label { color: rgba(255,255,255,.6); }
.mini-dark .mini-value { color: #fff; }
.mini-dark .mini-bar { background: rgba(255,255,255,.15); }
.mini-dark .mini-bar i { background: var(--secondary); }

/* lead funnel */
.funnel-card { padding: 20px 22px; }
.funnel { list-style: none; margin: 14px 0 0; padding: 0; }
.funnel li { margin-bottom: 12px; }
.funnel-row { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 5px; }
.funnel-row span { color: var(--text); font-weight: 500; }
.funnel-row b { color: var(--text-muted); font-weight: 600; }
.funnel-bar { height: 10px; border-radius: 5px; background: #eef2f1; overflow: hidden; }
.funnel-bar i { display: block; height: 100%; background: var(--primary); border-radius: 5px; }
.funnel-bar i.accent { background: var(--secondary); }

/* activity stream */
.stream-card { padding: 20px 22px; }
.stream { list-style: none; margin: 8px 0 0; padding: 0; }
.stream li {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 6px; border-bottom: 1px solid #f1f5f4; border-radius: 8px;
    transition: background-color .12s ease; cursor: default;
}
.stream li:hover { background: #f8fafb; }
.stream li:last-child { border-bottom: 0; }
.stream-ico {
    width: 30px; height: 30px; border-radius: 9px; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: #eef4f1; color: var(--primary);
}
.stream-body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stream-text { font-size: 13px; font-weight: 500; color: var(--text); }
.stream-time { font-size: 11px; color: var(--text-muted); }
.stream-chev { color: #cbd5e1; flex: none; }

/* avatars + cell avatars (shared) */
.avatar {
    width: 28px; height: 28px; border-radius: 50%; flex: none;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, #1a4a36, #0f2a22);
    color: #a7f3d0; font-size: 10px; font-weight: 700; letter-spacing: .04em;
}
.cell-avatar {
    width: 24px; height: 24px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: #e2e8f0; color: #475569; font-size: 9px; font-weight: 700;
    margin-right: 7px; vertical-align: -7px;
}

@media (max-width: 1100px) {
    .kpi-grid, .mini-grid { grid-template-columns: repeat(2, 1fr); }
    .dash-grid, .dash-grid.bottom { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .kpi-grid, .mini-grid { grid-template-columns: 1fr; }
    .topbar .pill { display: none; }
}

/* ---------- Collections ---------- */
.bucket-card { padding: 20px 22px; text-decoration: none; display: block; }
.bucket-head {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 700; color: var(--text);
}
.bucket-dot { width: 9px; height: 9px; border-radius: 50%; }
.bucket-sub { margin-left: auto; font-size: 11px; font-weight: 500; color: var(--text-muted); }
.bucket-count {
    font-family: var(--font-display); font-size: 30px; font-weight: 800;
    color: var(--text); letter-spacing: -.02em; margin-top: 12px;
}
.bucket-count span { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.bucket-nums { display: flex; gap: 28px; margin-top: 8px; }
.bucket-nums > div { display: flex; flex-direction: column; }
.bucket-nums span { font-size: 11px; color: var(--text-muted); }
.bucket-nums b { font-size: 13.5px; color: var(--text); }

.kv { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; border-bottom: 1px solid #f1f5f4; }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--text-muted); }
.kv b { color: var(--text); font-weight: 600; }
.kv a { color: var(--primary); text-decoration: none; }

/* ---------- Pagination ---------- */
.pager {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px; flex-wrap: wrap;
}
.pager-info { font-size: 12.5px; color: var(--text-muted); }
.pager-links { display: flex; gap: 4px; align-items: center; }
.pager-btn {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 30px; height: 30px; padding: 0 9px;
    border: 1px solid var(--border); border-radius: 8px;
    font-size: 12.5px; font-weight: 600; color: var(--text);
    text-decoration: none; background: #fff;
    transition: border-color .15s ease, background-color .15s ease;
}
.pager-btn:hover:not(.disabled):not(.on) { border-color: var(--primary); color: var(--primary); }
.pager-btn.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.pager-btn.disabled { color: #cbd5e1; background: #f8fafb; cursor: default; }

/* ---------- Dashboard: attention + PAR snapshot ---------- */
.attn-card {
    padding: 14px 18px; margin-bottom: 16px;
    border-left: 3px solid var(--accent);
}
.attn-title { font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--text-muted); }
.attn-list { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 8px; }
.attn-item {
    display: inline-flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; text-decoration: none; color: var(--text);
}
.attn-item i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.attn-item svg { color: var(--text-muted); }
.attn-item:hover { color: var(--primary); }
.attn-red i { background: #dc2626; }
.attn-amber i { background: #d97706; }
.attn-green i { background: #16a34a; }

.par-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 16px; }
.par-card { padding: 16px 20px; text-decoration: none; }
.par-head { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--text); }
.par-head i { width: 8px; height: 8px; border-radius: 50%; }
.par-head span { margin-left: auto; font-weight: 500; font-size: 11px; color: var(--text-muted); }
.par-count { font-family: var(--font-display); font-size: 26px; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin-top: 8px; }
.par-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 3px; }

@media (max-width: 900px) { .par-grid { grid-template-columns: 1fr; } }

/* ---------- Worklist / call mode ---------- */
.call-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.call-main { padding: 22px 24px; }
.call-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.call-name { font-family: var(--font-display); font-size: 24px; font-weight: 800; letter-spacing: -.02em; color: var(--text); margin: 0; }
.call-phone { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.call-phone a { color: var(--primary); font-weight: 600; text-decoration: none; font-size: 15px; }
.call-amounts {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    margin: 16px 0; padding: 14px; border-radius: 12px; background: #f6f9f7;
}
.call-amounts span { display: block; font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--text-muted); }
.call-amounts b { font-family: var(--font-display); font-size: 17px; font-weight: 800; color: var(--text); }
.call-script {
    font-size: 12.5px; color: #334155; background: #f0f7f2;
    border-left: 3px solid var(--secondary); border-radius: 8px;
    padding: 10px 14px; margin-bottom: 14px; line-height: 1.5;
}
.call-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.dispo {
    padding: 12px 8px; border-radius: 10px; border: 1px solid var(--border);
    background: #fff; font-family: inherit; font-size: 12.5px; font-weight: 700;
    color: var(--text); cursor: pointer;
    transition: all .12s ease;
}
.dispo:hover { border-color: var(--primary); transform: translateY(-1px); }
.dispo-green { background: var(--primary); border-color: var(--primary); color: #fff; }
.dispo-green:hover { background: var(--primary-light); color: #fff; }
.dispo-amber { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.dispo-paid { background: rgba(74,222,128,.15); border-color: var(--secondary); color: #15803d; }
.call-promise { margin-top: 14px; padding: 12px; border: 1px dashed var(--border); border-radius: 10px; }
@media (max-width: 900px) { .call-grid { grid-template-columns: 1fr; } .call-actions { grid-template-columns: repeat(2, 1fr); } .call-amounts { grid-template-columns: repeat(2,1fr); } }

/* ---------- Module launcher ---------- */
.mod-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
@media (max-width: 1200px) { .mod-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .mod-grid { grid-template-columns: repeat(2, 1fr); } }
.mod {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius-card); padding: 22px 20px;
    display: flex; flex-direction: column; gap: 4px;
    text-decoration: none;
    transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease;
}
.mod-live:hover { box-shadow: var(--shadow-card); transform: translateY(-2px); border-color: var(--secondary); }
.mod-soon { opacity: .62; cursor: default; }
.mod-icon {
    width: 38px; height: 38px; border-radius: 10px; margin-bottom: 10px;
    background: #eef4f1;
    display: inline-flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-weight: 800; font-size: 15px; color: var(--primary);
}
.mod-icon::before { content: '◆'; font-size: 13px; }
.mod-icon-bank::before { content: '⌂'; }
.mod-icon-users::before { content: '◐'; }
.mod-icon-user::before { content: '◉'; }
.mod-icon-check::before { content: '✓'; }
.mod-icon-arrow::before { content: '→'; }
.mod-icon-undo::before { content: '↺'; }
.mod-icon-mobile::before { content: '▯'; }
.mod-icon-magic::before { content: '✦'; }
.mod-icon-book::before { content: '≡'; }
.mod-icon-chart::before { content: '▥'; }
.mod-name { font-size: 13.5px; font-weight: 700; color: var(--text); }
.mod-desc { font-size: 11.5px; color: var(--text-muted); line-height: 1.45; flex: 1; }
.mod-badge {
    align-self: flex-start; margin-top: 10px;
    font-size: 9.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase;
    padding: 4px 10px; border-radius: 12px; background: #f1f5f4; color: var(--text-muted);
}
.mod-badge-live { background: rgba(74,222,128,.22); color: #15803d; }

/* ---------- Marketing login hero ---------- */
.hero-wrap {
    min-height: 100vh;
    background:
        radial-gradient(900px 300px at -5% 50%, rgba(74,222,128,.14), transparent 70%),
        radial-gradient(900px 300px at 105% 50%, rgba(74,222,128,.14), transparent 70%),
        #fafbf7;
    border: 10px solid #eff5ee; border-radius: 26px; margin: 8px;
    display: flex; flex-direction: column;
}
.hero-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 44px;
}
.hero-logo { font-family: var(--font-display); font-weight: 800; font-size: 19px; color: var(--text); letter-spacing: -.02em; }
.hero-nav { display: flex; gap: 10px; }
.hero-body { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 30px 20px 60px; }
.hero-title { font-family: var(--font-display); font-size: clamp(30px, 4.6vw, 52px); font-weight: 800; letter-spacing: -.03em; line-height: 1.12; color: var(--text); margin: 0 0 16px; }
.hero-sub { max-width: 560px; font-size: 15px; color: var(--text-muted); line-height: 1.55; margin: 0 0 30px; }
.hero-card {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card);
    padding: 26px 30px 20px; width: 380px; text-align: left;
    box-shadow: 0 18px 44px -18px rgba(20,50,42,.25);
}
.hero-card-title { font-weight: 700; font-size: 14.5px; margin-bottom: 14px; }
.hero-card .login-field input { width: 100%; box-sizing: border-box; }
.hero-card .login-submit { width: 100%; margin-top: 10px; }
.hero-card-note { font-size: 11.5px; color: var(--text-muted); margin-top: 12px; text-align: center; }
.hero-stats { display: flex; gap: 14px; margin-top: 46px; flex-wrap: wrap; justify-content: center; }
.hero-stat {
    background: #f4f7f2; border: 1px solid var(--border); border-radius: 14px;
    padding: 20px 34px; min-width: 170px; text-align: left;
}
.hero-stat b { display: block; font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--text); letter-spacing: -.02em; }
.hero-stat span { font-size: 12px; color: var(--text-muted); }

/* ---------- Constellation login ---------- */
.cosmos {
    min-height: 100vh; position: relative; overflow: hidden;
    background: radial-gradient(1400px 800px at 30% 40%, #14392d 0%, #0e2a21 55%, #0b241c 100%);
}
.cosmos-net {
    position: absolute; inset: 0; width: 100%; height: 100%;
    opacity: .5; animation: cosmos-drift 26s ease-in-out infinite alternate;
}
@keyframes cosmos-drift {
    from { transform: scale(1) translateY(0); }
    to   { transform: scale(1.06) translateY(-14px); }
}
.cosmos-topbar {
    position: relative; z-index: 2; display: flex; align-items: center;
    justify-content: flex-end; gap: 8px; padding: 26px 44px;
}
.hero-powered { font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: #7ba78f; font-weight: 700; }
.cosmos-body {
    position: relative; z-index: 2; display: grid;
    grid-template-columns: 1.1fr 400px; gap: 60px; align-items: center;
    max-width: 1160px; margin: 0 auto; padding: 6vh 40px 40px; width: 100%;
}
.cosmos-title {
    font-family: var(--font-display); font-size: clamp(34px, 4.6vw, 58px);
    font-weight: 800; letter-spacing: -.02em; line-height: 1.08; color: #f2f7f3; margin: 0 0 18px;
}
.cosmos-sub { max-width: 460px; font-size: 14.5px; color: #9dbfa9; line-height: 1.6; margin: 0 0 34px; }
.cosmos-card {
    background: #f7faf6; border-radius: 18px; padding: 34px 34px 24px;
    box-shadow: 0 30px 80px -20px rgba(0,0,0,.5);
}
.cosmos-card-title { font-size: 21px; font-weight: 800; color: var(--text); font-family: var(--font-display); }
.cosmos-card-sub { font-size: 12.5px; color: var(--text-muted); margin: 4px 0 24px; }
.cosmos-field { margin-bottom: 14px; }
.cosmos-field label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.cosmos-field input {
    width: 100%; box-sizing: border-box; padding: 11px 14px; font-size: 14px;
    border: 1px solid #dfe8e0; border-radius: 10px; background: #eef3ee; color: var(--text);
}
.cosmos-field input:focus { outline: 2px solid rgba(74,222,128,.5); border-color: var(--secondary); }
.cosmos-card .login-submit { width: 100%; margin-top: 10px; }
.cosmos-card-quote { font-size: 12px; font-style: italic; color: var(--text-muted); margin-top: 20px; }
.hero-stats-dark .hero-stat { background: rgba(255,255,255,.05); border-color: rgba(255,255,255,.1); }
.hero-stats-dark .hero-stat b { color: #f2f7f3; }
.hero-stats-dark .hero-stat span { color: #9dbfa9; }
@media (max-width: 900px) {
    .cosmos-body { grid-template-columns: 1fr; gap: 34px; padding-top: 4vh; }
    .cosmos { min-height: 100vh; }
}

/* ---------- Economic-activity map bg ---------- */
.econmap { position: absolute; inset: 0; z-index: 0; filter: saturate(.85) brightness(.8); }
.econmap .leaflet-pane { z-index: 1; }
.cosmos-scrim {
    position: absolute; inset: 0; z-index: 1;
    background:
        radial-gradient(1100px 700px at 30% 45%, rgba(11,36,28,.86) 0%, rgba(11,36,28,.55) 55%, rgba(11,36,28,.75) 100%),
        linear-gradient(90deg, rgba(11,36,28,.55), rgba(11,36,28,.35));
}
.cosmos-topbar, .cosmos-body { position: relative; z-index: 2; }
.econ-pulse { position: relative; }
.econ-pulse::before {
    content: ''; position: absolute; width: 6px; height: 6px; margin: -3px;
    border-radius: 50%; background: #4ade80;
    box-shadow: 0 0 0 0 rgba(74,222,128,.7);
    animation: econ-ping 2.4s cubic-bezier(0,0,.2,1) infinite;
}
@keyframes econ-ping {
    0%   { box-shadow: 0 0 0 0 rgba(74,222,128,.55); }
    70%  { box-shadow: 0 0 0 14px rgba(74,222,128,0); }
    100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}
