/* =====================================================================
   Turismo Federal — Admin · Fluent Design v2
   Tokens inspirados en Fluent 2 con el color de marca del manual.
   ===================================================================== */
:root {
    /* Marca */
    --oliva:    #6e8736;
    --bosque:   #395931;
    --turquesa: #2d8d8b;
    --celeste:  #8ac2c9;
    --naranja:  #cb6f21;
    --amarillo: #e9a22b;

    /* Color de acento (brand) Fluent */
    --brand:        #2d8d8b;
    --brand-hover:  #267a78;
    --brand-press:  #20696a;

    /* Neutrales Fluent 2 */
    --bg:           #f3f4f1;
    --layer:        #ffffff;
    --layer-alt:    #fafaf8;
    --stroke:       #e6e6e2;
    --stroke-soft:  #efefec;
    --text:         #1f2419;
    --text-2:       #5c6356;
    --text-3:       #8b9183;

    /* Radios Fluent (4 / 8) */
    --r-sm: 4px;
    --r-md: 8px;
    --r-lg: 12px;

    /* Sombras (Fluent depth) */
    --depth-2: 0 1px 2px rgba(0,0,0,.10), 0 0 1px rgba(0,0,0,.08);
    --depth-8: 0 4px 8px rgba(0,0,0,.10), 0 0 2px rgba(0,0,0,.08);
    --depth-16: 0 8px 16px rgba(0,0,0,.12), 0 0 2px rgba(0,0,0,.08);

    --font: "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;

    --sidebar-w: 260px;
}

* { box-sizing: border-box; }
body {
    margin: 0; font-family: var(--font); background: var(--bg); color: var(--text);
    font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

/* ── Layout ─────────────────────────────────────────────────────────── */
.layout { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-w); flex-shrink: 0; background: var(--bosque);
    color: #d8e1cf; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.sidebar__brand { padding: 22px 20px; border-bottom: 1px solid rgba(255,255,255,.10); }
.sidebar__brand img { height: 40px; }
.sidebar__nav { padding: 12px 12px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; }
.sidebar__nav a {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: var(--r-md);
    color: #cdd8c2; font-weight: 500; transition: background .15s, color .15s; position: relative;
}
.sidebar__nav a .iconify { font-size: 1.25rem; flex-shrink: 0; }
.sidebar__nav a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }
.sidebar__nav a.is-active { background: var(--brand); color: #fff; box-shadow: var(--depth-2); }
.sidebar__nav a.is-active::before {
    content: ""; position: absolute; left: -12px; top: 50%; transform: translateY(-50%);
    width: 3px; height: 18px; background: var(--amarillo); border-radius: 0 3px 3px 0;
}
.sidebar__nav a.is-sub { margin-left: 18px; font-size: .9rem; }
.sidebar__nav .badge {
    margin-left: auto; background: var(--naranja); color: #fff; font-size: .72rem; font-weight: 700;
    min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 6px;
}
.sidebar__foot { padding: 14px; border-top: 1px solid rgba(255,255,255,.10); }
.sidebar__foot a { display: flex; gap: 10px; align-items: center; color: #cdd8c2; padding: 8px 10px; border-radius: var(--r-md); }
.sidebar__foot a:hover { background: rgba(255,255,255,.08); color: #fff; text-decoration: none; }

.content { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ── Topbar ─────────────────────────────────────────────────────────── */
.topbar {
    height: 60px; background: rgba(255,255,255,.85); backdrop-filter: blur(20px) saturate(150%);
    border-bottom: 1px solid var(--stroke); display: flex; align-items: center; gap: 14px;
    padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.topbar__title { font-size: 1.05rem; font-weight: 600; margin: 0; }
.topbar__user { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topbar__name { font-weight: 600; font-size: .9rem; }
.avatar {
    width: 34px; height: 34px; border-radius: 50%; background: var(--brand); color: #fff;
    display: grid; place-items: center; font-weight: 700;
}

/* ── Botones ────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: var(--r-md);
    border: 1px solid transparent; font-family: inherit; font-size: .9rem; font-weight: 600;
    cursor: pointer; transition: .15s; background: var(--layer); color: var(--text);
}
.btn .iconify { font-size: 1.15rem; }
.btn--primary { background: var(--brand); color: #fff; box-shadow: var(--depth-2); }
.btn--primary:hover { background: var(--brand-hover); text-decoration: none; color: #fff; }
.btn--primary:active { background: var(--brand-press); }
.btn--ghost { background: var(--layer); border-color: var(--stroke); color: var(--text); }
.btn--ghost:hover { background: var(--layer-alt); text-decoration: none; }
.btn--danger { color: #b3261e; border-color: #f1c9c6; }
.btn--danger:hover { background: #fdecea; }
.btn--block { width: 100%; justify-content: center; }

.icon-btn {
    width: 34px; height: 34px; border-radius: var(--r-md); border: 1px solid transparent;
    background: transparent; color: var(--text-2); display: inline-grid; place-items: center;
    cursor: pointer; transition: .15s;
}
.icon-btn .iconify { font-size: 1.25rem; }
.icon-btn:hover { background: var(--layer-alt); border-color: var(--stroke); color: var(--text); text-decoration: none; }
.icon-btn--danger:hover { background: #fdecea; color: #b3261e; border-color: #f1c9c6; }

/* ── Main / cards ───────────────────────────────────────────────────── */
.main { padding: 24px; max-width: 1200px; width: 100%; margin: 0 auto; }
.card {
    background: var(--layer); border: 1px solid var(--stroke); border-radius: var(--r-lg);
    box-shadow: var(--depth-2); padding: 22px; margin-bottom: 20px;
}
.card__h { margin: 0 0 16px; font-size: 1.05rem; font-weight: 600; }
.muted { color: var(--text-2); }
.volver { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; margin-bottom: 16px; }

.page-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 12px; }

/* ── Dashboard ──────────────────────────────────────────────────────── */
.dash-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card {
    background: var(--layer); border: 1px solid var(--stroke); border-radius: var(--r-lg); padding: 18px;
    display: flex; flex-direction: column; gap: 6px; box-shadow: var(--depth-2); transition: .18s; color: var(--text);
}
.stat-card:hover { box-shadow: var(--depth-8); transform: translateY(-2px); text-decoration: none; }
.stat-card__icon { width: 44px; height: 44px; border-radius: var(--r-md); display: grid; place-items: center; color: #fff; }
.stat-card__icon .iconify { font-size: 1.5rem; }
.stat-card__num { font-size: 2rem; font-weight: 700; line-height: 1; }
.stat-card__label { color: var(--text-2); font-weight: 500; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ── Tablas ─────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--stroke-soft); }
.table th { font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; color: var(--text-3); font-weight: 600; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--layer-alt); }
.table .t-right { text-align: right; }
.t-actions { white-space: nowrap; }
.row-nuevo { background: #f0f8f2; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--naranja); margin-right: 6px; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; }
.pill--ok { background: #e3f1e1; color: #2f5d2a; }
.pill--mut { background: #ececec; color: #6a6a6a; }

.empty { text-align: center; padding: 50px 20px; color: var(--text-2); }
.empty .iconify { font-size: 3rem; color: var(--stroke); }
.empty p { margin: 10px 0 18px; }

/* ── Formularios ────────────────────────────────────────────────────── */
.form-admin { display: grid; gap: 18px; max-width: 760px; }
.field { display: grid; gap: 6px; }
.field label { font-weight: 600; font-size: .9rem; }
.field .req { color: var(--naranja); }
.field input[type=text], .field input[type=email], .field input[type=tel],
.field input[type=date], .field input[type=number], .field input[type=password],
.field textarea, .field select {
    width: 100%; padding: 10px 12px; border: 1px solid var(--stroke); border-radius: var(--r-md);
    font-family: inherit; font-size: .92rem; background: var(--layer); color: var(--text); transition: .15s;
}
/* Línea inferior de acento al enfocar (estilo Fluent) */
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none; border-color: var(--brand); box-shadow: 0 2px 0 -1px var(--brand);
}
.field textarea { resize: vertical; }
.field .hint { color: var(--text-3); font-size: .8rem; }
.form-admin__foot { display: flex; gap: 10px; align-items: center; padding-top: 6px; border-top: 1px solid var(--stroke-soft); }

.img-preview { display: inline-flex; flex-direction: column; gap: 6px; }
.img-preview img { width: 180px; height: 120px; object-fit: cover; border-radius: var(--r-md); border: 1px solid var(--stroke); }
.check-borrar { font-size: .82rem; font-weight: 500; display: flex; gap: 6px; align-items: center; }

/* Switch Fluent */
.switch { display: inline-flex; cursor: pointer; }
.switch input { display: none; }
.switch__track {
    width: 44px; height: 24px; background: #c8c8c4; border-radius: 999px; position: relative; transition: .18s;
}
.switch__track::after {
    content: ""; position: absolute; top: 4px; left: 4px; width: 16px; height: 16px; border-radius: 50%;
    background: #fff; transition: .18s;
}
.switch input:checked + .switch__track { background: var(--brand); }
.switch input:checked + .switch__track::after { transform: translateX(20px); }

/* Vista detalle */
.ver-row { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--stroke-soft); }
.ver-label { font-weight: 600; color: var(--text-2); }

/* ── Gráfico de barras ──────────────────────────────────────────────── */
.bars { display: flex; align-items: flex-end; gap: 8px; height: 200px; padding-top: 10px; }
.bars__col { flex: 1; display: flex; flex-direction: column; align-items: center; height: 100%; justify-content: flex-end; gap: 6px; }
.bars__val { font-size: .75rem; font-weight: 700; color: var(--text-2); }
.bars__bar {
    width: 100%; max-width: 38px; background: linear-gradient(var(--turquesa), var(--oliva));
    border-radius: 6px 6px 0 0; transition: height .3s; min-height: 4px;
}
.bars__col:hover .bars__bar { filter: brightness(1.08); }
.bars__lbl { font-size: .72rem; color: var(--text-3); }

/* ── Toasts ─────────────────────────────────────────────────────────── */
.toast {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: var(--r-md);
    margin-bottom: 18px; font-weight: 600; box-shadow: var(--depth-2);
}
.toast .iconify { font-size: 1.3rem; }
.toast--ok { background: #e3f1e1; color: #2f5d2a; border: 1px solid #bfe0ba; }
.toast--error { background: #fdecea; color: #b3261e; border: 1px solid #f3c5c1; }

/* ── Login ──────────────────────────────────────────────────────────── */
.login-body {
    min-height: 100vh; display: grid; place-items: center; padding: 20px;
    background: linear-gradient(135deg, var(--bosque), var(--turquesa) 70%, var(--oliva));
}
.login-card {
    background: var(--layer); border-radius: var(--r-lg); box-shadow: var(--depth-16);
    padding: 40px 36px; width: 100%; max-width: 400px; text-align: center;
}
.login-logo { height: 56px; margin: 0 auto 18px; }
.login-card h1 { font-size: 1.3rem; margin: 0 0 4px; }
.login-sub { color: var(--text-2); margin: 0 0 22px; }
.login-form { display: grid; gap: 16px; text-align: left; }
.login-form label { font-weight: 600; font-size: .88rem; display: grid; gap: 6px; }
.input-icon { position: relative; display: flex; align-items: center; }
.input-icon .iconify { position: absolute; left: 12px; color: var(--text-3); font-size: 1.2rem; }
.input-icon input {
    width: 100%; padding: 11px 12px 11px 40px; border: 1px solid var(--stroke); border-radius: var(--r-md);
    font-family: inherit; font-size: .95rem;
}
.input-icon input:focus { outline: none; border-color: var(--brand); box-shadow: 0 2px 0 -1px var(--brand); }

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 900px) {
    .cols-2 { grid-template-columns: 1fr; }
    .sidebar {
        position: fixed; left: 0; top: 0; z-index: 60; transform: translateX(-100%); transition: transform .22s;
        box-shadow: var(--depth-16);
    }
    .sidebar.is-open { transform: translateX(0); }
}
@media (min-width: 901px) { #menuToggle { display: none; } }

/* =====================================================================
   Ampliaciones nov-2026: menú agrupado, mapas, galerías, flyers, auditoría
   ===================================================================== */
.sidebar__grupo {
    display: block; padding: 16px 14px 6px; font-size: .7rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.45);
}
.nowrap { white-space: nowrap; }
.btn--sm { padding: 6px 12px; font-size: .82rem; }
.check-inline { display: inline-flex !important; gap: 8px; align-items: center; font-weight: 600; }

.pill--warn   { background: #fff1d6; color: #8a5a00; }
.pill--danger { background: #fdecea; color: #b3261e; }
.pill--info   { background: #e0f0f0; color: #1f6664; }

.page-actions__left, .page-actions__right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.buscador {
    padding: 9px 12px; border: 1px solid var(--stroke); border-radius: var(--r-md);
    font-family: inherit; font-size: .9rem; min-width: 240px; background: var(--layer);
}
.buscador:focus { outline: none; border-color: var(--brand); box-shadow: 0 2px 0 -1px var(--brand); }

/* Galería en formularios */
.galeria-admin { display: grid; gap: 10px; }
.galeria-admin__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.galeria-admin__grid:empty { display: none; }
.galeria-admin__item {
    position: relative; border-radius: var(--r-md); overflow: hidden; border: 1px solid var(--stroke);
    background: var(--layer-alt); cursor: pointer; display: block;
}
.galeria-admin__item img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.galeria-admin__quitar {
    display: flex; gap: 6px; align-items: center; justify-content: center; padding: 6px;
    font-size: .78rem; font-weight: 600; background: var(--layer);
}
.galeria-admin__item:has(input:checked) img { opacity: .35; filter: grayscale(1); }
.galeria-admin__item:has(input:checked) .galeria-admin__quitar { color: #b3261e; }
.galeria-admin__item.is-excedida { opacity: .45; }

/* Selector de mapa */
.mapa-picker, .ruta-editor { display: grid; gap: 10px; }
.mapa-picker__buscar { display: flex; gap: 8px; flex-wrap: wrap; }
.mapa-picker__buscar input {
    flex: 1; min-width: 200px; padding: 10px 12px; border: 1px solid var(--stroke);
    border-radius: var(--r-md); font-family: inherit; font-size: .92rem;
}
.mapa-picker__resultados { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.mapa-picker__resultados:empty { display: none; }
.mapa-picker__resultados button {
    width: 100%; text-align: left; background: var(--layer-alt); border: 1px solid var(--stroke);
    border-radius: var(--r-md); padding: 8px 10px; cursor: pointer; font-family: inherit; font-size: .84rem;
}
.mapa-picker__resultados button:hover { border-color: var(--brand); }
.mapa-picker__mapa { height: 340px; border-radius: var(--r-md); border: 1px solid var(--stroke); z-index: 0; }
.mapa-picker__coords { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; }
.mapa-picker__coords label { display: grid; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--text-2); }
.mapa-picker__coords input {
    width: 160px; padding: 8px 10px; border: 1px solid var(--stroke); border-radius: var(--r-md);
    font-family: ui-monospace, Consolas, monospace; font-size: .85rem;
}

/* Editor de paradas */
.ruta-editor__lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ruta-editor__lista li { display: flex; gap: 6px; align-items: center; }
.ruta-editor__lista input {
    flex: 1; padding: 8px 10px; border: 1px solid var(--stroke); border-radius: var(--r-md); font-family: inherit;
}
.ruta-editor__n, .parada-icono span {
    width: 28px; height: 28px; border-radius: 50%; background: var(--naranja); color: #fff; font-weight: 700;
    display: grid; place-items: center; font-size: .85rem; flex-shrink: 0; border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.parada-icono { background: none; border: 0; }

/* Clima mini (dashboard) */
.clima-mini { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.clima-mini__ico { font-size: 3rem; color: var(--amarillo); }
.clima-mini__temp { font-size: 2rem; display: block; line-height: 1; margin-bottom: 4px; }
.clima-mini__dias { margin-left: auto; display: flex; gap: 14px; }
.clima-mini__dias > span { display: grid; justify-items: center; gap: 2px; font-size: .82rem; font-weight: 600; }
.clima-mini__dias .iconify { font-size: 1.5rem; color: var(--turquesa); }

/* Auditoría */
.filtros { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filtros label { display: grid; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--text-2); }
.filtros select, .filtros input[type=date], .filtros input[type=search] {
    padding: 8px 10px; border: 1px solid var(--stroke); border-radius: var(--r-md); font-family: inherit; font-size: .88rem; background: var(--layer);
}
.filtros__check { display: flex !important; flex-direction: row; align-items: center; gap: 6px; padding-bottom: 9px; }
.filtros__acciones { display: flex; gap: 8px; margin-left: auto; }
.tabla-auditoria td { vertical-align: top; font-size: .86rem; }
.huella { display: inline-flex; align-items: center; gap: 4px; font-family: ui-monospace, Consolas, monospace; font-size: .78rem; }
.aud-detalle summary { cursor: pointer; color: var(--brand); font-size: .8rem; margin-top: 4px; }
.table--mini { margin-top: 6px; background: var(--layer-alt); border-radius: var(--r-md); }
.table--mini th, .table--mini td { padding: 5px 8px; font-size: .78rem; text-transform: none; letter-spacing: 0; }
.table--mini del { color: #b3261e; }
.table--mini ins { color: #2f5d2a; text-decoration: none; font-weight: 600; }
.paginador { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 16px; }
.login-aviso { margin: 22px 0 0; font-size: .78rem; color: var(--text-3); display: flex; gap: 6px; align-items: flex-start; text-align: left; }

/* Generador de flyers */
.flyer-app { display: grid; grid-template-columns: 380px 1fr; gap: 20px; align-items: start; }
.flyer-panel { display: grid; gap: 4px; margin: 0; max-height: calc(100vh - 110px); overflow-y: auto; position: sticky; top: 80px; }
.flyer-panel fieldset { border: 0; border-bottom: 1px solid var(--stroke-soft); margin: 0; padding: 0 0 16px; display: grid; gap: 12px; }
.flyer-panel legend { font-weight: 700; font-size: .95rem; padding: 12px 0 8px; color: var(--bosque); }
.flyer-panel__foot { padding-top: 14px; }
.flyer-panel__foot .btn { width: 100%; justify-content: center; }
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.seg input { display: none; }
.seg span {
    display: flex; gap: 6px; align-items: center; justify-content: center; padding: 10px; border-radius: var(--r-md);
    border: 1px solid var(--stroke); cursor: pointer; font-weight: 600; font-size: .84rem; text-align: center;
}
.seg input:checked + span { border-color: var(--brand); background: #e0f0f0; color: var(--brand-press); }
.rango label { display: grid; gap: 2px; font-size: .82rem; font-weight: 600; color: var(--text-2); }
.rango input { width: 100%; accent-color: var(--brand); }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch {
    width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--stroke); cursor: pointer; padding: 0;
    position: relative; overflow: hidden;
}
.swatch.is-sel { outline: 3px solid var(--brand); outline-offset: 2px; }
.swatch--custom { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); display: block; }
.swatch--custom input { opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.flyer-galeria { display: flex; flex-wrap: wrap; gap: 6px; }
.flyer-galeria__item { width: 64px; height: 64px; padding: 0; border: 2px solid var(--stroke); border-radius: var(--r-md); overflow: hidden; cursor: pointer; background: none; }
.flyer-galeria__item img { width: 100%; height: 100%; object-fit: cover; }
.flyer-galeria__item.is-sel { border-color: var(--brand); }
.flyer-preview { display: grid; justify-items: center; gap: 8px; }
.flyer-preview__marco {
    background: repeating-conic-gradient(#eee 0 25%, #fafafa 0 50%) 0 0 / 24px 24px;
    padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--stroke); width: 100%;
    display: grid; place-items: center;
}
.flyer-preview canvas { width: 100%; max-width: 640px; height: auto; box-shadow: var(--depth-16); border-radius: 6px; }
.flyer-preview__marco.is-historia canvas { width: auto; max-width: 100%; max-height: calc(100vh - 170px); }

@media (max-width: 1100px) {
    .flyer-app { grid-template-columns: 1fr; }
    .flyer-panel { position: static; max-height: none; }
    .flyer-preview { order: -1; }
}
@media (max-width: 600px) {
    .main { padding: 14px; }
    .buscador { min-width: 0; width: 100%; }
    .clima-mini__dias { margin-left: 0; }
    .ver-row { grid-template-columns: 1fr; }
}

/* =====================================================================
   Biblioteca de medios + selector
   ===================================================================== */
.bib { position: relative; display: flex; flex-direction: column; min-height: 420px; }
.bib__barra { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--stroke-soft); }
.bib__buscar { flex: 1; min-width: 200px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--stroke); border-radius: var(--r-md); padding: 0 10px; background: var(--layer); }
.bib__buscar input { border: 0; outline: 0; padding: 9px 0; flex: 1; font-family: inherit; font-size: .9rem; background: transparent; }
.bib__barra select { padding: 9px 10px; border: 1px solid var(--stroke); border-radius: var(--r-md); font-family: inherit; background: var(--layer); }
.bib__subir { cursor: pointer; }
.bib__progreso { padding: 8px 16px; background: #e0f0f0; color: var(--brand-press); font-weight: 600; font-size: .86rem; }
.bib__cuerpo { display: grid; grid-template-columns: 1fr 300px; flex: 1; min-height: 0; }
.bib__zona { padding: 14px 16px; overflow-y: auto; }
.bib__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.bib__vacio { grid-column: 1 / -1; text-align: center; padding: 40px 10px; }
.bib__item {
    position: relative; padding: 0; border: 2px solid transparent; border-radius: var(--r-md); overflow: hidden;
    background: repeating-conic-gradient(#eee 0 25%, #fafafa 0 50%) 0 0 / 16px 16px; cursor: pointer; aspect-ratio: 1;
    box-shadow: var(--depth-2); transition: .12s;
}
.bib__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bib__item:hover { box-shadow: var(--depth-8); }
.bib__item.is-activo { border-color: var(--celeste); }
.bib__item.is-sel { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand); }
.bib__item.is-roto { opacity: .4; }
.bib__uso {
    position: absolute; left: 6px; bottom: 6px; font-size: .68rem; font-weight: 700; padding: 2px 7px; border-radius: 999px;
    background: rgba(255,255,255,.92); color: var(--text-2);
}
.bib__uso.is-uso { background: var(--oliva); color: #fff; }
.bib__check {
    position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand);
    color: #fff; display: none; place-items: center; box-shadow: 0 0 0 2px #fff;
}
.bib__item.is-sel .bib__check { display: grid; }
.bib__pag { display: flex; justify-content: center; align-items: center; gap: 12px; padding: 14px 0 4px; }
.bib__detalle { border-left: 1px solid var(--stroke-soft); padding: 14px 16px; overflow-y: auto; background: var(--layer-alt); }
.bib__prev { border-radius: var(--r-md); overflow: hidden; background: repeating-conic-gradient(#eee 0 25%, #fafafa 0 50%) 0 0 / 16px 16px; }
.bib__prev img { width: 100%; max-height: 220px; object-fit: contain; }
.bib__datos { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; font-size: .8rem; margin: 10px 0; }
.bib__datos dt { color: var(--text-3); }
.bib__datos dd { margin: 0; word-break: break-all; }
.bib__campo { display: grid; gap: 4px; font-size: .8rem; font-weight: 600; margin-bottom: 8px; }
.bib__campo input { padding: 8px 10px; border: 1px solid var(--stroke); border-radius: var(--r-md); font-family: inherit; font-size: .86rem; }
.bib__acciones { display: flex; gap: 6px; flex-wrap: wrap; }
.bib__h { margin: 16px 0 6px; font-size: .9rem; }
.bib__donde { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.bib__donde li { background: var(--layer); border: 1px solid var(--stroke); border-radius: var(--r-md); padding: 7px 10px; display: grid; }
.bib__donde small { color: var(--text-3); text-transform: capitalize; }
.bib__pie { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; border-top: 1px solid var(--stroke); background: var(--layer); }
.bib__soltar {
    position: absolute; inset: 0; display: none; place-items: center; font-size: 1.2rem; font-weight: 700; color: var(--brand-press);
    background: rgba(224,240,240,.92); border: 3px dashed var(--brand); border-radius: var(--r-lg); z-index: 5; pointer-events: none;
}
.bib.is-soltando .bib__soltar { display: grid; }
.bib--pagina .bib__cuerpo { min-height: 60vh; }
.aviso-importar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.aviso-importar > .iconify { font-size: 2.4rem; color: var(--brand); }
.aviso-importar form { margin-left: auto; }
.importar-pie { text-align: right; }

/* Modal */
.bib-modal { position: fixed; inset: 0; z-index: 2000; background: rgba(20,25,15,.55); display: grid; place-items: center; padding: 20px; }
.bib-modal__caja { background: var(--layer); border-radius: var(--r-lg); box-shadow: var(--depth-16); width: min(1180px, 100%); height: min(820px, 100%); display: flex; flex-direction: column; overflow: hidden; }
.bib-modal__cab { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--stroke); }
.bib-modal__cab h2 { margin: 0; font-size: 1.05rem; }
.bib-modal__cuerpo { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.bib-modal__cuerpo .bib { flex: 1; min-height: 0; }
.bib-modal__cuerpo .bib__cuerpo { overflow: hidden; }

/* Campo imagen destacada */
.imagen-campo { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.imagen-campo__prev {
    width: 220px; aspect-ratio: 4/3; border-radius: var(--r-md); border: 1px dashed var(--stroke); overflow: hidden;
    display: grid; place-items: center; background: var(--layer-alt); position: relative;
}
.imagen-campo__prev img { width: 100%; height: 100%; object-fit: cover; display: none; }
.imagen-campo.tiene-imagen .imagen-campo__prev img { display: block; }
.imagen-campo.tiene-imagen .imagen-campo__prev { border-style: solid; }
.imagen-campo__vacio { color: var(--text-3); display: flex; align-items: center; gap: 6px; }
.imagen-campo.tiene-imagen .imagen-campo__vacio { display: none; }
.imagen-campo__acciones { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; flex: 1; min-width: 200px; }
.imagen-campo:not(.tiene-imagen) .js-imagen-quitar { display: none; }

/* Galería ordenable */
.galeria-admin__item { cursor: grab; position: relative; }
.galeria-admin__item.is-arrastrando { opacity: .4; }
.galeria-admin__x {
    position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center;
}
.galeria-admin__x:hover { background: #b3261e; }
.galeria-admin__pie { display: flex; align-items: center; gap: 12px; }

@media (max-width: 800px) {
    .bib__cuerpo { grid-template-columns: 1fr; }
    .bib__detalle { border-left: 0; border-top: 1px solid var(--stroke-soft); max-height: 40vh; }
    .bib-modal { padding: 0; }
    .bib-modal__caja { height: 100%; border-radius: 0; }
}

/* Campo de redes sociales */
.redes-campo { display: grid; gap: 8px; }
.redes-campo__item { display: flex; align-items: center; gap: 8px; }
.redes-campo__ico {
    width: 38px; height: 38px; border-radius: var(--r-md); background: var(--red); color: #fff;
    display: grid; place-items: center; flex-shrink: 0; font-size: 1.3rem;
}
.redes-campo__item input {
    flex: 1; padding: 9px 12px; border: 1px solid var(--stroke); border-radius: var(--r-md); font-family: inherit; font-size: .9rem;
}
.redes-campo__item input:focus { outline: none; border-color: var(--red); box-shadow: 0 2px 0 -1px var(--red); }

/* Códigos QR */
.qr-app { display: grid; grid-template-columns: 1fr 380px; gap: 20px; align-items: start; }
.qr-form { max-width: none; margin: 0; }
.qr-form select { margin-top: 6px; }
.qr-preview { display: grid; gap: 10px; justify-items: center; margin: 0; position: sticky; top: 80px; }
.qr-preview canvas { width: 100%; max-width: 320px; height: auto; border-radius: var(--r-md); border: 1px solid var(--stroke); }
.qr-corta { display: flex; gap: 6px; align-items: center; background: var(--layer-alt); border: 1px solid var(--stroke); border-radius: var(--r-md); padding: 4px 4px 4px 12px; max-width: 100%; }
.qr-corta code { font-size: .85rem; word-break: break-all; }
.qr-destino { font-size: .82rem; margin: 0; text-align: center; word-break: break-all; }
.qr-estado { font-size: .82rem; color: #2f5d2a; margin: 0; min-height: 1.2em; text-align: center; }
.qr-acciones { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.qr-mini { width: 44px; height: 44px; border-radius: 6px; border: 1px solid var(--stroke); object-fit: contain; background: #fff; }
.qr-mini--vacio { display: grid; place-items: center; color: var(--text-3); font-size: 1.4rem; }
.qr-codigo { font-size: .82rem; background: var(--layer-alt); padding: 2px 6px; border-radius: 4px; }
.icon-btn.is-ok { color: #2f5d2a; }
.flyer-aviso { font-size: .82rem; margin: 8px 0 0; padding: 8px 10px; border-radius: var(--r-md); background: #e0f0f0; color: var(--brand-press); }
.flyer-aviso--ok { background: #e3f1e1; color: #2f5d2a; }
.flyer-aviso--error { background: #fdecea; color: #b3261e; }
.bib__tipo { position: absolute; top: 6px; left: 6px; font-size: .64rem; font-weight: 800; padding: 2px 7px; border-radius: 999px; color: #fff; letter-spacing: .04em; }
.bib__tipo--flyer { background: var(--naranja); }
.bib__tipo--qr { background: var(--bosque); }
@media (max-width: 1000px) {
    .qr-app { grid-template-columns: 1fr; }
    .qr-preview { position: static; order: -1; }
}

/* Editor de menús */
.tabs { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: var(--r-md); border: 1px solid var(--stroke); background: var(--layer); color: var(--text); font-weight: 600; }
.tabs a:hover { text-decoration: none; border-color: var(--brand); }
.tabs a.is-activo { background: var(--brand); color: #fff; border-color: var(--brand); }
.menu-lista { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 6px; }
.menu-fila {
    display: grid; grid-template-columns: auto minmax(140px, 1fr) minmax(160px, 1.2fr) auto auto auto; gap: 8px; align-items: center;
    background: var(--layer-alt); border: 1px solid var(--stroke); border-radius: var(--r-md); padding: 8px;
}
.menu-fila.nivel-1 { margin-left: 44px; border-left: 3px solid var(--celeste); background: var(--layer); }
.menu-fila.is-oculto { opacity: .55; }
.menu-fila__orden { display: flex; gap: 2px; }
.menu-fila input[type=text], .menu-fila select { padding: 8px 10px; border: 1px solid var(--stroke); border-radius: var(--r-md); font-family: inherit; font-size: .88rem; min-width: 0; background: var(--layer); }
.menu-fila__titulo { font-weight: 600; }
.menu-fila__url { grid-column: 2 / 4; }
.menu-fila__chk { display: flex; align-items: center; gap: 4px; font-size: .78rem; white-space: nowrap; color: var(--text-2); }
.menu-editor__pie { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--stroke-soft); }
@media (max-width: 900px) {
    .menu-fila { grid-template-columns: 1fr 1fr; }
    .menu-fila__orden { grid-column: 1 / -1; }
    .menu-fila__url { grid-column: 1 / -1; }
    .menu-fila.nivel-1 { margin-left: 18px; }
}

/* Editor de texto enriquecido (Quill) */
.rt { border: 1px solid var(--stroke); border-radius: var(--r-md); background: var(--layer); }
.rt .ql-toolbar.ql-snow { border-radius: var(--r-md) var(--r-md) 0 0; }
.rt .ql-toolbar.ql-snow { border: 0; border-bottom: 1px solid var(--stroke); background: var(--layer-alt); font-family: var(--font); position: sticky; top: 60px; z-index: 5; padding: 6px 8px; }
.rt .ql-container.ql-snow { border: 0; font-family: var(--font); font-size: .98rem; }
.rt .ql-editor { min-height: 240px; max-height: 70vh; overflow-y: auto; line-height: 1.65; }
.rt .ql-editor h2 { font-size: 1.5rem; } .rt .ql-editor h3 { font-size: 1.25rem; } .rt .ql-editor h4 { font-size: 1.05rem; }
.rt .ql-editor img { max-width: 100%; border-radius: 6px; }
.rt .ql-editor.ql-blank::before { color: var(--text-3); font-style: normal; }
.rt .ql-snow .ql-picker.ql-header .ql-picker-label::before, .rt .ql-snow .ql-picker.ql-header .ql-picker-item::before { content: 'Párrafo'; }
.rt .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="2"]::before, .rt .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="2"]::before { content: 'Título'; }
.rt .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="3"]::before, .rt .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="3"]::before { content: 'Subtítulo'; }
.rt .ql-snow .ql-picker.ql-header .ql-picker-label[data-value="4"]::before, .rt .ql-snow .ql-picker.ql-header .ql-picker-item[data-value="4"]::before { content: 'Título chico'; }
.rt .ql-snow .ql-picker.ql-header { width: 112px; }
.rt .ql-snow .ql-picker.ql-size .ql-picker-label::before, .rt .ql-snow .ql-picker.ql-size .ql-picker-item::before { content: 'Normal'; }
.rt .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="small"]::before, .rt .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="small"]::before { content: 'Chico'; }
.rt .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="large"]::before, .rt .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="large"]::before { content: 'Grande'; }
.rt .ql-snow .ql-picker.ql-size .ql-picker-label[data-value="huge"]::before, .rt .ql-snow .ql-picker.ql-size .ql-picker-item[data-value="huge"]::before { content: 'Muy grande'; }
.rt .ql-snow .ql-picker.ql-size { width: 104px; }
.rt .ql-snow .ql-tooltip[data-mode=link]::before { content: 'Enlace:'; }
.rt .ql-snow .ql-tooltip[data-mode=video]::before { content: 'Video (YouTube):'; }
.rt .ql-snow .ql-tooltip.ql-editing a.ql-action::after { content: 'Guardar'; }
.rt .ql-snow .ql-tooltip a.ql-action::after { content: 'Editar'; }
.rt .ql-snow .ql-tooltip a.ql-remove::before { content: 'Quitar'; }
.rt .ql-snow .ql-tooltip::before { content: 'Abrir:'; }
.rt button.ql-imagenBiblioteca .iconify { font-size: 1.1rem; color: #444; }
.rt__codigo { font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: .78rem; color: #444; }
.rt--html .ql-toolbar > .ql-formats:not(:last-child) { opacity: .35; pointer-events: none; }
.rt--html button.ql-verHtml { background: var(--brand); border-radius: 4px; } .rt--html .rt__codigo { color: #fff; }
textarea.rt__html { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; min-height: 260px; }

/* Estadísticas de búsquedas */
.bars__bar--doble { background: linear-gradient(to top, #d9534f 0, #d9534f var(--sin, 0%), var(--turquesa) var(--sin, 0%), var(--oliva) 100%); }
.tabla-busq td { vertical-align: middle; }
.barra-mini { display: block; height: 4px; background: var(--stroke-soft); border-radius: 2px; margin-top: 4px; max-width: 220px; }
.barra-mini span { display: block; height: 100%; background: var(--turquesa); border-radius: 2px; }
.disp-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.disp-chips span { background: var(--layer-alt); border: 1px solid var(--stroke); border-radius: 999px; padding: 5px 12px; font-size: .85rem; }

/* Logos institucionales en el panel */
.login-body { flex-direction: column; gap: 18px; display: flex; align-items: center; justify-content: center; }
.login-logos { display: flex; gap: 22px; align-items: center; background: rgba(255,255,255,.95); border-radius: var(--r-lg); padding: 10px 18px; box-shadow: var(--depth-8); }
.login-logos img { height: 34px; width: auto; display: block; }
.sidebar__inst { padding: 10px 14px; border-top: 1px solid rgba(255,255,255,.10); }
.sidebar-logos { display: flex; gap: 10px; align-items: center; justify-content: space-between; background: rgba(255,255,255,.92); border-radius: var(--r-md); padding: 6px 10px; }
.sidebar-logos img { height: 22px; width: auto; display: block; }

/* Constructor de formularios */
.constructor__lista { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 10px; }
.constructor__vacio { padding: 24px; text-align: center; color: var(--text-2); border: 2px dashed var(--stroke); border-radius: var(--r-md); }
.pregunta { background: var(--layer); border: 1px solid var(--stroke); border-left: 4px solid var(--brand); border-radius: var(--r-md); padding: 12px; display: grid; gap: 8px; box-shadow: var(--depth-2); }
.pregunta--seccion { border-left-color: var(--naranja); background: #fff8f0; }
.pregunta__cab { display: flex; gap: 8px; align-items: center; }
.pregunta__n { width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .85rem; flex-shrink: 0; }
.pregunta--seccion .pregunta__n { background: var(--naranja); }
.pregunta input[type=text], .pregunta select, .pregunta textarea { padding: 8px 10px; border: 1px solid var(--stroke); border-radius: var(--r-md); font-family: inherit; font-size: .9rem; background: var(--layer); }
.pregunta__titulo { flex: 1; font-weight: 600; font-size: .98rem !important; min-width: 0; }
.pregunta__ayuda { font-size: .84rem !important; color: var(--text-2); }
.pregunta__ops { display: grid; gap: 4px; font-size: .8rem; font-weight: 600; color: var(--text-2); }
.pregunta__ops textarea { resize: vertical; }
.pregunta__pie { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--stroke-soft); padding-top: 6px; }
.pregunta__acc { display: flex; gap: 2px; }
.constructor__agregar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding: 10px; background: var(--layer-alt); border: 1px dashed var(--stroke); border-radius: var(--r-md); }

/* Resumen de respuestas */
.resumen-h { font-size: 1.1rem; margin: 6px 0 12px; }
.resumen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; margin-bottom: 20px; }
.resumen { margin: 0; }
.resumen h3 { margin: 0 0 2px; font-size: 1rem; }
.resumen__sub { font-size: .8rem; margin: 0 0 10px; }
.resumen__barras { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.resumen__barras li { display: grid; grid-template-columns: minmax(80px, 38%) 1fr auto; gap: 8px; align-items: center; font-size: .86rem; }
.resumen__op { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resumen__barra { height: 10px; background: var(--stroke-soft); border-radius: 5px; overflow: hidden; }
.resumen__barra span { display: block; height: 100%; background: linear-gradient(90deg, var(--turquesa), var(--oliva)); border-radius: 5px; }
.resumen__n { font-weight: 700; white-space: nowrap; } .resumen__n small { color: var(--text-3); font-weight: 500; }
.resumen__prom { margin: 10px 0 0; font-size: .9rem; }
.resumen__textos { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 280px; overflow-y: auto; }
.resumen__textos li { background: var(--layer-alt); border-radius: var(--r-md); padding: 7px 10px; font-size: .86rem; }
.tabla-respuestas td { font-size: .84rem; vertical-align: top; }
.pregunta__cab .pregunta__titulo { width: auto !important; flex: 1 1 auto; }
.pregunta__cab select { width: auto !important; flex: 0 0 220px; }
@media (max-width: 700px) {
    .pregunta__cab { flex-wrap: wrap; }
    .pregunta__cab select { flex: 1 1 100%; }
}

/* Logo de Turismo Federal (recortado) */
.sidebar__brand { padding: 20px 22px; }
.sidebar__brand img { height: 46px; width: auto; }
.login-logo { height: 64px; width: auto; margin: 0 auto 20px; }

/* Matriz de permisos */
.permisos { display: grid; gap: 10px; }
.permisos__admin { margin: 0; padding: 10px 12px; background: #e0f0f0; border-radius: var(--r-md); font-size: .85rem; display: none; }
.permisos.es-admin .permisos__admin { display: block; }
.permisos.es-admin .table-wrap, .permisos.es-admin .permisos__presets { opacity: .4; pointer-events: none; }
.permisos__presets { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.permisos__tabla { width: 100%; border-collapse: collapse; font-size: .86rem; }
.permisos__tabla th { background: var(--layer); padding: 6px 4px; border-bottom: 2px solid var(--stroke); }
.permisos__tabla th:first-child { text-align: left; }
.permisos__col { border: 0; background: none; cursor: pointer; display: grid; justify-items: center; gap: 2px; font-family: inherit; font-size: .72rem; font-weight: 700; color: var(--text-2); padding: 4px; border-radius: 6px; line-height: 1.15; max-width: 92px; margin: 0 auto; }
.permisos__col .iconify { font-size: 1.15rem; }
.permisos__col:hover, .permisos__fila:hover { background: var(--layer-alt); color: var(--brand); }
.permisos__tabla td { padding: 4px; border-bottom: 1px solid var(--stroke-soft); }
.permisos__tabla tbody tr:hover td { background: var(--layer-alt); }
.permisos__grupo td { background: var(--layer-alt); font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); padding: 8px 6px 4px; }
.permisos__fila { border: 0; background: none; cursor: pointer; font-family: inherit; font-weight: 600; font-size: .88rem; padding: 6px; border-radius: 6px; text-align: left; color: var(--text); }
.permisos__celda { text-align: center; }
.permiso { display: inline-grid; cursor: pointer; }
.permiso input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.permiso__si, .permiso__no { width: 30px; height: 30px; border-radius: 8px; display: none; place-items: center; font-size: 1rem; transition: .12s; }
.permiso__si { background: var(--oliva); color: #fff; }
.permiso__no { background: #f6e3e1; color: #b3261e; }
.permiso input:checked ~ .permiso__si { display: grid; }
.permiso input:not(:checked) ~ .permiso__no { display: grid; }
.permiso input:focus-visible ~ span { outline: 2px solid var(--brand); outline-offset: 2px; }
.permiso__na { color: var(--stroke); font-weight: 800; }
.toast--aviso { background: #fff1d6; color: #8a5a00; border: 1px solid #f0d9a8; }
.form-admin__campos { border: 0; padding: 0; margin: 0; min-width: 0; display: grid; gap: 18px; }
.es-solo-lectura .form-admin__campos { opacity: .85; }

/* El atributo hidden siempre oculta, aunque el elemento tenga display propio (.btn, etc.) */
[hidden] { display: none !important; }

/* Cabeceras de páginas */
.cab-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.cab-item { padding: 0; overflow: hidden; margin: 0; color: var(--text); transition: .15s; }
.cab-item:hover { text-decoration: none; box-shadow: var(--depth-8); transform: translateY(-2px); }
.cab-mini { height: 110px; display: grid; place-items: center; padding: 10px; text-align: center; color: #fff; font-size: 1.05rem; }
.cab-mini--oscuro { color: var(--bosque); }
.cab-item__pie { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; }
.cab-prev {
    min-height: 170px; border-radius: var(--r-lg); display: grid; place-items: center; padding: 22px; color: #fff; text-align: center;
    background-color: var(--c1); background-position: center; box-shadow: inset 0 0 0 1px rgba(0,0,0,.05);
}
.cab-prev.es-oscuro { color: var(--bosque); }
.cab-prev.es-izq { place-items: center start; text-align: left; }
.cab-prev__txt { display: grid; gap: 6px; max-width: 640px; }
.cab-prev__txt span { justify-self: center; font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; background: rgba(255,255,255,.2); padding: 3px 10px; border-radius: 999px; }
.cab-prev.es-izq .cab-prev__txt span { justify-self: start; }
.cab-prev__txt span:empty, .cab-prev__txt small:empty { display: none; }
.cab-prev__txt strong { font-size: 1.8rem; line-height: 1.1; }
.cab-tipos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.cab-tipo input { position: absolute; opacity: 0; }
.cab-tipo > span { display: grid; gap: 2px; padding: 12px; border: 2px solid var(--stroke); border-radius: var(--r-md); cursor: pointer; height: 100%; }
.cab-tipo .iconify { font-size: 1.4rem; color: var(--brand); }
.cab-tipo small { color: var(--text-2); font-size: .75rem; line-height: 1.3; }
.cab-tipo input:checked + span { border-color: var(--brand); background: #e0f0f0; }
.cab-tipo input:focus-visible + span { outline: 2px solid var(--brand); }
.cab-colores { display: flex; gap: 16px; }
.cab-colores label { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .85rem; }
.cab-colores input[type=color] { width: 46px; height: 34px; border: 1px solid var(--stroke); border-radius: 8px; padding: 2px; background: var(--layer); cursor: pointer; }
.cab-swatches { margin-top: 8px; }
.cab-swatches .swatch { width: 26px; height: 26px; }
.cab-patrones { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.cab-patron { display: grid; gap: 4px; cursor: pointer; text-align: center; }
.cab-patron input { position: absolute; opacity: 0; }
.cab-patron__muestra { height: 64px; border-radius: var(--r-md); border: 3px solid transparent; background-blend-mode: soft-light, normal; }
.cab-patron input:checked + .cab-patron__muestra { border-color: var(--brand); box-shadow: 0 0 0 2px #fff inset; }
.cab-patron small { font-size: .72rem; color: var(--text-2); }
.cab-iframe { width: 100%; height: 520px; border: 1px solid var(--stroke); border-radius: var(--r-md); }

/* Portada de entrada */
.portada-fondo { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px; background: var(--layer-alt); border: 1px solid var(--stroke); border-radius: var(--r-md); }
.portada-bloques { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.portada-accesos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin-top: 8px; }
.portada-acc input { position: absolute; opacity: 0; }
.portada-acc > span { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border: 2px solid var(--stroke); border-radius: var(--r-md); cursor: pointer; font-weight: 600; font-size: .88rem; }
.portada-acc__ico { font-size: 1.3rem; color: var(--text-3); display: grid; }
.portada-acc input:checked + span { border-color: var(--brand); background: #e0f0f0; }
.portada-acc input:checked + span .portada-acc__ico { color: var(--brand); }
.portada-acc input:focus-visible + span { outline: 2px solid var(--brand); }
.portada-prev { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.portada-prev__esc { flex: 1 1 600px; height: 560px; border: 1px solid var(--stroke); border-radius: var(--r-md); }
.portada-prev__cel { width: 375px; height: 700px; border: 10px solid #1f2419; border-radius: 30px; }

/* Paradas con descripción (nov. 2026) */
.ruta-editor__lista li.ruta-editor__item { align-items: flex-start; }
.ruta-editor__txt { flex: 1; display: grid; gap: 4px; min-width: 0; }
.ruta-editor__txt textarea { width: 100%; font: inherit; font-size: .85rem; padding: 6px 8px; border: 1px solid var(--borde, #ddd); border-radius: 6px; resize: vertical; }

/* Cuotas y ferias (nov. 2026) */
.grilla-config { margin-bottom: 14px; }
.grilla-config summary { cursor: pointer; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.grilla-form { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-top: 14px; }
.grilla-form .field { min-width: 160px; flex: 1; }
.grilla-form--linea { margin: 0; flex: 1; align-items: center; gap: 6px; }
.grilla-form--linea input, .grilla-form--linea select { padding: 6px 8px; border: 1px solid var(--stroke); border-radius: var(--r-sm); font: inherit; font-size: .88rem; }
.grilla-form--linea input[type=text] { flex: 1; min-width: 160px; }
.grilla-ferias { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.grilla-ferias li { display: flex; gap: 6px; align-items: center; }
.grilla-card { padding: 0; overflow: hidden; }
.grilla-wrap { max-height: 72vh; overflow: auto; }
.grilla { font-size: .86rem; }
.grilla th, .grilla td { padding: 6px 8px; white-space: nowrap; }
.grilla thead th { position: sticky; top: 0; background: var(--layer); z-index: 2; text-align: center; }
.grilla tfoot td, .grilla tfoot th { position: sticky; bottom: 0; background: var(--layer-alt); font-weight: 700; text-align: center; z-index: 2; }
.grilla .grilla__fija { position: sticky; left: 0; background: var(--layer); z-index: 1; text-align: left; min-width: 220px; max-width: 280px; white-space: normal; }
.grilla thead .grilla__fija, .grilla tfoot .grilla__fija { z-index: 3; }
.grilla__fija small { display: block; color: var(--text-3); font-weight: 400; font-size: .76rem; }
.grilla__col small { display: block; font-size: .66rem; text-transform: none; letter-spacing: 0; font-weight: 500; }
.grilla__c { text-align: center; transition: background .3s; }
.grilla__c input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--brand); }
.grilla__c.is-ok { background: #e3f1e1; }
.grilla .is-hoy { background: #fff8e6; }
.grilla tbody tr:hover .grilla__fija { background: var(--layer-alt); }

/* Módulos del sitio */
.modulos { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.modulo { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 1px solid var(--stroke); border-radius: var(--r-lg); background: var(--layer); cursor: pointer; transition: border-color .15s, opacity .15s; }
.modulo:hover { border-color: var(--brand); }
.modulo__ico { font-size: 1.6rem; color: var(--brand); flex-shrink: 0; }
.modulo__txt { flex: 1; }
.modulo__txt strong { display: block; }
.modulo__txt small { color: var(--text-2); }
.modulo.is-off { opacity: .6; background: var(--layer-alt); }
.modulo.is-off .modulo__ico { color: var(--text-3); }
.switch { position: relative; width: 44px; height: 24px; flex-shrink: 0; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; background: #c9ccc4; border-radius: 999px; transition: .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: .2s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--brand); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* El Radar */
.radar-evs { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.radar-ev { border: 1px solid var(--stroke); border-radius: var(--r-lg); overflow: hidden; background: var(--layer); display: flex; flex-direction: column; }
.radar-ev img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--layer-alt); }
.radar-ev__b { padding: 12px 14px; display: grid; gap: 6px; flex: 1; }
.radar-ev__b form { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }
textarea.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; }

/* Eventos → Nuevo: selector de El Radar */
.radar-sel { margin-bottom: 8px; }
.radar-sel summary { cursor: pointer; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.radar-sel summary img { background: #111; border-radius: 50%; padding: 3px; }
.radar-sel__grid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin: 14px 0; }
.radar-sel__item { display: flex; gap: 10px; align-items: center; padding: 8px; border: 1.5px solid var(--stroke); border-radius: var(--r-lg); cursor: pointer; background: var(--layer); transition: .15s; }
.radar-sel__item:hover { border-color: var(--brand); }
.radar-sel__item:has(input:checked) { border-color: var(--brand); background: #e9f5f4; }
.radar-sel__item.is-ya { opacity: .55; cursor: default; }
.radar-sel__item input { width: 18px; height: 18px; accent-color: var(--brand); flex-shrink: 0; }
.radar-sel__item img, .radar-sel__sin { width: 54px; height: 68px; object-fit: cover; border-radius: 6px; flex-shrink: 0; background: var(--layer-alt); }
.radar-sel__txt { display: grid; gap: 2px; min-width: 0; }
.radar-sel__txt strong { font-size: .9rem; line-height: 1.25; }
.radar-sel__txt small { color: var(--text-2); font-size: .78rem; }
.radar-sel__acc { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* Días de la semana (colectivos) */
.dias-sel { display: flex; gap: 6px; flex-wrap: wrap; }
.dias-sel label { position: relative; }
.dias-sel input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.dias-sel span { display: inline-block; padding: 8px 12px; border-radius: var(--r-md); border: 1px solid var(--stroke); background: var(--layer); font-weight: 600; font-size: .88rem; }
.dias-sel input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; }
.dias-sel input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }
.dias-mini { display: inline-flex; gap: 2px; }
.dias-mini b { width: 18px; text-align: center; font-size: .72rem; border-radius: 3px; color: var(--text-3); background: var(--layer-alt); }
.dias-mini b.on { background: var(--brand); color: #fff; }

/* Miniaturas en los listados */
.lista-foto { width: 52px; height: 40px; object-fit: cover; border-radius: 6px; display: block; background: var(--layer-alt); }
.lista-foto--vacia { display: grid; place-items: center; color: var(--text-3); font-size: 1.1rem; }
td small.pill { display: inline-block; margin-top: 3px; font-size: .66rem; }
