/* ==============================
   VIVAS Shared UI Polish Layer
   ============================== */

.vivas-empty-state {
    background: #f8fafc;
    border: 1px dashed #94a3b8;
    border-radius: 12px;
    padding: 18px;
    text-align: center;
    color: #475569;
    font-size: 13px;
}

.vivas-empty-state strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    margin-bottom: 5px;
}

.vivas-empty-state .hint {
    margin-top: 8px;
    font-size: 12px;
    color: #64748b;
}

.vivas-status-chip {
    display: inline-block;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
}

.vivas-chip-approved {
    background: #dcfce7;
    color: #166534;
}

.vivas-chip-pending {
    background: #fef3c7;
    color: #92400e;
}

.vivas-chip-rejected,
.vivas-chip-risk {
    background: #fee2e2;
    color: #991b1b;
}

.vivas-card-soft {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.smart-btn,
.state-link-btn,
.evidence-action-btn,
.geo-backlink-btn,
.selector-links a,
.topbar a,
.top-link {
    transition: all .15s ease-in-out;
}

.smart-btn:disabled,
.state-link-btn:disabled,
.evidence-action-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
}

.feed-accordion summary,
.state-accordion summary {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: center;
}

.feed-accordion summary:hover,
.state-accordion summary:hover {
    background: #f0fdf4;
}

.accordion-body {
    line-height: 1.55;
}

@media (max-width: 700px) {
    .feed-accordion summary,
    .state-accordion summary {
        display: block;
    }
}

/* ==============================
   VIVAS 4E-5 Final Polish
   ============================== */

body {
    -webkit-font-smoothing: antialiased;
}

.card,
.section,
.panel,
.data-panel,
.smart-nav-card,
.geo-backlinks-card,
.election-selector-card {
    box-sizing: border-box;
}

.card h3,
.section h3,
.panel h3 {
    margin-top: 0;
}

.smart-nav-card {
    margin: 14px 16px;
    background: #ffffff;
    border: 1px solid #d1fae5;
    border-left: 5px solid #059669;
    border-radius: 12px;
    padding: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

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

.smart-nav-title {
    font-weight: bold;
    font-size: 15px;
}

.smart-nav-meta {
    font-size: 12px;
    color: #475569;
    margin-top: 4px;
}

.smart-nav-badge {
    background: #064e3b;
    color: #ffffff;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
}

.smart-nav-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.smart-nav-btn {
    border: none;
    border-radius: 9px;
    padding: 10px 8px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    color: #0f172a;
}

.smart-nav-btn:hover {
    background: #dcfce7;
    border-color: #16a34a;
}

.smart-nav-btn.danger {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #991b1b;
}

.smart-nav-btn.danger:hover {
    background: #fee2e2;
    border-color: #dc2626;
}

.smart-nav-btn:disabled,
.geo-backlink-btn.disabled {
    opacity: .45;
    cursor: not-allowed;
}

.bimodal-results-card {
    margin-top: 14px;
}

.feed-accordion,
.state-accordion {
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.feed-accordion summary,
.state-accordion summary {
    min-height: 34px;
}

.smart-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.smart-btn {
    border: none;
    border-radius: 7px;
    padding: 6px 8px;
    font-size: 11px;
    font-weight: bold;
    cursor: pointer;
    color: #ffffff;
    background: #064e3b;
}

.smart-btn:hover {
    background: #022c22;
}

.smart-btn-warning {
    background: #b91c1c;
}

.smart-btn-warning:hover {
    background: #7f1d1d;
}

.vivas-empty-state {
    line-height: 1.55;
}

@media (max-width: 1100px) {
    .smart-nav-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 700px) {
    .smart-nav-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .smart-nav-grid {
        grid-template-columns: 1fr 1fr;
    }

    .smart-nav-btn,
    .geo-backlink-btn,
    .selector-links a,
    .topbar a,
    .top-link {
        font-size: 11px;
        padding: 8px;
    }

    .bimodal-header,
    .geo-backlinks-header,
    .election-selector-card {
        flex-direction: column;
        align-items: stretch;
    }

    .bimodal-grid {
        grid-template-columns: 1fr;
    }
}

/* ==============================
   VIVAS Tailwind Shell Alignment
   ============================== */

.vivas-shell {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
}

.vivas-topbar {
    width: 100%;
    background: #064e3b;
    color: #ffffff;
    box-shadow: 0 10px 20px rgba(6, 78, 59, 0.18);
}

.vivas-topbar-inner {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.vivas-page-wrap {
    max-width: 80rem;
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    padding: 1.5rem;
}

/* Force selector/backlinks to align with Tailwind body */
.election-selector-card,
.geo-backlinks-card {
    max-width: 80rem !important;
    width: calc(100% - 2rem) !important;
    margin: 1rem auto 0 auto !important;
}

/* Upgrade old generated buttons/cards */
.smart-btn,
.evidence-action-btn,
.state-link-btn {
    border-radius: 0.75rem !important;
    padding: 0.65rem 0.9rem !important;
    font-weight: 800 !important;
}

.glass-card {
    background: rgba(255, 255, 255, 0.92) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1rem;
    box-shadow: 0 10px 28px -18px rgba(15, 23, 42, 0.35);
}

@media (max-width: 768px) {
    .vivas-topbar-inner {
        flex-direction: column;
        align-items: flex-start;
    }

    .vivas-page-wrap {
        padding: 1rem;
    }
}


/* ==============================
   VIVAS Control Room Operations UI
   ============================== */

.ops-card,
.card {
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 1rem;
    box-shadow: 0 10px 28px -18px rgba(15, 23, 42, 0.35);
    box-sizing: border-box;
}

.ops-dark-card {
    background: #0f172a;
    color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 10px 28px -18px rgba(15, 23, 42, 0.5);
}

.ops-section-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: .5rem;
    padding-bottom: .75rem;
    margin-bottom: .85rem;
    border-bottom: 1px solid #e2e8f0;
}

.ops-kpi {
    min-height: 120px;
    padding: 1.25rem;
}

.ops-grid-scroll {
    max-height: 520px;
    overflow-y: auto;
    padding-right: .25rem;
}

.card-title {
    font-weight: 800;
    color: #0f172a;
    margin-bottom: .75rem;
}

.small {
    font-size: .78rem;
    color: #64748b;
    line-height: 1.55;
}

@media (max-width: 768px) {
    .ops-kpi {
        min-height: auto;
    }
}

/* ==============================
   VIVAS Full Map Workspace
   ============================== */

.map-command-workspace {
    display: grid;
    grid-template-columns: minmax(0, 2.2fr) minmax(340px, 0.8fr);
    gap: 1.5rem;
    align-items: stretch;
}

.map-main-panel,
.map-side-panel {
    min-width: 0;
}

#nigeriaLeafletMap {
    height: 680px !important;
    width: 100% !important;
    border-radius: 1rem;
}

.leaflet-container {
    font-family: 'Plus Jakarta Sans', sans-serif !important;
}

@media (max-width: 1100px) {
    .map-command-workspace {
        grid-template-columns: 1fr;
    }

    #nigeriaLeafletMap {
        height: 540px !important;
    }
}

@media (max-width: 700px) {
    #nigeriaLeafletMap {
        height: 440px !important;
    }
}

/* ==============================
   VIVAS Selected State Intelligence
   ============================== */

.selected-state-card {
    background: linear-gradient(135deg, #064e3b, #047857);
    color: #ffffff;
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: 0 12px 28px -18px rgba(6, 78, 59, 0.55);
}

.selected-state-card .label {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #a7f3d0;
    font-weight: 800;
}

.selected-state-card .value {
    font-size: 1.35rem;
    font-weight: 900;
    color: #ffffff;
}

.selected-state-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .65rem;
    margin-top: .85rem;
}

.selected-state-stat {
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.18);
    border-radius: .8rem;
    padding: .7rem;
}

.selected-state-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    margin-top: .9rem;
}

.selected-state-actions button {
    border: none;
    border-radius: .8rem;
    padding: .65rem .8rem;
    font-size: .75rem;
    font-weight: 900;
    cursor: pointer;
}

.selected-state-actions .primary {
    background: #ffffff;
    color: #064e3b;
}

.selected-state-actions .dark {
    background: #0f172a;
    color: #ffffff;
}

/* ==============================
   VIVAS Map Coloring Modes
   ============================== */

.map-mode-btn {
    border: 1px solid #d1fae5;
    background: #ffffff;
    color: #047857;
    border-radius: 999px;
    padding: .55rem .85rem;
    font-size: .75rem;
    font-weight: 900;
    cursor: pointer;
    transition: all .18s ease;
}

.map-mode-btn:hover {
    background: #ecfdf5;
    border-color: #10b981;
}

.map-mode-btn.active {
    background: #047857;
    color: #ffffff;
    border-color: #047857;
    box-shadow: 0 8px 20px -14px rgba(4, 120, 87, .7);
}
