/* ============================================
   ADAPTOO — Dark Command Center
   Aesthetic: Industrial sales cockpit
   Fonts: DM Sans (UI) + JetBrains Mono (data)
   ============================================ */

:root {
    /* Surfaces */
    --bg: #0c0e12;
    --surface-1: #13161c;
    --surface-2: #1a1d25;
    --surface-3: #22262f;
    --surface-hover: #282c37;

    /* Borders */
    --border: rgba(255,255,255,0.06);
    --border-strong: rgba(255,255,255,0.1);

    /* Brand */
    --teal: #4ecdc4;
    --teal-dim: rgba(78, 205, 196, 0.12);
    --teal-glow: rgba(78, 205, 196, 0.25);
    --mint: #88cbb6;
    --mint-dim: rgba(136, 203, 182, 0.1);
    --yellow: #fbbf24;
    --yellow-dim: rgba(251, 191, 36, 0.1);
    --purple: #a78bfa;
    --purple-dim: rgba(167, 139, 250, 0.1);
    --red: #f87171;
    --red-dim: rgba(248, 113, 113, 0.1);
    --green: #34d399;
    --green-dim: rgba(52, 211, 153, 0.1);

    /* Text */
    --text-primary: #e8eaed;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --text-dim: #4b5563;

    /* Radii */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-lg: 14px;

    /* Shadows */
    --shadow: 0 1px 3px rgba(0,0,0,0.3), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4), 0 2px 4px rgba(0,0,0,0.2);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 20px rgba(78, 205, 196, 0.08);

    --sidebar-w: 220px;
    --header-h: 56px;

    --font: 'DM Sans', -apple-system, sans-serif;
    --mono: 'JetBrains Mono', 'SF Mono', monospace;
}

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 14px; scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-secondary);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

/* ---- Sidebar ---- */
#sidebar {
    position: fixed;
    left: 0; top: 0;
    width: var(--sidebar-w);
    height: 100vh;
    background: var(--surface-1);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    z-index: 200;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-brand {
    padding: 1.4rem 1.25rem 1.1rem;
    border-bottom: 1px solid var(--border);
}

.sidebar-logo { height: 24px; width: auto; opacity: 0.9; }

.sidebar-nav {
    flex: 1;
    padding: 0.6rem;
    display: flex;
    flex-direction: column;
    gap: 1px;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.55rem 0.75rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font);
    font-size: 0.86rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: left;
}

.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; stroke-width: 1.8; }
.nav-item:hover { background: var(--surface-hover); color: var(--text-secondary); }

.nav-item.active {
    background: var(--teal-dim);
    color: var(--teal);
}
.nav-item.active svg { stroke: var(--teal); }

.sidebar-footer {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--border);
}

.sidebar-footer-text {
    font-family: var(--mono);
    font-size: 0.6rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-dim);
}

/* ---- Mobile ---- */
#mobile-header {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--surface-1);
    border-bottom: 1px solid var(--border);
    z-index: 150;
    align-items: center;
    padding: 0 1rem;
    gap: 1rem;
}

#menu-toggle { background: none; border: none; cursor: pointer; color: var(--text-secondary); width: 24px; height: 24px; }
#menu-toggle svg { width: 100%; height: 100%; }
.mobile-logo { height: 20px; }

/* ---- Main ---- */
#main {
    margin-left: var(--sidebar-w);
    min-height: 100vh;
    padding: 1.75rem 2rem;
    animation: fadeIn 0.4s ease;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ---- Sections ---- */
.section { display: none; }
.section.active { display: block; animation: fadeIn 0.3s ease; }

.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.section-header h1 {
    font-family: var(--font);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.03em;
}

.date-badge {
    display: inline-flex;
    padding: 0.25rem 0.7rem;
    background: var(--surface-2);
    color: var(--text-muted);
    font-family: var(--mono);
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 100px;
    border: 1px solid var(--border);
}

.sub-heading {
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

/* ---- Action Cards (Home) ---- */
.action-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
}

.action-card {
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.action-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius);
    opacity: 0;
    transition: opacity 0.3s;
}

.action-card.action-leads::after { background: radial-gradient(ellipse at 50% 0%, var(--teal-glow), transparent 70%); }
.action-card.action-callbacks::after { background: radial-gradient(ellipse at 50% 0%, rgba(251,191,36,0.15), transparent 70%); }
.action-card.action-positive::after { background: radial-gradient(ellipse at 50% 0%, rgba(52,211,153,0.15), transparent 70%); }
.action-card.action-followups::after { background: radial-gradient(ellipse at 50% 0%, rgba(167,139,250,0.15), transparent 70%); }

.action-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.action-card:hover::after { opacity: 1; }

.action-number {
    font-family: var(--mono);
    font-size: 2.2rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.3rem;
    position: relative;
    z-index: 1;
}

.action-leads .action-number { color: var(--teal); }
.action-callbacks .action-number { color: var(--yellow); }
.action-positive .action-number { color: var(--green); }
.action-followups .action-number { color: var(--purple); }

.action-label {
    font-family: var(--font);
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

.action-card.has-items { border-color: var(--border-strong); }
.action-card.has-items::after { opacity: 1; }

/* ---- Activity Bar ---- */
.activity-bar {
    display: flex;
    justify-content: space-around;
    padding: 1rem 0.75rem;
    gap: 0.25rem;
}

.activity-item { text-align: center; flex: 1; }

.activity-num {
    font-family: var(--mono);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.activity-lbl {
    font-family: var(--font);
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-top: 0.15rem;
}

/* ---- Cards ---- */
.card {
    background: var(--surface-2);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.15rem;
    border-bottom: 1px solid var(--border);
}

.card-header h2 {
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    letter-spacing: -0.01em;
}

.card-badge {
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    background: var(--teal-dim);
    color: var(--teal);
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.card-body { padding: 0.85rem 1.15rem; }

/* ---- Content Grid ---- */
.content-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    gap: 1rem;
}

/* ---- Performance Grid ---- */
.perf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

/* ---- Conversion Funnel ---- */
.funnel-container {
    padding: 1.15rem;
    display: flex;
    align-items: flex-end;
    gap: 2px;
    min-height: 100px;
}

.funnel-stage { flex: 1; text-align: center; }

.funnel-bar-fill {
    border-radius: 3px 3px 0 0;
    min-height: 10px;
    transition: height 0.4s ease;
}

.funnel-count {
    font-family: var(--mono);
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 0.4rem;
}

.funnel-pct {
    font-family: var(--mono);
    font-size: 0.65rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 0.1rem;
}

.funnel-label {
    font-family: var(--font);
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin-top: 0.25rem;
}

.funnel-arrow {
    flex: 0 0 20px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85rem;
    padding-bottom: 2rem;
}

/* ---- Weekly Comparison ---- */
.weekly-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
}
.weekly-row:last-child { border-bottom: none; }

.weekly-label {
    font-family: var(--font);
    font-size: 0.8rem;
    color: var(--text-muted);
    flex: 1;
}

.weekly-values {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-family: var(--mono);
    font-size: 0.8rem;
    font-weight: 600;
}

.weekly-old { color: var(--text-dim); }
.weekly-new { color: var(--text-primary); }
.weekly-arrow { font-size: 0.85rem; }
.weekly-arrow.up { color: var(--green); }
.weekly-arrow.down { color: var(--red); }
.weekly-arrow.flat { color: var(--text-dim); }

/* ---- Niche Scoreboard ---- */
.niche-row {
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border);
    gap: 0.65rem;
}
.niche-row:last-child { border-bottom: none; }

.niche-row-name {
    font-family: var(--font);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.niche-row-stat {
    font-family: var(--mono);
    font-size: 0.72rem;
    text-align: right;
    white-space: nowrap;
}
.niche-row-stat strong { font-weight: 600; color: var(--teal); }
.niche-row-stat span { color: var(--text-dim); font-size: 0.65rem; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }

th {
    text-align: left;
    padding: 0.6rem 0.85rem;
    font-family: var(--font);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    background: var(--surface-3);
    border-bottom: 1px solid var(--border);
}

td {
    padding: 0.6rem 0.85rem;
    font-size: 0.82rem;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
}

tr { transition: background 0.1s ease; }
tbody tr { cursor: pointer; }
tbody tr:hover td { background: var(--surface-hover); }
tbody tr:last-child td { border-bottom: none; }
td a { color: var(--teal); text-decoration: none; font-weight: 500; }
td a:hover { color: var(--mint); text-decoration: underline; }

/* ---- Quality Dots ---- */
.q-dot {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-family: var(--mono);
    font-weight: 600;
    font-size: 0.78rem;
}

.q-dot::before {
    content: '';
    width: 7px; height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

.q-high { color: var(--green); }
.q-high::before { background: var(--green); box-shadow: 0 0 6px rgba(52,211,153,0.5); }
.q-mid { color: var(--yellow); }
.q-mid::before { background: var(--yellow); box-shadow: 0 0 6px rgba(251,191,36,0.4); }
.q-low { color: var(--red); }
.q-low::before { background: var(--red); box-shadow: 0 0 6px rgba(248,113,113,0.4); }

/* ---- Badges ---- */
.badge {
    display: inline-flex;
    padding: 0.12rem 0.5rem;
    border-radius: 100px;
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-positive { background: var(--green-dim); color: var(--green); }
.badge-question { background: var(--yellow-dim); color: var(--yellow); }
.badge-negative { background: rgba(107,114,128,0.15); color: var(--text-muted); }
.badge-niche { background: var(--teal-dim); color: var(--teal); }

/* ---- Charts ---- */
.chart-wrap { padding: 1rem; }

/* ---- Pipeline Hero ---- */
.pipeline-hero {
    background: linear-gradient(135deg, var(--surface-2) 0%, var(--surface-3) 100%);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem 2rem;
    margin-bottom: 1.25rem;
    position: relative;
    overflow: hidden;
}

.pipeline-hero::after {
    content: '';
    position: absolute;
    top: -50%; right: -15%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, var(--teal-glow), transparent 70%);
    border-radius: 50%;
}

.pipeline-value {
    font-family: var(--mono);
    font-size: 2.6rem;
    font-weight: 800;
    color: var(--teal);
    line-height: 1;
    letter-spacing: -0.03em;
    position: relative;
    z-index: 1;
}

.pipeline-meta {
    font-family: var(--font);
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    position: relative;
    z-index: 1;
}

/* ---- Follow-up Cards ---- */
.followup-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.fu-card {
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.75rem;
    transition: all 0.2s ease;
    cursor: pointer;
    margin-bottom: 0.5rem;
}

.fu-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.fu-info { flex: 1; }
.fu-name { font-weight: 600; color: var(--text-primary); font-size: 0.88rem; }
.fu-meta { font-size: 0.72rem; color: var(--text-muted); margin-top: 0.15rem; }
.fu-opener { font-size: 0.75rem; color: var(--teal); font-style: italic; margin-top: 0.3rem; }
.fu-phone { color: var(--teal); text-decoration: none; font-family: var(--mono); font-weight: 600; font-size: 0.78rem; white-space: nowrap; }
.fu-phone:hover { color: var(--mint); }

/* ---- CRM Toolbar ---- */
.crm-toolbar {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box { flex: 1; min-width: 200px; position: relative; }

.search-box svg {
    position: absolute;
    left: 0.75rem; top: 50%;
    transform: translateY(-50%);
    width: 16px; height: 16px;
    color: var(--text-dim);
    stroke-width: 2;
}

.search-box input {
    width: 100%;
    padding: 0.5rem 0.75rem 0.5rem 2.25rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.82rem;
    color: var(--text-primary);
    background: var(--surface-2);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.search-box input:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 2px var(--teal-dim);
}

.search-box input::placeholder { color: var(--text-dim); }

.crm-toolbar select {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--surface-2);
    cursor: pointer;
    outline: none;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
}
.toggle-label input { accent-color: var(--teal); }

/* ---- Pagination ---- */
.pagination { display: flex; gap: 0.25rem; justify-content: center; margin-top: 1rem; }

.pagination button {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--border);
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s;
}

.pagination button:hover { border-color: var(--teal); color: var(--teal); }
.pagination button.active { background: var(--teal); color: var(--bg); border-color: var(--teal); }

/* ---- A/B Test ---- */
.ab-card {
    background: var(--surface-2);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.ab-card h3 {
    font-family: var(--font);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.winner-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    background: var(--teal);
    color: var(--bg);
    padding: 0.15rem 0.55rem;
    border-radius: 100px;
    font-family: var(--mono);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.ab-card table { margin-top: 0.4rem; }
.ab-card th { background: transparent; }

/* ---- Reply Breakdown ---- */
.reply-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1.15rem;
    border-bottom: 1px solid var(--border);
}
.reply-item:last-child { border-bottom: none; }

.reply-label { display: flex; align-items: center; gap: 0.45rem; font-size: 0.82rem; font-weight: 500; color: var(--text-secondary); }

.reply-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.reply-dot.positive { background: var(--green); box-shadow: 0 0 6px rgba(52,211,153,0.4); }
.reply-dot.question { background: var(--yellow); box-shadow: 0 0 6px rgba(251,191,36,0.3); }
.reply-dot.negative { background: var(--text-dim); }

.reply-count { font-family: var(--mono); font-weight: 700; font-size: 1rem; color: var(--text-primary); }

/* ---- Empty State ---- */
.empty-state { text-align: center; padding: 2rem; color: var(--text-dim); font-size: 0.85rem; }

/* ---- Modal ---- */
.modal { position: fixed; inset: 0; z-index: 500; display: flex; align-items: center; justify-content: flex-end; }
.modal.hidden { display: none; }

.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.2s ease;
}

.modal-panel {
    position: relative;
    width: 540px;
    max-width: 95vw;
    height: 100vh;
    background: var(--surface-1);
    border-left: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface-1);
    z-index: 10;
}

.modal-head h2 { font-family: var(--font); font-size: 1.05rem; font-weight: 700; color: var(--text-primary); }

.modal-close { background: none; border: none; cursor: pointer; color: var(--text-dim); width: 22px; height: 22px; transition: color 0.15s; }
.modal-close:hover { color: var(--text-primary); }
.modal-close svg { width: 100%; height: 100%; }

#modal-body { padding: 1.25rem 1.5rem; }

#modal-body .detail-row {
    display: flex;
    padding: 0.45rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.82rem;
}

#modal-body .detail-label {
    width: 100px;
    flex-shrink: 0;
    font-weight: 600;
    color: var(--text-dim);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: var(--font);
}

#modal-body .detail-value { color: var(--text-secondary); }

#modal-body .modal-section { margin-top: 1.25rem; }

#modal-body .modal-section h3 {
    font-family: var(--font);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-dim);
    margin-bottom: 0.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-strong);
}

#modal-body .opener-box {
    background: var(--teal-dim);
    border: 1px solid rgba(78,205,196,0.15);
    border-radius: var(--radius-sm);
    padding: 0.75rem 0.85rem;
    font-style: italic;
    color: var(--teal);
    font-size: 0.82rem;
    line-height: 1.5;
}

#modal-body .note-item { padding: 0.5rem 0; border-bottom: 1px solid var(--border); font-size: 0.8rem; }
#modal-body .note-date { color: var(--text-dim); font-family: var(--mono); font-size: 0.68rem; }

/* ---- Best Time ---- */
.bt-card {
    background: var(--surface-3);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
}

.bt-niche { font-family: var(--font); font-weight: 600; font-size: 0.85rem; color: var(--text-primary); }
.bt-calls { font-family: var(--mono); font-size: 0.72rem; color: var(--text-dim); }
.bt-rec { margin-top: 0.35rem; font-size: 0.8rem; color: var(--teal); font-style: italic; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}

.btn-primary { background: var(--teal); color: var(--bg); }
.btn-primary:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 4px 12px var(--teal-glow); }

.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--surface-hover); color: var(--text-secondary); }

.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 0.25rem 0.55rem; font-size: 0.72rem; }
.card-actions { display: flex; gap: 0.4rem; }

/* ---- Action Buttons (Modal) ---- */
.action-buttons { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.btn-action {
    padding: 0.45rem 0.85rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
}

.btn-called { background: var(--teal-dim); color: var(--teal); border-color: rgba(78,205,196,0.2); }
.btn-called:hover { background: rgba(78,205,196,0.2); }

.btn-no-answer { background: var(--yellow-dim); color: var(--yellow); border-color: rgba(251,191,36,0.2); }
.btn-no-answer:hover { background: rgba(251,191,36,0.2); }

.btn-interested { background: var(--green-dim); color: var(--green); border-color: rgba(52,211,153,0.2); }
.btn-interested:hover { background: rgba(52,211,153,0.2); }

.btn-not-interested { background: rgba(107,114,128,0.1); color: var(--text-muted); border-color: rgba(107,114,128,0.2); }
.btn-not-interested:hover { background: rgba(107,114,128,0.2); }

.btn-callback { background: var(--purple-dim); color: var(--purple); border-color: rgba(167,139,250,0.2); }
.btn-callback:hover { background: rgba(167,139,250,0.2); }

.btn-whatsapp { background: var(--green-dim); color: #25d366; border-color: rgba(37,211,102,0.2); }
.btn-whatsapp:hover { background: rgba(37,211,102,0.2); }

/* ---- Objection Tags ---- */
.objection-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.65rem; }

.objection-tag {
    padding: 0.3rem 0.65rem;
    border-radius: 100px;
    border: 1px solid var(--border);
    background: var(--surface-3);
    font-family: var(--font);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-muted);
}

.objection-tag:hover { border-color: var(--teal); color: var(--teal); }
.objection-tag.selected { background: var(--teal); color: var(--bg); border-color: var(--teal); }

/* ---- Note Prompt ---- */
.note-prompt {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.65rem;
    padding: 0.65rem;
    background: var(--surface-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.note-prompt label {
    font-family: var(--font);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
}

/* ---- Message Composer ---- */
.message-composer {
    margin-top: 1.25rem;
    padding: 1rem;
    background: var(--surface-3);
    border-radius: var(--radius);
    border: 1px solid var(--teal);
    box-shadow: 0 0 16px rgba(78, 205, 196, 0.08);
}

.composer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.composer-header h3 {
    font-family: var(--font);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--teal);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.composer-badge {
    font-family: var(--mono);
    font-size: 0.6rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    background: var(--teal-dim);
    color: var(--teal);
    border-radius: 100px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.composer-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.6rem;
}

.composer-controls select {
    flex: 1;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.78rem;
    color: var(--text-primary);
    background: var(--surface-2);
    outline: none;
}

.variant-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.variant-btn {
    padding: 0.35rem 0.65rem;
    background: var(--surface-2);
    border: none;
    font-family: var(--mono);
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-dim);
    cursor: pointer;
    transition: all 0.15s;
}

.variant-btn + .variant-btn { border-left: 1px solid var(--border); }
.variant-btn:hover { color: var(--text-secondary); }
.variant-btn.active { background: var(--teal); color: var(--bg); }

.composer-textarea {
    width: 100%;
    padding: 0.65rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text-primary);
    background: var(--surface-1);
    outline: none;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.2s;
}

.composer-textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 2px var(--teal-dim);
}

.composer-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.6rem;
}

/* ---- Quality Signals ---- */
.signals-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.4rem; }

.signal-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    font-size: 0.78rem;
}

.signal-good { background: var(--green-dim); border: 1px solid rgba(52,211,153,0.15); }
.signal-bad { background: var(--red-dim); border: 1px solid rgba(248,113,113,0.15); }
.signal-icon { font-weight: 700; flex-shrink: 0; width: 16px; text-align: center; }
.signal-good .signal-icon { color: var(--green); }
.signal-bad .signal-icon { color: var(--red); }
.signal-label { font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.signal-detail { color: var(--text-dim); font-size: 0.7rem; margin-left: auto; text-align: right; }

/* ---- Upcoming Calls ---- */
.upcoming-item { padding: 0.55rem 0; border-bottom: 1px solid var(--border); }
.upcoming-item:last-child { border-bottom: none; }
.upcoming-name { font-weight: 600; color: var(--teal); font-size: 0.82rem; }
.upcoming-meta { font-family: var(--mono); font-size: 0.68rem; color: var(--text-dim); margin-top: 0.1rem; }

/* ---- Settings ---- */
.settings-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 1rem; align-items: start; }
.settings-card-wide { min-height: 400px; display: flex; flex-direction: column; }
.settings-right { display: flex; flex-direction: column; gap: 1rem; }
.settings-body { padding: 1rem 1.15rem; }
.settings-desc { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 0.85rem; line-height: 1.5; }

/* ---- Forms ---- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.65rem 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.25rem; }
.form-group label { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }

.form-input {
    padding: 0.45rem 0.65rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.8rem;
    color: var(--text-primary);
    background: var(--surface-3);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-dim); }
.form-help { font-size: 0.68rem; color: var(--text-dim); line-height: 1.4; }

.config-status { padding: 0.5rem 1.15rem; font-size: 0.78rem; min-height: 0; transition: all 0.3s ease; }
.config-status.success { background: var(--green-dim); color: var(--green); }
.config-status.error { background: var(--red-dim); color: var(--red); }

/* ---- Scrape ---- */
.scrape-status { margin-top: 0.65rem; font-size: 0.78rem; display: flex; align-items: center; gap: 0.4rem; }

.scrape-status .spinner {
    width: 14px; height: 14px;
    border: 2px solid var(--border);
    border-top-color: var(--teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.scrape-log {
    margin-top: 0.65rem;
    padding: 0.65rem;
    background: var(--bg);
    color: var(--text-dim);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    font-family: var(--mono);
    font-size: 0.68rem;
    line-height: 1.5;
    max-height: 220px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}
.scrape-log.hidden { display: none; }

/* ---- Niche Cards ---- */
.niche-card { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); }
.niche-card:last-child { border-bottom: none; }

.niche-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.4rem; }
.niche-title { display: flex; align-items: center; gap: 0.65rem; }
.niche-title strong { font-family: var(--font); font-size: 0.9rem; color: var(--teal); }

.niche-keyword {
    font-size: 0.68rem;
    font-family: var(--mono);
    padding: 0.1rem 0.45rem;
    background: var(--teal-dim);
    color: var(--teal);
    border-radius: 3px;
    border: 1px solid rgba(78,205,196,0.15);
}

.niche-summary { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; font-size: 0.75rem; color: var(--text-muted); }
.niche-summary strong { color: var(--text-secondary); font-weight: 600; }
.niche-edit { margin-top: 0.85rem; padding-top: 0.85rem; border-top: 1px solid var(--border); }
.niche-edit.hidden { display: none; }

/* ---- Nav Divider ---- */
.nav-divider { height: 1px; background: var(--border); margin: 0.4rem 0; }

/* ---- Overlay ---- */
#sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 199; }
#sidebar-overlay.active { display: block; }

/* ---- Scrollbar ---- */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-hover); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

/* ---- Responsive ---- */
@media (max-width: 1024px) {
    #sidebar { transform: translateX(-100%); }
    #sidebar.open { transform: translateX(0); }
    #mobile-header { display: flex; }
    #main { margin-left: 0; padding-top: calc(var(--header-h) + 1.25rem); padding-left: 0.85rem; padding-right: 0.85rem; }
    .content-grid { grid-template-columns: 1fr; }
    .followup-grid { grid-template-columns: 1fr; }
    .action-grid { grid-template-columns: repeat(2, 1fr); }
    .perf-grid { grid-template-columns: 1fr; }
    .settings-grid { grid-template-columns: 1fr; }
    .form-grid { grid-template-columns: 1fr; }
    .pipeline-value { font-size: 2rem; }
    .modal-panel { width: 100%; }
}

@media (max-width: 600px) {
    .action-grid { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
    .action-number { font-size: 1.6rem; }
    .activity-bar { flex-wrap: wrap; }
    .activity-item { min-width: 30%; }
    #main { padding: 0.85rem 0.65rem; padding-top: calc(var(--header-h) + 0.85rem); }
    .crm-toolbar { flex-direction: column; }
    .search-box { min-width: unset; }
    th, td { padding: 0.45rem 0.55rem; font-size: 0.72rem; }
    .section-header h1 { font-size: 1.2rem; }
}
