:root {
    --bg: #e6eeeb;
    --ink: #1a2c30;
    --muted: #5d7174;
    --line: #d3e0db;
    --panel: #ffffff;
    --sidebar: #143533;
    --sidebar-ink: #e8f3f0;
    --sidebar-muted: #b7cdc8;
    --accent: #1f6f64;
    --accent-soft: #e7f4f1;
    --brass: #a68445;
    --exclusive-bg: #f8f1e3;
    --exclusive-ink: #7a5416;
    --shadow: 0 16px 40px rgba(20, 53, 51, 0.08);
    --radius: 18px;
    --fuente: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--fuente);
    font-size: 16px;
    line-height: 1.45;
}

a { color: var(--accent); }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

.layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    align-items: start;
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow: auto;
    background: var(--sidebar);
    color: var(--sidebar-ink);
    padding: 28px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.marca {
    display: flex;
    gap: 12px;
    align-items: center;
}

.marca-icono { color: #f4faf8; display: flex; }

.sobre {
    margin: 0;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 11px;
    color: var(--brass);
}

.nombre-app {
    margin: 2px 0 0;
    font-size: 18px;
    font-weight: 650;
    letter-spacing: -0.02em;
}

.nav { display: flex; flex-direction: column; gap: 8px; }

.nav-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    text-decoration: none;
    color: var(--sidebar-ink);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 14px;
    padding: 12px 12px;
}

.nav-item:hover { background: rgba(255, 255, 255, 0.06); }

.nav-item.is-active {
    background: #f7fbfa;
    color: var(--sidebar);
}

.nav-item.is-active .nav-horario { color: var(--muted); }

.nav-texto { display: flex; flex-direction: column; min-width: 0; }

.nav-nombre { font-weight: 650; }

.nav-horario {
    color: var(--sidebar-muted);
    font-size: 12.5px;
}

.cuenta {
    min-width: 2.2rem;
    text-align: center;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    font-size: 13px;
    font-variant-numeric: tabular-nums;
}

.is-active .cuenta {
    background: var(--accent-soft);
    color: var(--accent);
}

.filtros button, .dialogo-cerrar button, .enlace-ficha {
    font: inherit;
    cursor: pointer;
}

.fuente {
    margin: 8px 0 0;
    margin-top: auto;
    color: var(--sidebar-muted);
    font-size: 12.5px;
}

.principal { padding: 32px 28px 56px; }

.contenido { width: min(1120px, 100%); margin: 0 auto; }

.eyebrow {
    margin: 0 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 12px;
    color: var(--brass);
    font-weight: 700;
}

h1 {
    margin: 0;
    font-size: 34px;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.bajada { margin: 8px 0 0; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

.chip {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 13px;
}

.aviso {
    margin: 18px 0 0;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--accent-soft);
    color: #145248;
}

.aviso-error {
    background: #fdecec;
    color: #7a2e2e;
}

.filtros { margin-top: 22px; }

.busqueda { display: flex; gap: 8px; }

.busqueda input, .filtros select {
    font: inherit;
    color: var(--ink);
    background: var(--panel);
    border: 1px solid #c9d8d3;
    border-radius: 12px;
    padding: 12px 14px;
}

.busqueda input { flex: 1; min-width: 0; }

.busqueda input:focus, .filtros select:focus, .nav-item:focus-visible, a:focus-visible, button:focus-visible {
    outline: 3px solid rgba(31, 111, 100, 0.35);
    outline-offset: 2px;
}

.filtros button {
    border: 0;
    background: var(--accent);
    color: white;
    border-radius: 12px;
    padding: 0 18px;
    font-weight: 650;
}

.filtros-extra {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 16px;
    align-items: end;
    margin-top: 12px;
}

.filtros-extra label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }

.filtros-extra select { min-width: 180px; }

.limpiar {
    align-self: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.panel {
    margin-top: 18px;
    background: var(--panel);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.panel-barra {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
    padding: 16px 18px 0;
}

.conteo { margin: 0; font-weight: 650; }

.rango, .pista, .vacio, .origen { color: var(--muted); font-weight: 400; }

.pista { margin: 0; font-size: 13px; }

.tabla-wrap { overflow-x: auto; }

.tabla { width: 100%; border-collapse: collapse; }

.tabla th, .tabla td {
    text-align: left;
    padding: 13px 16px;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
}

.tabla th a {
    color: inherit;
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 0.01em;
}

.tabla th a.is-sorted { color: var(--accent); }

.tabla tbody tr:hover { background: #f3faf8; }

.tabla tbody tr.es-exclusivo { box-shadow: inset 3px 0 0 var(--brass); }

.col-nombre { font-weight: 650; }

.ficha-link { color: inherit; text-decoration: none; }

.ficha-link:hover { color: var(--accent); text-decoration: underline; }

.badge {
    display: inline-block;
    background: var(--exclusive-bg);
    color: var(--exclusive-ink);
    border-radius: 999px;
    padding: 3px 9px;
    font-size: 13px;
    font-weight: 650;
}

.badge-tipo {
    background: var(--accent-soft);
    color: #145248;
}

.vacio-tabla { text-align: center; color: var(--muted); padding: 36px 16px; }

.paginacion {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 14px 16px 18px;
}

.paginacion a, .paginacion .deshabilitado {
    min-width: 2.4rem;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    color: var(--ink);
}

.paginacion a.is-current {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

.paginacion .deshabilitado { color: #9aada9; }

dialog {
    width: min(640px, calc(100vw - 32px));
    border: 0;
    border-radius: 20px;
    padding: 28px 28px 22px;
    box-shadow: var(--shadow);
    color: var(--ink);
}

dialog::backdrop { background: rgba(20, 40, 42, 0.48); }

.dialogo-cerrar { display: flex; justify-content: flex-end; margin: 0; }

.dialogo-cerrar button, .enlace-ficha {
    border: 0;
    background: transparent;
    color: var(--accent);
    padding: 0;
    font-weight: 650;
}

dialog h2 {
    margin: 0;
    font-size: 30px;
    letter-spacing: -0.03em;
}

.ficha-datos { margin: 18px 0; display: grid; gap: 14px; }

.ficha-datos div {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
}

.ficha-datos dt { color: var(--muted); }

.ficha-datos dd { margin: 0; font-weight: 650; }

.exclusiva {
    background: var(--exclusive-bg);
    color: var(--exclusive-ink);
    border-radius: 14px;
    padding: 14px 16px;
}

.exclusiva p { margin: 0 0 4px; font-size: 13px; letter-spacing: 0.04em; text-transform: uppercase; }

.exclusiva strong { font-size: 18px; }

.origen { font-size: 13px; }

.enlace-ficha { display: inline-block; margin-top: 16px; }

.volver {
    display: inline-block;
    margin-bottom: 14px;
    text-decoration: none;
    font-weight: 650;
}

.ficha-pagina { padding: 28px; }

.pagina-error {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.pagina-error main {
    width: min(520px, 100%);
    background: white;
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}

@media (max-width: 900px) {
    .layout { display: block; }
    .sidebar {
        position: static;
        height: auto;
        padding: 18px 16px 14px;
    }
    .nav { flex-direction: row; overflow-x: auto; }
    .nav-item { min-width: 210px; }
    .fuente { margin-top: 8px; }
    .principal { padding: 20px 16px 40px; }
    h1 { font-size: 28px; }
}

@media (max-width: 700px) {
    .busqueda { flex-direction: column; }
    .filtros button { padding: 12px; }
    .panel-barra { flex-direction: column; }
    .tabla thead { display: none; }
    .tabla, .tabla tbody, .tabla tr, .tabla td { display: block; width: 100%; }
    .tabla tr {
        border-bottom: 8px solid var(--bg);
        padding: 8px 12px;
    }
    .tabla td {
        display: grid;
        grid-template-columns: 42% 1fr;
        gap: 8px;
        border: 0;
        padding: 6px 0;
    }
    .tabla td::before {
        content: attr(data-label);
        color: var(--muted);
        font-size: 12px;
        font-weight: 650;
    }
    .tabla td.col-nombre { display: block; font-size: 18px; }
    .tabla td.col-nombre::before { display: none; }
    .vacio-tabla { display: block; }
    .ficha-datos div { grid-template-columns: 1fr; gap: 4px; }
}

@media print {
    .sidebar, .filtros, .paginacion, .pista, dialog { display: none !important; }
    .layout, .principal, .contenido { display: block; width: auto; padding: 0; }
    body { background: white; }
    .panel { box-shadow: none; }
}
