:root {
    --polaris-cyan: #00d2ff;
    --polaris-blue: #3a7bd5;
    --polaris-bg: #0f172a;
    --polaris-surface: rgba(30, 41, 59, 0.7);
    --polaris-border: rgba(255, 255, 255, 0.1);
    --polaris-text: #f8fafc;
    --polaris-muted: #94a3b8;
    --polaris-success: #10b981;
    --polaris-error: #f43f5e;
    --polaris-glow: 0 0 20px rgba(0, 210, 255, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', 'Inter', sans-serif;
}

body {
    background: var(--polaris-bg);
    color: var(--polaris-text);
    overflow: hidden;
    height: 100vh;
}

.polaris-layout {
    display: flex;
    height: 100vh;
}

/* Sidebar Styling */
.polaris-sidebar {
    width: 280px;
    background: rgba(15, 23, 42, 0.98);
    border-right: 1px solid var(--polaris-border);
    padding: 2.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.logo-container {
    padding: 0 1rem 3rem 1rem;
}

.logo-main {
    display: flex;
    justify-content: center;
    width: 100%;
}

.sidebar-logo {
    height: 140px;
    width: auto;
    filter: drop-shadow(0 0 25px rgba(0, 210, 255, 0.45));
    transition: transform 0.3s ease;
}

.sidebar-logo:hover {
    transform: scale(1.05);
}

.nav-menu {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    /* Space for scrollbar */
    margin-right: -5px;
    /* Offset padding to keep layout stable */
}

/* Custom Scrollbar for Polaris Aesthetic */
.nav-menu::-webkit-scrollbar {
    width: 5px;
}

.nav-menu::-webkit-scrollbar-track {
    background: transparent;
}

.nav-menu::-webkit-scrollbar-thumb {
    background: rgba(0, 210, 255, 0.2);
    border-radius: 10px;
    transition: background 0.3s;
}

.nav-menu:hover::-webkit-scrollbar-thumb {
    background: rgba(0, 210, 255, 0.5);
}

.nav-link {
    display: flex;
    align-items: center;
    padding: 14px 18px;
    margin-bottom: 8px;
    border-radius: 12px;
    cursor: pointer;
    color: var(--polaris-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 0.95rem;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.03);
    color: white;
}

.nav-link.active {
    background: linear-gradient(90deg, rgba(0, 210, 255, 0.1), transparent);
    color: var(--polaris-cyan);
    box-shadow: inset 4px 0 0 var(--polaris-cyan);
}

/* Main Workspace */
.polaris-main {
    flex: 1;
    padding: 3rem;
    overflow-y: auto;
    background: radial-gradient(circle at 50% -20%, rgba(58, 123, 213, 0.1), transparent);
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3.5rem;
}

.glass-card {
    background: var(--polaris-surface);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border: 1px solid var(--polaris-border);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.title-xl {
    font-size: 2.2rem;
    font-weight: 800;
}

/* Dashboard Specifics */
.stats-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-box {
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.stat-box::after {
    content: "";
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(0, 210, 255, 0.05), transparent);
}

.stat-label {
    color: var(--polaris-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.stat-digit {
    font-size: 2.4rem;
    font-weight: 800;
    margin-top: 0.2rem;
    position: relative;
    z-index: 2;
    background: linear-gradient(180deg, #fff, var(--polaris-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 🧭 Refined Gauge Styles (Premium) */
.stat-box {
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid rgba(255, 255, 255, 0.05);
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.4), rgba(15, 23, 42, 0.6));
}

.stat-box:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 210, 255, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(0, 210, 255, 0.1);
}

.gauge-container {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 65px;
    height: 65px;
    z-index: 1;
}

.gauge-svg {
    transform: rotate(-90deg);
}

.gauge-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.03);
    stroke-width: 4;
}

.gauge-progress {
    fill: none;
    stroke: var(--polaris-cyan);
    stroke-width: 4;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 0 8px var(--polaris-cyan));
}

/* Form Controls */
.polaris-form-group {
    margin-bottom: 1.5rem;
}

.polaris-label {
    display: block;
    margin-bottom: 0.8rem;
    font-size: 0.85rem;
    color: var(--polaris-muted);
}

.polaris-input {
    width: 100%;
    padding: 14px 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--polaris-border);
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    transition: all 0.3s;
}

.polaris-input:focus {
    border-color: var(--polaris-cyan);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: var(--polaris-glow);
    outline: none;
}

.polaris-input option {
    background-color: #0f172a;
    color: white;
}

textarea.polaris-input {
    min-height: 120px;
    resize: vertical;
}

select.polaris-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2rem;
    padding-right: 3rem;
}

.polaris-btn {
    padding: 14px 28px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: 0.4s;
}

/* ⚡ Compact Action Buttons */
.btn-action {
    padding: 8px 14px;
    font-size: 0.75rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-action:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--polaris-cyan);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-action-danger {
    color: #ff6b6b;
}

.btn-action-danger:hover {
    background: rgba(255, 107, 107, 0.1);
    border-color: #ff6b6b;
}

.btn-cyan {
    background: linear-gradient(135deg, var(--polaris-cyan), var(--polaris-blue));
    color: white;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.05);
    color: var(--polaris-muted);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.modal-footer-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.polaris-btn:hover {
    transform: translateY(-3px);
    filter: brightness(1.1);
}

/* 🗺️ Map Control Specialities (Fase 2A) */
.polaris-checkbox {
    appearance: none;
    width: 32px;
    height: 18px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: 0.3s;
}

.polaris-checkbox:checked {
    background: var(--polaris-cyan);
}

.polaris-checkbox::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.polaris-checkbox:checked::after {
    left: 16px;
}

/* Section Switching */
.view-section {
    display: none;
}

.view-section.visible {
    display: block;
    animation: sectionFade 0.6s cubic-bezier(0.23, 1, 0.32, 1) forwards;
}

@keyframes sectionFade {
    from {
        opacity: 0;
        transform: scale(0.98) translateY(10px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Leaflet Overrides */
.leaflet-container {
    border-radius: 20px;
    border: 1px solid var(--polaris-border);
}

/* Activity Feed */
.news-item {
    border-bottom: 1px solid var(--polaris-border);
    padding: 1rem 0;
}

.news-item:last-child {
    border: none;
}

/* Spinner for loading states */
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(0, 210, 255, 0.2);
    border-top-color: var(--polaris-cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes pulseAlert {
    0% {
        opacity: 0.2;
        border-width: 10px;
    }

    50% {
        opacity: 0.8;
        border-width: 30px;
    }

    100% {
        opacity: 0.2;
        border-width: 10px;
    }
}

/* Modals */
.polaris-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--polaris-surface);
    border: 1px solid var(--polaris-border);
    max-height: 90vh;
    overflow-y: auto;
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
}

.animate-fade {
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modal Overlay & Utilities */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.9);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-glass {
    background: #1e293b;
    /* Fallback */
    background: var(--polaris-surface);
    border: 1px solid var(--polaris-border);
    border-radius: 20px;
    padding: 2rem;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    max-height: 90vh;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
    color: var(--polaris-text);
}

.modal-lg {
    max-width: 900px;
}

.hidden {
    display: none !important;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--polaris-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: 0.3s;
}

.close-btn:hover {
    color: var(--polaris-error);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

/* Tab Navigation */
.nav-tabs {
    display: flex;
    gap: 1rem;
    border-bottom: 1px solid var(--polaris-border);
    margin-bottom: 1rem;
    list-style: none;
    padding: 0;
}

.nav-link {
    background: transparent;
    border: none;
    padding: 0.5rem 1rem;
    color: var(--polaris-muted);
    cursor: pointer;
    font-weight: 600;
    border-bottom: 2px solid transparent;
}

.nav-link:hover {
    color: var(--polaris-cyan);
}

.nav-link.active {
    color: var(--polaris-cyan);
    border-bottom-color: var(--polaris-cyan);
}

.d-flex {
    display: flex;
}

.justify-content-between {
    justify-content: space-between;
}

.align-items-center {
    align-items: center;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.p-0 {
    padding: 0 !important;
}

.p-3 {
    padding: 1rem;
}

.p-4 {
    padding: 1.5rem;
}

.text-end {
    text-align: right;
}

.text-center {
    text-align: center;
}

.glass-panel {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--polaris-border);
}

.text-danger {
    color: var(--polaris-error) !important;
}

.text-success {
    color: var(--polaris-success) !important;
}

.text-muted {
    color: var(--polaris-muted) !important;
}

.btn-icon {
    background: none;
    border: none;
    color: var(--polaris-cyan);
    cursor: pointer;
    font-size: 1.1rem;
    margin-right: 5px;
}

/* View Management */
.view-section {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.view-section.visible {
    display: block;
    opacity: 1;
    animation: fadeIn 0.4s ease-out;
}

/* Tabs System */
.polaris-tabs {
    display: flex;
    gap: 10px;
    border-bottom: 1px solid var(--polaris-border);
    padding-bottom: 5px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--polaris-text-muted);
    padding: 10px 20px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    color: var(--polaris-accent);
}

.tab-btn.active {
    color: var(--polaris-accent);
    border-bottom: 3px solid var(--polaris-accent);
}

/* Evidence System */
.evidence-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

.evidence-preview-card {
    background: var(--polaris-surface);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--polaris-border);
    border-radius: 12px;
    padding: 10px;
    width: 100px;
    height: 90px;
    transition: all 0.3s;
    overflow: hidden;
}

.evidence-preview-card:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.mw-800 {
    max-width: 800px !important;
}

.text-content {
    line-height: 1.6;
    color: var(--polaris-text);
    white-space: pre-wrap;
}

/* Map & Popups System */
.polaris-leaflet-popup .leaflet-popup-content-wrapper {
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid var(--polaris-border);
    color: white;
    border-radius: 12px;
    padding: 5px;
}

.polaris-leaflet-popup .leaflet-popup-tip {
    background: rgba(15, 23, 42, 0.9);
}

.map-popup-custom {
    min-width: 180px;
    font-size: 0.85rem;
}

.popup-title {
    font-weight: 800;
    color: var(--polaris-cyan);
    margin-bottom: 8px;
    border-bottom: 1px solid var(--polaris-border);
    padding-bottom: 4px;
    font-size: 0.9rem;
}

.popup-row {
    margin-bottom: 4px;
    display: flex;
    justify-content: space-between;
}

.popup-divider {
    height: 1px;
    background: var(--polaris-border);
    margin: 8px 0;
}

/* Layer Control Overrides */
.leaflet-control-layers {
    background: rgba(15, 23, 42, 0.85) !important;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    border: 1px solid var(--polaris-border) !important;
    color: white !important;
    border-radius: 12px !important;
    padding: 10px !important;
    font-family: inherit;
}

.leaflet-control-layers-overlays span {
    font-weight: 600;
    font-size: 0.8rem;
}

/* Custom Map Controls Panel */
#map-controls {
    background: rgba(15, 23, 42, 0.7);
    -webkit-backdrop-filter: blur(15px);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#map-controls:hover {
    background: rgba(15, 23, 42, 0.85);
    border-color: var(--polaris-cyan);
    transform: translateY(-2px);
}

.map-layer-item span {
    color: var(--polaris-text-dim);
    font-weight: 500;
    transition: color 0.3s;
}

.map-layer-item:hover span {
    color: white;
}

.polaris-checkbox {
    cursor: pointer;
    accent-color: var(--polaris-cyan);
    width: 16px;
    height: 16px;
}

/* 📊 DASHBOARD REFACTOR V2 (Planning-Tracking-Control) */

.dashboard-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--polaris-cyan);
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(6, 182, 212, 0.2);
    padding-bottom: 8px;
}

.badg-sm {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    font-size: 0.65rem;
    padding: 2px 8px;
    border-radius: 99px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

/* Grids */
.stats-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 10px;
}

.stats-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-bottom: 10px;
}

.tracking-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* Stat Box Mini */
.stat-box-mini {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    gap: 15px;
    transition: transform 0.2s;
}

.stat-box-mini:hover {
    transform: translateY(-2px);
    border-color: var(--polaris-cyan);
}

.stat-icon-bg {
    width: 45px;
    height: 45px;
    background: rgba(6, 182, 212, 0.1);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--polaris-cyan);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--polaris-muted);
    margin-top: 2px;
}

/* Tracking Section */
.map-card-dashboard {
    height: 350px;
    padding: 0;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--polaris-border);
}

.overlap-status {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(4px);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    z-index: 1000;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--polaris-success);
    box-shadow: 0 0 10px var(--polaris-success);
}

.pulse-green {
    animation: pulseG 2s infinite;
}

@keyframes pulseG {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }

    100% {
        opacity: 1;
    }
}

.flex-vertical-gap {
    display: flex;
    flex-direction: column;
    gap: 15px;
    height: 350px;
}

.stat-detail-row {
    flex: 0 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
}

.stat-big {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.stat-meta {
    font-size: 0.85rem;
    color: var(--polaris-muted);
}

.feed-box {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding: 15px;
}

#feed-container {
    flex: 1;
    overflow-y: auto;
    padding-right: 5px;
    max-height: 240px;
    /* Force scroll */
}

/* Custom Scrollbar for Feed */
#feed-container::-webkit-scrollbar {
    width: 4px;
}

#feed-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

#feed-container::-webkit-scrollbar-thumb {
    background: var(--polaris-cyan);
    border-radius: 4px;
}

/* KPI Control Cards */
.stat-kpi {
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 110px;
    cursor: default;
    transition: transform 0.2s;
}

.stat-kpi.clickable:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.08);
    cursor: pointer;
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--polaris-text-dim);
}

.kpi-value {
    font-size: 2rem;
    font-weight: 700;
    margin: 5px 0;
}

.kpi-sub {
    font-size: 0.7rem;
    color: var(--polaris-muted);
}

.progress-mini {
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    margin-top: auto;
}

.progress-bar {
    height: 100%;
    border-radius: 2px;
}

.bg-warning {
    background-color: var(--polaris-warning);
}

/* 📊 Data Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
}

.polaris-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    color: var(--polaris-text);
}

.polaris-table th {
    text-align: left;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    color: var(--polaris-cyan);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.polaris-table td {
    padding: 12px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.polaris-table tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

.badge-tag {
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.7rem;
    font-weight: 700;
}

.bg-success-dim {
    background: rgba(16, 185, 129, 0.1);
    color: var(--polaris-success);
}

.bg-error-dim {
    background: rgba(244, 63, 94, 0.1);
    color: var(--polaris-error);
}

.bg-cyan-dim {
    background: rgba(0, 210, 255, 0.1);
    color: var(--polaris-cyan);
}

.badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
    font-size: 0.65rem;
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.badge-danger {
    background: rgba(244, 63, 94, 0.2);
    color: #fb7185;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.badge-success {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.badge-primary {
    background: rgba(0, 210, 255, 0.2);
    color: #00d2ff;
    border: 1px solid rgba(0, 210, 255, 0.2);
}

.badge-cyan {
    background: rgba(34, 211, 238, 0.2);
    color: #67e8f9;
    border: 1px solid rgba(34, 211, 238, 0.2);
}

.badge-secondary {
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5e1;
    border-bottom: 1px solid rgba(148, 163, 184, 0.2);
}

/* 📅 Maintenance Calendar Styles */
.maintenance-calendar {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
    margin-top: 15px;
}

.calendar-day-head {
    text-align: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--polaris-cyan);
    text-transform: uppercase;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.calendar-day {
    aspect-ratio: 1 / 1;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    border: 1px solid transparent;
}

.calendar-day:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    border-color: rgba(0, 210, 255, 0.3);
}

.calendar-day.not-current {
    opacity: 0.2;
    cursor: default;
}

.calendar-day.not-current:hover {
    transform: none;
    background: rgba(255, 255, 255, 0.03);
    border-color: transparent;
}

.calendar-day.has-maint {
    background: rgba(244, 63, 94, 0.05);
    border-color: rgba(244, 63, 94, 0.2);
}

.calendar-day.has-maint::after {
    content: '';
    position: absolute;
    bottom: 6px;
    width: 8px;
    height: 8px;
    background: var(--polaris-error);
    border-radius: 50%;
    box-shadow: 0 0 12px var(--polaris-error);
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.3);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.calendar-day.active {
    background: rgba(0, 210, 255, 0.1);
    border-color: var(--polaris-cyan);
}

.calendar-day-num {
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
}

/* ==========================================================================
   Cyber Pills (KPIs)
   ========================================================================== */
.cyber-pill {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    padding: 8px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.cyber-pill.v2-compact {
    padding: 6px 12px;
}

.cyber-pill.clickable {
    cursor: pointer;
}

.cyber-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.3);
}

.cyber-pill.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--polaris-cyan);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.2);
}

.pill-icon {
    font-size: 1.2rem;
    width: 35px;
    height: 35px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--polaris-cyan);
    box-shadow: inset 0 0 10px rgba(6, 182, 212, 0.2);
}

.pill-content {
    display: flex;
    flex-direction: column;
}

.pill-value {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1;
}

.pill-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: rgba(255, 255, 255, 0.5);
}

/* Color Variants */
.pill-red .pill-icon {
    color: #ef4444;
    box-shadow: inset 0 0 10px rgba(239, 68, 68, 0.2);
}

.pill-red.active {
    border-color: #ef4444;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.3);
}

.pill-orange .pill-icon {
    color: #f59e0b;
    box-shadow: inset 0 0 10px rgba(245, 158, 11, 0.2);
}

.pill-orange.active {
    border-color: #f59e0b;
    box-shadow: 0 0 15px rgba(245, 158, 11, 0.3);
}

.pill-green .pill-icon {
    color: #10b981;
    box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.2);
}

.pill-green.active {
    border-color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.pill-cyan .pill-icon {
    color: var(--polaris-cyan);
    box-shadow: inset 0 0 10px rgba(6, 182, 212, 0.2);
}

.pill-cyan.active {
    border-color: var(--polaris-cyan);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

/* Module Identity Variants */
.pill-tickets .pill-icon {
    color: var(--polaris-cyan);
    box-shadow: inset 0 0 10px rgba(6, 182, 212, 0.2);
}

.pill-tickets.active {
    border-color: var(--polaris-cyan);
    box-shadow: 0 0 15px rgba(6, 182, 212, 0.3);
}

.pill-novedades .pill-icon {
    color: #10b981;
    /* Emerald */
    box-shadow: inset 0 0 10px rgba(16, 185, 129, 0.2);
}

.pill-novedades.active {
    border-color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.kpi-row-tickets {
    border-left: 3px solid var(--polaris-cyan) !important;
    padding-left: 10px;
    position: relative;
    z-index: 1;
}

.kpi-row-tickets::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 150px;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.08) 0%, transparent 100%);
    pointer-events: none;
    z-index: -1;
}

.kpi-row-novedades {
    border-left: 3px solid #10b981 !important;
    padding-left: 10px;
    position: relative;
    z-index: 1;
}

.kpi-row-novedades::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 150px;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.08) 0%, transparent 100%);
    pointer-events: none;
    z-index: -1;
}

.kpi-row-vehicles {
    border-left: 4px solid var(--polaris-cyan);
    padding-left: 15px;
    position: relative;
    z-index: 1;
}

.kpi-row-vehicles::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 150px;
    background: linear-gradient(90deg, rgba(6, 182, 212, 0.08) 0%, transparent 100%);
    pointer-events: none;
    z-index: -1;
}

/* Identidad del Módulo: Minutas Digitales (Índigo) */
.kpi-row-minutas {
    border-left: 4px solid #6366f1;
    padding-left: 15px;
    position: relative;
    z-index: 1;
}

.kpi-row-minutas::after {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 150px;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.08) 0%, transparent 100%);
    pointer-events: none;
    z-index: -1;
}

.pill-minutas {
    border-left: 3px solid #6366f1;
}

.pill-minutas.active {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid #6366f1;
    box-shadow: 0 0 15px rgba(99, 102, 241, 0.3);
}

.pill-minutas:hover {
    box-shadow: -5px 0 15px -3px rgba(99, 102, 241, 0.4);
}

.indigo-glow {
    text-shadow: 0 0 10px rgba(99, 102, 241, 0.5);
}

.btn-indigo {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    border: none;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-indigo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
    color: white;
}

/* 🏎️ Vehicle Mini-Pills (Compact for Tables) */
.v-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: all 0.2s ease;
    cursor: default;
}

.v-pill i {
    font-size: 0.7rem;
}

.v-pill-red {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border-color: rgba(239, 68, 68, 0.3);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

.v-pill-orange {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
    border-color: rgba(245, 158, 11, 0.3);
}

.v-pill-amber {
    background: rgba(217, 119, 6, 0.15);
    color: #f59e0b;
    border-color: rgba(217, 119, 6, 0.3);
}

.v-pill-green {
    background: rgba(16, 185, 129, 0.15);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.3);
}

.v-pill-blue {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border-color: rgba(6, 182, 212, 0.3);
}

.v-pill-gray {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border-color: rgba(148, 163, 184, 0.2);
}

.v-pill:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.4);
}

/* 💠 Dashboard: Slanted Pills (Planning Section) */
.slanted-pill {
    background: rgba(255, 255, 255, 0.04);
    border-right: 4px solid var(--polaris-cyan);
    clip-path: polygon(0 0, 95% 0, 100% 100%, 0% 100%);
    padding: 15px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.slanted-pill::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(6, 182, 212, 0.1), transparent);
    transition: 0.5s;
}

.slanted-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(5px);
}

.slanted-pill:hover::before {
    left: 100%;
}

/* ⚡ Dashboard: Neon Vitals (Tracking Section) */
.neon-vital {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(34, 211, 238, 0.1);
    border-radius: 12px;
    padding: 20px;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
}

.neon-vital.pulse-blue {
    border-color: rgba(6, 182, 212, 0.3);
    animation: neon-pulse-blue 4s infinite ease-in-out;
}

@keyframes neon-pulse-blue {

    0%,
    100% {
        box-shadow: 0 0 15px rgba(6, 182, 212, 0.1), inset 0 0 10px rgba(6, 182, 212, 0.05);
    }

    50% {
        box-shadow: 0 0 25px rgba(6, 182, 212, 0.3), inset 0 0 15px rgba(6, 182, 212, 0.1);
    }
}

.vital-value {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 2.2rem;
    color: #fff;
    text-shadow: 0 0 10px rgba(103, 232, 249, 0.5);
    line-height: 1;
}

/* 📈 Dashboard: Glass Metrics (Control Section) */
.glass-metric {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 18px;
    transition: all 0.3s ease;
}

.glass-metric:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-4px);
}

.sparkline-container {
    height: 40px;
    width: 100%;
    margin-top: 10px;
}

.sparkline-svg {
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
    filter: drop-shadow(0 0 5px rgba(34, 211, 238, 0.4));
}