/* ============================================================================
   Sala de Informática — hoja de estilos
   Tema oscuro "glass". Reescrito legible y accesible.
   ========================================================================== */

:root {
    --bg:        #0b1220;
    --surface:   rgba(255, 255, 255, .05);
    --surface-2: rgba(255, 255, 255, .03);
    --text:      #eaf0ff;
    --muted:     #b9c6e6;            /* aclarado para mejor contraste */
    --line:      rgba(255, 255, 255, .10);

    --blue:      #4aa3ff;
    --ok:        #3dd6c6;
    --danger:    #ff5c7a;

    --radius:    14px;
    --radius-lg: 16px;
    --focus:     0 0 0 3px rgba(74, 163, 255, .55);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    color: var(--text);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    line-height: 1.45;
    background:
        radial-gradient(1200px 500px at 20% -10%, rgba(74, 163, 255, .25), transparent 60%),
        radial-gradient(900px 450px at 90% 0%,  rgba(61, 214, 198, .18), transparent 55%),
        var(--bg);
    background-attachment: fixed;
}

a { color: inherit; text-decoration: none; }

h1, h2, h3 { line-height: 1.2; }

/* --- Foco visible para teclado (accesibilidad) --------------------------- */
:focus-visible {
    outline: none;
    box-shadow: var(--focus);
    border-radius: 8px;
}

/* ----------------------------------------------------------------------------
   Barra superior y navegación
   -------------------------------------------------------------------------- */
.topbar {
    padding: 16px 0;
    border-bottom: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 255, 255, .04), transparent);
    backdrop-filter: blur(6px);
    position: sticky;
    top: 0;
    z-index: 20;
}

.wrap { max-width: 1180px; margin: 0 auto; padding: 18px; }

.brand {
    display: flex;
    gap: 14px;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.brand-name {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .2px;
}

.brand-mark {
    display: inline-grid;
    place-items: center;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 900;
    color: #04121a;
    background: linear-gradient(135deg, var(--ok), var(--blue));
}

.nav { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

.pill {
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    font-size: 13px;
    transition: border-color .15s ease, background .15s ease;
}

.pill:not(.is-static):hover { background: rgba(255, 255, 255, .09); }
.pill.accent { border-color: rgba(61, 214, 198, .55); color: #d6fff8; }
.pill.danger { border-color: rgba(255, 92, 122, .50); }
.pill.is-static { opacity: .85; cursor: default; }

/* ----------------------------------------------------------------------------
   Tarjetas y estructura
   -------------------------------------------------------------------------- */
main { display: block; }

.card {
    max-width: 1180px;
    margin: 0 auto 16px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02));
    box-shadow: 0 12px 35px rgba(0, 0, 0, .35);
}

/* La tarjeta queda dentro de .wrap en las páginas; este margin la centra igual. */
.wrap > .card { margin-left: 0; margin-right: 0; }

.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }

.hr { height: 1px; background: var(--line); margin: 16px 0; border: 0; }

.small { color: var(--muted); font-size: 12.5px; }

/* ----------------------------------------------------------------------------
   Formularios
   -------------------------------------------------------------------------- */
.label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin: 12px 0 6px;
}

input, select, textarea {
    width: 100%;
    padding: 10px 12px;
    color: var(--text);
    font: inherit;
    background: rgba(255, 255, 255, .07);
    border: 1px solid var(--line);
    border-radius: 12px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}

input::placeholder, textarea::placeholder { color: rgba(185, 198, 230, .55); }

input:focus, select:focus, textarea:focus {
    border-color: rgba(74, 163, 255, .6);
    box-shadow: var(--focus);
}

textarea { min-height: 96px; resize: vertical; }

/* El selector de fecha/hora nativo necesita el ícono claro en tema oscuro */
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator,
input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: invert(1) opacity(.7);
    cursor: pointer;
}

/* ----------------------------------------------------------------------------
   Botones
   -------------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    transition: transform .05s ease, background .15s ease, border-color .15s ease;
}

.btn:hover  { background: rgba(255, 255, 255, .10); }
.btn:active { transform: translateY(1px); }

.btn.primary { background: rgba(74, 163, 255, .20); border-color: rgba(74, 163, 255, .45); }
.btn.ok      { background: rgba(61, 214, 198, .18); border-color: rgba(61, 214, 198, .45); }
.btn.danger  { background: rgba(255, 92, 122, .16); border-color: rgba(255, 92, 122, .45); }

/* ----------------------------------------------------------------------------
   Avisos
   -------------------------------------------------------------------------- */
.notice {
    max-width: 1180px;
    margin: 0 auto 14px;
    padding: 12px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--line);
    background: var(--surface-2);
}

.notice.ok  { border-color: rgba(61, 214, 198, .50); }
.notice.err { border-color: rgba(255, 92, 122, .50); }

/* ----------------------------------------------------------------------------
   Tablas
   -------------------------------------------------------------------------- */
.table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
}

.table th, .table td {
    padding: 10px 12px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
    font-size: 13px;
}

.table th {
    text-align: left;
    color: var(--muted);
    background: var(--surface-2);
    font-weight: 700;
}

.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, .025); }

/* ----------------------------------------------------------------------------
   Badges
   -------------------------------------------------------------------------- */
.badge {
    display: inline-flex;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    border: 1px solid var(--line);
}

.badge.ok  { border-color: rgba(61, 214, 198, .40); color: #cdfff7; }
.badge.off { border-color: rgba(255, 92, 122, .50); color: #ffd3dc; }

/* ----------------------------------------------------------------------------
   Grillas
   -------------------------------------------------------------------------- */
.grid  { display: grid; gap: 14px; }
.grid2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 800px) {
    .grid2, .grid3 { grid-template-columns: 1fr; }
}

/* ----------------------------------------------------------------------------
   Inventario (PCs y periféricos)
   -------------------------------------------------------------------------- */
.pc-card {
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface-2);
    padding: 14px;
    margin-bottom: 14px;
}

.pc-title {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    font-weight: 800;
    font-size: 16px;
    margin-bottom: 10px;
}

.periferico {
    border-left: 3px solid rgba(61, 214, 198, .55);
    padding: 8px 10px;
    margin: 6px 0;
    background: rgba(255, 255, 255, .025);
    border-radius: 10px;
}

/* ----------------------------------------------------------------------------
   Calendario / agenda mensual
   -------------------------------------------------------------------------- */
.cal {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 10px;
}

.dow {
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    padding: 6px 0;
}

.day {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 10px;
    background: var(--surface-2);
    min-height: 112px;
}

.day > b { font-size: 14px; }

/* En celular: la grilla de 7 columnas no sirve. Pasamos a lista de días,
   cada uno con su rótulo de fecha, sin perder la información. */
@media (max-width: 760px) {
    .cal { grid-template-columns: 1fr; gap: 8px; }
    .dow { display: none; }
    .day { min-height: auto; }
    .day::before {
        content: attr(data-fecha);
        display: block;
        color: var(--muted);
        font-size: 11px;
        margin-bottom: 2px;
    }
}

/* ----------------------------------------------------------------------------
   Accesibilidad: respetar "reducir movimiento"
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ----------------------------------------------------------------------------
   Menú reorganizado: módulos (deslizables) + zona de sesión
   -------------------------------------------------------------------------- */
.brand { flex-wrap: wrap; row-gap: 8px; }

.nav-modulos {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    max-width: 100%;
}
.nav-modulos::-webkit-scrollbar { display: none; }
.nav-modulos .pill { white-space: nowrap; flex: 0 0 auto; }

.nav-sesion {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
    flex-wrap: nowrap;
}
.nav-sesion .pill { white-space: nowrap; }
.nav-sesion .pill.inst {
    max-width: 190px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 860px) {
    .nav-sesion { margin-left: 0; width: 100%; }
    .nav-sesion .pill.inst { max-width: 150px; }
}

/* Menú compacto: más chance de entrar en una sola línea */
.brand { gap: 10px; }
.pill { padding: 7px 11px; font-size: 12.5px; }
.nav-modulos { gap: 6px; }
.nav-sesion { gap: 6px; }

/* Menú en dos filas fijas: título + sesión arriba, módulos abajo (igual en todas las páginas) */
.top-fila1 { display: flex; align-items: center; justify-content: space-between;
             gap: 10px; row-gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.brand-titulo { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.nav-sesion { margin-left: auto; }
@media (max-width: 860px) { .nav-sesion { width: auto; margin-left: auto; } }

/* ----------------------------------------------------------------------------
   Desplegables: la lista abierta la dibuja el sistema operativo, así que hay
   que darle color explícito o el texto queda ilegible en el tema oscuro.
   -------------------------------------------------------------------------- */
select {
    color-scheme: dark;                       /* lista desplegada en tono oscuro */
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23b9c6e6' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 34px;
}
select option,
select optgroup {
    background-color: #1b2334;                /* fondo del listado */
    color: #e8edf4;                           /* texto legible */
}
