/* ── Google Fonts ── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; }
body {
    background: #f0f4fb;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    margin: 0; color: #111827; -webkit-font-smoothing: antialiased;
}

/* ══════════════════════════════════════════════
   SIDEBAR
══════════════════════════════════════════════ */
.sidebar {
    width: 260px; height: 100vh;
    background: #ffffff;
    border-right: 1px solid #e5e7eb;
    position: fixed; top: 0; left: 0;
    overflow-y: auto; z-index: 100;
    box-shadow: 2px 0 12px rgba(0,0,0,0.06);
    display: flex; flex-direction: column;
}
.main-content { margin-left: 260px; }
.page-body    { padding: 0 28px 48px; }

/* Sidebar logo block */
.sidebar-logo {
    padding: 22px 18px 14px;
    background: linear-gradient(135deg, #0f2554 0%, #1d4ed8 100%);
}
.sidebar-logo-label {
    font-size: 9px; font-weight: 700; letter-spacing: 2.5px;
    color: rgba(255,255,255,0.55); text-transform: uppercase; margin-bottom: 4px;
}
.sidebar-logo-name { font-size: 24px; font-weight: 900; color: #ffffff; line-height: 1; }
.sidebar-logo-sub  { font-size: 11px; color: rgba(255,255,255,0.65); margin-top: 3px; }

/* Nav section labels */
.nav-section-label {
    padding: 14px 18px 3px;
    font-size: 9px; font-weight: 700; letter-spacing: 2px;
    color: #9ca3af; text-transform: uppercase;
}

/* Nav links */
.sidebar-nav .nav-link {
    color: #374151 !important;
    font-size: 13px; font-weight: 500;
    padding: 8px 14px; border-radius: 9px;
    margin: 1px 10px;
    transition: background 0.12s, color 0.12s;
    display: flex; align-items: center; gap: 8px;
}
.sidebar-nav .nav-link.active {
    background: linear-gradient(120deg, #eff6ff, #dbeafe) !important;
    color: #1d4ed8 !important; font-weight: 700;
    box-shadow: 0 1px 4px rgba(29,78,216,0.18);
}
.sidebar-nav .nav-link:hover:not(.active) {
    background: #f3f4f6 !important; color: #1d4ed8 !important;
}

/* Generate button */
#gen-btn {
    transition: all 0.18s !important;
    letter-spacing: 0.2px;
}
#gen-btn:hover {
    background: linear-gradient(135deg, #1e40af, #1d4ed8) !important;
    box-shadow: 0 5px 18px rgba(29,78,216,0.42) !important;
    transform: translateY(-1px) !important;
}
#gen-btn:active { transform: translateY(0) !important; }

/* Compact sliders inside sidebar */
.sidebar .rc-slider { margin-bottom: 4px; }
.sidebar .form-label { margin-bottom: 2px !important; }
.sidebar div[style*="marginBottom: 12px"] { margin-bottom: 8px !important; }

/* Accordion */
.accordion-item   { border: 1px solid #e5e7eb !important; border-radius: 10px !important; overflow: hidden; margin: 0 12px 8px; }
.accordion-button { font-size: 12.5px !important; font-weight: 600 !important; padding: 10px 14px !important; background: #f9fafb !important; color: #374151 !important; }
.accordion-button:not(.collapsed) { background: #eff6ff !important; color: #1d4ed8 !important; box-shadow: none !important; }
.accordion-body   { padding: 10px 14px 16px !important; }
.form-label       { font-size: 11.5px !important; font-weight: 600 !important; color: #6b7280 !important; margin-bottom: 4px !important; text-transform: uppercase; letter-spacing: 0.5px; }

/* Switch labels */
.form-check-label { font-size: 9px !important; color: #374151 !important; font-weight: 600 !important; letter-spacing: 0.3px !important; text-transform: uppercase !important; }
.form-check-input:checked { background-color: #1d4ed8 !important; border-color: #1d4ed8 !important; }

/* ══════════════════════════════════════════════
   PAGE HEADER
══════════════════════════════════════════════ */
.page-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 18px 30px 16px;
    margin-bottom: 28px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.page-title    { font-size: 23px; font-weight: 800; color: #111827; line-height: 1.2; letter-spacing: -0.3px; }
.page-subtitle { font-size: 13px; color: #6b7280; margin-top: 3px; max-width: 560px; }
.breadcrumb-bar { font-size: 11.5px; color: #9ca3af; margin-bottom: 4px; }

/* ══════════════════════════════════════════════
   KPI CARDS
══════════════════════════════════════════════ */
.kpi-card {
    background: #ffffff; border: 1px solid #e2e8f0;
    border-radius: 12px; padding: 16px 18px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    height: 100%; min-width: 0; transition: box-shadow 0.2s, transform 0.2s;
}
.kpi-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); transform: translateY(-1px); }
.kpi-label {
    font-size: 9.5px; font-weight: 700; letter-spacing: 1px;
    color: #6b7280; text-transform: uppercase; margin-bottom: 8px;
}
.kpi-value {
    font-size: 26px; font-weight: 800; color: #111827;
    line-height: 1; margin-bottom: 6px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.kpi-desc { font-size: 11px; color: #9ca3af; line-height: 1.4; }

/* ══════════════════════════════════════════════
   PANEL CARDS
══════════════════════════════════════════════ */
.panel-card {
    background: #ffffff; border: 1px solid #e5e7eb;
    border-radius: 14px; padding: 22px 24px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05); height: 100%;
}

/* Section header */
.section-hdr {
    font-size: 14.5px; font-weight: 700; color: #111827;
    border-left: 3px solid #1d4ed8; padding-left: 10px;
    margin-bottom: 16px; line-height: 1.3;
}

/* ══════════════════════════════════════════════
   TABLES
══════════════════════════════════════════════ */
.iq-table { width: 100%; border-collapse: collapse; }
.iq-th {
    font-size: 9.5px; font-weight: 700; letter-spacing: 1.2px;
    color: #9ca3af; text-transform: uppercase;
    padding: 9px 12px; border-bottom: 2px solid #e5e7eb;
    background: #f9fafb; white-space: nowrap;
}
.iq-td {
    padding: 11px 12px; border-bottom: 1px solid #f3f4f6;
    font-size: 12.5px; vertical-align: middle; color: #374151;
}
.iq-tr:hover .iq-td { background: #fafafa; }
.iq-table tbody tr:hover td { background: #f8fafc; }

/* ══════════════════════════════════════════════
   BADGES
══════════════════════════════════════════════ */
.badge-field { background:#eff6ff; color:#1d4ed8; border:1.5px solid #bfdbfe; border-radius:6px; padding:3px 10px; font-size:11px; font-weight:700; white-space:nowrap; }
.badge-legal { background:#fdf4ff; color:#7c3aed; border:1.5px solid #e9d5ff; border-radius:6px; padding:3px 10px; font-size:11px; font-weight:700; white-space:nowrap; }
.badge-high  { background:#fff1f2; color:#be123c; border:1.5px solid #fecdd3; border-radius:6px; padding:3px 10px; font-size:11px; font-weight:700; white-space:nowrap; }
.badge-std   { background:#f0f9ff; color:#0369a1; border:1.5px solid #bae6fd; border-radius:6px; padding:3px 10px; font-size:11px; font-weight:700; white-space:nowrap; }
.badge-pend  { background:#fff7ed; color:#ea580c; border:1px solid #fed7aa;   border-radius:20px; padding:3px 10px; font-size:11px; font-weight:700; white-space:nowrap; }
.badge-ok    { background:#f0fdf4; color:#15803d; border:1px solid #bbf7d0;   border-radius:20px; padding:3px 10px; font-size:11px; font-weight:700; white-space:nowrap; }

/* ══════════════════════════════════════════════
   AGENT AVATAR + TABLE HELPERS
══════════════════════════════════════════════ */
.agent-name    { font-weight: 600; font-size: 12.5px; color: #111827; }
.agent-sub     { font-size: 11px; color: #9ca3af; margin-top: 1px; }
.cell-primary  { font-weight: 700; font-size: 12.5px; color: #1d4ed8; }
.cell-muted    { font-size: 11px; color: #9ca3af; }
.cell-green    { font-weight: 600; font-size: 12.5px; color: #16a34a; }
.label-overline {
    font-size: 9.5px; font-weight: 700; letter-spacing: 1px;
    text-transform: uppercase; color: #9ca3af; margin-bottom: 4px;
}
.stat-value    { font-size: 22px; font-weight: 800; color: #111827; line-height: 1; }

/* Stat mini-cards inside dispatch panel */
.stat-tile {
    background: #f8fafc; border-radius: 10px; padding: 16px 18px;
    border: 1px solid #f1f5f9; transition: box-shadow 0.15s;
}
.stat-tile:hover { box-shadow: 0 2px 10px rgba(0,0,0,0.06); }

/* Hide number input spin arrows — cleaner look in param bar */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type=number] { -moz-appearance: textfield; }

/* Param bar input hover/focus */
.panel-card input[type=number]:focus {
    border-color: #1d4ed8 !important;
    box-shadow: 0 0 0 2px rgba(29,78,216,0.12) !important;
    outline: none !important;
}

/* DataTable overrides */
.dash-table-container .dash-header { font-size: 10px !important; }
.dash-table-container .dash-cell  { font-size: 12.5px !important; }

/* ══════════════════════════════════════════════
   LOADING OVERLAY
══════════════════════════════════════════════ */
._dash-loading { opacity: 0.4; transition: opacity 0.2s; }

/* ══════════════════════════════════════════════
   MISC
══════════════════════════════════════════════ */
.text-muted-sm { font-size: 11px; color: #9ca3af; }
hr { border-color: #f1f5f9 !important; }

/* Portfolio table hover */
.iq-table tbody tr:hover td { background: #f8fafc !important; }
.iq-table thead { position: sticky; top: 0; z-index: 100; background: #f9fafb; }
.iq-table thead th { position: sticky; top: 0; z-index: 100; background: #f9fafb; }

/* DataTable tooltip */
.dash-tooltip { font-size: 12px !important; max-width: 280px !important; }

/* Plan generation progress bar animation */
@keyframes progress-pulse {
    0%   { width: 15%; opacity: 0.8; }
    50%  { width: 88%; opacity: 1;   }
    100% { width: 15%; opacity: 0.8; }
}

/* Per-agent strategy dropdown inside field force table */
.strategy-dd .Select-control { border: 1px solid #e5e7eb !important; border-radius: 6px !important; min-height: 28px !important; }
.strategy-dd .Select-value-label { font-size: 11px !important; font-weight: 600 !important; color: #1d4ed8 !important; }
.strategy-dd .Select-arrow { border-top-color: #9ca3af !important; }
.strategy-dd .Select-menu-outer { font-size: 11px !important; z-index: 9999 !important; }

/* Scrollbar */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #d1d5db; }

/* Slider value badge — shown inline in label row, no floating tooltip */
.slider-val-badge {
    font-size: 11px; font-weight: 800; color: #1d4ed8;
    background: #eff6ff; border-radius: 5px;
    padding: 1px 7px; border: 1px solid #dbeafe;
    min-width: 24px; text-align: center; display: inline-block;
}

/* Login page — make placeholder text clearly visible on dark glass card */
#login-user::placeholder,
#login-pass::placeholder {
    color: rgba(255, 255, 255, 0.5);
    font-size: 16px;
    font-weight: 400;
}

#login-user, #login-pass {
    min-height: 58px;
}

/* ══════════════════════════════════════════════
   SHIMMER SKELETON LOADER
══════════════════════════════════════════════ */
@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── CollectX sidebar: grouped navigation (Plan / Run the day / Review / More) ── */
.sidebar-nav .nav-link i.bi { width:18px; text-align:center; font-size:15px; opacity:.75; margin-right:2px !important; }
.sidebar-nav .nav-link.active i.bi { opacity:1; }
.sidebar-nav .nav-link.active { border-left:3px solid #1d4ed8; padding-left:11px; }
.nav-section-label { padding-top:16px; }
details > summary.cx-more:hover { color:#1d4ed8; }
details > summary.cx-more { cursor:pointer; list-style:none; user-select:none; }
details > summary.cx-more::-webkit-details-marker { display:none; }
details > summary.cx-more::after { content:" \25B8"; }
details[open] > summary.cx-more::after { content:" \25BE"; }
