/* ============================================================
   Radio VHF — Estilos principales
   ============================================================ */

:root {
    --sidebar-w:     240px;
    --sidebar-bg:    #1a2332;
    --sidebar-hover: #2d3f55;
    --sidebar-active:#3d5a80;
    --accent:        #3d8bcd;
    --canal-bg:      #6c4fbb;
    --topbar-h:      56px;
    --radius:        8px;
}

/* ── Base ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', system-ui, sans-serif;
    background: #f0f2f5;
    color: #333;
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ────────────────────────────────────────────────── */
.sidebar {
    width: var(--sidebar-w);
    background: var(--sidebar-bg);
    color: #cdd6e3;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform .25s ease;
    overflow-y: auto;
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 16px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.sidebar-logo    { font-size: 28px; }
.sidebar-title   { font-size: .9rem; font-weight: 700; color: #fff; line-height: 1.2; }
.sidebar-version { font-size: .7rem; color: #8a9bb5; }

.sidebar-nav {
    list-style: none;
    padding: 12px 0;
    margin: 0;
    flex: 1;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 20px;
    color: #b0bec5;
    text-decoration: none;
    font-size: .875rem;
    border-radius: 0;
    transition: background .15s, color .15s;
}

.sidebar-nav li a:hover     { background: var(--sidebar-hover); color: #fff; }
.sidebar-nav li.active a    { background: var(--sidebar-active); color: #fff; font-weight: 600; }
.sidebar-nav li a .bi       { font-size: 1rem; flex-shrink: 0; }

.nav-section {
    font-size: .68rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #546e7a;
    padding: 14px 20px 4px;
    font-weight: 600;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-top: 1px solid rgba(255,255,255,.08);
    flex-shrink: 0;
}

.user-avatar {
    width: 34px; height: 34px;
    background: var(--accent);
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: 700;
    color: #fff;
    font-size: .85rem;
    flex-shrink: 0;
}

.user-info   { flex: 1; min-width: 0; }
.user-name   { font-size: .8rem; color: #fff; font-weight: 600;
               white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-role   { font-size: .7rem; color: #8a9bb5; }

.btn-logout {
    color: #8a9bb5;
    font-size: 1.1rem;
    text-decoration: none;
    flex-shrink: 0;
    transition: color .15s;
}
.btn-logout:hover { color: #ef5350; }

/* ── Main content ───────────────────────────────────────────── */
.main-content {
    margin-left: var(--sidebar-w);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left .25s ease;
}

/* ── Topbar ─────────────────────────────────────────────────── */
.topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
    position: sticky;
    top: 0;
    z-index: 900;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.topbar-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.topbar-actions { display: flex; align-items: center; gap: 8px; }
.sidebar-toggle { color: #555; padding: 4px 8px; }

/* ── Page content ───────────────────────────────────────────── */
.page-content   { padding: 0 0 32px; flex: 1; }

/* ── Login ──────────────────────────────────────────────────── */
body.login-page {
    background: linear-gradient(135deg, #1a2332 0%, #3d5a80 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-container { width: 100%; max-width: 400px; padding: 16px; }

.login-card {
    background: #fff;
    border-radius: 16px;
    padding: 40px 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
}

.login-logo     { font-size: 48px; text-align: center; margin-bottom: 8px; }
.login-title    { text-align: center; font-size: 1.4rem; font-weight: 700;
                  color: #1a2332; margin-bottom: 4px; }
.login-subtitle { text-align: center; color: #6c757d; font-size: .85rem; margin-bottom: 24px; }
.login-form     { margin-top: 8px; }

/* ── Stat cards ─────────────────────────────────────────────── */
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: 0 1px 4px rgba(0,0,0,.07);
    display: flex;
    align-items: center;
    gap: 16px;
    border-left: 4px solid transparent;
}

.stat-success { border-color: #28a745; }
.stat-warning { border-color: #ffc107; }
.stat-primary { border-color: var(--accent); }
.stat-info    { border-color: #17a2b8; }

.stat-icon { font-size: 2rem; }
.stat-num  { font-size: 2rem; font-weight: 800; line-height: 1; }
.stat-label{ font-size: .8rem; color: #6c757d; }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    border-radius: var(--radius) !important;
    box-shadow: 0 1px 4px rgba(0,0,0,.08) !important;
    border: 1px solid #e9ecef !important;
}

.card-header {
    border-radius: var(--radius) var(--radius) 0 0 !important;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

/* ── Prueba cards ───────────────────────────────────────────── */
.prueba-card  { border-width: 2px !important; }

/* ── Asignación cards ───────────────────────────────────────── */
.asig-card { transition: box-shadow .2s; }
.asig-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.13) !important; }

.list-item-entregada { background: #f0fff4; }
.list-item-devuelta  { background: #f0f8ff; }

/* ── Badges ─────────────────────────────────────────────────── */
.bg-canal  { background-color: var(--canal-bg) !important; }
.bg-purple { background-color: #6f42c1 !important; }

/* ── Tabla ──────────────────────────────────────────────────── */
.table th     { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table td     { vertical-align: middle; }
.opacity-60   { opacity: .6; }

/* ── Sección title ──────────────────────────────────────────── */
.section-title {
    font-size: 1rem;
    font-weight: 700;
    color: #495057;
    padding: 16px 0 8px;
    margin: 0;
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 14px;
}

/* ── Channel grid (emisoras modal) ─────────────────────────── */
.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: var(--radius);
    border: 1px solid #dee2e6;
}

.channel-check {
    display: flex !important;
    align-items: flex-start;
    gap: 8px;
    padding: 8px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    margin: 0 !important;
    cursor: pointer;
    transition: border-color .15s;
}

.channel-check:hover { border-color: var(--accent); }

/* ── Font mono ──────────────────────────────────────────────── */
.font-mono { font-family: 'Courier New', monospace; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

/* ── Scrollbar sidebar ───────────────────────────────────────── */
.sidebar::-webkit-scrollbar       { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,.15); border-radius: 2px; }


/* ── Vehículo card ──────────────────────────────────────────── */
.vehiculo-card {
    border-left: 4px solid var(--accent) !important;
    transition: box-shadow .2s;
}
.vehiculo-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,.12) !important;
}
.vehiculo-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 14px 20px !important;
}

/* ── Placa badge ────────────────────────────────────────────── */
.placa-badge {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    background: var(--sidebar-bg);
    border-radius: 10px;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.placa-num   { font-size: 1.5rem; font-weight: 900; line-height: 1; }
.placa-label { font-size: .55rem; letter-spacing: .1em; opacity: .7; }

/* ── Badge identificador acreditado ────────────────────────── */
.bg-vehiculo-placa {
    background-color: #495057 !important;
    font-family: 'Courier New', monospace;
    font-size: .8rem;
    padding: 4px 8px;
}

/* ── Zona acreditados ───────────────────────────────────────── */
.acreditados-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: #f1f3f5;
    border-top: 1px solid #dee2e6;
    border-bottom: 1px solid #dee2e6;
}

.acred-table thead th {
    background: #f8f9fa;
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6c757d;
    border-bottom: 1px solid #dee2e6;
    padding: 6px 12px;
}
.acred-table tbody td { padding: 8px 12px; }
.acred-inactivo        { opacity: .55; background: #f8f9fa; }

.acred-empty {
    padding: 16px 20px;
    color: #adb5bd;
    font-size: .875rem;
    font-style: italic;
}

/* ── Pasos de confirmación eliminación ──────────────────────── */
.confirm-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    opacity: .45;
    pointer-events: none;
    transition: opacity .25s, border-color .25s, background .25s;
}

/* Paso activo — se aplica por clase explícita, no por :first-of-type */
.confirm-step.confirm-step-active {
    opacity: 1;
    pointer-events: auto;
    border-color: #dc3545;
    background: #fff5f5;
}

.confirm-step-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #dc3545;
    color: #fff;
    font-weight: 700;
    font-size: .85rem;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    margin-top: 2px;
}

#confirm3Block              { align-items: flex-start; }
#confirm3Block .flex-grow-1 { width: 100%; }

/* ── Panel subheader (emisoras / acreditados dentro del collapse) ── */
.panel-subheader {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 14px;
    background: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
    border-top: 1px solid #dee2e6;
}

/* ── Colores por canal ───────────────────────────────────────── */
.bg-canal-ro    { background-color: #f0b400 !important; color: #000 !important; }
.bg-canal-rv    { background-color: #dc3545 !important; color: #fff !important; }
.bg-canal-rj    { background-color: #28a745 !important; color: #fff !important; }
.bg-canal-rinfo { background-color: #0d6efd !important; color: #fff !important; }
.bg-canal-default { background-color: #6c4fbb !important; color: #fff !important; }


/* ── Dashboard — selección de prueba ────────────────────────── */
.prueba-seleccion-card {
    display: block;
    padding: 16px 18px;
    border-radius: var(--radius);
    border: 2px solid transparent;
    background: #fff;
    cursor: pointer;
    transition: all .2s ease;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    text-decoration: none;
    color: inherit;
}

.prueba-seleccion-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.15);
    color: inherit;
}

.prueba-card-activa     { border-color: #28a745; }
.prueba-card-activa:hover { background: #f0fff4; }

.prueba-card-preparacion { border-color: #ffc107; }
.prueba-card-preparacion:hover { background: #fffdf0; }

.prueba-card-finalizada { border-color: #6c757d; }
.prueba-card-finalizada:hover { background: #f8f9fa; }

/* ── Dashboard — cabecera prueba seleccionada ────────────────── */
.prueba-dashboard-header {
    background: #fff;
    border-radius: var(--radius);
    padding: 20px 24px;
    border-left: 5px solid var(--accent);
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}

/* ── Botones acción rápida ───────────────────────────────────── */
.btn-accion-rapida {
    display: block;
    padding: 24px 16px;
    border-radius: var(--radius);
    text-align: center;
    text-decoration: none;
    color: #fff;
    transition: all .2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

.btn-accion-rapida:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,.2);
    color: #fff;
}

.btn-accion-primary { background: linear-gradient(135deg, #2649B2, #3d8bcd); }
.btn-accion-dark    { background: linear-gradient(135deg, #1a2332, #2d3f55); }
.btn-accion-info    { background: linear-gradient(135deg, #0d6efd, #17a2b8); }

/* ── Sidebar — prueba activa ─────────────────────────────────── */
.prueba-activa-sidebar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 8px 20px;
    background: rgba(255,255,255,.07);
    border-radius: 6px;
    margin: 2px 10px;
}

.prueba-activa-nombre {
    font-size: .78rem;
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.btn-salir-prueba {
    background: none;
    border: none;
    color: #ef5350;
    cursor: pointer;
    font-size: 1rem;
    padding: 0;
    flex-shrink: 0;
    transition: color .15s;
}

.btn-salir-prueba:hover { color: #c62828; }

/* ── Canal RX (renombrado de RV) ─────────────────────────────── */
.bg-canal-rx { background-color: #dc3545 !important; color: #fff !important; }

/* ── Canales RV y RX (ambos rojos por defecto) ───────────────── */
.bg-canal-rv { background-color: #dc3545 !important; color: #fff !important; }
.bg-canal-rx { background-color: #dc3545 !important; color: #fff !important; }

/* ── Placa mini preview en modal ────────────────────────────── */
.placa-badge-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 6px;
    color: #fff;
    font-weight: 900;
    font-size: .9rem;
    flex-shrink: 0;
    transition: background-color .2s;
}

/* ── Color picker tamaño controlado ─────────────────────────── */
.form-control-color {
    min-width: 48px;
    max-width: 48px;
    padding: 4px;
    cursor: pointer;
}