/**
 * ==========================================================
 * SISTEMA ELEIÇÃO 360 - WAR ROOM THEME & STYLESHEET
 * ==========================================================
 */

:root {
    --bg-main: #0a0e17;
    --bg-surface: #111827;
    --bg-card: rgba(17, 24, 39, 0.88);
    --bg-card-hover: rgba(30, 41, 59, 0.95);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-highlight: rgba(59, 130, 246, 0.3);
    
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.4);
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;

    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --font-main: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    --sidebar-width: 270px;
}

[data-bs-theme="light"] {
    --bg-main: #f1f5f9;
    --bg-surface: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f8fafc;
    --border-color: #e2e8f0;
    --border-highlight: rgba(37, 99, 235, 0.3);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* Scrollbar moderno */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}
::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* Glassmorphism & Cards */
.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.glass-card:hover {
    border-color: var(--border-highlight);
}

.kpi-card {
    position: relative;
    overflow: hidden;
}
.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

.kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

/* Sidebar Layout */
.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.app-sidebar {
    width: var(--sidebar-width);
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.app-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 1.75rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.nav-link-custom {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    border-radius: 0.75rem;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-link-custom i {
    width: 24px;
    font-size: 1.1rem;
    margin-right: 0.75rem;
}

.nav-link-custom:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
    transform: translateX(4px);
}

.nav-link-custom.active {
    color: #ffffff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 4px 15px -3px var(--primary-glow);
}

/* Thermometer / Gauge Meter */
.thermometer-wrapper {
    background: rgba(0, 0, 0, 0.25);
    border-radius: 1rem;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
}

.progress-war-room {
    height: 16px;
    background-color: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.progress-bar-glow {
    background: linear-gradient(90deg, #10b981, #06b6d4, #3b82f6);
    box-shadow: 0 0 12px rgba(6, 182, 212, 0.6);
}

/* Badges & Tags */
.badge-territorio {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.78rem;
    display: inline-flex;
    align-items: center;
    margin: 2px;
}

.badge-partido {
    background: rgba(139, 92, 246, 0.15);
    color: #c084fc;
    border: 1px solid rgba(139, 92, 246, 0.3);
    font-weight: 700;
    border-radius: 0.4rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* Avatar Liderança */
.avatar-lideranca {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.1);
}

.avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #1e293b, #334155);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: #94a3b8;
    border: 1px solid var(--border-color);
}

/* Camera Live View */
.camera-container {
    position: relative;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    border-radius: 1rem;
    overflow: hidden;
    background: #000;
    border: 2px dashed var(--border-highlight);
}

#camera-video {
    width: 100%;
    height: auto;
    display: block;
    transform: scaleX(-1); /* espelhado para selfie/comprovante */
}

#camera-canvas {
    display: none;
}

.camera-preview-img {
    width: 100%;
    max-height: 260px;
    object-fit: cover;
    border-radius: 0.75rem;
    border: 1px solid var(--border-color);
}

/* Tables */
.table-war-room {
    --bs-table-bg: transparent;
    --bs-table-color: var(--text-primary);
    border-color: var(--border-color);
}
.table-war-room th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 700;
    border-bottom-width: 1px;
}
.table-war-room td {
    vertical-align: middle;
    font-size: 0.9rem;
    border-color: var(--border-color);
}

/* Buttons */
.btn-war-primary {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #ffffff;
    border: none;
    font-weight: 700;
    border-radius: 0.75rem;
    padding: 0.6rem 1.25rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}
.btn-war-primary:hover {
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.5);
}

/* Mapa Leaflet */
#map-container {
    height: 440px;
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid var(--border-color);
    z-index: 1;
}

/* Mobile Responsiveness */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
    }
    .app-sidebar.show {
        transform: translateX(0);
    }
    .app-content {
        margin-left: 0;
        padding: 1rem;
    }
}

/* Impressão / Fichas */
@media print {
    .app-sidebar, .btn, .modal, .no-print {
        display: none !important;
    }
    .app-content {
        margin-left: 0 !important;
        padding: 0 !important;
    }
    body {
        background: #fff !important;
        color: #000 !important;
    }
    .glass-card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
        background: #fff !important;
        color: #000 !important;
    }
}
