/* ==========================================================================
   AVVNL SolarFlow Style Sheet — caller-first UI
   Same class names as before; typography, panes, and components reworked.
   ========================================================================== */

:root {
    /* Color Palette */
    --bg-app: #0b0f19;
    --bg-sidebar: #101624;
    --bg-card: rgba(23, 31, 50, 0.72);
    --bg-card-hover: rgba(33, 44, 72, 0.85);
    --bg-input: #121a2b;
    --border-color: rgba(255, 255, 255, 0.09);
    --border-strong: rgba(255, 255, 255, 0.16);

    --color-text-primary: #f4f6f9;
    --color-text-secondary: #a7b0bf;
    --color-text-muted: #737d8f;

    --color-accent: #f59e0b; /* Solar Gold */
    --color-accent-hover: #d97706;
    --color-accent-gradient: linear-gradient(135deg, #ff8c00 0%, #f59e0b 100%);

    --color-success: #10b981;
    --color-info: #3b82f6;
    --color-pending: #f59e0b;
    --color-error: #ef4444;
    --color-purple: #8b5cf6;

    --font-primary: 'Inter', system-ui, sans-serif;
    --font-display: 'Outfit', 'Inter', sans-serif;

    /* Type scale — sized for callers reading at arm's length */
    --fs-xs: 0.75rem;    /* 12px — micro labels */
    --fs-sm: 0.8125rem;  /* 13px — secondary text */
    --fs-base: 0.9375rem;/* 15px — body / table cells */
    --fs-md: 1.0625rem;  /* 17px — emphasized values */
    --fs-lg: 1.25rem;    /* 20px — panel titles */
    --fs-xl: 1.5rem;     /* 24px — big numbers */

    --transition-smooth: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius-sm: 8px;
    --border-radius-md: 12px;
    --border-radius-lg: 18px;

    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
    --shadow-focus: 0 14px 40px -12px rgba(0, 0, 0, 0.65);
    --shadow-glow: 0 0 15px rgba(245, 158, 11, 0.2);

    /* Workspace split: width of the lead-list pane (drag the divider to change) */
    --split: 55%;
    --resizer-w: 16px;
}

/* Reset & Basics */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    font-size: var(--fs-base);
    background-color: var(--bg-app);
    color: var(--color-text-primary);
    overflow: hidden;
    height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
}

button {
    font-family: inherit;
}

/* Keyboard focus ring, everywhere */
:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ==========================================================================
   Scrollbars — every pane scrolls independently with a slim themed bar
   ========================================================================== */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.35) transparent;
}

*::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background-color: rgba(148, 163, 184, 0.28);
    border-radius: 6px;
    border: 2px solid transparent;
    background-clip: content-box;
}

*::-webkit-scrollbar-thumb:hover {
    background-color: rgba(245, 158, 11, 0.55);
}

/* App Container Layout */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ==========================================================================
   Sidebar — scrolls on its own when content overflows
   ========================================================================== */
.sidebar {
    width: 312px;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    padding: 22px 20px;
    flex-shrink: 0;
    z-index: 10;
    overflow-y: auto;
    overflow-x: hidden;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
    flex-shrink: 0;
}

.brand-logo {
    width: 44px;
    height: 44px;
    border-radius: var(--border-radius-md);
    background: var(--color-accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: var(--shadow-glow);
    animation: pulseGlow 3s infinite ease-in-out;
    flex-shrink: 0;
}

.brand-logo svg {
    width: 24px;
    height: 24px;
}

.brand-info h1 {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #fff;
}

.brand-info span {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    font-weight: 500;
}

/* Connection status cards */
.connection-card {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    position: relative;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.connection-card:hover {
    border-color: var(--border-strong);
    background-color: rgba(255, 255, 255, 0.05);
}

.status-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.status-indicator.connected {
    background-color: var(--color-success);
    box-shadow: 0 0 8px var(--color-success);
}

.status-indicator.disconnected {
    background-color: var(--color-error);
    box-shadow: 0 0 8px var(--color-error);
}

.connection-details {
    flex-grow: 1;
    min-width: 0;
}

.connection-details p {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.connection-details span {
    font-size: var(--fs-xs);
    color: var(--color-text-secondary);
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sync-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.sync-btn:hover {
    color: var(--color-accent);
    background-color: rgba(245, 158, 11, 0.12);
    transform: scale(1.08);
}

.sync-btn svg {
    width: 18px;
    height: 18px;
}

.sync-btn.spin svg,
#syncIcon.spin,
#tcScrapeIcon.spin {
    animation: spin 1s infinite linear;
}

/* Statistics widgets */
.stats-panel {
    margin: 14px 0 22px;
    flex-shrink: 0;
}

.stats-panel h3, .filter-section h3 {
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--color-text-muted);
    margin-bottom: 12px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.stat-card {
    background-color: rgba(255, 255, 255, 0.025);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.stat-card:hover {
    border-color: rgba(245, 158, 11, 0.45);
    background-color: rgba(245, 158, 11, 0.06);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px -8px rgba(0, 0, 0, 0.6);
}

.stat-card:active {
    transform: translateY(0);
}

.stat-num {
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    font-weight: 700;
    margin-bottom: 2px;
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: var(--fs-xs);
    color: var(--color-text-secondary);
    font-weight: 600;
}

/* Pitch filter chips */
.filter-section {
    flex-grow: 1;
    flex-shrink: 0; /* don't squash the chips — let the sidebar scroll instead */
}

.pitch-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-chip {
    background: none;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px 14px;
    color: var(--color-text-secondary);
    font-size: var(--fs-sm);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-chip:hover {
    background-color: rgba(255, 255, 255, 0.04);
    border-color: var(--border-strong);
    color: #fff;
    transform: translateX(3px);
}

.filter-chip.active {
    background-color: rgba(245, 158, 11, 0.12);
    border-color: var(--color-accent);
    color: var(--color-accent);
    font-weight: 600;
}

.sidebar-footer {
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid var(--border-color);
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer span {
    display: block;
    margin-top: 2px;
}

/* ==========================================================================
   Main Area
   ========================================================================== */
.main-content {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    height: 100vh;
    min-width: 0;
    position: relative;
    background-color: var(--bg-app);
}

/* Top bar / Search */
.top-bar {
    height: 68px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    flex-shrink: 0;
    gap: 16px;
}

.search-area {
    display: flex;
    align-items: center;
    gap: 18px;
    min-width: 0;
    flex: 1;
}

.search-box {
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    width: min(460px, 100%);
    padding: 10px 16px;
    gap: 12px;
    transition: var(--transition-smooth);
}

.search-box:hover {
    border-color: var(--border-strong);
}

.search-box:focus-within {
    border-color: var(--color-accent);
    box-shadow: var(--shadow-glow);
    background-color: rgba(255, 255, 255, 0.05);
}

.search-icon {
    width: 18px;
    height: 18px;
    color: var(--color-text-secondary);
    flex-shrink: 0;
}

.search-box input {
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-size: var(--fs-base);
    width: 100%;
    outline: none;
}

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

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.user-role {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    background-color: rgba(255, 255, 255, 0.05);
    padding: 5px 12px;
    border-radius: 14px;
    white-space: nowrap;
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--color-accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: var(--fs-base);
    color: #fff;
}

/* Truecaller-only toggle switch */
.toggle-container {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    flex-shrink: 0;
}

.toggle-container input {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 40px;
    height: 20px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.toggle-slider::before {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    left: 2px;
    top: 2px;
    background-color: var(--color-text-secondary);
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.toggle-container input:checked + .toggle-slider {
    background-color: rgba(245, 158, 11, 0.18);
    border-color: var(--color-accent);
}

.toggle-container input:checked + .toggle-slider::before {
    transform: translateX(20px);
    background-color: var(--color-accent);
}

.toggle-text {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.toggle-container:hover .toggle-text {
    color: #fff;
}

.toggle-container input:checked ~ .toggle-text {
    color: var(--color-accent);
    font-weight: 600;
}

/* ==========================================================================
   Workspace — two resizable panes with a draggable divider.
   --split controls the list pane width; hovering a pane gently grows it.
   ========================================================================== */
.workspace {
    display: flex;
    flex-grow: 1;
    padding: 18px 22px 22px;
    height: calc(100vh - 68px);
    min-height: 0;
    overflow: hidden;
}

/* Global Cards */
.card {
    background-color: var(--bg-card);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-premium);
    transition: border-color 0.28s ease, box-shadow 0.28s ease;
}

/* Lead list pane — width driven by --split (drag divider to change) */
.lead-list-section {
    width: calc(var(--split) - var(--resizer-w) / 2);
    flex: none;
    min-width: 0;
    height: 100%;
    transition: width 0.28s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.28s ease, box-shadow 0.28s ease;
}

/* Details pane fills the rest */
.lead-details-section {
    flex: 1;
    min-width: 0;
    height: 100%;
}

/* Divider between panes */
.pane-resizer {
    flex: none;
    width: var(--resizer-w);
    cursor: col-resize;
    position: relative;
    z-index: 5;
    touch-action: none;
}

.pane-resizer::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 4px;
    height: 52px;
    border-radius: 3px;
    background-color: rgba(255, 255, 255, 0.14);
    transition: var(--transition-smooth);
}

.pane-resizer:hover::before,
.workspace.dragging .pane-resizer::before {
    background-color: var(--color-accent);
    height: 90px;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.45);
}

/* Hover focus: the pane under the cursor brightens and grows slightly.
   Disabled while dragging so the divider stays authoritative. */
@media (hover: hover) and (min-width: 1025px) {
    .workspace:not(.dragging) .lead-list-section:hover,
    .workspace:not(.dragging) .lead-details-section:hover {
        border-color: rgba(245, 158, 11, 0.35);
        box-shadow: var(--shadow-focus);
    }

    .workspace:not(.dragging) .lead-list-section:hover {
        width: calc(var(--split) - var(--resizer-w) / 2 + 3%);
    }

    .workspace:not(.dragging):has(.lead-details-section:hover) .lead-list-section {
        width: calc(var(--split) - var(--resizer-w) / 2 - 3%);
    }
}

/* While dragging, kill transitions so the divider tracks the mouse exactly */
.workspace.dragging .lead-list-section {
    transition: none;
}

.workspace.dragging,
.workspace.dragging * {
    user-select: none;
}

/* ==========================================================================
   Lead list pane internals
   ========================================================================== */
.section-header {
    padding: 16px 20px 12px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.section-title {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.section-header h2 {
    font-size: var(--fs-lg);
    font-weight: 700;
}

.lead-count {
    font-size: var(--fs-xs);
    color: var(--color-text-secondary);
    font-weight: 600;
    background-color: rgba(255, 255, 255, 0.04);
    padding: 3px 10px;
    border-radius: 6px;
    align-self: flex-start;
}

.list-toolbar {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.list-toolbar .tb-select {
    background: var(--bg-input);
    color: var(--color-text-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: var(--fs-sm);
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.list-toolbar .tb-select:hover,
.list-toolbar .tb-select:focus {
    border-color: var(--color-accent);
    outline: none;
}

.list-toolbar .tb-check {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    cursor: pointer;
    user-select: none;
    transition: var(--transition-smooth);
}

.list-toolbar .tb-check:hover {
    color: #fff;
}

.list-toolbar .tb-check input {
    accent-color: var(--color-accent);
    cursor: pointer;
    width: 15px;
    height: 15px;
}

/* Today's call goal bar */
.today-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 10px 16px 8px;
    padding: 9px 14px;
    background: linear-gradient(90deg, rgba(245, 158, 11, 0.10), rgba(245, 158, 11, 0.02));
    border: 1px solid rgba(245, 158, 11, 0.25);
    border-radius: 10px;
    flex-shrink: 0;
}

.today-text {
    font-size: var(--fs-sm);
    color: #e2e8f0;
    white-space: nowrap;
}

.today-text strong {
    color: var(--color-accent);
    font-size: var(--fs-md);
    font-variant-numeric: tabular-nums;
}

.today-track {
    flex: 1;
    height: 8px;
    background: #1e293b;
    border-radius: 999px;
    overflow: hidden;
    min-width: 60px;
}

.today-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.today-remaining {
    font-size: var(--fs-xs);
    color: #94a3b8;
    white-space: nowrap;
}

/* The lead list scrolls by itself, both axes */
.list-container {
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: auto;
    overscroll-behavior: contain;
}

/* Table Design */
.leads-table {
    width: 100%;
    min-width: 660px;
    border-collapse: collapse;
    text-align: left;
}

.leads-table th {
    position: sticky;
    top: 0;
    background-color: #141b2d;
    z-index: 5;
    padding: 12px 16px;
    font-size: var(--fs-xs);
    font-weight: 700;
    text-transform: uppercase;
    color: var(--color-text-secondary);
    letter-spacing: 0.6px;
    border-bottom: 1px solid var(--border-strong);
    white-space: nowrap;
}

.leads-table td {
    padding: 13px 16px;
    font-size: var(--fs-sm);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    vertical-align: middle;
    transition: background-color 0.15s ease;
}

.leads-table tbody tr {
    cursor: pointer;
    position: relative;
}

.leads-table tbody tr:hover td {
    background-color: var(--bg-card-hover);
}

.leads-table tbody tr:hover td:first-child {
    box-shadow: inset 3px 0 0 var(--color-accent);
}

.leads-table tbody tr.active td {
    background-color: rgba(245, 158, 11, 0.08);
    border-bottom-color: rgba(245, 158, 11, 0.2);
}

.leads-table tbody tr.active td:first-child {
    box-shadow: inset 3px 0 0 var(--color-accent);
}

.leads-table .company-info h4 {
    font-size: var(--fs-base);
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.leads-table .company-info span {
    font-size: var(--fs-xs);
    color: var(--color-text-secondary);
    display: block;
}

.leads-table .bill-info span {
    font-weight: 700;
    font-size: var(--fs-base);
    color: #fff;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.company-title-container {
    display: flex;
    align-items: center;
}

.verified-icon {
    display: inline-block;
    width: 15px;
    height: 15px;
    color: var(--color-info);
    vertical-align: middle;
    margin-left: 6px;
    flex-shrink: 0;
}

/* Color badges */
.badge {
    display: inline-block;
    padding: 4px 11px;
    border-radius: 12px;
    font-size: var(--fs-xs);
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.badge-pitch-new {
    background-color: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-pitch-maint {
    background-color: rgba(139, 92, 246, 0.12);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.25);
}

.badge-pitch-low {
    background-color: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.status-indicator-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    margin-right: 6px;
    vertical-align: middle;
}

.badge-status {
    background-color: rgba(255, 255, 255, 0.04);
    color: var(--color-text-secondary);
    border: 1px solid var(--border-color);
}

.badge-status-wa-sent {
    background-color: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.25);
}

.badge-status-interested {
    background-color: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.badge-status-pending {
    background-color: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.badge-status-failed {
    background-color: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
}

/* Row action arrow */
.row-action-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    padding: 8px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition-smooth);
}

.row-action-btn:hover {
    color: var(--color-accent);
    background-color: rgba(245, 158, 11, 0.12);
    transform: translateX(2px);
}

.row-action-btn svg {
    width: 16px;
    height: 16px;
}

/* Pagination */
.pagination {
    padding: 12px 20px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-shrink: 0;
}

.pag-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--color-text-primary);
    padding: 8px 16px;
    border-radius: var(--border-radius-sm);
    font-size: var(--fs-sm);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.pag-btn:hover:not(:disabled) {
    background-color: rgba(245, 158, 11, 0.08);
    border-color: var(--color-accent);
    color: var(--color-accent);
}

.pag-btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.pag-info {
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.kbd-hint {
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    white-space: nowrap;
}

.kbd-hint kbd {
    display: inline-block;
    font-family: inherit;
    font-size: 0.625rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 0 4px;
    margin: 0 1px;
}

/* ==========================================================================
   Lead Details pane internals
   ========================================================================== */
.no-lead-selected {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 40px;
    text-align: center;
    color: var(--color-text-secondary);
}

.box-icon {
    width: 64px;
    height: 64px;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.box-icon svg {
    width: 100%;
    height: 100%;
}

.no-lead-selected h3 {
    color: #fff;
    margin-bottom: 8px;
    font-size: var(--fs-md);
}

.no-lead-selected p {
    font-size: var(--fs-sm);
    line-height: 1.55;
    max-width: 340px;
}

/* Layout: fixed header + fixed tabs + SCROLLING content + fixed status form */
.details-container {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}

.details-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-shrink: 0;
}

.details-title-area {
    min-width: 0;
}

.details-title-area h2 {
    font-size: var(--fs-lg);
    font-weight: 700;
    color: #fff;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.badge-kno {
    background-color: rgba(255, 255, 255, 0.05);
    color: var(--color-text-secondary);
    border: 1px solid var(--border-color);
    font-variant-numeric: tabular-nums;
}

.badge-city {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--color-accent);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.close-details-btn {
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: var(--transition-smooth);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.close-details-btn:hover {
    color: #fff;
    background-color: rgba(239, 68, 68, 0.15);
    transform: rotate(90deg);
}

/* Tab Menu */
.tabs-nav {
    display: flex;
    background-color: rgba(0, 0, 0, 0.18);
    border-bottom: 1px solid var(--border-color);
    padding: 0 8px;
    flex-shrink: 0;
    overflow-x: auto;
}

.tab-link {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 13px 18px;
    font-family: var(--font-display);
    font-size: var(--fs-sm);
    font-weight: 500;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: var(--transition-smooth);
    white-space: nowrap;
}

.tab-link:hover {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.03);
}

.tab-link.active {
    color: var(--color-accent);
    border-bottom-color: var(--color-accent);
    font-weight: 600;
}

/* The tab content is the pane's own scroll area */
.tab-content-container {
    flex-grow: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 20px;
    overscroll-behavior: contain;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.2s ease-out;
}

/* Weather Widget */
.weather-widget {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.06) 0%, rgba(22, 30, 49, 0.4) 100%);
    border: 1px solid rgba(245, 158, 11, 0.18);
    border-radius: var(--border-radius-md);
    padding: 16px;
    margin-bottom: 18px;
    transition: var(--transition-smooth);
}

.weather-widget:hover {
    border-color: rgba(245, 158, 11, 0.35);
}

.weather-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    gap: 12px;
}

.weather-title {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

.weather-icon {
    width: 32px;
    height: 32px;
    color: var(--color-accent);
    flex-shrink: 0;
}

.weather-title h4 {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: #fff;
}

.weather-source {
    font-size: var(--fs-xs);
    color: var(--color-text-muted);
}

.weather-temp {
    font-family: var(--font-display);
    font-size: 1.9rem;
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

.weather-body p {
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

.weather-tip-box {
    background-color: rgba(0, 0, 0, 0.2);
    border-left: 3px solid var(--color-accent);
    border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
    padding: 10px 14px;
}

.weather-tip-box strong {
    font-size: var(--fs-xs);
    color: var(--color-accent);
    display: block;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.weather-tip-box p {
    font-size: var(--fs-sm);
    line-height: 1.5;
    color: var(--color-text-primary);
    margin: 0;
}

/* Profile Info Grid */
.profile-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.profile-item {
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 12px 14px;
    transition: var(--transition-smooth);
    min-width: 0;
}

.profile-item:hover {
    border-color: var(--border-strong);
    background-color: rgba(255, 255, 255, 0.035);
}

.profile-item.full-width {
    grid-column: span 2;
}

.profile-item .label {
    display: block;
    font-size: 0.6875rem;
    color: var(--color-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 5px;
}

.profile-item strong {
    font-size: var(--fs-base);
    color: #fff;
    word-break: break-word;
}

.profile-item span:not(.label) {
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    line-height: 1.45;
}

/* Phone number gets extra prominence — the caller reads this constantly */
.phone-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.phone-number {
    font-size: var(--fs-md) !important;
    letter-spacing: 0.5px;
    font-variant-numeric: tabular-nums;
    color: var(--color-accent) !important;
}

.copy-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--color-text-secondary);
    padding: 6px;
    border-radius: 7px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    flex-shrink: 0;
}

.copy-btn:hover {
    color: var(--color-accent);
    border-color: var(--color-accent);
    background-color: rgba(245, 158, 11, 0.1);
}

.copy-btn svg {
    width: 15px;
    height: 15px;
}

/* Call / WhatsApp action bar */
.action-buttons-group {
    display: flex;
    gap: 12px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: none;
    padding: 14px 20px;
    border-radius: var(--border-radius-md);
    font-weight: 700;
    font-size: var(--fs-base);
    cursor: pointer;
    text-decoration: none;
    transition: var(--transition-smooth);
}

.call-action {
    background: var(--color-accent-gradient);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.call-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 22px rgba(245, 158, 11, 0.45);
}

.call-action:active {
    transform: translateY(0);
}

.wa-action {
    background-color: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: #34d399;
}

.wa-action:hover {
    background-color: rgba(16, 185, 129, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 0 18px rgba(16, 185, 129, 0.25);
}

.wa-action:active {
    transform: translateY(0);
}

.action-btn svg {
    width: 19px;
    height: 19px;
    flex-shrink: 0;
}

/* Script tab */
.script-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 10px;
    flex-wrap: wrap;
}

.script-header h4 {
    font-size: var(--fs-md);
}

.lang-toggle {
    display: flex;
    background-color: rgba(0, 0, 0, 0.25);
    padding: 3px;
    border-radius: 9px;
}

.lang-btn {
    background: none;
    border: none;
    color: var(--color-text-secondary);
    padding: 6px 14px;
    border-radius: 7px;
    font-size: var(--fs-sm);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.lang-btn:hover:not(.active) {
    color: #fff;
}

.lang-btn.active {
    background-color: var(--color-accent);
    color: #fff;
}

.script-body {
    background-color: rgba(0, 0, 0, 0.18);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 18px;
    font-size: var(--fs-base);
    line-height: 1.75;
    color: var(--color-text-primary);
    margin-bottom: 18px;
}

.script-body p {
    margin-bottom: 12px;
}

.script-body p:last-child {
    margin-bottom: 0;
}

.script-body strong {
    color: var(--color-accent);
}

.script-body em {
    color: var(--color-text-muted);
}

.script-body mark {
    background-color: rgba(245, 158, 11, 0.2);
    color: var(--color-accent);
    padding: 0 4px;
    border-radius: 3px;
    font-weight: 600;
}

/* Call Checklist */
.checklist-box {
    background-color: rgba(255, 255, 255, 0.015);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    margin-bottom: 18px;
}

.checklist-box h5, .objections-helper h5 {
    font-size: var(--fs-xs);
    font-weight: 700;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
    letter-spacing: 0.8px;
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.check-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    padding: 4px 6px;
    margin: -4px -6px;
    border-radius: 6px;
    transition: background-color 0.15s ease;
}

.check-item:hover {
    background-color: rgba(255, 255, 255, 0.03);
}

.check-item input {
    margin-top: 4px;
    cursor: pointer;
    accent-color: var(--color-accent);
    width: 15px;
    height: 15px;
    flex-shrink: 0;
}

.check-item span {
    font-size: var(--fs-sm);
    color: var(--color-text-secondary);
    transition: var(--transition-smooth);
}

.check-item input:checked + span {
    text-decoration: line-through;
    color: var(--color-text-muted);
}

/* Objection Accordion */
.objections-helper {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: var(--transition-smooth);
}

.accordion-item:hover {
    border-color: var(--border-strong);
}

.accordion-title {
    background-color: rgba(255, 255, 255, 0.02);
    padding: 13px 16px;
    font-size: var(--fs-sm);
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    user-select: none;
    transition: var(--transition-smooth);
    position: relative;
    padding-right: 36px;
}

.accordion-title::after {
    content: "▾";
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-muted);
    transition: var(--transition-smooth);
}

.accordion-title:hover {
    background-color: rgba(245, 158, 11, 0.06);
    color: var(--color-accent);
}

.accordion-content {
    background-color: rgba(0, 0, 0, 0.12);
    padding: 13px 16px;
    font-size: var(--fs-sm);
    line-height: 1.6;
    color: var(--color-text-secondary);
    border-top: 1px solid var(--border-color);
}

/* Billing tab */
.billing-chart-container {
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-md);
    padding: 16px;
    height: 250px;
    margin-bottom: 18px;
    position: relative;
}

.svg-chart-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tariff-analysis h4 {
    font-size: var(--fs-md);
    margin-bottom: 10px;
}

.table-container {
    overflow-x: auto;
}

.analysis-table {
    width: 100%;
    border-collapse: collapse;
}

.analysis-table td {
    padding: 12px 14px;
    font-size: var(--fs-sm);
    border-bottom: 1px solid var(--border-color);
}

.analysis-table td.bold {
    font-weight: 700;
    color: #fff;
    font-variant-numeric: tabular-nums;
}

.progress-bar-container {
    width: 90px;
    height: 7px;
    background-color: rgba(255, 255, 255, 0.06);
    border-radius: 4px;
    display: inline-block;
    vertical-align: middle;
    margin-right: 8px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
    border-radius: 4px;
    transition: width 0.4s ease;
}

/* Status update form — pinned at the bottom of the details pane */
.status-notes-card {
    border-top: 1px solid var(--border-color);
    padding: 16px 20px 18px;
    background-color: rgba(0, 0, 0, 0.15);
    flex-shrink: 0;
}

.status-notes-card h4 {
    font-size: var(--fs-sm);
    margin-bottom: 12px;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
}

.form-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.form-group label {
    font-size: var(--fs-xs);
    font-weight: 600;
    color: var(--color-text-secondary);
}

.date-display {
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 10px 12px;
    border-radius: var(--border-radius-sm);
    font-size: var(--fs-sm);
    color: var(--color-text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-notes-card select, .status-notes-card textarea {
    background-color: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--color-text-primary);
    padding: 10px 12px;
    font-size: var(--fs-sm);
    outline: none;
    font-family: var(--font-primary);
    transition: var(--transition-smooth);
    width: 100%;
    resize: vertical;
}

.status-notes-card select {
    cursor: pointer;
}

.status-notes-card select:hover, .status-notes-card textarea:hover {
    border-color: var(--border-strong);
}

.status-notes-card select:focus, .status-notes-card textarea:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.12);
}

.submit-btn {
    width: 100%;
    background: var(--color-accent-gradient);
    border: none;
    color: #fff;
    padding: 12px 16px;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    font-size: var(--fs-base);
    cursor: pointer;
    margin-top: 10px;
    box-shadow: var(--shadow-glow);
    transition: var(--transition-smooth);
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 0 20px rgba(245, 158, 11, 0.4);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

/* ==========================================================================
   Toasts
   ========================================================================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: min(380px, calc(100vw - 48px));
}

.toast {
    background-color: #1c2537;
    border: 1px solid var(--border-color);
    border-left: 4px solid var(--color-accent);
    color: #fff;
    padding: 13px 18px;
    border-radius: var(--border-radius-sm);
    font-size: var(--fs-sm);
    box-shadow: var(--shadow-premium);
    animation: slideIn 0.3s ease-out;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast svg {
    flex-shrink: 0;
}

.toast-success {
    border-left-color: var(--color-success);
}

.toast-success svg {
    color: var(--color-success);
}

.toast-error {
    border-left-color: var(--color-error);
}

.toast-error svg {
    color: var(--color-error);
}

/* ==========================================================================
   Animations & utilities
   ========================================================================== */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes slideIn {
    0% { transform: translateX(120%); opacity: 0; }
    100% { transform: translateX(0); opacity: 1; }
}

@keyframes fadeIn {
    0% { opacity: 0; transform: translateY(4px); }
    100% { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
    0% { box-shadow: 0 0 5px rgba(245, 158, 11, 0.2); }
    50% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.5); }
    100% { box-shadow: 0 0 5px rgba(245, 158, 11, 0.2); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.loading-cell {
    text-align: center;
    padding: 40px !important;
    color: var(--color-text-secondary);
    font-size: var(--fs-base);
}

.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top: 3px solid var(--color-accent);
    border-radius: 50%;
    display: inline-block;
    animation: spin 0.8s infinite linear;
    vertical-align: middle;
    margin-right: 10px;
}

.hidden {
    display: none !important;
}

.text-gradient {
    background: var(--color-accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-success { color: var(--color-success); }
.text-info { color: var(--color-info); }
.text-pending { color: var(--color-pending); }
.text-error { color: var(--color-error); }

/* ==========================================================================
   Responsive layout
   Desktop: fixed 100vh, resizable side-by-side panes.
   Tablet/mobile: panes stack, page scrolls, resizer hidden.
   ========================================================================== */

@media (max-width: 1280px) {
    .sidebar { width: 272px; }
    .toggle-text { display: none; }
}

@media (max-width: 1024px) {
    .workspace {
        flex-direction: column;
        height: auto;
        overflow-y: auto;
        gap: 16px;
        padding: 16px;
    }
    .pane-resizer { display: none; }
    .lead-list-section,
    .lead-details-section {
        width: 100% !important;
        height: auto;
        flex: none;
    }
    .lead-list-section { min-height: 62vh; }
    .lead-details-section { min-height: 55vh; }
    .list-container { max-height: 55vh; }
    .main-content { height: 100vh; }
}

@media (max-width: 768px) {
    body { overflow-y: auto; }
    .app-container {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
        width: 100%;
    }
    .sidebar {
        width: 100%;
        padding: 16px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        overflow-y: visible;
    }
    .main-content { height: auto; }
    .workspace { height: auto; overflow: visible; }
    .top-bar {
        height: auto;
        flex-wrap: wrap;
        gap: 10px;
        padding: 12px 16px;
    }
    .search-box, .search-area { width: 100%; }
    .toggle-text { display: inline; }
    .section-header { flex-direction: column; align-items: stretch; gap: 10px; }
    .list-toolbar { width: 100%; }
    .list-toolbar .tb-select { flex: 1; min-width: 120px; }
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
    .profile-grid { grid-template-columns: 1fr; }
    .profile-item.full-width { grid-column: span 1; }
    .today-bar { flex-wrap: wrap; }
    .action-buttons-group { flex-direction: column; }
    .form-row { flex-direction: column; }
    .kbd-hint { display: none; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .user-role { display: none; }
}

/* ============================================================
   Load-band multi-select dropdown
   ============================================================ */
.multi-select { position: relative; }
.multi-select-btn { cursor: pointer; white-space: nowrap; }
.multi-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 50;
    min-width: 190px;
    background: #0f172a;
    border: 1px solid #334155;
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}
.multi-select-menu.hidden { display: none; }
.multi-select-menu label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    font-size: 0.8rem;
    color: #cbd5e1;
    border-radius: 6px;
    cursor: pointer;
    user-select: none;
}
.multi-select-menu label:hover { background: #1e293b; }
.multi-select-menu input { accent-color: #f59e0b; cursor: pointer; }
.multi-select-clear {
    margin-top: 6px;
    padding: 6px 8px;
    font-size: 0.75rem;
    color: #94a3b8;
    background: transparent;
    border: 1px solid #334155;
    border-radius: 6px;
    cursor: pointer;
}
.multi-select-clear:hover { color: #f59e0b; border-color: #f59e0b; }

@media (max-width: 768px) {
    .multi-select-menu { position: fixed; left: 16px; right: 16px; min-width: 0; }
}

/* ============================================================
   Collapsible "Update Sales Status" dock
   Collapsed to its header at the bottom of the details panel;
   expands on hover / focus / tap so lead details stay readable.
   ============================================================ */
.status-notes-card {
    max-height: 54px;                 /* collapsed: header bar only */
    overflow: hidden;
    cursor: pointer;
    transition: max-height 0.35s ease, background-color 0.25s ease;
}
.status-notes-card:hover,
.status-notes-card:focus-within,
.status-notes-card.expanded {
    max-height: 400px;                /* expanded: full form */
    overflow-y: auto;
    background-color: rgba(0, 0, 0, 0.30);
    cursor: default;
}
.status-notes-card h4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 12px;
    cursor: pointer;
}
.status-notes-card h4::after {
    content: "\25B2";                 /* ▲ */
    font-size: 0.7em;
    opacity: 0.55;
    transition: transform 0.35s ease;
}
.status-notes-card:hover h4::after,
.status-notes-card:focus-within h4::after,
.status-notes-card.expanded h4::after {
    transform: rotate(180deg);        /* points down when open */
}
