/* =====================================================================
   CMS FAA — sistema de diseño (sobre Bootstrap 5)
   ===================================================================== */
:root {
    --brand: #0b7a3b;
    --brand-600: #096a33;
    --brand-700: #075a2b;
    --brand-50: #ebf6ef;
    --brand-100: #d3ecdc;
    --ink: #111a15;
    --ink-2: #3b4842;
    --muted: #6b7871;
    --line: #e1e8e4;
    --line-2: #eef2f0;
    --bg: #f2f5f3;
    --paper: #ffffff;
    --side: #0d1712;
    --side-2: #15221b;
    --side-text: #a9b8b0;
    --danger: #c4312b;
    --warn: #b7791f;
    --info: #1f6feb;
    --radius: 12px;
    --radius-lg: 14px;
    --accent: #f2c200;
    --display: "Barlow Semi Condensed", "Inter", system-ui, sans-serif;
    --card-shadow: 0 1px 2px rgb(16 24 20 / .04), 0 8px 24px -16px rgb(10 40 24 / .16);
    --radius-sm: 8px;
    --shadow-sm: 0 1px 2px rgb(16 24 20 / .05);
    --shadow: 0 1px 3px rgb(16 24 20 / .06), 0 4px 16px rgb(16 24 20 / .04);
    --shadow-lg: 0 12px 40px rgb(16 24 20 / .16);

    /* Cristal */
    --glass: rgb(255 255 255 / .72);
    --glass-strong: rgb(255 255 255 / .86);
    --glass-border: rgb(255 255 255 / .8);
    --glass-line: rgb(15 60 35 / .07);
    --glass-blur: blur(16px) saturate(170%);
    --glass-shadow: 0 1px 0 rgb(255 255 255 / .9) inset, 0 12px 32px -14px rgb(6 40 20 / .18), 0 2px 6px rgb(6 40 20 / .04);

    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
    --bs-body-font-size: .9375rem;
    --bs-body-color: var(--ink);
    --bs-body-bg: var(--bg);
    --bs-border-color: var(--line);
    --bs-link-color: var(--brand);
    --bs-link-color-rgb: 11, 122, 59;
    --bs-link-hover-color: var(--brand-700);
    --bs-link-hover-color-rgb: 7, 90, 43;
    --bs-primary: var(--brand);
    --bs-primary-rgb: 11, 122, 59;
    --bs-border-radius: var(--radius-sm);
    --bs-focus-ring-color: rgb(11 122 59 / .25);
}

html { scrollbar-color: #c4cfc9 transparent; }
body {
    -webkit-font-smoothing: antialiased; letter-spacing: -.005em;
    background:
        radial-gradient(1100px 380px at 30% -120px, rgb(11 122 59 / .09), transparent 70%),
        var(--bg);
    background-attachment: fixed;
}
/* Barras de desplazamiento finas en los paneles con scroll propio */
.editor-side, .crud-panel, .inbox-list, .pick-options, .champ-picks, .champ-field-results, .picker-body, .table-responsive, .rows-editor {
    scrollbar-width: thin; scrollbar-color: #cfd8d3 transparent;
}
:focus-visible { outline: 2px solid rgb(11 122 59 / .55); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
h1, h2, h3, h4 { letter-spacing: -.02em; color: var(--ink); }
h1:focus { outline: none; }
code { color: var(--brand-700); background: var(--brand-50); padding: .1em .35em; border-radius: 4px; font-size: .85em; }
::selection { background: var(--brand-100); }

/* ---------- Botones y formularios ---------- */
.btn { font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border-radius: var(--radius-sm); }
.btn-primary {
    --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand);
    --bs-btn-hover-bg: var(--brand-600); --bs-btn-hover-border-color: var(--brand-600);
    --bs-btn-active-bg: var(--brand-700); --bs-btn-active-border-color: var(--brand-700);
    --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand);
    box-shadow: 0 1px 2px rgb(11 122 59 / .25), inset 0 1px 0 rgb(255 255 255 / .12);
}
.btn-light {
    --bs-btn-bg: #fff; --bs-btn-border-color: var(--line); --bs-btn-color: var(--ink-2);
    --bs-btn-hover-bg: #f6f8f7; --bs-btn-hover-border-color: #d5ddd9; --bs-btn-hover-color: var(--ink);
    --bs-btn-active-bg: #eef2f0; box-shadow: var(--shadow-sm);
}
.btn-danger { --bs-btn-bg: var(--danger); --bs-btn-border-color: var(--danger); --bs-btn-hover-bg: #a92822; --bs-btn-hover-border-color: #a92822; }
.btn-link { text-decoration: none; }
.btn-lg { padding: .7rem 1rem; font-size: 1rem; }

.form-label { font-weight: 500; font-size: .85rem; color: var(--ink-2); margin-bottom: .35rem; gap: .5rem; align-items: baseline; }
.form-control, .form-select { border-color: var(--line); border-radius: var(--radius-sm); font-size: .9rem; padding: .5rem .75rem; box-shadow: var(--shadow-sm); background-color: #fff; }
.form-control:disabled, .form-select:disabled { background-color: #f3f5f4; }
.form-control:focus, .form-select:focus { border-color: #7cc49a; box-shadow: 0 0 0 3px rgb(11 122 59 / .14); }
.form-control::placeholder { color: #a3aea8; }
.form-control-sm, .form-select-sm { padding: .35rem .6rem; font-size: .85rem; }
.form-select { padding-right: 2.25rem; }
.form-select-sm { padding-right: 2rem; }
.form-control-color { width: 3rem; padding: .3rem; }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgb(11 122 59 / .18); border-color: #7cc49a; }
.form-switch .form-check-input { width: 2.2em; }
.form-check-label { font-size: .9rem; }
.input-group-text { background: #f7f9f8; border-color: var(--line); color: var(--muted); }
.field-hint { font-size: .78rem; color: var(--muted); margin-top: .3rem; display: flex; gap: .3rem; align-items: center; }
.validation-message { color: var(--danger); font-size: .8rem; margin-top: .25rem; }
.invalid { border-color: var(--danger) !important; }
.code-area { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: .82rem; line-height: 1.5; }
.form-actions { display: flex; gap: .5rem; justify-content: flex-end; margin-top: 1.25rem; padding-top: 1rem; border-top: 1px solid var(--line-2); }
.alert { border-radius: var(--radius-sm); font-size: .9rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand); font-size: .8rem; font-weight: 500; }

.icon { flex: none; vertical-align: -.2em; }
.spin { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
    display: inline-grid; place-items: center; width: 32px; height: 32px; padding: 0; border-radius: 8px;
    border: 1px solid transparent; background: transparent; color: var(--muted); transition: .12s;
}
.icon-btn:hover:not(:disabled) { background: var(--line-2); color: var(--ink); }
.icon-btn.danger:hover:not(:disabled) { background: #fdecea; color: var(--danger); }
.icon-btn:disabled { opacity: .35; }

/* ---------- Armazón ---------- */
.shell { display: flex; min-height: 100vh; }
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shell-overlay { display: none; }

/* El menú es la pista: verde de tartán oscuro, calles curvas al pie y la calle activa marcada en amarillo */
.sidebar {
    position: sticky; top: 0; height: 100vh; width: 252px; flex: none; display: flex; flex-direction: column; color: var(--side-text);
    background:
        radial-gradient(380px 260px at 0% 0%, rgb(22 163 74 / .22), transparent 70%),
        linear-gradient(180deg, #0b2416 0%, #0a1b12 60%, #08140d 100%);
    border-right: 1px solid rgb(255 255 255 / .05); box-shadow: 8px 0 30px -20px rgb(0 0 0 / .55);
}
.sidebar::before { content: ""; position: absolute; z-index: 2; inset: 0 0 auto; height: 3px; background: linear-gradient(90deg, #0b7a3b, #3fae6a 45%, var(--accent)); }
.sidebar::after {
    content: ""; position: absolute; inset: auto 0 0; height: 230px; pointer-events: none;
    background: radial-gradient(ellipse 150% 100% at 115% 100%,
        transparent 50%, rgb(255 255 255 / .055) 50.3% 50.9%, transparent 51.2% 59%, rgb(255 255 255 / .055) 59.3% 59.9%,
        transparent 60.2% 68%, rgb(255 255 255 / .055) 68.3% 68.9%, transparent 69.2% 77%, rgb(255 255 255 / .055) 77.3% 77.9%, transparent 78.2%);
}
.sidebar > * { position: relative; z-index: 1; }
.sidebar-brand { display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; padding: 1.2rem 1.15rem .95rem; color: #fff; text-decoration: none; }
.sidebar-brand:hover { color: #fff; }
.sidebar-brand img { width: 100%; max-width: 184px; height: auto; filter: drop-shadow(0 2px 10px rgb(0 0 0 / .3)); }
.sidebar-brand-tag { display: inline-flex; align-items: center; gap: .45rem; padding: .18rem .6rem .18rem .5rem; border-radius: 999px; background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .09); font-size: .74rem; font-weight: 500; color: #cfe0d6; }
.sidebar-brand-tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #34d27b; box-shadow: 0 0 0 3px rgb(52 210 123 / .2); }

/* Scroll del menú: sin barra hasta que pasas por encima, y un fundido que avisa de que hay más */
.sidebar-nav {
    flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: .55rem .6rem 1.5rem;
    border-top: 1px solid rgb(255 255 255 / .06);
    scrollbar-width: thin; scrollbar-color: transparent transparent; transition: scrollbar-color .2s;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 32px), transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 12px, #000 calc(100% - 32px), transparent 100%);
}
.sidebar-nav:hover, .sidebar-nav:focus-within { scrollbar-color: rgb(255 255 255 / .22) transparent; }
.nav-group + .nav-group { margin-top: .85rem; }
.nav-group-title {
    display: flex; align-items: center; gap: .4rem; width: 100%; padding: .3rem .6rem; margin-bottom: .15rem;
    border: 0; border-radius: 7px; background: none; color: #7d9288; font-size: .76rem; font-weight: 600; text-align: left; transition: color .12s, background .12s;
}
.nav-group-title:hover { color: #e3eee8; background: rgb(255 255 255 / .04); }
.nav-group-title .icon { margin-left: auto; opacity: .65; transition: transform .2s; }
.nav-group-count { display: none; min-width: 18px; height: 18px; padding: 0 .35rem; place-items: center; border-radius: 999px; background: var(--accent); color: #1b1500; font-size: .66rem; font-weight: 800; }
:is(html[data-nav-collapsed~="bandeja"] [data-group="bandeja"], html[data-nav-collapsed~="contenido"] [data-group="contenido"], html[data-nav-collapsed~="delegacion"] [data-group="delegacion"], html[data-nav-collapsed~="portada"] [data-group="portada"], html[data-nav-collapsed~="admin"] [data-group="admin"]) .nav-item:not(.active) { display: none; }
:is(html[data-nav-collapsed~="bandeja"] [data-group="bandeja"], html[data-nav-collapsed~="contenido"] [data-group="contenido"], html[data-nav-collapsed~="delegacion"] [data-group="delegacion"], html[data-nav-collapsed~="portada"] [data-group="portada"], html[data-nav-collapsed~="admin"] [data-group="admin"]) .nav-group-title .icon { transform: rotate(-90deg); }
:is(html[data-nav-collapsed~="bandeja"] [data-group="bandeja"], html[data-nav-collapsed~="contenido"] [data-group="contenido"], html[data-nav-collapsed~="delegacion"] [data-group="delegacion"], html[data-nav-collapsed~="portada"] [data-group="portada"], html[data-nav-collapsed~="admin"] [data-group="admin"]) .nav-group-count { display: inline-grid; }
.nav-item {
    position: relative; display: flex; align-items: center; gap: .7rem; padding: .44rem .6rem; margin-bottom: 1px;
    border-radius: 8px; color: var(--side-text); text-decoration: none; font-size: .875rem; font-weight: 500; transition: background .12s, color .12s;
}
.nav-item .icon { color: #7f968b; transition: color .12s; }
.nav-item:hover { background: rgb(255 255 255 / .055); color: #fff; }
.nav-item:hover .icon { color: #cfe0d6; }
.nav-item.active { background: linear-gradient(90deg, rgb(242 194 0 / .13), rgb(255 255 255 / .03) 70%); color: #fff; box-shadow: inset 0 0 0 1px rgb(255 255 255 / .06); }
.nav-item.active::before { content: ""; position: absolute; left: -.6rem; top: 7px; bottom: 7px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); box-shadow: 0 0 12px rgb(242 194 0 / .5); }
.nav-item.active .icon { color: var(--accent); }
.nav-item:focus-visible, .nav-group-title:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.sidebar-footer { padding: .7rem .9rem .8rem; border-top: 1px solid rgb(255 255 255 / .06); }
.sidebar-footer a { display: flex; align-items: center; gap: .45rem; padding: .4rem .5rem; border-radius: 8px; color: #8aa096; font-size: .8rem; font-weight: 500; text-decoration: none; }
.sidebar-footer a:hover { color: #fff; background: rgb(255 255 255 / .05); }
.sidebar-footer a span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1rem; height: 60px; padding: 0 1.75rem;
    background: rgb(255 255 255 / .72); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border); box-shadow: 0 1px 0 var(--glass-line), 0 8px 24px -18px rgb(6 40 20 / .3);
}
.topbar-burger { display: none; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: .6rem; }
.create-menu .menu-panel { left: 0; right: auto; min-width: 200px; }
.create-menu > .btn .icon { color: var(--brand); }

.user-menu { position: relative; }
.user-menu-btn { display: flex; align-items: center; gap: .6rem; padding: .3rem .5rem .3rem .3rem; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--ink-2); }
.user-menu-btn:hover, .user-menu.open .user-menu-btn { background: var(--glass-strong); border-color: var(--glass-border); box-shadow: var(--glass-shadow); }
.user-menu-text { display: flex; flex-direction: column; text-align: left; line-height: 1.15; }
.user-menu-text strong { font-size: .85rem; font-weight: 600; color: var(--ink); }
.user-menu-text small { font-size: .72rem; color: var(--muted); }
.user-menu-panel {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 210px; padding: .35rem; background: var(--glass-strong); border: 1px solid var(--glass-border);
    -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%); border-radius: 14px; box-shadow: 0 20px 50px -18px rgb(6 40 20 / .4); opacity: 0; visibility: hidden; transform: translateY(-4px); transition: .12s;
}
.user-menu.open .user-menu-panel { opacity: 1; visibility: visible; transform: none; }
.user-menu-panel a, .user-menu-panel button {
    display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .7rem; border: 0; border-radius: 7px;
    background: none; color: var(--ink-2); text-decoration: none; font-size: .875rem; text-align: left;
}
.user-menu-panel a:hover, .user-menu-panel button:hover { background: var(--line-2); color: var(--ink); }

/* Sin tope de ancho: en monitores grandes los listados y los editores aprovechan toda la pantalla */
.content { padding: 1.75rem; width: 100%; }

/* ---------- Cabecera de página ---------- */
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.page-header h1 { display: flex; align-items: center; gap: .75rem; font-family: var(--display); font-size: 2rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.05; margin: 0; }
.page-header p { margin: .35rem 0 0; color: var(--muted); max-width: 70ch; }
.page-header-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(160deg, #13914a, var(--brand-700)); color: #fff; box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), 0 8px 18px -8px rgb(11 122 59 / .6); }
.page-header-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.page-back { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; font-weight: 500; color: var(--muted); text-decoration: none; margin-bottom: .4rem; }
.page-back:hover { color: var(--brand); }
.page-meta { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem .9rem; margin-top: .55rem; font-size: .82rem; color: var(--muted); }
.page-meta .user-badge { vertical-align: middle; }

/* ---------- Tarjetas ---------- */
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--card-shadow); margin-bottom: 1.25rem; overflow: hidden; }
/* La barra del editor de texto se queda fija al desplazarse: la tarjeta no puede recortar */
.card:has(.html-editor) { overflow: visible; }
.card:has(.html-editor) > .card-header { border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.card-header {
    display: flex; align-items: center; gap: .6rem; min-height: 52px; padding: .7rem 1.15rem; background: transparent; border-bottom: 1px solid var(--line-2);
    font-weight: 600; font-size: .94rem; color: var(--ink);
}
.card-header .icon { color: var(--muted); }
/* El icono que abre la cabecera va en una ficha verde: marca el tipo de bloque */
.card-header > .icon:first-child { box-sizing: content-box; padding: 6px; border-radius: 9px; background: var(--brand-50); color: var(--brand); }
.card-body { padding: 1.15rem; }
.card-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line-2); background: #fbfcfb; }
.card-toolbar.filters > * { width: auto; }
.card-footer-bar { display: flex; align-items: center; gap: .75rem; padding: .7rem 1rem; border-top: 1px solid var(--line-2); background: #fafcfb; }
.count-chip { display: inline-grid; place-items: center; min-width: 22px; height: 20px; padding: 0 .4rem; border-radius: 999px; background: var(--line-2); color: var(--ink-2); font-size: .72rem; font-weight: 600; }
.version-chip { font-size: .72rem; font-weight: 600; color: var(--muted); background: var(--line-2); border-radius: 6px; padding: .1rem .45rem; }

/* ---------- Buscador, pestañas ---------- */
.search-box { display: flex; align-items: center; gap: .45rem; min-width: 240px; padding: .42rem .85rem; border: 1px solid var(--line); border-radius: 999px; background: rgb(255 255 255 / .85); color: var(--muted); box-shadow: inset 0 1px 2px rgb(6 40 20 / .05); }
.search-box:focus-within { border-color: #7cc49a; box-shadow: 0 0 0 3px rgb(11 122 59 / .14); }
.search-box input { border: 0; outline: 0; flex: 1; font-size: .875rem; background: transparent; min-width: 0; }

.tabs-pills { display: flex; flex-wrap: wrap; gap: .25rem; padding: .22rem; background: rgb(15 60 35 / .06); border: 1px solid var(--glass-line); border-radius: 12px; }
.tabs-pills button { display: flex; align-items: center; gap: .4rem; padding: .35rem .7rem; border: 0; border-radius: 8px; background: transparent; color: var(--ink-2); font-size: .82rem; font-weight: 500; }
.tabs-pills button span { font-size: .72rem; color: var(--muted); font-weight: 600; }
.tabs-pills button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.tabs-underline { display: flex; gap: 1.5rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs-underline button { padding: .6rem 0; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); font-weight: 500; font-size: .9rem; white-space: nowrap; margin-bottom: -1px; }
.tabs-underline button.on { color: var(--brand); border-color: var(--brand); }
.segmented { display: inline-flex; padding: .15rem; background: var(--line-2); border-radius: 8px; gap: .15rem; }
.segmented button { display: flex; align-items: center; gap: .3rem; border: 0; background: none; padding: .25rem .6rem; border-radius: 6px; font-size: .78rem; font-weight: 500; color: var(--muted); }
.segmented button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- Tablas ---------- */
.table-modern { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .875rem; }
.table-modern th { position: sticky; top: 0; padding: .65rem 1rem; background: rgb(250 251 250 / .92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); color: var(--muted); font-size: .78rem; font-weight: 600; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table-modern td { padding: .75rem 1rem; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table-modern tbody tr { transition: background .1s; }
.table-modern tbody tr:hover { background: #f5f9f6; }
.table-modern tbody tr:last-child td { border-bottom: 0; }
.table-modern tr.clickable, .crud .table-modern tbody tr { cursor: pointer; }
.table-modern tr.selected { background: var(--brand-50); }
.cell-title { min-width: 220px; }
.cell-title a, .cell-title > span { font-weight: 600; color: var(--ink); text-decoration: none; }
.cell-title a:hover { color: var(--brand); }
.cell-sub { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .15rem; font-size: .78rem; color: var(--muted); }
.row-actions { display: flex; gap: .15rem; justify-content: flex-end; white-space: nowrap; }
.thumb { width: 56px; height: 40px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); display: block; }
.thumb.wide { width: 80px; height: 45px; }
.thumb.poster { width: 40px; height: 54px; }
.link-list { display: grid; gap: .45rem; }
.link-row { display: grid; grid-template-columns: auto 120px 150px minmax(140px, 1fr) minmax(180px, 1.4fr) auto; gap: .4rem; align-items: center; padding: .35rem; border: 1px solid var(--line-2); border-radius: 9px; background: #fcfdfc; }
.link-actions { display: flex; align-items: center; gap: .1rem; }
.link-actions label.icon-btn { cursor: pointer; }
/* Con la columna de edición estrecha, el título y la dirección pasan a su propia fila */
@media (max-width: 1700px) { .link-row { grid-template-columns: auto 1fr 1fr auto; } .link-row .link-title, .link-row .link-url { grid-column: 2 / 4; } }
.thumb-empty { display: grid; place-items: center; background: var(--line-2); color: #b0bab5; }
.flag { display: inline-flex; align-items: center; gap: .2rem; padding: .05rem .4rem; border-radius: 5px; background: #fff7e0; color: #8a5a00; font-size: .7rem; font-weight: 600; }
.flag.muted { background: var(--line-2); color: var(--muted); }
.file-link { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; font-weight: 500; }
.type-chip { display: inline-flex; align-items: center; gap: .25rem; padding: .05rem .45rem; border-radius: 5px; background: var(--line-2); color: var(--ink-2); font-size: .72rem; font-weight: 600; }

/* ---------- Estados ---------- */
.status { display: inline-flex; align-items: center; gap: .4rem; padding: .2rem .6rem .2rem .5rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-published { background: #e5f5ec; color: #0a7a3a; }
.status-scheduled { background: #e8f0fe; color: #1a56c4; }
.status-review { background: #fff4dc; color: #9a6200; }
.status-draft { background: #eef1f0; color: #5d6964; }
.status-archived { background: #f3eefb; color: #6b44b0; }
.status-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; margin-top: .3rem; }
.status-dot.status-published { background: #16a34a; }
.status-dot.status-review { background: #e5a000; }
.status-dot.status-draft { background: #94a39b; }
.status-dot.status-archived { background: #8b5cf6; }
.role { display: inline-block; padding: .15rem .55rem; border-radius: 6px; font-size: .75rem; font-weight: 600; }
.role-admin { background: #fde8f2; color: #a3195b; }
.role-editor { background: #e8f0fe; color: #1a56c4; }
.action { display: inline-block; padding: .15rem .55rem; border-radius: 6px; font-size: .75rem; font-weight: 600; }
.action-created { background: #e5f5ec; color: #0a7a3a; }
.action-updated { background: #e8f0fe; color: #1a56c4; }
.action-deleted { background: #fdecea; color: var(--danger); }

.status-picker { display: grid; gap: .4rem; }
.status-picker button { display: flex; gap: .7rem; align-items: flex-start; padding: .6rem .75rem; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: .12s; }
.status-picker button:hover { border-color: #c9d4ce; }
.status-picker button.on { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px rgb(11 122 59 / .1); }
.status-picker-text { display: flex; flex-direction: column; line-height: 1.25; }
.status-picker-text strong { font-size: .875rem; font-weight: 600; }
.status-picker-text small { font-size: .75rem; color: var(--muted); }

/* ---------- Avatares ---------- */
.avatar { --av: #64748b; display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--av); color: #fff; font-size: .78rem; font-weight: 600; letter-spacing: .02em; box-shadow: inset 0 0 0 2px rgb(255 255 255 / .2); }
.avatar.sm { width: 26px; height: 26px; font-size: .66rem; }
.avatar.xs { width: 22px; height: 22px; font-size: .6rem; }
.avatar.xl { width: 56px; height: 56px; font-size: 1.1rem; }
.user-badge { display: inline-flex; align-items: center; gap: .5rem; min-width: 0; }
.user-badge-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.user-badge-name { font-size: .82rem; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-badge-when { font-size: .74rem; color: var(--muted); white-space: nowrap; }

/* ---------- Escritorio ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 1rem; margin-bottom: 1.5rem; }
.kpi { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: .9rem; align-items: center; padding: 1.1rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--card-shadow); text-decoration: none; color: var(--ink); transition: border-color .15s, box-shadow .15s; }
.kpi:hover { border-color: #b8dcc6; box-shadow: 0 0 0 3px rgb(11 122 59 / .07), var(--card-shadow); color: var(--ink); }
.kpi-icon { --tone: var(--brand); grid-row: span 2; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: color-mix(in srgb, var(--tone) 12%, #fff); color: var(--tone); }
.kpi-value { font-family: var(--display); font-size: 2rem; font-weight: 700; line-height: 1; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi-label { font-size: .8rem; color: var(--muted); font-weight: 500; }
.kpi-hint { grid-column: 1 / -1; margin-top: .6rem; padding-top: .6rem; border-top: 1px dashed var(--line); font-size: .76rem; color: var(--warn); font-weight: 500; }
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 1.25rem; align-items: start; }
.item-list { list-style: none; margin: 0; padding: 0; }
.item-list li { display: flex; align-items: center; gap: .9rem; padding: .7rem 1.15rem; border-bottom: 1px solid var(--line-2); }
.item-list li:last-child { border-bottom: 0; }
.item-list-main { display: flex; align-items: center; gap: .7rem; flex: 1; min-width: 0; text-decoration: none; color: var(--ink); }
.item-list-main:hover .item-title { color: var(--brand); }
.item-type { display: grid; place-items: center; width: 30px; height: 30px; flex: none; border-radius: 8px; background: var(--line-2); color: var(--muted); }
.item-title { font-weight: 500; font-size: .875rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: .7rem; padding: .65rem 0; border-bottom: 1px solid var(--line-2); font-size: .84rem; }
.feed li:last-child { border-bottom: 0; }
.feed-title { display: block; font-weight: 500; color: var(--ink); text-decoration: none; line-height: 1.3; margin: .1rem 0; }
a.feed-title:hover { color: var(--brand); }
.feed time { font-size: .74rem; color: var(--muted); }

/* ---------- Listado + panel lateral ---------- */
.crud { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; align-items: start; }
.crud.crud-editing { grid-template-columns: minmax(0, 1fr) 440px; }
.crud-panel { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; overscroll-behavior: contain; }
.crud-panel > .card:first-child { border-color: #b8dcc6; box-shadow: 0 0 0 3px rgb(11 122 59 / .06), var(--card-shadow); }
.crud-panel .card { margin-bottom: 1rem; }

/* ---------- Editores ---------- */
/* ---------- Editores: barra de acciones fija ---------- */
.editor-bar {
    position: sticky; top: 60px; z-index: 15; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap;
    margin: -1.75rem -1.75rem 1.5rem; padding: .7rem 1.75rem; min-height: 64px;
    background: rgb(255 255 255 / .72); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
    border-bottom: 1px solid var(--glass-border); box-shadow: 0 1px 0 var(--glass-line), 0 10px 26px -20px rgb(6 40 20 / .35);
}
.editor-bar::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, #e5a000, #f2c200); transform: scaleX(0); transform-origin: left; transition: transform .3s; }
.editor-bar.is-dirty::after { transform: scaleX(1); }
.editor-bar-back { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); box-shadow: var(--shadow-sm); transition: .15s; }
.editor-bar-back:hover { color: var(--brand); border-color: #b8dcc6; transform: translateX(-2px); }
.editor-bar-title { display: flex; flex-direction: column; min-width: 0; max-width: 46ch; line-height: 1.2; }
.editor-bar-title small { font-size: .76rem; font-weight: 600; color: var(--brand); }
.editor-bar-title strong { font-family: var(--display); font-size: 1.3rem; font-weight: 700; letter-spacing: -.005em; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.editor-bar-state { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.editor-bar-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.save-state { display: inline-flex; align-items: center; gap: .35rem; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.save-state.dirty { background: #fff4dc; color: #8a5a00; }
.save-state.saving { background: #e8f0fe; color: #1a56c4; }
.save-state.saved { color: var(--muted); }
.save-dot { width: 7px; height: 7px; border-radius: 50%; background: #e5a000; box-shadow: 0 0 0 0 rgb(229 160 0 / .6); animation: dirty-pulse 1.8s infinite; }
@keyframes dirty-pulse { 70% { box-shadow: 0 0 0 6px rgb(229 160 0 / 0); } 100% { box-shadow: 0 0 0 0 rgb(229 160 0 / 0); } }
kbd { padding: .05rem .35rem; border-radius: 5px; border: 1px solid var(--line); border-bottom-width: 2px; background: #fff; color: var(--ink-2); font: 600 .68rem/1.4 "Inter", sans-serif; box-shadow: none; }

/* Menú de más acciones */
.menu-button { position: relative; }
.menu-panel {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px; padding: .35rem;
    background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 14px; box-shadow: 0 20px 50px -18px rgb(6 40 20 / .4);
    -webkit-backdrop-filter: blur(20px) saturate(180%); backdrop-filter: blur(20px) saturate(180%);
    opacity: 0; visibility: hidden; transform: translateY(-4px); transition: .12s;
}
.menu-button.open .menu-panel { opacity: 1; visibility: visible; transform: none; }
.menu-panel a, .menu-panel button { display: flex; align-items: center; gap: .6rem; width: 100%; padding: .55rem .7rem; border: 0; border-radius: 9px; background: none; color: var(--ink-2); text-decoration: none; font-size: .875rem; text-align: left; }
.menu-panel a:hover, .menu-panel button:hover { background: rgb(15 60 35 / .06); color: var(--ink); }
.menu-panel .danger { color: var(--danger); }
.menu-panel .danger:hover { background: #fdecea; color: var(--danger); }

/* ---------- Editores: lienzo ---------- */
/* Izquierda: todo lo que se edita. Derecha: lo común a cualquier contenido (publicación, revisión, historial) */
.editor-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.editor-side {
    position: sticky; top: 136px; max-height: calc(100vh - 148px); overflow-y: auto; overscroll-behavior: contain;
    margin-right: -12px; padding: 0 12px .25rem 0; scrollbar-color: transparent transparent;
}
.editor-side:hover, .editor-side:focus-within { scrollbar-color: #cfd8d3 transparent; }
.editor-side .card { background: rgb(255 255 255 / .62); box-shadow: none; margin-bottom: .9rem; }
.editor-side .card-header { min-height: 46px; padding: .6rem .95rem; font-size: .86rem; }
.editor-side .card-header > .icon:first-child { padding: 0; background: none; color: var(--muted); }
.editor-side .card-body { padding: .95rem; }
.editor-side .card-footer-bar { background: transparent; }
/* En la columna estrecha, el botón ocupa la fila: Ctrl+S ya lo recuerda la barra del editor */
.editor-side .card-footer-bar > .text-muted { display: none; }
.editor-side .card-footer-bar { flex-wrap: wrap; gap: .5rem; }
.editor-side .card-footer-bar > .btn { flex: 1; margin-left: 0 !important; white-space: nowrap; }
.editor-canvas .card-body { padding: 1.75rem 2rem 2rem; }

/* Rejillas de campos dentro de las tarjetas */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem 1.1rem; }
.form-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-grid > * { min-width: 0; }
.form-grid > .span-2 { grid-column: span 2; }
.form-grid > .span-all { grid-column: 1 / -1; }
.form-grid .form-label { display: flex; }
.split { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 1.75rem; align-items: start; }
.split.media-first { grid-template-columns: minmax(200px, 260px) minmax(0, 1fr); }
@media (max-width: 1240px) {
    .form-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .form-grid.cols-3 > .span-2 { grid-column: 1 / -1; }
}
@media (max-width: 1300px) and (min-width: 1101px) {
    .split { grid-template-columns: minmax(0, 1fr); }
}
.title-input {
    display: block; width: 100%; border: 0; outline: 0; padding: 0; resize: none; overflow: hidden; field-sizing: content; min-height: 1.25em;
    font-family: var(--display); font-size: 2.35rem; font-weight: 700; line-height: 1.1; letter-spacing: -.01em; color: var(--ink); background: transparent;
}
.title-input::placeholder { color: #c3ccc7; }
.field-block { margin-top: 1.5rem; }
.lead-input { font-size: 1rem; line-height: 1.55; }

.slug-field {
    display: flex; align-items: center; gap: .4rem; margin-top: .65rem; padding: .35rem .45rem .35rem .75rem; max-width: 100%;
    border: 1px solid var(--glass-line); border-radius: 999px; background: rgb(15 60 35 / .035); font-size: .82rem; color: var(--muted);
}
.slug-field.is-taken { border-color: #f1b3ae; background: #fdf3f2; }
.slug-base { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; direction: rtl; text-align: left; }
.slug-field input { flex: 1; min-width: 80px; border: 0; outline: 0; padding: .15rem .3rem; border-radius: 6px; color: var(--brand); font-weight: 600; background: transparent; }
.slug-field input:focus { background: #fff; box-shadow: 0 0 0 2px rgb(11 122 59 / .15); }
.slug-state { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.slug-state.ok { color: #16a34a; }
.slug-state.bad { color: var(--danger); }
.slug-regen, .slug-open { display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .55rem; border: 0; border-radius: 999px; background: #fff; color: var(--ink-2); font-size: .72rem; font-weight: 600; white-space: nowrap; text-decoration: none; box-shadow: var(--shadow-sm); }
.slug-regen:hover, .slug-open:hover { color: var(--brand); }

.chip-options { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip-options button { padding: .3rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--ink-2); font-size: .8rem; font-weight: 500; transition: .12s; }
.chip-options button:hover { border-color: #b8dcc6; color: var(--brand); }
.chip-options button.on { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 4px 10px -4px rgb(11 122 59 / .6); }

.tag-input { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; min-height: 40px; padding: .3rem .4rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: #fff; box-shadow: var(--shadow-sm); cursor: text; }
.tag-input:focus-within { border-color: #7cc49a; box-shadow: 0 0 0 3px rgb(11 122 59 / .14); }
.tag-input input { flex: 1; min-width: 110px; border: 0; outline: 0; padding: .2rem .3rem; font-size: .88rem; background: transparent; }
.tag-chip { display: inline-flex; align-items: center; gap: .2rem; padding: .15rem .25rem .15rem .6rem; border-radius: 999px; background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand-700); font-size: .78rem; font-weight: 600; }
.tag-chip button { display: grid; place-items: center; width: 18px; height: 18px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; opacity: .6; }
.tag-chip button:hover { opacity: 1; background: rgb(11 122 59 / .15); }

.empty-inline { display: flex; align-items: center; gap: .75rem; padding: .9rem 1rem; border: 1px dashed #cfd9d4; border-radius: 12px; color: var(--muted); font-size: .85rem; }
.empty-inline .icon { color: #9fb3a8; }

/* Revisión antes de publicar */
.checklist .card-header { display: flex; }
.checklist-score { padding: .1rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.checklist-score.good { background: #e5f5ec; color: #0a7a3a; }
.checklist-score.fair { background: #fff4dc; color: #8a5a00; }
.checklist-score.bad { background: #fdecea; color: var(--danger); }
.checklist-bar { height: 3px; background: var(--line-2); }
.checklist-bar span { display: block; height: 100%; transition: width .3s; }
.checklist-bar span.good { background: #16a34a; }
.checklist-bar span.fair { background: #e5a000; }
.checklist-bar span.bad { background: var(--danger); }
.checklist-items { list-style: none; margin: 0; padding: .65rem .9rem .8rem; display: grid; gap: .45rem; font-size: .82rem; }
.checklist-items li { display: flex; align-items: flex-start; gap: .55rem; color: var(--ink-2); line-height: 1.4; }
.checklist-icon { display: grid; place-items: center; width: 20px; height: 20px; flex: none; border-radius: 50%; margin-top: -.05rem; }
.checklist-items li.ok { color: var(--muted); }
.checklist-items li.ok .checklist-icon { background: #e5f5ec; color: #16a34a; }
.checklist-items li.missing .checklist-icon { background: #fdecea; color: var(--danger); }
.checklist-items li.missing { color: var(--ink); font-weight: 500; }
.checklist-items li.tip .checklist-icon { background: #fff4dc; color: #b7791f; }

/* ---------- Editor de texto ---------- */
.html-editor { position: relative; border-radius: 12px; }
.quill-host { min-height: 280px; background: #fff; font-family: "Inter", sans-serif; }
.ql-toolbar.ql-snow {
    position: sticky; top: 124px; z-index: 5; border: 1px solid var(--line) !important; border-radius: 12px 12px 0 0;
    background: rgb(250 251 250 / .95); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); padding: .45rem .5rem !important;
}
.ql-toolbar.ql-snow .ql-formats { margin-right: .6rem !important; padding-right: .6rem; border-right: 1px solid var(--line-2); }
.ql-toolbar.ql-snow .ql-formats:last-child { border-right: 0; }
.ql-snow.ql-toolbar button { border-radius: 6px; }
.ql-snow.ql-toolbar button:hover, .ql-snow.ql-toolbar button.ql-active { background: var(--brand-50); }
.ql-snow.ql-toolbar button:hover .ql-stroke, .ql-snow.ql-toolbar button.ql-active .ql-stroke { stroke: var(--brand) !important; }
.ql-snow.ql-toolbar button:hover .ql-fill, .ql-snow.ql-toolbar button.ql-active .ql-fill { fill: var(--brand) !important; }
.ql-container.ql-snow { border: 1px solid var(--line) !important; border-top: 0 !important; border-radius: 0; font-size: 1rem; font-family: "Inter", sans-serif; }
.ql-editor { min-height: 320px; line-height: 1.7; padding: 1.25rem 1.4rem; color: var(--ink-2); }
.ql-editor.ql-blank::before { color: #b3bdb8; font-style: normal; left: 1.4rem; }
.ql-editor h2 { font-size: 1.5rem; font-weight: 700; margin: 1.2em 0 .4em; color: var(--ink); }
.ql-editor h3 { font-size: 1.25rem; font-weight: 700; margin: 1.1em 0 .4em; color: var(--ink); }
.ql-editor h4 { font-size: 1.05rem; font-weight: 700; margin: 1em 0 .3em; color: var(--ink); }
.ql-editor p { margin-bottom: .7em; }
.ql-editor img { max-width: 100%; height: auto; border-radius: 8px; }
.ql-editor blockquote { border-left: 4px solid #f2c200 !important; background: #fffbea; padding: .6rem 1rem !important; border-radius: 0 8px 8px 0; font-style: italic; }
.ql-editor a { color: var(--brand); }
.html-editor .code-area { border-radius: 12px 12px 0 0; min-height: 320px; }
.html-editor-status {
    display: flex; align-items: center; gap: .75rem; padding: .35rem .45rem; border: 1px solid var(--line); border-top: 0;
    border-radius: 0 0 12px 12px; background: rgb(250 251 250 / .95); font-size: .75rem; color: var(--muted);
}
.html-editor-stats { display: flex; align-items: center; gap: .9rem; }
.html-editor-stats span { display: inline-flex; align-items: center; gap: .25rem; }
.html-editor-stats strong { color: var(--ink-2); }
.html-editor-fullbar { display: flex; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.html-editor.is-fullscreen {
    position: fixed; inset: 0; z-index: 1070; overflow-y: auto; border-radius: 0;
    padding: 1.25rem max(1.25rem, calc((100vw - 980px) / 2)) 2rem;
    background: radial-gradient(900px 520px at 15% -5%, rgb(11 122 59 / .08), transparent 65%), var(--bg);
}
.html-editor.is-fullscreen .ql-toolbar.ql-snow { top: -1.25rem; }
.html-editor.is-fullscreen .ql-editor { min-height: calc(100vh - 200px); font-size: 1.08rem; padding: 2rem 2.5rem; }
html.editor-fullscreen, html.editor-fullscreen body { overflow: hidden; }

/* Secciones desplegables */
.section-list { display: grid; gap: .6rem; }
.section-item { border: 1px solid var(--line); border-radius: 12px; background: rgb(255 255 255 / .7); transition: box-shadow .15s, border-color .15s; }
.section-item:hover { border-color: #cfdcd5; }
.section-item.open { border-color: #b8dcc6; box-shadow: 0 0 0 3px rgb(11 122 59 / .06); background: #fff; }
.section-head { display: flex; align-items: center; gap: .5rem; padding: .5rem .6rem; }
.section-index { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; background: var(--brand-50); color: var(--brand); font-size: .72rem; font-weight: 700; }
.section-move { display: flex; flex-direction: column; }
.section-move .icon-btn { width: 24px; height: 18px; }
.section-title { font-weight: 600; }
.section-anchor { max-width: 200px; }
.section-body { padding: .75rem; border-top: 1px solid var(--line-2); }
.section-excerpt { padding: 0 .9rem .6rem 4.6rem; font-size: .8rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.char-counter { margin-left: auto; font-size: .72rem; font-weight: 500; color: #a3aea8; }
.char-counter.good { color: var(--brand); }
.char-counter.over { color: var(--danger); }

.seo-preview { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem; border-radius: 10px; background: #fafbfa; border: 1px solid var(--line-2); font-family: Arial, sans-serif; }
.seo-url { font-size: .78rem; color: #4d5156; }
.seo-title { font-size: 1.15rem; color: #1a0dab; line-height: 1.3; }
.seo-desc { font-size: .84rem; color: #4d5156; line-height: 1.45; }

/* ---------- Medios ---------- */
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 1rem; }
.media-card { display: flex; flex-direction: column; padding: 0; overflow: hidden; text-align: left; border: 1px solid var(--line); border-radius: 10px; background: #fff; transition: .12s; }
.media-card:hover { border-color: #c9d4ce; box-shadow: var(--shadow); }
.media-card.selected { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(11 122 59 / .15); }
.media-card img, .media-file { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: var(--line-2); }
.media-file { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .3rem; color: var(--brand); font-weight: 700; font-size: .8rem; }
.media-card-info { display: flex; flex-direction: column; padding: .55rem .7rem; }
.media-card-name { font-size: .8rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.media-card-meta { font-size: .72rem; color: var(--muted); }
.media-card { position: relative; }
.media-card-badge { position: absolute; top: .5rem; left: .5rem; }
.media-card-badge .status { box-shadow: var(--shadow-sm); }
.summary-card .card-header { display: flex; align-items: center; gap: .5rem; }
.summary-card .card-header .icon { color: #b7791f; }
.summary-text { font-size: .9rem; line-height: 1.55; color: var(--ink); margin-bottom: .5rem; }
.status-error { background: #fdecec; color: #b42318; }
.callout { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 1rem; border-radius: var(--radius-sm); border: 1px solid; font-size: .88rem; line-height: 1.5; }
.callout > .icon { flex: none; margin-top: .1rem; }
.callout code { font-size: .8rem; }
.callout-warning { background: #fff8e6; border-color: #f5d68a; color: #7a4d00; }
.callout-info { background: #eef4ff; border-color: #c7d9fb; color: #1a4a9c; }
.filter-select { width: auto; min-width: 140px; }
.media-detail-img { display: block; width: 100%; max-height: 260px; object-fit: contain; background: var(--line-2); }
.video-preview { width: 100%; border-radius: 10px; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1rem; font-size: .84rem; margin-bottom: 1rem; }
.kv dt { color: var(--muted); font-weight: 500; }
.kv dd { margin: 0; }

/* ---------- Menús ---------- */
.menu-tree { list-style: none; margin: 0; padding: .35rem; }
.menu-row { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: 9px; }
.menu-row:hover { background: #f8faf9; }
.menu-row.selected { background: var(--brand-50); }
.menu-row.child { margin-left: 2.4rem; position: relative; }
.menu-row.child::before { content: ""; position: absolute; left: -1.3rem; top: 0; bottom: 50%; width: .9rem; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); border-bottom-left-radius: 6px; }
.menu-row.hidden-item .menu-text { color: var(--muted); }
.menu-move { display: flex; flex-direction: column; }
.menu-move .icon-btn { width: 22px; height: 16px; }
.menu-swatch { --sw: #64748b; display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 8px; background: var(--sw); color: #fff; }
.menu-label { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 0; border: 0; background: none; text-align: left; }
.menu-text { font-weight: 600; font-size: .875rem; color: var(--ink); display: flex; align-items: center; gap: .4rem; }
.menu-url { font-size: .76rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-picker { display: grid; grid-template-columns: repeat(auto-fill, 38px); gap: .35rem; }
.icon-picker button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink-2); }
.icon-picker button:hover { border-color: #c9d4ce; }
.icon-picker button.on { border-color: var(--brand); background: var(--brand); color: #fff; }

/* ---------- Historial ---------- */
.audit-meta { display: grid; gap: .8rem; margin: 0 0 1rem; }
.audit-meta dt { font-size: .76rem; font-weight: 600; color: var(--muted); margin-bottom: .25rem; }
.audit-meta dd { margin: 0; }
.timeline { list-style: none; margin: 0 0 .75rem; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 10px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.timeline li { position: relative; display: flex; gap: .65rem; padding: .45rem 0; }
.timeline-body { min-width: 0; flex: 1; }
.timeline-title { font-size: .8rem; color: var(--ink-2); line-height: 1.35; }
.timeline-title time { color: var(--muted); margin-left: .25rem; }
.change-list { list-style: none; margin: .3rem 0 0; padding: 0; display: grid; gap: .2rem; }
.change-list li { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem; font-size: .76rem; line-height: 1.35; padding: 0 !important; }
.change-field { font-weight: 600; color: var(--ink-2); }
.change-field::after { content: ":"; }
.change-old { color: #a14b47; text-decoration: line-through; text-decoration-color: rgb(161 75 71 / .4); max-width: 100%; overflow-wrap: anywhere; }
.change-new { color: #0a6e34; overflow-wrap: anywhere; }
.change-list .icon { color: var(--muted); }
.activity-table .change-list { max-width: 520px; }

/* ---------- Estados vacíos y carga ---------- */
.empty-state { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 3rem 1.5rem; color: var(--muted); }
.empty-state-icon { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--line-2); color: var(--muted); margin-bottom: .9rem; }
.empty-state h3 { font-size: 1rem; font-weight: 600; margin-bottom: .3rem; }
.empty-state p { font-size: .875rem; max-width: 42ch; margin-bottom: 1rem; }
.skeleton-rows { padding: 1rem; display: grid; gap: .75rem; }
.skeleton-rows div { height: 42px; border-radius: 8px; background: linear-gradient(90deg, #eef1ef 25%, #f6f8f7 50%, #eef1ef 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ---------- Paginación ---------- */
.pager { display: flex; align-items: center; gap: .2rem; margin-left: auto; }
.pager-num { min-width: 32px; height: 32px; padding: 0 .5rem; border: 1px solid transparent; border-radius: 8px; background: none; font-size: .84rem; font-weight: 500; color: var(--ink-2); }
.pager-num:hover { background: var(--line-2); }
.pager-num.on { background: var(--brand); color: #fff; }
.pager-gap { color: var(--muted); padding: 0 .2rem; }

/* ---------- Diálogo y notificaciones ---------- */
.dialog-backdrop { position: fixed; inset: 0; z-index: 1080; background: rgb(13 23 18 / .45); backdrop-filter: blur(2px); animation: fade .15s; }
.dialog {
    position: fixed; z-index: 1095; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100vw - 2rem));
    display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1.4rem; background: #fff; border-radius: 16px; box-shadow: var(--shadow-lg); animation: pop .18s;
}
.dialog-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: #e8f0fe; color: var(--info); }
.dialog-icon.danger { background: #fdecea; color: var(--danger); }
.dialog h2 { font-size: 1.05rem; font-weight: 600; margin: .2rem 0 .35rem; }
.dialog p { margin: 0; color: var(--muted); font-size: .9rem; }
.dialog-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: .5rem; margin-top: .5rem; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translate(-50%, -46%) scale(.97); } }

/* ---------- Selector de la biblioteca de medios ---------- */
.picker {
    position: fixed; z-index: 1090; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: min(1100px, calc(100vw - 2rem)); height: min(780px, calc(100vh - 2rem));
    display: grid; grid-template-rows: auto auto 1fr auto; overflow: hidden;
    background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 20px;
    -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 40px 100px -30px rgb(2 30 14 / .55); animation: pop .18s;
}
.picker-head { display: flex; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.25rem .6rem; }
.picker-head h2 { font-size: 1.15rem; font-weight: 700; margin: 0; }
.picker-head p { margin: .15rem 0 0; font-size: .82rem; color: var(--muted); }
.picker-toolbar { display: flex; align-items: center; gap: .75rem; padding: .25rem 1.25rem .9rem; border-bottom: 1px solid var(--glass-line); }
.picker-body { overflow-y: auto; padding: 1rem 1.25rem; }
.picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: .8rem; }
.picker-item {
    position: relative; display: flex; flex-direction: column; padding: 0; overflow: hidden; aspect-ratio: 1; text-align: left;
    border: 2px solid transparent; border-radius: 12px; background: #fff; box-shadow: 0 0 0 1px var(--line); transition: .12s;
}
.picker-item:hover { box-shadow: 0 0 0 1px #b8dcc6, var(--shadow); transform: translateY(-2px); }
.picker-item.selected { border-color: var(--brand); box-shadow: 0 0 0 4px rgb(11 122 59 / .18); }
.picker-item img, .picker-item .media-file { width: 100%; flex: 1; min-height: 0; object-fit: cover; background: var(--line-2); }
.picker-item.skeleton { background: linear-gradient(90deg, #eef1ef 25%, #f6f8f7 50%, #eef1ef 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.picker-item-name { padding: .35rem .5rem; font-size: .72rem; font-weight: 500; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: #fff; }
.picker-check { position: absolute; top: .4rem; right: .4rem; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--brand); color: #fff; box-shadow: var(--shadow); }
.picker-foot { display: flex; align-items: center; gap: 1rem; padding: .85rem 1.25rem; border-top: 1px solid var(--glass-line); background: rgb(255 255 255 / .6); }
.picker-selected { display: flex; align-items: center; gap: .75rem; min-width: 0; flex: 1; }
.picker-selected img { width: 52px; height: 52px; flex: none; object-fit: cover; border-radius: 10px; box-shadow: var(--shadow-sm); }
.picker-selected-text { display: flex; flex-direction: column; min-width: 0; }
.picker-selected-text strong { font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-selected-text small { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.picker-alt { width: min(320px, 40%); margin-left: auto; }
.picker-actions { display: flex; gap: .5rem; margin-left: auto; }

/* ---------- Vista previa ---------- */
.preview {
    position: fixed; z-index: 1090; inset: 2.5vh 2.5vw; display: grid; grid-template-rows: auto 1fr; overflow: hidden;
    background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 20px;
    -webkit-backdrop-filter: blur(24px) saturate(180%); backdrop-filter: blur(24px) saturate(180%);
    box-shadow: 0 40px 100px -30px rgb(2 30 14 / .55); animation: fade .15s;
}
.preview-head { display: flex; align-items: center; gap: 1rem; padding: .75rem 1rem .75rem 1.25rem; border-bottom: 1px solid var(--glass-line); }
.preview-badge { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .7rem; border-radius: 999px; background: linear-gradient(160deg, #13914a, var(--brand-700)); color: #fff; font-size: .78rem; font-weight: 600; }
.preview-stage {
    position: relative; display: flex; justify-content: center; align-items: stretch; min-height: 0; padding: 1rem; overflow: auto;
    background: repeating-linear-gradient(45deg, rgb(15 60 35 / .03) 0 12px, transparent 12px 24px), rgb(236 240 238 / .7);
}
.preview-device { width: 100%; height: 100%; flex: none; transition: width .25s, height .25s; }
.preview-device iframe { display: block; width: 100%; height: 100%; border: 0; border-radius: 12px; background: #fff; box-shadow: 0 20px 50px -20px rgb(2 30 14 / .4); }
/* Los marcos de 12 px se suman al ancho para que la pantalla interior mida lo que dice (820 / 390 px) */
.device-tablet .preview-device { width: 844px; max-width: 100%; }
.device-mobile .preview-device { width: 414px; max-width: 100%; height: min(868px, 100%); align-self: center; }
.device-tablet .preview-device iframe, .device-mobile .preview-device iframe { border: 12px solid #0d1712; border-radius: 30px; box-shadow: 0 30px 70px -25px rgb(2 30 14 / .55), inset 0 0 0 1px #2a3a32; }
.device-mobile .preview-device iframe { border-radius: 40px; }
.preview-loading { display: flex; align-items: center; gap: .6rem; margin: auto; color: var(--muted); font-size: .9rem; }
.preview-size { min-width: 56px; font-size: .75rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; }

/* ---------- Campo de imagen o fichero ---------- */
.media-field-preview { position: relative; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); background: repeating-conic-gradient(#f2f4f3 0 25%, #fff 0 50%) 0 0 / 16px 16px; }
.media-field-preview img { display: block; width: 100%; max-height: 240px; object-fit: contain; }
.media-field-actions { position: absolute; right: .5rem; bottom: .5rem; display: flex; gap: .35rem; opacity: 0; transform: translateY(4px); transition: .15s; }
.media-field-preview:hover .media-field-actions, .media-field-preview:focus-within .media-field-actions { opacity: 1; transform: none; }
.media-field-actions .btn { box-shadow: var(--shadow); }
.dropzone { position: relative; display: flex; flex-direction: column; align-items: center; gap: .45rem; padding: 1.6rem 1rem; border: 2px dashed #cfd9d4; border-radius: 12px; background: rgb(250 252 251 / .8); color: var(--muted); text-align: center; font-size: .82rem; transition: .12s; margin: 0; }
.dropzone:hover, .dropzone:focus-within { border-color: var(--brand); color: var(--brand); background: var(--brand-50); }
.dropzone.is-busy { opacity: .7; }
.dropzone strong { color: var(--ink); }
.dropzone-input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.dropzone-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fff; color: var(--brand); box-shadow: var(--shadow); }
.media-field-file { display: flex; align-items: center; gap: .6rem; padding: .5rem .6rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; font-size: .85rem; }
.media-field-file-icon { display: grid; place-items: center; width: 32px; height: 32px; flex: none; border-radius: 8px; background: #fdecea; color: #c4161c; }

/* Panel de edición rápida */
.crud-panel-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.crud-panel-title small { font-size: .74rem; font-weight: 600; color: var(--brand); }
.crud-panel-title strong { font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }


.toast-stack { position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 1100; display: grid; gap: .6rem; width: min(380px, calc(100vw - 2.5rem)); }
.toast-item { display: flex; align-items: flex-start; gap: .7rem; padding: .85rem .9rem; background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand); border-radius: 10px; box-shadow: var(--shadow-lg); animation: slide .2s; }
.toast-item > .icon { color: var(--brand); margin-top: .05rem; }
.toast-error { border-left-color: var(--danger); }
.toast-error > .icon { color: var(--danger); }
.toast-info { border-left-color: var(--info); }
.toast-info > .icon { color: var(--info); }
.toast-text { flex: 1; display: flex; flex-direction: column; font-size: .85rem; min-width: 0; }
.toast-text span { color: var(--muted); font-size: .8rem; overflow-wrap: anywhere; }
.toast-close { border: 0; background: none; color: var(--muted); padding: 0; }
@keyframes slide { from { opacity: 0; transform: translateY(8px); } }

/* ---------- Perfil ---------- */
.profile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 1.25rem; align-items: start; }
.profile-head { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.25rem; }
.social-fields .input-group-text { width: 42px; justify-content: center; }

/* ---------- Acceso ---------- */
.login { display: grid; grid-template-columns: 1.1fr 1fr; min-height: 100vh;
    background: radial-gradient(700px 500px at 100% 0%, rgb(242 194 0 / .12), transparent 60%), radial-gradient(800px 600px at 60% 100%, rgb(11 122 59 / .14), transparent 65%), var(--bg); }
.login-brand { position: relative; overflow: hidden; display: flex; align-items: flex-end; padding: 3.5rem; color: #fff; background: var(--side); }
.login-track { position: absolute; inset: 0; opacity: .9;
    background:
        radial-gradient(ellipse 80% 70% at 100% 100%, transparent 54%, rgb(255 255 255 / .16) 54.3% 54.8%, transparent 55.1% 61%, rgb(255 255 255 / .16) 61.3% 61.8%, transparent 62.1% 68%, rgb(255 255 255 / .16) 68.3% 68.8%, transparent 69.1%),
        linear-gradient(160deg, #0b7a3b 0%, #064a24 45%, #0d1712 100%); }
.login-brand-content { position: relative; max-width: 460px; padding: 2rem; border-radius: 22px; background: linear-gradient(135deg, rgb(255 255 255 / .12), rgb(255 255 255 / .04)); border: 1px solid rgb(255 255 255 / .16); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%); box-shadow: inset 0 1px 0 rgb(255 255 255 / .18), 0 30px 60px -30px rgb(0 0 0 / .6); }
.login-logo { width: 260px; max-width: 100%; height: auto; filter: drop-shadow(0 4px 16px rgb(0 0 0 / .35)); }
.login-brand h1 { color: #fff; font-size: 2.3rem; font-weight: 700; margin: 1.5rem 0 .4rem; }
.login-brand p { color: rgb(255 255 255 / .75); margin: 0 0 2rem; }
.login-features { list-style: none; padding: 0; margin: 0; display: grid; gap: .8rem; color: rgb(255 255 255 / .9); font-size: .95rem; }
.login-features li { display: flex; align-items: center; gap: .7rem; }
.login-features .icon { color: #34d27b; }
.login-form { display: grid; place-items: center; padding: 2rem; }
.login-card { width: 100%; max-width: 410px; padding: 2.25rem 2rem; border-radius: 22px; background: var(--glass); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow), 0 30px 60px -30px rgb(6 40 20 / .35); -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur); }
.login-card-logo { display: none; }
.login-card h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: .3rem; }
.login-card > p { margin-bottom: 1.75rem; }
.input-icon { position: relative; }
.input-icon .icon { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: #9aa7a0; }
.input-icon .form-control { padding-left: 2.5rem; height: 46px; }

/* ---------- Errores de Blazor ---------- */
#blazor-error-ui { display: none; position: fixed; inset: auto 0 0 0; z-index: 1000; padding: .8rem 1.25rem; background: #fff4dc; color: #6b4a00; box-shadow: 0 -2px 10px rgb(0 0 0 / .1); }
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 1rem; top: .7rem; }
.blazor-error-boundary { padding: 1rem 1rem 1rem 1.25rem; border-radius: 10px; background: #fdecea; color: var(--danger); }
.blazor-error-boundary::after { content: "Se ha producido un error."; }


/* ---------- Delegaciones provinciales ---------- */
.andalucia-map { display: block; width: 100%; height: auto; overflow: visible; }
.andalucia-map .province-shape { fill: #dcebe2; stroke: #fff; stroke-width: 2; stroke-linejoin: round; transition: fill .15s; }
.andalucia-map .province-shape.link { cursor: pointer; }
.andalucia-map .province-shape.link:focus { outline: none; }
.andalucia-map .province-shape.hover, .andalucia-map .province-shape.link:hover { fill: #8fcaa6; }
.andalucia-map .province-shape.selected { fill: var(--brand); }
.andalucia-map.has-selection .province-shape:not(.selected) { fill: #e8efeb; }
.andalucia-map .province-label { fill: #3b4842; font: 700 21px/1 "Inter", sans-serif; text-anchor: middle; dominant-baseline: middle; pointer-events: none; }
.andalucia-map .province-label.on { fill: #fff; }

.province-board { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 1.25rem; align-items: start; }
.province-board-map { position: sticky; top: 76px; }
.province-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .85rem; }
.province-card { position: relative; display: flex; flex-direction: column; gap: .7rem; padding: 1rem 1.1rem; border-radius: 16px; background: rgb(255 255 255 / .8); border: 1px solid var(--glass-border); box-shadow: var(--glass-shadow); transition: .15s; }
.province-card:hover, .province-card.on { border-color: #b8dcc6; box-shadow: 0 0 0 3px rgb(11 122 59 / .08), var(--glass-shadow); transform: translateY(-2px); }
.province-card-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.province-card-name { font-size: 1.15rem; font-weight: 700; color: var(--ink); text-decoration: none; }
.province-card-name::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.province-card-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .4rem; font-size: .72rem; color: var(--muted); line-height: 1.3; }
.province-card-stats strong { display: block; font-size: 1.25rem; color: var(--ink); letter-spacing: -.02em; }
.province-card-foot { display: flex; align-items: center; gap: .5rem; padding-top: .6rem; border-top: 1px solid var(--line-2); }
.province-card-link { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: .25rem; text-decoration: none; }

.province-locked { display: flex; align-items: center; gap: .6rem; padding: .55rem .75rem; border-radius: 10px; background: var(--brand-50); border: 1px solid var(--brand-100); color: var(--brand-700); }
.province-locked span { display: flex; flex-direction: column; line-height: 1.25; }
.province-locked strong { font-size: .88rem; }
.province-locked small { font-size: .72rem; color: var(--muted); }
.flag.province { background: var(--brand-50); color: var(--brand-700); }

/* Escritorio provincial */
/* Cabecera de los escritorios: el mismo verde de pista que el menú, con las calles curvas a la derecha */
.province-hero { position: relative; overflow: hidden; display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 1.5rem; align-items: center; margin-bottom: 1.5rem; padding: 1.9rem 2.1rem; border-radius: 20px; color: #fff;
    background: radial-gradient(500px 300px at 0% 0%, rgb(22 163 74 / .4), transparent 70%), linear-gradient(160deg, #0a5a2e, #052e17 70%);
    box-shadow: 0 24px 60px -30px rgb(2 30 14 / .6); }
.province-hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(ellipse 70% 120% at 108% 120%,
        transparent 46%, rgb(255 255 255 / .07) 46.3% 46.8%, transparent 47.1% 55%, rgb(255 255 255 / .07) 55.3% 55.8%,
        transparent 56.1% 64%, rgb(255 255 255 / .07) 64.3% 64.8%, transparent 65.1% 73%, rgb(255 255 255 / .07) 73.3% 73.8%, transparent 74.1%);
}
.province-hero > * { position: relative; z-index: 1; }
.province-hero-kicker { display: inline-flex; align-items: center; gap: .4rem; font-size: .85rem; font-weight: 600; color: var(--accent); }
.province-hero h1 { color: #fff; font-family: var(--display); font-size: 2.6rem; font-weight: 700; letter-spacing: -.01em; line-height: 1.05; margin: .35rem 0 .35rem; }
.btn-accent {
    --bs-btn-bg: var(--accent); --bs-btn-border-color: var(--accent); --bs-btn-color: #1b1500;
    --bs-btn-hover-bg: #ffd426; --bs-btn-hover-border-color: #ffd426; --bs-btn-hover-color: #1b1500;
    --bs-btn-active-bg: #e0b400; --bs-btn-active-border-color: #e0b400; --bs-btn-active-color: #1b1500;
    font-weight: 600; box-shadow: 0 8px 20px -10px rgb(242 194 0 / .7);
}
.dash-hero-side { display: grid; gap: .75rem; }
.dash-next { display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; border-radius: 14px; background: rgb(255 255 255 / .08); border: 1px solid rgb(255 255 255 / .14); color: #fff; text-decoration: none; transition: background .15s, border-color .15s; }
.dash-next:hover { background: rgb(255 255 255 / .13); border-color: rgb(255 255 255 / .24); color: #fff; }
.dash-next .champ-pick-date { width: 48px; height: 52px; background: #fff; color: var(--ink); }
.dash-next .champ-pick-date strong { font-family: var(--display); font-size: 1.35rem; line-height: 1; }
.dash-next .champ-pick-date small { color: var(--brand); }
.dash-next-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.dash-next-text small { font-size: .78rem; color: rgb(255 255 255 / .65); }
.dash-next-text strong { font-size: .98rem; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dash-next-text span { font-size: .82rem; color: var(--accent); font-weight: 500; }
.dash-inbox { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }
.dash-inbox a { display: grid; grid-template-columns: auto 1fr; align-items: center; column-gap: .55rem; padding: .7rem .9rem; border-radius: 14px; background: rgb(0 0 0 / .14); border: 1px solid rgb(255 255 255 / .08); color: rgb(255 255 255 / .75); text-decoration: none; font-size: .8rem; transition: background .15s; }
.dash-inbox a:hover { background: rgb(0 0 0 / .22); color: #fff; }
.dash-inbox a .icon { grid-row: span 2; color: rgb(255 255 255 / .5); }
.dash-inbox a strong { font-family: var(--display); font-size: 1.5rem; line-height: 1; color: #fff; }
.dash-inbox a.on { background: rgb(242 194 0 / .14); border-color: rgb(242 194 0 / .4); }
.dash-inbox a.on .icon, .dash-inbox a.on strong { color: var(--accent); }
.province-hero p { margin: 0 0 1.2rem; color: rgb(255 255 255 / .78); }
.province-hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.province-hero-actions .btn-light { --bs-btn-bg: rgb(255 255 255 / .12); --bs-btn-border-color: rgb(255 255 255 / .2); --bs-btn-color: #fff; --bs-btn-hover-bg: rgb(255 255 255 / .22); --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: rgb(255 255 255 / .35); box-shadow: none; }
.province-hero-map .andalucia-map .province-shape { fill: rgb(255 255 255 / .1); stroke: rgb(255 255 255 / .4); }
.province-hero-map .andalucia-map .province-shape.selected { fill: #f2c200; stroke: #fff; }
.province-hero-map .andalucia-map .province-label { fill: rgb(255 255 255 / .7); }
.province-hero-map .andalucia-map .province-label.on { fill: #052e17; }

.month-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: .45rem; align-items: end; height: 180px; padding-top: .5rem; }
.month-chart-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: .3rem; height: 100%; }
.month-chart-bar { width: 100%; max-width: 34px; min-height: 2px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #3fae6a, var(--brand)); transition: height .4s; }
.month-chart-value { font-size: .72rem; font-weight: 700; color: var(--ink-2); min-height: 1em; }
.month-chart-label { font-size: .72rem; color: var(--muted); }
.dash-side { display: grid; gap: 0; }
.item-list .champ-pick-date { width: 36px; height: 38px; }
/* ---------- Pantallas grandes ---------- */
@media (min-width: 1800px) {
    .content { padding: 2rem 2.5rem; }
    .editor-bar { margin: -2rem -2.5rem 1.5rem; padding: .7rem 2.5rem; }
    .editor-grid { grid-template-columns: minmax(0, 1fr) 360px; gap: 1.75rem; }
    .editor-side { top: 140px; }
    .dash-grid { grid-template-columns: minmax(0, 1fr) 440px; gap: 1.5rem; }
    .crud.crud-editing { grid-template-columns: minmax(0, 1fr) 520px; }
    .kpi-grid { gap: 1.25rem; }
}
@media (min-width: 2300px) {
    .editor-grid { grid-template-columns: minmax(0, 1fr) 400px; }
    .dash-grid { grid-template-columns: minmax(0, 1fr) 500px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
    .crud.crud-editing { grid-template-columns: minmax(0, 1fr) 380px; }
    .dash-grid { grid-template-columns: minmax(0, 1fr) 320px; }
}
@media (max-width: 1100px) {
    .editor-grid, .dash-grid, .crud.crud-editing { grid-template-columns: minmax(0, 1fr); }
    .province-board, .province-hero { grid-template-columns: minmax(0, 1fr); }
    .province-board-map { position: static; }
    .editor-side, .crud-panel { position: static; max-height: none; overflow: visible; margin-right: 0; padding-right: 0; }
}
@media (max-width: 900px) {
    .sidebar { position: fixed; z-index: 40; left: 0; transform: translateX(-100%); transition: transform .2s; }
    .shell.nav-open .sidebar { transform: none; }
    .shell.nav-open .shell-overlay { display: block; position: fixed; inset: 0; z-index: 30; background: rgb(13 23 18 / .4); }
    .topbar { padding: 0 1rem; }
    .topbar-burger { display: inline-grid; }
    .content { padding: 1.25rem 1rem; }
    .editor-bar { margin: -1.25rem -1rem 1.25rem; padding: .6rem 1rem; }
    .editor-side { margin-right: 0; padding-right: 0; }
    .editor-bar-title { max-width: 60vw; }
    .editor-canvas .card-body { padding: 1.25rem; }
    .title-input { font-size: 1.5rem; }
    .ql-toolbar.ql-snow { top: 118px; }
    .picker-alt { display: none; }
    .user-menu-text { display: none; }
    .login { grid-template-columns: 1fr; }
    .login-brand { display: none; }
    .login-card-logo { display: block; width: 100%; max-width: 230px; height: auto; margin: 0 0 1.5rem; padding: .9rem 1.1rem; border-radius: 16px; background: linear-gradient(160deg, #0a5a2e, #052e17); box-sizing: content-box; }
}
@media (max-width: 760px) {
    .form-grid.cols-2, .form-grid.cols-3, .split, .split.media-first { grid-template-columns: minmax(0, 1fr); }
    .form-grid > .span-2 { grid-column: auto; }
}
@media (max-width: 600px) {
    .page-header h1 { font-size: 1.6rem; }
    .search-box { min-width: 0; width: 100%; }
    .section-head { flex-wrap: wrap; }
    .section-anchor { max-width: none; }
}

/* ---------- Editor de CSS (Ajustes) ---------- */
.css-editor { border: 1px solid #1e2d25; border-radius: 12px; background: #0d1712; box-shadow: var(--shadow); }
.css-editor.has-errors { border-color: #c4312b; box-shadow: 0 0 0 3px rgb(196 49 43 / .15); }
.css-editor-bar { display: flex; align-items: center; gap: .75rem; padding: .45rem .55rem .45rem .8rem; border-bottom: 1px solid #1e2d25; border-radius: 12px 12px 0 0; background: #13211a; }
.css-editor-lang { padding: .1rem .5rem; border-radius: 6px; background: rgb(52 210 123 / .15); color: #34d27b; font: 700 .7rem/1.4 ui-monospace, "Cascadia Code", Consolas, monospace; letter-spacing: .06em; }
.css-editor-stats { font-size: .75rem; color: #8fa398; }
.css-editor-bar .btn-light { --bs-btn-bg: #1c2c24; --bs-btn-border-color: #2a3d33; --bs-btn-color: #d7e5dc; --bs-btn-hover-bg: #24372d; --bs-btn-hover-color: #fff; --bs-btn-hover-border-color: #34513f; box-shadow: none; }
.css-editor-body { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.css-gutter, .css-area { margin: 0; padding: .8rem .6rem; font: .84rem/1.65 ui-monospace, "Cascadia Code", Consolas, monospace; }
.css-gutter { min-width: 3.2rem; overflow: hidden; text-align: right; color: #4f6359; user-select: none; border-right: 1px solid #1e2d25; background: #0b130f; border-radius: 0 0 0 12px; }
.css-area { display: block; width: 100%; min-height: 320px; resize: vertical; border: 0; outline: 0; white-space: pre; overflow: auto; tab-size: 4; color: #d7e5dc; caret-color: #34d27b; background: transparent; }
.css-area::placeholder { color: #4f6359; }
.css-area::selection { background: rgb(52 210 123 / .25); }
.css-problems { list-style: none; margin: 0; padding: .55rem .8rem; display: grid; gap: .3rem; border-top: 1px solid #1e2d25; font-size: .78rem; }
.css-problems li { display: flex; align-items: center; gap: .4rem; }
.css-problems li.error { color: #ff8a80; }
.css-problems li.warn { color: #f2c94c; }

/* ---------- Newsletter ---------- */
.subnav { display: flex; flex-wrap: wrap; gap: .35rem; margin: -.5rem 0 1.25rem; padding: .3rem; width: fit-content; max-width: 100%; border: 1px solid var(--glass-border); border-radius: 14px; background: rgb(255 255 255 / .6); box-shadow: var(--glass-shadow); }
.subnav-item { display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .85rem; border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: .86rem; font-weight: 500; transition: .12s; }
.subnav-item:hover { background: rgb(15 60 35 / .06); color: var(--ink); }
.subnav-item.active { background: #fff; color: var(--brand); box-shadow: var(--shadow-sm); font-weight: 600; }
.kpi-value-sm { font-size: 1.15rem; letter-spacing: -.01em; }
fieldset.editor-grid, fieldset.weekly-fields { margin: 0; padding: 0; border: 0; min-width: 0; }
fieldset.weekly-fields:disabled { opacity: .55; }
.code-hint { margin: 0 0 1rem; padding: .55rem .7rem; border-radius: 8px; background: #0d1712; color: #d7e5dc; font-size: .72rem; white-space: pre-wrap; word-break: break-all; }

.pick-list { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .45rem; }
.pick-list li { display: flex; align-items: center; gap: .65rem; padding: .45rem .55rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.pick-list li.featured { border-color: #b8dcc6; box-shadow: 0 0 0 3px rgb(11 122 59 / .07); }
.pick-thumb { width: 64px; height: 44px; flex: none; object-fit: cover; border-radius: 8px; background: var(--line-2); }
.pick-thumb.empty { display: grid; place-items: center; color: #9fb3a8; }
.pick-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.pick-text strong { font-size: .88rem; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-text small { font-size: .75rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pick-search { margin-bottom: .6rem; }
.pick-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .4rem; max-height: 300px; overflow-y: auto; padding: .1rem; }
.pick-option { display: flex; align-items: flex-start; gap: .5rem; padding: .5rem .6rem; border: 1px dashed #cfd9d4; border-radius: 10px; background: rgb(255 255 255 / .6); text-align: left; color: var(--brand); transition: .12s; }
.pick-option:hover { border-style: solid; border-color: var(--brand); background: var(--brand-50); }
.pick-option-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.pick-option-text strong { font-size: .82rem; font-weight: 600; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pick-option-text small { font-size: .72rem; color: var(--muted); }

.champ-picks { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: .45rem; max-height: 420px; overflow-y: auto; padding: .1rem; }
.champ-pick { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; transition: .12s; margin: 0; }
.champ-pick:hover { border-color: #b8dcc6; }
.champ-pick.on { border-color: var(--brand); background: var(--brand-50); }
.champ-pick input { accent-color: var(--brand); width: 16px; height: 16px; flex: none; }
.champ-pick-date { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 40px; height: 42px; flex: none; border-radius: 9px; background: linear-gradient(160deg, #0a5a2e, #052e17); color: #fff; line-height: 1; }
.champ-pick-date strong { font-size: 1rem; }
.champ-pick-date small { font-size: .62rem; font-weight: 700; text-transform: uppercase; color: #f2c200; margin-top: .1rem; }

.send-audience { display: flex; align-items: center; gap: .45rem; margin: 0 0 1rem; font-size: .9rem; color: var(--ink-2); }
.send-audience .icon { color: var(--brand); }
.send-summary .card-body { display: flex; align-items: center; gap: 1.1rem; }
.send-summary h2 { font-size: 1.15rem; font-weight: 700; margin: 0 0 .25rem; }
.send-summary-icon { display: grid; place-items: center; width: 54px; height: 54px; flex: none; border-radius: 16px; background: #e8f0fe; color: #1a56c4; }
.send-summary-icon.done { background: #e5f5ec; color: #16a34a; }
.send-progress { height: 8px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.send-progress span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #0b7a3b, #3fae6a); transition: width .4s; }

/* ---------- Récords ---------- */
.record-mark { font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 700; color: var(--ink); white-space: nowrap; }
.record-mark small { font-weight: 500; color: var(--muted); margin-left: .15rem; }
.count-chip.warn { background: #fff1c7; color: #8a5a00; margin-left: .2rem; }

.notice-list { list-style: none; margin: 0; padding: 0; }
.notice-list > li { padding: .95rem 1.1rem; border-bottom: 1px solid var(--line-2); }
.notice-list > li:last-child { border-bottom: 0; }
.notice-list > li.open { background: rgb(242 194 0 / .06); }
.notice-head { display: flex; align-items: flex-start; gap: 1rem; }
.notice-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: .15rem; }
.notice-main strong { font-size: .95rem; color: var(--ink); }
.notice-main span { font-size: .87rem; color: var(--ink-2); }
.notice-main small { font-size: .77rem; color: var(--muted); }
.notice-notes { margin: .4rem 0 0; padding: .45rem .7rem; border-left: 3px solid var(--line); background: rgb(255 255 255 / .6); font-size: .83rem; color: var(--ink-2); white-space: pre-line; }
.notice-actions { display: flex; align-items: center; gap: .35rem; flex: none; }
.notice-form { margin-top: .9rem; padding: 1rem; border: 1px solid var(--glass-line); border-radius: 14px; background: #fff; }
@media (max-width: 720px) { .notice-head { flex-wrap: wrap; } .notice-actions { width: 100%; } }

/* ---------- Campeonato de una noticia y ubicación ---------- */
.champ-field-selected { display: flex; align-items: center; gap: .6rem; padding: .45rem .5rem .45rem .45rem; border: 1px solid var(--brand); border-radius: 12px; background: var(--brand-50); }
.champ-field-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.champ-field-text strong { font-size: .82rem; font-weight: 600; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.champ-field-text small { font-size: .72rem; color: var(--muted); }
.champ-field-search { display: flex; align-items: center; gap: .45rem; padding: .35rem .65rem; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--muted); margin: 0; }
.champ-field-search input { border: 0; outline: 0; flex: 1; min-width: 0; font-size: .85rem; background: transparent; }
.champ-field-search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgb(11 122 59 / .12); }
.champ-field-results { list-style: none; margin: .35rem 0 0; padding: .25rem; max-height: 280px; overflow-y: auto; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.champ-field-results button { display: flex; align-items: center; gap: .55rem; width: 100%; padding: .35rem; border: 0; border-radius: 9px; background: none; text-align: left; }
.champ-field-results button:hover { background: var(--brand-50); }
.champ-field-hint { padding: .2rem .4rem; font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.champ-field .champ-pick-date { width: 36px; height: 38px; }
.linked-list { list-style: none; margin: 0; padding: 0; }
.linked-list li { display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; border-bottom: 1px solid var(--line-2); }
.linked-list li:last-child { border-bottom: 0; }
.linked-list a { flex: 1; min-width: 0; font-weight: 500; color: var(--ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.linked-list a:hover { color: var(--brand); }
.linked-list small { color: var(--muted); white-space: nowrap; }

/* ---------- Atletas ---------- */
.thumb-round { border-radius: 50%; }
.medal-counts { display: inline-flex; gap: .3rem; }
.medal-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; padding: 0 .35rem; border-radius: 999px; font-size: .75rem; font-weight: 700; color: #3b2a00; box-shadow: inset 0 -2px 0 rgb(0 0 0 / .12); }
.medal-gold { background: linear-gradient(160deg, #ffe27a, #e0a800); }
.medal-silver { background: linear-gradient(160deg, #f1f3f5, #aab3bb); color: #2c3338; }
.medal-bronze { background: linear-gradient(160deg, #f0c39a, #b8743d); color: #3a1f08; }
.card-header .medal-counts { margin-left: .25rem; }

.rows-editor { display: grid; gap: .4rem; }
.rows-head, .rows-line { display: grid; gap: .4rem; align-items: center; }
.rows-head span { font-size: .76rem; font-weight: 600; color: var(--muted); }
.rows-editor.achievements .rows-head, .rows-editor.achievements .rows-line { grid-template-columns: 52px 76px minmax(160px, 2fr) minmax(80px, 1fr) 64px 118px 84px minmax(80px, 1fr) 32px; }
.rows-editor.bests .rows-head, .rows-editor.bests .rows-line { grid-template-columns: 52px minmax(90px, 1fr) 96px 76px minmax(90px, 1fr) minmax(110px, 1.2fr) 32px; }
.rows-editor { overflow-x: auto; }
.row-move { display: flex; gap: 2px; }
.row-move .icon-btn { width: 24px; height: 24px; }
.medal-select.medal-gold, .medal-select.medal-silver, .medal-select.medal-bronze { font-weight: 600; }

.gallery-editor { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.gallery-editor figure { margin: 0; display: grid; gap: .35rem; }
.gallery-editor img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.gallery-editor-tools { display: flex; justify-content: space-between; }

.social-fields { display: grid; gap: .45rem; }
.social-field { display: flex; align-items: center; gap: .5rem; margin: 0; color: var(--muted); }
.social-field .icon { flex: none; }

/* ---------- Bloques HTML dentro del editor visual (galerías, tablas…) ---------- */
.ql-editor .ql-html-block { position: relative; margin: .9rem 0; border: 1px dashed #b9cfc2; border-radius: 12px; background: #f7faf8; cursor: default; user-select: none; }
.ql-editor .ql-html-block:hover { border-color: var(--brand); }
.ql-html-block-bar { display: flex; align-items: center; gap: .4rem; padding: .35rem .5rem .35rem .75rem; border-bottom: 1px dashed #d5e2da; font: 600 .72rem/1.2 var(--body, system-ui); letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.ql-html-block-bar span { margin-right: auto; }
.ql-html-block-bar button { padding: .2rem .55rem; border: 1px solid var(--line); border-radius: 7px; background: #fff; font: 600 .72rem/1.2 var(--body, system-ui); text-transform: none; letter-spacing: 0; color: var(--ink-2); cursor: pointer; }
.ql-html-block-bar button:hover { border-color: var(--brand); color: var(--brand); }
.ql-html-block-bar button[data-act="remove"]:hover { border-color: var(--danger); color: var(--danger); }
.ql-html-block-preview { padding: .75rem; max-height: 420px; overflow: auto; pointer-events: none; white-space: normal; }
.ql-html-block-preview > :first-child { margin-top: 0; }
.ql-html-block-preview img { max-width: 100%; height: auto; border-radius: 6px; }
.ql-html-block-preview .gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .4rem; }
.ql-html-block-preview .gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.ql-html-block-preview table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.ql-html-block-preview th, .ql-html-block-preview td { padding: .3rem .5rem; border: 1px solid var(--line); text-align: left; }
.ql-html-block-preview iframe, .ql-html-block-preview video { max-width: 100%; }
.ql-snow .ql-toolbar button.ql-htmlblock { width: 30px; }

.html-block-dialog { position: fixed; inset: 0; z-index: 1300; display: grid; place-items: center; padding: 1rem; background: rgb(6 30 16 / .45); backdrop-filter: blur(3px); }
.html-block-dialog-box { display: grid; gap: .6rem; width: min(820px, 100%); padding: 1.25rem; border-radius: 18px; background: #fff; box-shadow: 0 30px 80px -20px rgb(0 0 0 / .45); }
.html-block-dialog-box h3 { margin: 0; font-size: 1.1rem; font-weight: 700; }
.html-block-dialog-box p { margin: 0; font-size: .85rem; color: var(--muted); }
.html-block-dialog-box textarea { min-height: 320px; resize: vertical; }
.html-block-dialog-actions { display: flex; align-items: center; gap: .5rem; }
.html-block-dialog-actions span { margin-right: auto; }

/* ---------- Junta Directiva y órganos ---------- */
.body-list { display: grid; gap: .6rem; }
.body-card { display: flex; flex-direction: row; align-items: center; gap: .75rem; padding: .7rem 1rem; }
.body-card.is-hidden { opacity: .6; }
.body-card-main { display: flex; align-items: center; gap: .85rem; flex: 1; min-width: 0; color: inherit; text-decoration: none; }
.body-card-main:hover strong { color: var(--brand); }
.body-card-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 12px; background: var(--brand-50); color: var(--brand); }
.body-card-icon.kind-board { background: linear-gradient(160deg, #0a5a2e, #052e17); color: #f2c200; }
.body-card-text { display: flex; flex-direction: column; min-width: 0; }
.body-card-text strong { font-size: .95rem; }
.body-card-text small { color: var(--muted); font-size: .78rem; }
.body-card-faces { display: flex; margin-left: auto; padding-left: .5rem; }
.body-card-faces > * { width: 30px; height: 30px; margin-left: -8px; border-radius: 50%; border: 2px solid #fff; object-fit: cover; display: grid; place-items: center; font-size: .66rem; font-weight: 700; color: #fff; background: var(--c, #94a39b); }
.body-card-faces .more { background: var(--line-2); color: var(--ink-2); }

.member-list { display: grid; gap: 1rem; }
.member-group { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.member-group-head { display: flex; align-items: center; gap: .5rem; padding: .5rem .75rem; background: var(--brand-50); }
.member-group-head strong { font-size: .85rem; }
.member-group-head > span { font-size: .72rem; font-weight: 700; color: var(--muted); }
.member-row { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; align-items: center; gap: .6rem; padding: .55rem .75rem; border-top: 1px solid var(--line-2); }
.member-row.is-lead { background: rgb(242 194 0 / .08); }
.member-photo { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; overflow: hidden; cursor: pointer; background: none; flex: none; }
.member-photo img { width: 100%; height: 100%; object-fit: cover; }
.member-photo span { display: grid; place-items: center; width: 100%; height: 100%; font-size: .8rem; font-weight: 700; color: #fff; background: var(--c, #94a39b); }
.member-photo:hover { box-shadow: 0 0 0 3px rgb(11 122 59 / .25); }
.member-fields { display: grid; grid-template-columns: minmax(150px, 1.3fr) minmax(150px, 1.4fr) minmax(110px, 1fr) minmax(130px, 1fr) minmax(110px, .9fr); gap: .35rem; }
.member-fields .member-name { font-weight: 600; }
.member-actions { display: flex; gap: .2rem; }
@media (max-width: 1600px) { .member-fields { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1200px) { .member-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Bandeja: mensajes de contacto ---------- */
.nav-badge { margin-left: auto; display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 .4rem; border-radius: 999px; background: #f2c200; color: #1b1500; font-size: .7rem; font-weight: 800; }
.inbox { overflow: hidden; }
.inbox-split { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); min-height: 520px; }
.inbox-list { list-style: none; margin: 0; padding: 0; border-right: 1px solid var(--line-2); max-height: 72vh; overflow-y: auto; }
.inbox-list li { display: flex; gap: .7rem; padding: .8rem 1rem; border-bottom: 1px solid var(--line-2); cursor: pointer; transition: background .12s; }
.inbox-list li:hover { background: #f6faf7; }
.inbox-list li.on { background: var(--brand-50); box-shadow: inset 3px 0 0 var(--brand); }
.inbox-list li.unread .inbox-item-head strong, .inbox-list li.unread .inbox-item-subject { font-weight: 700; color: var(--ink); }
.inbox-avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--c, #94a39b); color: #fff; font-size: .75rem; font-weight: 700; }
.inbox-avatar.big { width: 46px; height: 46px; font-size: .9rem; }
.inbox-item { display: flex; flex-direction: column; gap: .15rem; min-width: 0; flex: 1; }
.inbox-item-head { display: flex; align-items: baseline; gap: .5rem; }
.inbox-item-head strong { font-weight: 600; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-item-head time { margin-left: auto; font-size: .72rem; color: var(--muted); white-space: nowrap; }
.inbox-item-subject { font-size: .83rem; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.inbox-item-meta { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .15rem; }
.inbox-item-meta .status { font-size: .66rem; padding: .1rem .45rem .1rem .35rem; }
.inbox-detail { padding: 1.25rem 1.5rem; min-width: 0; }
.inbox-empty { display: grid; place-items: center; gap: .5rem; height: 100%; min-height: 300px; color: var(--muted); text-align: center; }
.inbox-detail-head h2 { margin: 0 0 .9rem; font-size: 1.25rem; font-weight: 700; }
.inbox-from { display: flex; flex-wrap: wrap; align-items: center; gap: .3rem 1rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line-2); }
.inbox-from > div:nth-child(2) { display: flex; flex-direction: column; font-size: .88rem; }
.inbox-from-meta { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: .1rem; font-size: .78rem; color: var(--muted); }
.inbox-body { margin: 1.1rem 0; padding: 1rem 1.2rem; border-radius: 12px; background: #f7faf8; border: 1px solid var(--line-2); white-space: pre-wrap; line-height: 1.6; font-size: .93rem; }
.inbox-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.inbox-notes { margin-top: 1.25rem; padding-top: 1rem; border-top: 1px dashed var(--line); }
@media (max-width: 900px) { .inbox-split { grid-template-columns: 1fr; } .inbox-list { max-height: 320px; border-right: 0; border-bottom: 1px solid var(--line-2); } }

.partner-thumb { display: inline-grid; place-items: center; width: 130px; height: 54px; padding: .35rem .6rem; border-radius: 10px; background: #fff; border: 1px solid var(--line); }
.partner-thumb.dark { background: #0d6a37; border-color: transparent; }
.partner-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.partner-thumb.big { display: grid; width: 220px; height: 90px; }

/* ---------- Bloques de portada: tipo de bloque ---------- */
.kind-picker { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
.kind-picker button { display: flex; align-items: flex-start; gap: .75rem; padding: .85rem .95rem; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .12s, box-shadow .12s, background .12s; }
.kind-picker button:hover { border-color: #b8dcc6; }
.kind-picker button.on { border-color: var(--brand); background: var(--brand-50); box-shadow: 0 0 0 3px rgb(11 122 59 / .1); }
.kind-picker-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 10px; background: var(--line-2); color: var(--muted); }
.kind-picker button.on .kind-picker-icon { background: var(--brand); color: #fff; }
.kind-picker-text { display: flex; flex-direction: column; gap: .15rem; line-height: 1.3; }
.kind-picker-text strong { font-size: .92rem; font-weight: 600; color: var(--ink); }
.kind-picker-text small { font-size: .78rem; color: var(--muted); }
@media (max-width: 760px) { .kind-picker { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Listas editables ---------- */
.lists-layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.lists-nav { position: sticky; top: 76px; padding: .6rem; }
.lists-nav-group + .lists-nav-group { margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--line-2); }
.lists-nav-area { display: block; padding: .2rem .6rem .35rem; font-size: .76rem; font-weight: 600; color: var(--muted); }
.lists-nav-item { display: flex; align-items: center; gap: .5rem; padding: .45rem .6rem; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-size: .88rem; font-weight: 500; }
.lists-nav-item span:first-child { flex: 1; }
.lists-nav-item:hover { background: var(--line-2); color: var(--ink); }
.lists-nav-item.on { background: var(--brand-50); color: var(--brand-700); box-shadow: inset 3px 0 0 var(--brand); }
.lists-editor-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.lists-editor-title small { font-size: .8rem; font-weight: 400; color: var(--muted); }
.lists-add { display: flex; gap: .5rem; padding: .9rem 1rem; border-bottom: 1px solid var(--line-2); background: #fbfcfb; }
.lists-items { list-style: none; margin: 0; padding: .35rem 0; }
.lists-items li { display: grid; grid-template-columns: auto minmax(0, 1fr) 110px auto auto; align-items: center; gap: .65rem; padding: .3rem 1rem; }
.lists-items li:hover { background: #f8faf9; }
.lists-items li.is-hidden .lists-item-name { color: var(--muted); text-decoration: line-through; text-decoration-color: rgb(107 120 113 / .4); }
.lists-item-name { font-weight: 500; }
.lists-item-usage { font-size: .78rem; text-align: right; white-space: nowrap; }
.lists-items .form-check { display: flex; align-items: center; gap: .4rem; padding-left: 0; }
.lists-items .form-check .form-check-input { margin: 0; float: none; }
@media (max-width: 900px) {
    .lists-layout { grid-template-columns: minmax(0, 1fr); }
    .lists-nav { position: static; }
    .lists-items li { grid-template-columns: auto minmax(0, 1fr) auto; }
    .lists-item-usage, .lists-items .form-check-label { display: none; }
}

/* ---------- «Editar lista» junto a la etiqueta de un campo ---------- */
.list-link { display: inline-flex; align-items: center; gap: .25rem; margin-left: auto; padding: .05rem .4rem; border-radius: 6px; font-size: .74rem; font-weight: 500; color: var(--muted); text-decoration: none; white-space: nowrap; }
.list-link:hover { color: var(--brand); background: var(--brand-50); }
.form-label:has(.list-link) { display: flex; align-items: baseline; }

/* ---------- Mapa para fijar la ubicación ---------- */
.location-picker-map { height: 260px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #eef2f0; cursor: crosshair; }
.location-picker-map .leaflet-tile-pane { filter: saturate(.8) contrast(.97); }
.location-picker-hint { display: flex; align-items: center; gap: .35rem; margin-top: .4rem; font-size: .76rem; color: var(--muted); }
.faa-pin span { position: absolute; left: 50%; top: 0; width: 30px; height: 30px; margin-left: -15px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: linear-gradient(160deg, #13914a, #052e17); border: 3px solid #fff; box-shadow: 0 6px 14px -4px rgb(3 32 15 / .6); cursor: grab; }
.faa-pin span::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: var(--accent); }
.leaflet-container { font-family: var(--bs-body-font-family); }

/* ---------- Enlaces y documentos: zona de subida ---------- */
.links-drop { padding: 1.2rem 1rem; }
.links-drop small { max-width: 60ch; font-size: .76rem; color: var(--muted); }
.links-drop kbd { font-size: .66rem; }

/* ---------- Recorte de imágenes ---------- */
.crop-dialog {
    position: fixed; z-index: 1095; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(760px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem);
    display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto auto; overflow: hidden; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); animation: pop .18s;
}
.crop-head { display: flex; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.25rem .8rem; }
.crop-head h2 { margin: 0; font-family: var(--display); font-size: 1.45rem; font-weight: 700; }
.crop-head p { margin: .2rem 0 0; font-size: .85rem; color: var(--muted); }
.crop-head .icon-btn { margin-left: auto; }
.crop-stage { position: relative; height: min(460px, 58vh); overflow: hidden; background: #0d1712; touch-action: none; cursor: grab; user-select: none; }
.crop-stage.dragging { cursor: grabbing; }
.crop-image { position: absolute; left: 0; top: 0; max-width: none; height: auto; transform-origin: 0 0; pointer-events: none; }
.crop-frame { position: absolute; border: 2px solid #fff; border-radius: 4px; box-shadow: 0 0 0 9999px rgb(5 14 9 / .62); pointer-events: none;
    background-image: linear-gradient(rgb(255 255 255 / .35) 1px, transparent 1px), linear-gradient(90deg, rgb(255 255 255 / .35) 1px, transparent 1px);
    background-size: 33.333% 33.333%; background-position: -1px -1px; }
.crop-tools { display: flex; align-items: center; gap: .75rem; padding: .8rem 1.25rem 0; color: var(--muted); }
.crop-tools input[type=range] { flex: 1; accent-color: var(--brand); }
.crop-foot { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .9rem 1.25rem 1.1rem; }

/* ---------- Atleta: datos de World Athletics ---------- */
.wa-load { display: flex; gap: .5rem; }
.wa-load .btn { white-space: nowrap; }
.wa-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; margin: 1rem 0 .85rem; }
.wa-summary > div { padding: .65rem .8rem; border: 1px solid var(--line-2); border-radius: 12px; background: #fafcfb; }
.wa-summary dt { font-size: .74rem; font-weight: 600; color: var(--muted); }
.wa-summary dd { display: flex; flex-direction: column; margin: .15rem 0 0; font-family: var(--display); font-size: 1.55rem; font-weight: 700; line-height: 1.05; color: var(--ink); }
.wa-summary dd small { font-family: var(--bs-body-font-family); font-size: .74rem; font-weight: 500; color: var(--muted); }
.wa-actions { display: flex; flex-wrap: wrap; gap: .4rem; }
@media (max-width: 760px) { .wa-load { flex-direction: column; } }

/* ---------- Atletas de una noticia o un campeonato ---------- */
.athlete-face { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; object-fit: cover; background: var(--c, #94a39b); color: #fff; font-size: .72rem; font-weight: 700; }
.athlete-chips { list-style: none; margin: 0 0 .6rem; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .45rem; }
.athlete-chip { display: flex; align-items: center; gap: .55rem; padding: .4rem .4rem .4rem .45rem; border: 1px solid var(--brand); border-radius: 12px; background: var(--brand-50); }
.athlete-chip.is-draft { border-color: #f1d28a; background: #fffaeb; }
.athlete-chip-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.25; }
.athlete-chip-text strong { font-size: .84rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.athlete-chip-text small { font-size: .72rem; color: var(--muted); }
.athlete-suggest { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-bottom: .6rem; font-size: .8rem; color: var(--muted); }
.athlete-suggest button { display: inline-flex; align-items: center; gap: .25rem; padding: .2rem .6rem; border: 1px dashed #b8dcc6; border-radius: 999px; background: #fff; color: var(--brand-700); font-size: .8rem; font-weight: 500; }
.athlete-suggest button:hover { border-style: solid; background: var(--brand-50); }
.athletes-field .champ-field-results button { align-items: center; }
.linked-list li > .icon { flex: none; color: var(--muted); }
