@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800;900&display=swap');

/* ============================================================
   RADAR MS — V2  (CicloJus Design System)
   ============================================================ */

:root {
    /* Primary brand — teal */
    --primary:        #4ECDC4;
    --primary-light:  #6EDDD8;
    --primary-dark:   #2D7D8A;
    --primary-dim:    rgba(78,205,196,0.10);
    --primary-glow:   rgba(78,205,196,0.20);
    --gradient:       linear-gradient(135deg, #2D7D8A 0%, #4ECDC4 100%);

    /* Backgrounds — deep navy */
    --bg-root:        #0F1520;
    --bg-sidebar:     #0D1321;
    --bg-card:        #161E2E;
    --bg-card-hover:  #1C2740;
    --bg-input:       #1A2236;
    --bg-elevated:    #1E2A3E;

    /* Borders */
    --border:         rgba(255,255,255,0.07);
    --border-focus:   #4ECDC4;
    --border-hover:   rgba(78,205,196,0.30);

    /* Text */
    --text-title:     #E8EDF5;
    --text-primary:   #C0CCDC;
    --text-secondary: #A8B5C8;
    --text-muted:     #5C6E85;
    --text-disabled:  #3A4860;

    /* Semantic */
    --success:        #4DB896;
    --success-dim:    rgba(77,184,150,0.12);
    --error:          #E05C6A;
    --error-dim:      rgba(224,92,106,0.12);
    --warning:        #F0A04B;
    --warning-dim:    rgba(240,160,75,0.12);
    --info:           #5B9CF6;
    --info-dim:       rgba(91,156,246,0.12);

    /* Shadows */
    --shadow-sm:      0 2px 12px rgba(0,0,0,0.35);
    --shadow-md:      0 4px 24px rgba(0,0,0,0.45);
    --shadow-btn:     0 4px 20px rgba(78,205,196,0.22);
    --shadow-card:    0 1px 0 rgba(255,255,255,0.03) inset;

    /* Radius */
    --r-sm:   8px;
    --r-md:  10px;
    --r-lg:  16px;

    /* Sidebar */
    --sidebar-w: 240px;

    /* Transition */
    --t: all 0.2s ease;
}

/* Light theme */
body.theme-light {
    --primary:        #2D7D8A;
    --primary-light:  #6EC6C6;
    --primary-dark:   #1F5C68;
    --primary-dim:    rgba(45,125,138,0.08);
    --primary-glow:   rgba(45,125,138,0.18);
    --gradient:       linear-gradient(135deg, #2D7D8A 0%, #6EC6C6 100%);

    --bg-root:        #F0F2F5;
    --bg-sidebar:     #D6EEEE;
    --bg-card:        #FFFFFF;
    --bg-card-hover:  #F5F7FA;
    --bg-input:       #F0F2F5;
    --bg-elevated:    #E8ECF2;

    --border:         #E8ECF0;
    --border-focus:   #6EC6C6;
    --border-hover:   rgba(45,125,138,0.35);

    --text-title:     #1E2A38;
    --text-primary:   #2E3D50;
    --text-secondary: #4A5A6E;
    --text-muted:     #8A97A8;
    --text-disabled:  #C2CAD4;

    --shadow-sm:      0 2px 12px rgba(0,0,0,0.07);
    --shadow-md:      0 4px 20px rgba(0,0,0,0.10);
    --shadow-btn:     0 4px 14px rgba(45,125,138,0.28);
    --shadow-card:    0 1px 0 rgba(255,255,255,0.8) inset;
}

/* ============================================================
   RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--bg-root);
    color: var(--text-primary);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        color 0.2s ease !important;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.v2-app { display: flex; height: 100vh; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.v2-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-right: 1.5px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Brand */
.v2-sidebar-brand {
    padding: 20px 18px 16px;
    border-bottom: 1.5px solid var(--border);
    flex-shrink: 0;
}

.v2-brand-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

.v2-brand-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    background: var(--gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: var(--shadow-btn);
    flex-shrink: 0;
}

.v2-brand-name {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-title);
    letter-spacing: -0.2px;
}
.v2-brand-sub {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

/* Search */
.v2-search-wrap { position: relative; }
.v2-search {
    width: 100%;
    padding: 9px 12px 9px 34px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-title);
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    outline: none;
    transition: var(--t);
}
.v2-search:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-dim);
}
.v2-search::placeholder { color: var(--text-muted); }
.v2-search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: var(--text-muted);
    pointer-events: none;
}
.v2-autocomplete {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0; right: 0;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    box-shadow: var(--shadow-md);
}

/* Nav */
.v2-nav {
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    border-bottom: 1.5px solid var(--border);
}

.v2-nav-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: var(--r-sm);
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--t);
    text-align: left;
    width: 100%;
}
.v2-nav-item:hover {
    background: var(--primary-dim);
    color: var(--text-title);
}
.v2-nav-item.active {
    background: var(--primary);
    color: #fff;
}
.v2-nav-item.active .v2-nav-icon { color: rgba(255,255,255,0.85); }
.v2-nav-icon {
    font-size: 15px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Tree */
.v2-tree { flex: 1; overflow-y: auto; padding: 10px; }

.v2-region-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--r-sm);
    user-select: none;
    margin-top: 10px;
    transition: color 0.15s;
}
.v2-region-header:first-child { margin-top: 0; }
.v2-region-header:hover { color: var(--text-secondary); }

.region-chevron { font-size: 10px; transition: transform 0.2s; }
.region-content { overflow: hidden; transition: max-height 0.25s ease, opacity 0.2s; max-height: 2000px; opacity: 1; }
.region-content.region-collapsed { max-height: 0 !important; opacity: 0 !important; }

.v2-tree-item {
    padding: 7px 12px;
    border-radius: var(--r-sm);
    font-size: 12.5px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--t);
    margin-bottom: 1px;
}
.v2-tree-item:hover { background: var(--primary-dim); color: var(--text-title); }
.v2-tree-item.active {
    background: var(--primary-dim);
    color: var(--primary);
    font-weight: 700;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.v2-main {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    background: var(--bg-root);
}

.v2-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 28px 32px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.v2-page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.v2-page-eyebrow {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--primary);
    margin-bottom: 4px;
}
.v2-page-title {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-title);
    letter-spacing: -0.4px;
    line-height: 1.2;
}
.v2-page-subtitle {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 4px;
}
.v2-page-subtitle span { color: var(--primary); font-weight: 700; }

.v2-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-sep {
    width: 1px;
    height: 20px;
    background: var(--border);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: var(--r-md);
    font-size: 13px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
    transition: var(--t);
    white-space: nowrap;
}

.btn-primary {
    background: var(--gradient);
    color: #fff;
    box-shadow: var(--shadow-btn);
}
.btn-primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1.5px solid var(--border);
}
.btn-ghost:hover {
    border-color: var(--primary);
    background: var(--primary-dim);
    color: var(--primary);
}

.btn-danger-ghost {
    background: transparent;
    color: var(--error);
    border: 1.5px solid var(--border);
}
.btn-danger-ghost:hover {
    background: var(--error-dim);
    border-color: rgba(224,92,106,0.3);
}

.btn-sim {
    background: transparent;
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    font-size: 12px;
}
.btn-sim.active {
    background: var(--primary-dim);
    color: var(--primary);
    border-color: var(--primary);
}

/* ============================================================
   KPI CARDS
   ============================================================ */
.v2-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.v2-kpi-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 20px;
    position: relative;
    box-shadow: var(--shadow-sm), var(--shadow-card);
    transition: var(--t);
}
.v2-kpi-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md), var(--shadow-card);
}

.v2-kpi-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 7px;
}
.v2-kpi-icon {
    width: 24px;
    height: 24px;
    border-radius: var(--r-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}
.v2-kpi-icon.teal    { background: var(--primary-dim); color: var(--primary); }
.v2-kpi-icon.green   { background: var(--success-dim); color: var(--success); }
.v2-kpi-icon.blue    { background: var(--info-dim);    color: var(--info);    }
.v2-kpi-icon.orange  { background: var(--warning-dim); color: var(--warning); }

.v2-kpi-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-title);
    letter-spacing: -1px;
    line-height: 1;
    margin-bottom: 8px;
}
.v2-kpi-value.teal   { color: var(--primary); }
.v2-kpi-value.green  { color: var(--success); }
.v2-kpi-value.red    { color: var(--error);   }

.v2-kpi-meta {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
}

.v2-goal-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-title);
    font-size: 28px;
    font-weight: 800;
    font-family: inherit;
    letter-spacing: -1px;
    padding: 0;
    outline: none;
    margin-bottom: 8px;
    transition: color 0.2s;
}
.v2-goal-input:focus { color: var(--primary); }

/* ============================================================
   PANELS
   ============================================================ */
.v2-panels {
    display: flex;
    gap: 14px;
    min-height: 520px;
}

.v2-panel {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm), var(--shadow-card);
    transition: var(--t);
}
.v2-panel:hover { border-color: var(--border-hover); }

.v2-panel-leaders {
    width: 300px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}
.v2-panel-map { flex: 1; position: relative; }

.v2-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 12px;
    border-bottom: 1.5px solid var(--border);
    flex-shrink: 0;
}
.v2-panel-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--text-muted);
}
.v2-panel-count {
    background: var(--bg-input);
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 99px;
    border: 1.5px solid var(--border);
}

.v2-leaders-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}
.v2-leaders-empty {
    text-align: center;
    padding: 48px 16px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
}

/* Leader card */
.v2-leader-card {
    border-radius: var(--r-md);
    padding: 12px;
    margin-bottom: 6px;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    cursor: pointer;
    transition: var(--t);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: fadeUp 0.25s ease both;
}
.v2-leader-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateX(2px);
}
.v2-leader-avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--r-sm);
    background: var(--primary-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 800;
    color: var(--primary);
    flex-shrink: 0;
}
.v2-leader-info { flex: 1; min-width: 0; }
.v2-leader-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-title);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}
.v2-leader-meta {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}
.v2-leader-badges {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
}

/* Badges */
.v2-badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 99px;
}
.v2-badge-score-strong { background: var(--success-dim); color: var(--success); }
.v2-badge-score-medium { background: var(--warning-dim); color: var(--warning); }
.v2-badge-score-weak   { background: var(--error-dim);   color: var(--error);   }
.v2-badge-status-fechado    { background: var(--success-dim); color: var(--success); }
.v2-badge-status-negociacao { background: var(--warning-dim); color: var(--warning); }
.v2-badge-status-sondagem   { background: var(--primary-dim); color: var(--primary); }
.v2-badge-status-perdido    { background: var(--error-dim);   color: var(--error);   }

/* ============================================================
   MAP LEGEND
   ============================================================ */
.v2-map-legend {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 16px;
    width: 168px;
    box-shadow: var(--shadow-md);
}
.v2-legend-section { margin-bottom: 10px; }
.v2-legend-section:last-child { margin-bottom: 0; }
.v2-legend-title {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 7px;
    padding-bottom: 5px;
    border-bottom: 1.5px solid var(--border);
}
.v2-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.v2-legend-item:last-child { margin-bottom: 0; }
.v2-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}
.v2-dot.green  { background: var(--success); }
.v2-dot.yellow { background: var(--warning); border: 1.5px dashed rgba(0,0,0,0.25); }
.v2-dot.large  { width: 11px; height: 11px; }

/* ============================================================
   BENTO GRID
   ============================================================ */
.v2-kpi-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.v2-bento-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-auto-rows: minmax(140px, auto);
    gap: 14px;
}

.v2-bento-card {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 22px;
    overflow: hidden;
    box-shadow: var(--shadow-sm), var(--shadow-card);
    transition: var(--t);
}
.v2-bento-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md), var(--shadow-card);
}

.v2-bento-chart { grid-column: span 2; grid-row: span 3; max-height: 70vh; display: flex; flex-direction: column; }
.v2-bento-chart #main-chart { flex: 1; overflow-y: auto; padding-right: 4px; }
.v2-bento-tall  { grid-row: span 2; }

.v2-card-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 14px;
}
.v2-card-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--text-title);
    letter-spacing: -1px;
    line-height: 1;
}
.v2-card-sub {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 8px;
}

/* Chart header */
.v2-chart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
    flex-shrink: 0;
}
.v2-tabs {
    display: inline-flex;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    padding: 3px;
    gap: 2px;
}
.v2-tab {
    background: transparent;
    border: none;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    padding: 5px 12px;
    border-radius: var(--r-sm);
    cursor: pointer;
    transition: var(--t);
}
.v2-tab:hover { color: var(--text-primary); }
.v2-tab.active {
    background: var(--bg-card);
    color: var(--text-title);
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--border);
}

/* Bar Chart */
.radar-bar-item { margin-bottom: 14px; position: relative; }
.radar-bar-header { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 7px; font-weight: 600; color: var(--text-secondary); }
.radar-bar-outer { height: 5px; background: var(--bg-input); border-radius: 3px; overflow: visible; display: flex; align-items: center; }
.radar-bar-inner { height: 100%; background: var(--gradient); border-radius: 3px; transition: width 1s cubic-bezier(0.34,1.56,0.64,1); z-index: 1; }
.qe-line { position: absolute; left: 100%; top: -4px; bottom: -4px; width: 2px; background: var(--success); z-index: 2; border-radius: 2px; box-shadow: 0 0 5px var(--success); }

/* ============================================================
   MODAL — LEADER
   ============================================================ */
.v2-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(10px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 16px;
}

.v2-modal {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    width: 100%;
    max-width: 640px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 40px 80px rgba(0,0,0,0.6);
    animation: fadeUp 0.22s ease;
}

.v2-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1.5px solid var(--border);
    flex-shrink: 0;
}
.v2-modal-title { font-size: 16px; font-weight: 800; color: var(--text-title); }
.v2-modal-sub   { font-size: 11px; font-weight: 500; color: var(--text-muted); margin-top: 2px; }

.v2-modal-close {
    width: 30px;
    height: 30px;
    border-radius: var(--r-sm);
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--t);
}
.v2-modal-close:hover { background: var(--bg-elevated); color: var(--text-title); }

.v2-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.v2-modal-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-top: 1.5px solid var(--border);
    flex-shrink: 0;
    background: var(--bg-sidebar);
    border-radius: 0 0 var(--r-lg) var(--r-lg);
}

/* Form */
.v2-form-row { display: grid; gap: 12px; }
.v2-form-group { display: flex; flex-direction: column; gap: 6px; }

.v2-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.v2-label.required::after { content: ' *'; color: var(--primary); }

.v2-input, .v2-select, .v2-textarea {
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-title);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    padding: 9px 12px;
    outline: none;
    transition: var(--t);
    width: 100%;
}
.v2-input:focus, .v2-select:focus, .v2-textarea:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-dim);
}
.v2-input::placeholder, .v2-textarea::placeholder { color: var(--text-muted); }
.v2-input-votes {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--primary);
    padding: 5px 10px;
}
.v2-input-large {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.3px;
}
.v2-textarea { resize: none; line-height: 1.6; }
.v2-select { appearance: none; -webkit-appearance: none; cursor: pointer; color-scheme: dark; }

.v2-form-divider { height: 1.5px; background: var(--border); margin: 2px 0; }
.v2-section-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}
.v2-section-label::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.v2-cep-row { display: flex; gap: 8px; }
.v2-cep-row .v2-input { flex: 1; }
.btn-cep {
    padding: 9px 14px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    white-space: nowrap;
    transition: var(--t);
}
.btn-cep:hover { background: var(--primary-dim); color: var(--primary); border-color: var(--primary); }

.v2-history {
    display: none;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    padding: 12px;
    max-height: 120px;
    overflow-y: auto;
}
.v2-history-title {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: var(--success);
    margin-bottom: 8px;
}
.v2-history-list { display: flex; flex-direction: column; gap: 6px; }

/* ============================================================
   MODAL — REPORT
   ============================================================ */
.v2-report-modal {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    width: 100%;
    max-width: 520px;
    box-shadow: 0 40px 80px rgba(0,0,0,0.6);
    animation: fadeUp 0.22s ease;
}
.v2-report-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px 16px;
    border-bottom: 1.5px solid var(--border);
}
.v2-report-title { font-size: 15px; font-weight: 800; color: var(--text-title); }
.v2-report-title span { color: var(--primary); }
.v2-report-terminal {
    background: #060d14;
    border: 1.5px solid rgba(78,205,196,0.12);
    border-radius: var(--r-md);
    margin: 16px 24px;
    padding: 16px;
}
.v2-report-terminal pre {
    margin: 0;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 12px;
    color: var(--success);
    line-height: 1.6;
    max-height: 360px;
    overflow-y: auto;
    white-space: pre-wrap;
}
.v2-report-footer { display: flex; gap: 8px; padding: 0 24px 20px; }

/* ============================================================
   CONFIRM DIALOG
   ============================================================ */
.v2-confirm {
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--r-lg);
    padding: 32px 28px 24px;
    max-width: 400px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    box-shadow: 0 30px 60px rgba(0,0,0,0.6);
    animation: fadeUp 0.2s ease;
}
.v2-confirm-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin-bottom: 4px;
    background: var(--error-dim);
    border: 1.5px solid rgba(224,92,106,0.2);
}
.v2-confirm-icon.warn { background: var(--warning-dim); border-color: rgba(240,160,75,0.2); }
.v2-confirm-icon.info { background: var(--primary-dim); border-color: rgba(78,205,196,0.2); }
.v2-confirm-title  { font-size: 16px; font-weight: 800; color: var(--text-title); text-align: center; }
.v2-confirm-msg    { font-size: 13px; font-weight: 500; color: var(--text-secondary); text-align: center; line-height: 1.6; max-width: 300px; }
.v2-confirm-actions { display: flex; gap: 8px; width: 100%; margin-top: 6px; }
.v2-confirm-cancel {
    flex: 1; padding: 11px; border-radius: var(--r-md);
    border: 1.5px solid var(--border); background: var(--bg-input);
    color: var(--text-muted); font-size: 13px; font-weight: 700;
    font-family: inherit; cursor: pointer; transition: var(--t);
}
.v2-confirm-cancel:hover { background: var(--bg-elevated); color: var(--text-title); }
.v2-confirm-ok {
    flex: 1; padding: 11px; border-radius: var(--r-md); border: none;
    background: var(--error); color: #fff;
    font-size: 13px; font-weight: 800; font-family: inherit; cursor: pointer; transition: var(--t);
}
.v2-confirm-ok:hover { filter: brightness(1.08); transform: translateY(-1px); }
.v2-confirm-ok.warn { background: var(--primary); }
.v2-confirm-ok.info { background: var(--primary); }

/* ============================================================
   INTEL OVERLAY
   ============================================================ */
.v2-intel-overlay {
    display: none;
    position: fixed;
    top: 0; left: var(--sidebar-w); right: 0; bottom: 0;
    background: rgba(9,13,20,0.97);
    z-index: 100;
    padding: 60px;
    backdrop-filter: blur(20px);
}
.v2-intel-close {
    position: absolute;
    top: 28px; right: 36px;
    background: var(--bg-elevated);
    border: 1.5px solid var(--border);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--r-md);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    font-family: inherit;
    transition: var(--t);
}
.v2-intel-close:hover { color: var(--text-title); border-color: var(--primary); }

/* ============================================================
   MAP OVERLAY (full state view)
   ============================================================ */
.v2-map-overlay {
    position: absolute;
    top: 16px; right: 16px;
    z-index: 1000;
    background: var(--bg-card);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 16px;
    width: 180px;
    box-shadow: var(--shadow-md);
}

/* ============================================================
   LEAFLET OVERRIDES
   ============================================================ */
.leaflet-popup-content-wrapper {
    background: var(--bg-card) !important;
    border: 1.5px solid var(--border) !important;
    border-radius: var(--r-md) !important;
    color: var(--text-title) !important;
    box-shadow: var(--shadow-md) !important;
}
.leaflet-popup-tip { background: var(--bg-card) !important; }
.leaflet-container a.leaflet-popup-close-button {
    color: var(--text-muted) !important;
    padding: 8px 8px 0 0 !important;
}

/* ============================================================
   AUTOCOMPLETE
   ============================================================ */
.autocomplete-item {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-primary);
    transition: var(--t);
    border-bottom: 1.5px solid var(--border);
}
.autocomplete-item:last-child { border-bottom: none; }
.autocomplete-item:hover { background: var(--primary-dim); color: var(--primary); }

/* ============================================================
   STRATEGY TEXTAREA
   ============================================================ */
#strategy-notes {
    flex: 1;
    background: var(--bg-input);
    border: 1.5px solid var(--border);
    border-radius: var(--r-md);
    color: var(--text-title);
    padding: 12px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 500;
    resize: none;
    margin-top: 10px;
    outline: none;
    transition: var(--t);
    line-height: 1.6;
}
#strategy-notes:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--primary-dim); }
#strategy-notes::placeholder { color: var(--text-muted); }

/* ============================================================
   FILTER SELECTS
   ============================================================ */
.v2-filter-select {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1.5px solid var(--border);
    padding: 8px 12px;
    border-radius: var(--r-md);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    outline: none;
    cursor: pointer;
    transition: var(--t);
    appearance: none;
    -webkit-appearance: none;
}
.v2-filter-select:focus { border-color: var(--border-focus); }

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeSlideIn {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes simPulse {
    0%  { box-shadow: 0 0 0 0   var(--primary-glow); }
    70% { box-shadow: 0 0 0 8px transparent; }
    100%{ box-shadow: 0 0 0 0   transparent; }
}

.loading-overlay {
    position: absolute; inset: 0;
    background: rgba(9,13,20,0.65);
    display: flex; align-items: center; justify-content: center;
    z-index: 10; border-radius: var(--r-lg);
}
.spinner {
    width: 26px; height: 26px;
    border: 2.5px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bg-elevated); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-hover); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1100px) {
    .v2-kpi-grid { grid-template-columns: 1fr 1fr; }
    .v2-bento-grid { grid-template-columns: 1fr 1fr; }
    .v2-bento-chart { grid-column: span 2; }
    .v2-bento-tall { grid-row: span 1; }
    .v2-panels { flex-direction: column; }
    .v2-panel-leaders { width: 100%; max-height: 300px; }
    .v2-kpi-grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .v2-sidebar { display: none; }
    .v2-content { padding: 16px; }
    .v2-kpi-grid { grid-template-columns: 1fr; }
    .v2-bento-grid { grid-template-columns: 1fr; }
    .v2-bento-chart { grid-column: span 1; max-height: 50vh; }
    .v2-page-header { flex-direction: column; }
    .v2-kpi-grid-3 { grid-template-columns: 1fr; }
    #leaflet-map { height: 50vh !important; }
}
