/**
 * Wantelco Network Maps - Estilo Corporativo v3
 * Tema: Fondo blanco, iconos violeta, acentos verde turquesa
 * Fuente: Poppins
 */

/* ===== Google Fonts - Poppins ===== */
@import url('https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,400;0,500;0,600;0,700;0,800;1,500&display=swap');

/* ===== Variables CSS - Colores Wantelco ===== */
:root {
    /* Colores principales */
    --primary: #7B2D8E;           /* Violeta Wantelco */
    --primary-dark: #5E2270;
    --primary-light: #9B4DAE;
    
    --accent: #00D4AA;            /* Verde turquesa Wantelco */
    --accent-dark: #00B894;
    --accent-light: #55EFC4;
    
    /* Fondos blancos */
    --background: #FFFFFF;
    --background-alt: #F5F7FA;
    --surface: #FFFFFF;
    --surface-hover: #F0F2F5;
    --border-color: #E8ECF0;
    
    /* Textos */
    --text: #1A1A2E;
    --text-secondary: #4A4A5A;
    --text-muted: #8A8A9A;
    --text-light: #FFFFFF;
    
    /* Estados */
    --success: #00D4AA;
    --warning: #FFB800;
    --danger: #FF4757;
    --info: #3B82F6;
    
    /* Colores rutas */
    --route-1: #7B2D8E;
    --route-2: #00D4AA;
    --route-3: #FF6B35;
    --route-4: #3B82F6;
    --route-5: #FFB800;
    
    /* Fuentes */
    --font-main: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Efectos */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --shadow-primary: 0 4px 20px rgba(123, 45, 142, 0.3);
    
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --border-radius-lg: 16px;
    --transition: all 0.25s ease;
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: var(--font-main);
    font-weight: 400;
    font-size: 14px;
    color: var(--text);
    background: var(--background);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ===== Layout Principal ===== */
.app-container {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ===== Sidebar Blanco ===== */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: var(--background);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-header {
    padding: 24px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    width: 120px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
}

.logo img {
    width: 100%;
    height: auto;
    object-fit: contain;
}

.brand h1 {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.5px;
}

.brand span {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
}

/* ===== Navegación Sidebar ===== */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    padding: 8px 24px;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 24px;
    color: var(--text-secondary);
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
    gap: 14px;
    font-weight: 500;
    font-size: 14px;
}

.nav-item:hover {
    background: var(--background-alt);
    color: var(--primary);
}

.nav-item.active {
    background: rgba(123, 45, 142, 0.08);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-item svg, .nav-item i {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    font-size: 20px;
    color: var(--primary);
}

.nav-item span {
    flex: 1;
}

.nav-badge {
    background: var(--accent);
    color: var(--text-light);
    font-size: 12px;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

/* ===== Footer Sidebar ===== */
.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--border-color);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background-alt);
    border-radius: var(--border-radius-sm);
}

.user-avatar {
    width: 44px;
    height: 44px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.user-details {
    flex: 1;
}

.user-name {
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 10px;
    border-radius: 8px;
    transition: var(--transition);
}

.logout-btn:hover {
    background: rgba(255, 71, 87, 0.1);
    color: var(--danger);
}

/* ===== Contenido Principal ===== */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: var(--background-alt);
}

/* ===== Header ===== */
.header {
    height: 70px;
    background: var(--background);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 28px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.page-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ===== Botones ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-family: var(--font-main);
    font-size: 14px;
    font-weight: 600;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.btn svg, .btn i {
    width: 18px;
    height: 18px;
    font-size: 16px;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-primary);
}

.btn-accent {
    background: var(--accent);
    color: white;
}

.btn-accent:hover {
    background: var(--accent-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--background);
    color: var(--text);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--border-radius-sm);
}

/* ===== Mapa ===== */
.map-container {
    flex: 1;
    position: relative;
    margin: 16px;
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

#map {
    width: 100%;
    height: 100%;
    background: var(--background-alt);
}

/* ===== Overlay del Mapa ===== */
.map-overlay {
    position: absolute;
    z-index: 500;
}

.map-overlay.top-left {
    top: 16px;
    left: 16px;
}

.map-overlay.top-right {
    top: 16px;
    right: 16px;
}

.map-overlay.bottom-left {
    bottom: 24px;
    left: 16px;
}

.map-overlay.bottom-right {
    bottom: 24px;
    right: 16px;
}

/* ===== Panel de Tráfico ===== */
.traffic-panel {
    background: var(--background);
    border-radius: var(--border-radius);
    padding: 14px;
    min-width: 260px;
    max-width: 280px;
    max-height: calc(100vh - 160px);
    overflow-y: auto;
    box-shadow: var(--shadow);
    font-size: 12px;
}

.traffic-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent);
}

.traffic-panel-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.3px;
}

.traffic-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-muted);
}

.traffic-status .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.traffic-item {
    padding: 10px;
    background: var(--background-alt);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
    border-left: 3px solid var(--primary);
    transition: var(--transition);
}

.traffic-item:hover {
    transform: translateX(2px);
    box-shadow: var(--shadow-sm);
}

.traffic-item:nth-child(2) { border-left-color: var(--accent); }
.traffic-item:nth-child(3) { border-left-color: var(--route-3); }
.traffic-item:nth-child(4) { border-left-color: var(--route-4); }
.traffic-item:nth-child(5) { border-left-color: var(--route-5); }

.traffic-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.traffic-route-name {
    font-weight: 600;
    color: var(--text);
    font-size: 12px;
}

.traffic-interface {
    font-size: 10px;
    color: var(--text-muted);
}

.traffic-rates {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.traffic-rate {
    text-align: center;
    padding: 8px;
    background: var(--background);
    border-radius: var(--border-radius-sm);
}

.traffic-rate-label {
    font-size: 9px;
    color: var(--text-muted);
    margin-bottom: 2px;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.traffic-rate-value {
    font-size: 14px;
    font-weight: 700;
}

.traffic-rate-value.in {
    color: var(--accent);
}

.traffic-rate-value.out {
    color: var(--primary);
}

/* ===== Controles del Mapa ===== */
.map-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.map-control-btn {
    width: 46px;
    height: 46px;
    background: var(--background);
    border: none;
    border-radius: var(--border-radius-sm);
    color: var(--primary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.map-control-btn:hover {
    background: var(--primary);
    color: white;
}

.map-control-btn.active {
    background: var(--primary);
    color: white;
}

.map-control-btn svg, .map-control-btn i {
    width: 22px;
    height: 22px;
    font-size: 20px;
}

/* ===== Inputs ===== */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.form-control {
    width: 100%;
    padding: 14px 18px;
    font-family: var(--font-main);
    font-size: 14px;
    color: var(--text);
    background: var(--background);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
}

.form-control::placeholder {
    color: var(--text-muted);
}

/* ===== Modals ===== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 26, 46, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.modal-backdrop.show {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--background);
    border-radius: var(--border-radius-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: var(--transition);
}

.modal-backdrop.show .modal {
    transform: translateY(0);
}

.modal-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 24px;
}

.modal-close:hover {
    background: rgba(255, 71, 87, 0.1);
    color: var(--danger);
}

.modal-body {
    padding: 24px;
    max-height: calc(90vh - 160px);
    overflow-y: auto;
}

.modal-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ===== Cards ===== */
.card {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
}

.card-body {
    padding: 20px;
}

/* ===== Status Badges ===== */
.status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.status-online {
    background: rgba(0, 212, 170, 0.15);
    color: var(--accent-dark);
}

.status-offline {
    background: rgba(255, 71, 87, 0.15);
    color: var(--danger);
}

.status-warning {
    background: rgba(255, 184, 0, 0.15);
    color: var(--warning);
}

/* ===== Loading ===== */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
}

.login-container {
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.login-card {
    background: var(--background);
    border-radius: var(--border-radius-lg);
    padding: 48px 40px;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.login-logo {
    text-align: center;
    margin-bottom: 40px;
}

.login-logo img {
    height: 40px;
    margin-bottom: 20px;
}

.login-logo h1 {
    font-size: 24px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}

.login-logo p {
    color: var(--text-muted);
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 16px;
}

.login-form .btn {
    width: 100%;
    padding: 16px;
    font-size: 15px;
    margin-top: 8px;
}

.login-error {
    background: rgba(255, 71, 87, 0.1);
    border: 1px solid rgba(255, 71, 87, 0.2);
    color: var(--danger);
    padding: 14px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    font-size: 13px;
    display: none;
}

.login-error.show {
    display: block;
}

/* ===== Tooltips Leaflet ===== */
.leaflet-tooltip {
    background: var(--background) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: var(--border-radius-sm) !important;
    color: var(--text) !important;
    font-family: var(--font-main) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    padding: 10px 14px !important;
    box-shadow: var(--shadow) !important;
}

.leaflet-tooltip::before {
    display: none !important;
}

/* ===== Popups Leaflet ===== */
.leaflet-popup-content-wrapper {
    background: var(--background) !important;
    border-radius: var(--border-radius) !important;
    color: var(--text) !important;
    box-shadow: var(--shadow-lg) !important;
    padding: 0 !important;
}

.leaflet-popup-tip {
    background: var(--background) !important;
}

.leaflet-popup-content {
    margin: 20px !important;
    font-family: var(--font-main) !important;
}

.popup-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--accent);
}

.popup-info {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.popup-traffic {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-alt);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

/* ===== Layer Selector ===== */
.layer-selector {
    background: var(--background);
    border-radius: var(--border-radius);
    margin-top: 10px;
    min-width: 240px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.layer-selector-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
}

.layer-options {
    padding: 12px;
    max-height: 320px;
    overflow-y: auto;
}

.layer-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    cursor: pointer;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    margin-bottom: 6px;
}

.layer-option:hover {
    background: var(--background-alt);
}

.layer-option input[type="radio"] {
    display: none;
}

.layer-option input[type="radio"]:checked + .layer-preview {
    box-shadow: 0 0 0 3px var(--primary);
}

.layer-option input[type="radio"]:checked ~ span:last-child {
    color: var(--primary);
    font-weight: 600;
}

.layer-preview {
    width: 40px;
    height: 40px;
    border-radius: var(--border-radius-sm);
    border: 2px solid var(--border-color);
    transition: var(--transition);
}

.layer-option span:last-child {
    flex: 1;
    font-size: 14px;
    color: var(--text);
}

/* ===== Routes List in Sidebar ===== */
.routes-list {
    padding: 8px 12px;
}

.route-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--background-alt);
    border-radius: var(--border-radius-sm);
    margin-bottom: 8px;
    transition: var(--transition);
    cursor: pointer;
}

.route-item:hover {
    background: rgba(123, 45, 142, 0.08);
}

.route-color {
    width: 28px;
    height: 4px;
    border-radius: 2px;
}

.route-name {
    flex: 1;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== File Upload ===== */
.file-upload {
    border: 2px dashed var(--border-color);
    border-radius: var(--border-radius);
    padding: 48px 24px;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    background: var(--background-alt);
}

.file-upload:hover {
    border-color: var(--primary);
    background: rgba(123, 45, 142, 0.05);
}

.file-upload.dragover {
    border-color: var(--primary);
    background: rgba(123, 45, 142, 0.1);
}

.file-upload svg, .file-upload i {
    width: 56px;
    height: 56px;
    font-size: 48px;
    color: var(--primary);
    margin-bottom: 16px;
}

.file-upload-text {
    color: var(--text);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 15px;
}

.file-upload-hint {
    color: var(--text-muted);
    font-size: 13px;
}

.file-upload input[type="file"] {
    display: none;
}

/* ===== Device Cards ===== */
.device-card {
    background: var(--background);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.device-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
}

.device-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.device-name {
    font-weight: 700;
    color: var(--text);
    font-size: 16px;
}

.device-ip {
    font-size: 13px;
    color: var(--text-muted);
}

.device-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.device-stat {
    text-align: center;
    padding: 12px;
    background: var(--background-alt);
    border-radius: var(--border-radius-sm);
}

.device-stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
}

.device-stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* ===== Leyenda del mapa ===== */
.map-legend {
    background: var(--background);
    border-radius: var(--border-radius-sm);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    min-width: 160px;
    font-size: 11px;
}

.map-legend h4 {
    font-size: 11px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 0;
    font-size: 11px;
    font-weight: 500;
    color: var(--text);
}

.legend-color {
    width: 20px;
    height: 3px;
    border-radius: 2px;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -280px;
        height: 100%;
        z-index: 1000;
        transition: var(--transition);
    }
    
    .sidebar.open {
        left: 0;
    }
    
    .sidebar-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar.open + .sidebar-backdrop {
        display: block;
    }
    
    .traffic-panel {
        max-width: calc(100vw - 32px);
    }
    
    .map-container {
        margin: 8px;
        border-radius: var(--border-radius);
    }
}

/* ===== Modo Fullscreen / NOC ===== */
.fullscreen-mode .sidebar,
.fullscreen-mode .header {
    display: none !important;
}

.fullscreen-mode .main-content {
    width: 100vw;
}

.fullscreen-mode .map-container {
    margin: 0;
    border-radius: 0;
    height: 100vh;
}

.fullscreen-mode .traffic-panel {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
}

.fullscreen-mode .map-legend {
    position: fixed;
    bottom: 16px;
    left: 16px;
    z-index: 1000;
}

/* Botón salir de fullscreen */
.fullscreen-exit-btn {
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    background: var(--background);
    border: none;
    border-radius: var(--border-radius-sm);
    padding: 12px 16px;
    font-family: var(--font-main);
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    box-shadow: var(--shadow);
    display: none;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.fullscreen-mode .fullscreen-exit-btn {
    display: flex;
}

.fullscreen-exit-btn:hover {
    background: var(--primary);
    color: white;
}

/* ===== Modo NOC - Dashboard grande ===== */
body.noc-mode {
    background: #0a0a0a;
}

body.noc-mode .map-container {
    margin: 0;
    border-radius: 0;
}

body.noc-mode .traffic-panel {
    background: rgba(255, 255, 255, 0.95);
    max-height: calc(100vh - 40px);
}

body.noc-mode .map-legend {
    background: rgba(255, 255, 255, 0.95);
}

/* ===== Alertas de Tráfico NOC ===== */
@keyframes alertPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.traffic-item.alert-warning {
    background: rgba(255, 184, 0, 0.1);
    border-left-color: #FFB800 !important;
}

.traffic-item.alert-critical {
    background: rgba(255, 71, 87, 0.1);
    border-left-color: #FF4757 !important;
}

.traffic-item.alert-down {
    background: rgba(255, 71, 87, 0.15);
    border-left-color: #FF4757 !important;
}

.traffic-item.alert-down .traffic-route-name,
.traffic-item.alert-critical .traffic-route-name {
    color: #FF4757;
}

.traffic-item.alert-warning .traffic-route-name {
    color: #E6A700;
}

.utilization-badge {
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(0,0,0,0.05);
}

/* ===== POP Markers en el Mapa ===== */
.pop-marker {
    background: transparent !important;
    border: none !important;
}

.pop-icon {
    position: relative;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
    transition: transform 0.2s ease;
}

.pop-icon:hover {
    transform: scale(1.2);
}

.pop-icon.offline {
    animation: popPulse 1.5s infinite;
}

.pop-alert {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    background: #FF4757;
    color: white;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
    animation: alertBlink 0.8s infinite;
}

@keyframes popPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

@keyframes alertBlink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Tabla editable */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.table th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background: var(--background-alt);
}

.table-container {
    overflow-x: auto;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #e03e4d;
}

.btn-warning {
    background: var(--warning);
    color: var(--text);
}

.btn-warning:hover {
    background: #e6a600;
}

.color-preview {
    display: inline-block;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    border: 2px solid var(--border-color);
}
