/* ==========================================================================
   ev.conecta2nic.com — panel de administración
   ========================================================================== */

@font-face {
    font-family: 'Outfit';
    font-style: normal;
    font-weight: 300 700;
    font-display: swap;
    src: url('../fonts/outfit-latin.woff2') format('woff2');
}

:root {
    /* Marca EV.conecta2nic.com (marino → azul → cian). El cian claro es solo decorativo. */
    --brand-navy: #0A2353;
    --brand-blue: #1B5FAF;
    --brand-blue-ink: #144A8C;
    --brand-cyan: #19A7DB;
    --brand-cyan-ink: #0B7AA8;
    --brand-orange: #AD4D0A;
    --brand-ink: #0A1A33;
    --brand-gradient: linear-gradient(90deg, var(--brand-navy), var(--brand-blue) 55%, var(--brand-cyan));
    --sidebar-bg: #0A2353;
    --sidebar-active: #13305F;
    --sidebar-text: #B8C7DE;
    --bg: #F3F6FA;
    --surface: #FFFFFF;
    --text: #0A1A33;
    --muted: #5A6B85;
    --line: #DDE4EE;
    --on-primary: #FFFFFF;
    --tint-blue: #E8F0FA;
    --tint-orange: #FFF1E8;
    --tint-green: #E7F7EE;
    --primary: var(--brand-blue);
    --primary-hover: var(--brand-blue-ink);
    --sidebar-w: 256px;
    --ease-out: cubic-bezier(.22, 1, .36, 1);

    --bs-body-font-family: 'Outfit', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-border-color: var(--line);
    --bs-primary: #1B5FAF;
    --bs-primary-rgb: 27, 95, 175;
    --bs-link-color-rgb: 27, 95, 175;
    --bs-border-radius: 10px;
}

[data-bs-theme="dark"] {
    --primary: #4FB8F0;
    --primary-hover: #7CC8F2;
    --on-primary: #081326;
    --sidebar-bg: #06101F;
    --sidebar-active: #102A50;
    --bg: #081326;
    --surface: #0F2140;
    --text: #E6EDF7;
    --muted: #9DB0CC;
    --line: #1E3358;
    --tint-blue: rgb(79 184 240 / .14);
    --tint-orange: rgb(255 122 46 / .15);
    --tint-green: rgb(18 161 80 / .18);
    --bs-body-bg: var(--bg);
    --bs-body-color: var(--text);
    --bs-border-color: var(--line);
    --bs-link-color-rgb: 79, 184, 240;
    --bs-table-bg: transparent;
}

body { background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { letter-spacing: -.02em; font-weight: 700; }
a { text-underline-offset: .2em; }
.min-w-0 { min-width: 0; }

.skip-link { position: fixed; left: 12px; top: -60px; z-index: 2000; background: var(--brand-ink); color: #fff; padding: 8px 14px; border-radius: 8px; }
.skip-link:focus { top: 12px; }

.btn { font-weight: 600; border-radius: 999px; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-color: var(--on-primary); --bs-btn-hover-bg: var(--primary-hover); --bs-btn-hover-border-color: var(--primary-hover); --bs-btn-hover-color: var(--on-primary); --bs-btn-active-bg: var(--primary-hover); --bs-btn-active-color: var(--on-primary); --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary); --bs-btn-disabled-color: var(--on-primary); }
[data-bs-theme="dark"] .btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); --bs-btn-hover-color: var(--on-primary); }
.btn-icon { width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; border: 1.5px solid var(--line); background: var(--surface); color: var(--text); }
.btn-icon:hover { border-color: var(--text); }
.theme-toggle .icon-light { display: none; }
[data-bs-theme="dark"] .theme-toggle .icon-light { display: inline; }
[data-bs-theme="dark"] .theme-toggle .icon-dark { display: none; }

.form-control, .form-select { border-radius: 10px; border-width: 1.5px; }
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 15%, transparent); }

.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; }
.brand:hover { color: #fff; }
.brand-svg { display: inline-block; height: auto; flex-shrink: 0; }
.brand-logo { width: 44px; }
.brand-word { display: flex; flex-direction: column; line-height: 1.05; font-size: 1.15rem; letter-spacing: -.02em; font-weight: 400; }
.brand-word strong { font-weight: 800; letter-spacing: -.04em; }
.brand-word small { font-size: .72rem; color: var(--sidebar-text); letter-spacing: .02em; margin-top: 3px; }

/* ---------- Sidebar ---------- */
.sidebar {
    background: var(--sidebar-bg); color: var(--sidebar-text); display: flex; flex-direction: column;
}
/* offcanvas-lg de Bootstrap deja el fondo transparente en escritorio */
.sidebar.offcanvas-lg { background-color: var(--sidebar-bg) !important; }
.sidebar::before { content: ''; display: block; height: 3px; background: var(--brand-gradient); flex-shrink: 0; }
@media (min-width: 992px) {
    .sidebar { position: fixed !important; inset: 0 auto 0 0; width: var(--sidebar-w); height: 100vh; z-index: 1030; }
    .admin-body { margin-left: var(--sidebar-w); }
}
@media (max-width: 991.98px) { .sidebar { --bs-offcanvas-width: 280px; --bs-offcanvas-bg: var(--sidebar-bg); } }
.sidebar-head { display: flex; align-items: center; justify-content: space-between; padding: 22px 22px 18px; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; flex-grow: 1; overflow-y: auto; }
.sidebar-nav a, .sidebar-foot a, .sidebar-foot button {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px;
    color: var(--sidebar-text); text-decoration: none; font-weight: 500; font-size: .975rem; border: 0; background: none; width: 100%; text-align: left;
    transition: background-color .2s, color .2s;
}
.sidebar-nav a:hover, .sidebar-foot a:hover, .sidebar-foot button:hover { background: rgb(255 255 255 / .06); color: #fff; }
.sidebar-nav a.active, .sidebar-foot a.active { background: var(--sidebar-active); color: #fff; box-shadow: inset 3px 0 0 var(--brand-cyan); }
.sidebar-nav i, .sidebar-foot i { font-size: 1.1rem; width: 20px; text-align: center; }
.badge-count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--brand-orange); color: #fff; font-size: .75rem; font-weight: 700; display: inline-grid; place-items: center; }
.badge-count.is-bump { animation: bump .5s cubic-bezier(.34, 1.56, .64, 1); }
@keyframes bump { 50% { transform: scale(1.35); } }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--sidebar-active); }
.sidebar-foot span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Topbar y contenido ---------- */
.topbar { position: sticky; top: 0; z-index: 1020; display: flex; align-items: center; gap: 12px; padding: 16px clamp(16px, 3vw, 32px); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar-title { font-size: 1.375rem; margin: 0; flex-grow: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }
.admin-main { padding: clamp(16px, 3vw, 32px); max-width: 1400px; }
.admin-main:focus { outline: none; }
.lead-hello { font-size: 1.125rem; color: var(--muted); margin-bottom: 20px; }
.lead-hello strong { color: var(--text); }
.page-help { color: var(--muted); font-size: .95rem; margin-bottom: 16px; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 24px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-head h2, .panel-title { font-size: 1.0625rem; margin: 0 0 14px; }
.panel-head h2 { margin: 0; }
.panel-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; }

/* KPIs */
.kpi { position: relative; display: block; height: 100%; padding: 20px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: transform .2s var(--ease-out), box-shadow .2s; }
.kpi-link:hover { transform: translateY(-3px); box-shadow: 0 12px 26px -16px rgb(10 35 83 / .35); color: var(--text); }
.kpi-label { display: block; color: var(--muted); font-size: .9rem; margin-bottom: 6px; }
.kpi-value { display: block; font-size: 2rem; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; }
.kpi-value-sm { font-size: 1.15rem; padding-top: 8px; }
.kpi-icon { position: absolute; right: 16px; top: 16px; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.tone-blue { background: var(--tint-blue); color: var(--primary); }
.tone-orange { background: var(--tint-cyan); color: var(--brand-cyan-ink); }
.tone-ink { background: rgb(10 35 83 / .07); color: var(--text); }
.tone-green { background: var(--tint-green); color: var(--ok); }
[data-bs-theme="dark"] .tone-ink { background: rgb(255 255 255 / .08); }

/* Gráfico */
.chart-svg { width: 100%; height: 180px; display: block; }
.bar { fill: var(--primary); transform-box: fill-box; transform-origin: bottom; animation: grow .7s var(--ease-out) both; }
.bar:hover { fill: var(--brand-orange); }
.bar-zero { fill: var(--line); }
.bar:nth-child(2n) { animation-delay: .04s; }
.bar:nth-child(3n) { animation-delay: .08s; }
@keyframes grow { from { transform: scaleY(0); } }
.chart-labels { display: grid; grid-template-columns: repeat(14, 1fr); text-align: center; color: var(--muted); font-size: .75rem; margin-top: 6px; }
.interest-list li { margin-bottom: 14px; font-size: .95rem; }
.interest-list progress { width: 100%; height: 8px; border: 0; border-radius: 99px; overflow: hidden; background: var(--line); appearance: none; margin-top: 4px; }
.interest-list progress::-webkit-progress-bar { background: var(--line); }
.interest-list progress::-webkit-progress-value { background: var(--brand-orange); border-radius: 99px; }
.interest-list progress::-moz-progress-bar { background: var(--brand-orange); }

/* Lista de mensajes */
.msg-list { margin: 0 -12px; }
.msg-row { display: flex; align-items: center; gap: 14px; padding: 12px; border-radius: 12px; color: var(--text); text-decoration: none; transition: background-color .15s; }
.msg-row:hover { background: var(--bg); color: var(--text); }
.msg-row.is-new strong::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: var(--brand-orange); vertical-align: middle; }
.msg-avatar { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--tint-blue); color: var(--primary); font-weight: 700; flex-shrink: 0; }
.msg-avatar-lg { width: 52px; height: 52px; font-size: 1.3rem; }
.msg-main { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; }
.msg-main span { color: var(--muted); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-size: .8rem; color: var(--muted); }

.status { display: inline-block; padding: .2rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 600; white-space: nowrap; }
.status-new { background: var(--tint-blue); color: var(--primary); }
.status-pending { background: var(--tint-orange); color: var(--brand-orange); }
.status-replied { background: var(--tint-green); color: var(--ok); }
.status-archived { background: rgb(90 100 120 / .12); color: var(--muted); }

.pill-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.pill-tabs a { padding: .4rem .9rem; border-radius: 999px; border: 1.5px solid var(--line); color: var(--text); text-decoration: none; font-weight: 600; font-size: .9rem; transition: background-color .15s, color .15s; }
.pill-tabs a span { color: var(--muted); font-weight: 500; margin-left: 2px; }
.pill-tabs a.active { background: var(--brand-navy); border-color: var(--brand-navy); color: #fff; }
.pill-tabs a.active span { color: #B8C7DE; }
[data-bs-theme="dark"] .pill-tabs a.active { background: var(--primary); border-color: var(--primary); }
.search { position: relative; min-width: min(280px, 100%); }
.search i { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 34px; border-radius: 999px; }

.msg-table { --bs-table-bg: transparent; }
.msg-table thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; background: var(--bg); border-bottom: 1px solid var(--line); padding: 10px 12px; }
.msg-table td { padding: 12px; border-color: var(--line); }
.msg-table tbody tr { cursor: pointer; }
.msg-table tr.is-new .msg-sender strong::after { content: ''; display: inline-block; width: 7px; height: 7px; margin-left: 8px; border-radius: 50%; background: var(--brand-orange); vertical-align: middle; }
.msg-sender { display: flex; flex-direction: column; color: var(--text); text-decoration: none; }
.msg-sender span, .msg-snippet { color: var(--muted); font-size: .875rem; }
.msg-subject { display: block; font-weight: 500; }
.col-check { width: 44px; }
.bulk-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 10px 20px; background: var(--tint-blue); font-size: .9rem; font-weight: 600; }

.msg-head { display: flex; align-items: center; gap: 16px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.msg-body { padding: 22px 0; font-size: 1.0625rem; line-height: 1.7; white-space: normal; word-wrap: break-word; }
.msg-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 18px; border-top: 1px solid var(--line); }
.data-list { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; margin: 0; font-size: .95rem; }
.data-list dt { color: var(--muted); font-weight: 500; }
.data-list dd { margin: 0; word-break: break-word; }

/* Formularios del panel */
.form-panel { max-width: 1040px; }
.form-group-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; margin: 12px 0 0; padding-top: 12px; border-top: 1px dashed var(--line); }
.form-panel .row > .col-12:first-child .form-group-title { border-top: 0; padding-top: 0; margin-top: 0; }
.form-actions { display: flex; gap: 8px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.notice { background: var(--tint-orange); color: var(--text); padding: 12px 16px; border-radius: 12px; font-size: .925rem; margin: 0; }
.segmented { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: .45rem .9rem; border-radius: 999px; border: 1.5px solid var(--line); cursor: pointer; font-weight: 600; font-size: .9rem; color: var(--text); text-decoration: none; user-select: none; transition: background-color .15s, border-color .15s; }
.chip small { color: var(--muted); font-weight: 400; }
.chip .chip-on { display: none; }
.btn-check:checked + .chip { background: var(--tint-blue); border-color: var(--primary); }
.btn-check:checked + .chip .chip-on { display: inline; color: var(--primary); }
.btn-check:focus-visible + .chip { outline: 3px solid color-mix(in srgb, var(--primary) 40%, transparent); outline-offset: 2px; }
.chip-add { border-style: dashed; color: var(--muted); }
.mail-log { margin: 0; }
.mail-log li { display: flex; gap: 12px; padding: 12px 24px; border-top: 1px solid var(--line); }
.mail-log i { font-size: 1.1rem; margin-top: 2px; }

.thumb-logo { height: 32px; width: auto; max-width: 110px; object-fit: contain; }
.thumb-logo-lg { height: 64px; width: auto; max-width: 220px; object-fit: contain; background: var(--bg); border-radius: 10px; padding: 8px; }
.thumb-logo.is-dark, .thumb-logo-lg.is-dark { background: #081326; border-radius: 6px; padding: 4px; }
.thumb-logo-lg.is-dark { border-radius: 10px; padding: 8px; }
.upload-box { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.col-drag { width: 40px; }
.drag-handle { border: 0; background: none; color: var(--muted); cursor: grab; padding: 4px; }
tr.is-dragging { opacity: .4; }
tr.drag-over td { box-shadow: inset 0 2px 0 var(--primary); }

.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-logo { width: 72px; margin-bottom: 14px; }
.empty-state p { max-width: 420px; margin: 0 auto 16px; }

/* Toasts */
.toast { border-radius: 14px; box-shadow: 0 16px 40px -16px rgb(10 35 83 / .45); background: var(--brand-navy); color: #fff; }
.toast .btn-close { filter: invert(1) grayscale(1) brightness(2); }
.toast-success .bi { color: #4ADE80; }
.toast-danger { background: #B42318; }
.toast-warning .bi { color: #FDBA74; }

/* ---------- Login ---------- */
.admin-guest { min-height: 100vh; display: grid; place-items: center; background: var(--bg); }
.auth-wrap { width: min(420px, calc(100% - 32px)); padding: 40px 0; }
.auth-card { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 36px 32px; box-shadow: 0 30px 60px -30px rgb(10 35 83 / .35); animation: rise .6s var(--ease-out) both; }
.auth-logo { width: 84px; }
.auth-card { position: relative; overflow: hidden; }
.auth-card::before { content: ''; position: absolute; inset: 0 0 auto; height: 4px; background: var(--brand-gradient); }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.auth-brand .wordmark-name { font-size: 1.25rem; letter-spacing: -.02em; color: var(--text); }
.auth-brand .wordmark-name strong { font-weight: 800; }
.auth-foot { text-align: center; margin-top: 20px; font-size: .9rem; }
.auth-foot a { color: var(--muted); text-decoration: none; }
@keyframes rise { from { opacity: 0; transform: translateY(16px); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ==========================================================================
   Evaluaciones: roles, accesos, auditoría, cola y pantalla del jurado
   ========================================================================== */
:root { --tint-red: #FDECEC; --tint-violet: #EEEAFB; --tint-cyan: #E3F4FB; --ok: #12804A; --danger: #C0352B; --violet: #5B3FD1; }
[data-bs-theme="dark"] { --tint-red: rgb(240 82 82 / .16); --tint-violet: rgb(150 120 255 / .16); --tint-cyan: rgb(79 184 240 / .14); --ok: #3FD47F; --danger: #FF7A70; --violet: #B9A8FF; --brand-cyan-ink: #7CC8F2; }

.sidebar-user { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; padding: 8px 12px; color: #E6EDF7; font-size: .9rem; }
.sidebar-user small { display: block; color: var(--sidebar-text); }
.fieldset-reset { border: 0; padding: 0; margin: 0; min-width: 0; }
.btn.is-sending { position: relative; color: transparent !important; }
.btn.is-sending::after { content: ''; position: absolute; inset: 0; margin: auto; width: 1.1em; height: 1.1em; border: 2px solid currentColor; border-color: #fff #fff transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn-outline-secondary.is-sending::after, .btn-link.is-sending::after { border-color: var(--text) var(--text) transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.role { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: rgb(90 100 120 / .12); color: var(--muted); }
.role-admin { background: var(--tint-red); color: var(--danger); }
.role-gestor { background: var(--tint-violet); color: var(--violet); }
.role-jurado { background: var(--tint-blue); color: var(--primary); }

.turn-list, .cat-list, .mini-log, .level-chips, .review-list, .timeline { list-style: none; margin: 0; padding: 0; }
.turn-list li, .cat-list li { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.turn-list li:first-child { border-top: 0; }
.turn-list a, .cat-list a { flex-grow: 1; min-width: 0; display: flex; flex-direction: column; color: var(--text); text-decoration: none; }
.turn-list a span, .cat-list a span { color: var(--muted); font-size: .9rem; }
.cat-list li { padding: 14px 20px; }
.cat-list li:hover { background: var(--bg); }
.mini-log li { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0; border-top: 1px dashed var(--line); font-size: .9rem; }
.mini-log time { color: var(--muted); font-variant-numeric: tabular-nums; }
.mini-log span { color: var(--muted); }
.event-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; }

/* Kill switch */
.kill-panel { border-color: color-mix(in srgb, var(--danger) 40%, var(--line)); }
.kill-panel .panel-title { color: var(--danger); }

/* Indicador en vivo */
.live-dot { display: inline-flex; align-items: center; gap: 8px; margin: 0; font-size: .85rem; font-weight: 600; color: var(--muted); }
.live-dot i { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); }
.live-dot[data-mode="live"] i { background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 60%, transparent); animation: pulse 2s infinite; }
.live-dot[data-mode="error"] i { background: var(--danger); }
.live-dot[data-mode="paused"] i { background: var(--brand-orange); }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* Timeline de auditoría */
.audit-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.audit-count { margin: 0; padding: 10px 20px 0; color: var(--muted); font-size: .85rem; }
.timeline { padding: 8px 20px 12px; max-height: 70vh; overflow-y: auto; }
.tl-item { position: relative; display: flex; gap: 14px; padding: 10px 0 10px 4px; border-left: 2px solid var(--line); margin-left: 6px; }
.tl-dot { position: absolute; left: -7px; top: 16px; width: 12px; height: 12px; border-radius: 50%; background: var(--primary); border: 2px solid var(--surface); }
.tl-body { padding-left: 14px; min-width: 0; flex-grow: 1; }
.tl-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tl-action { font-weight: 700; font-size: .8rem; padding: .1rem .45rem; border-radius: 6px; background: var(--tint-blue); color: var(--primary); }
.tl-time { margin-left: auto; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.tl-detail { margin: 4px 0 0; font-size: .95rem; word-break: break-word; }
.tl-meta { margin: 2px 0 0; color: var(--muted); font-size: .8rem; word-break: break-all; }
.tl-meta span:not(:empty) + span:not(:empty)::before { content: '· '; }
.tone-danger .tl-dot { background: var(--danger); }
.tone-danger .tl-action { background: var(--tint-red); color: var(--danger); }
.tone-auth .tl-dot { background: var(--brand-cyan); }
.tone-auth .tl-action { background: var(--tint-cyan); color: var(--brand-cyan-ink); }
.tone-eval .tl-dot { background: var(--ok); }
.tone-eval .tl-action { background: var(--tint-green); color: var(--ok); }
.tl-item.is-new { animation: flash-in 1.6s var(--ease-out); }
@keyframes flash-in { from { background: var(--tint-orange); transform: translateY(-6px); opacity: 0; } 30% { opacity: 1; transform: none; } }

/* Cola de presentación */
.queue-table tbody tr { cursor: default; }
.queue-table tr.is-turn { background: var(--tint-blue); }
.queue-table tr.is-turn td:first-child { box-shadow: inset 4px 0 0 var(--primary); }
.queue-table tr.is-done { opacity: .7; }
.queue-table .drag-handle:focus-visible { outline: 3px solid var(--primary); border-radius: 6px; }

/* Rúbricas */
.level-box { height: 100%; padding: 14px; border-radius: 12px; border: 1.5px solid var(--line); }
.level-1 { --lv: var(--danger); --lv-bg: var(--tint-red); }
.level-2 { --lv: var(--brand-orange); --lv-bg: var(--tint-orange); }
.level-3 { --lv: var(--ok); --lv-bg: var(--tint-green); }
.level-box { border-top: 4px solid var(--lv); }
.level-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.level-chips li { padding: .3rem .75rem; border-radius: 999px; background: var(--lv-bg); color: var(--lv); font-size: .85rem; }
.rubric-card summary { cursor: pointer; color: var(--primary); font-weight: 600; }

/* ---------- Pantalla del jurado (mobile-first) ---------- */
body.jury { min-height: 100vh; }
.jury-bar { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 16px; background: var(--sidebar-bg); color: #fff; border-bottom: 3px solid transparent; border-image: var(--brand-gradient) 1; }
.jury-bar .brand-svg { width: 34px; }
.jury-bar .btn-icon { background: transparent; color: #fff; border-color: rgb(255 255 255 / .25); }
.jury-who { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jury-main { max-width: 640px; margin: 0 auto; padding: 16px 16px 120px; }
.jury-main:focus { outline: none; }
.jury-team { margin-bottom: 18px; }
.jury-team .eyebrow { margin: 0 0 4px; color: var(--muted); font-size: .85rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.jury-team h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); margin: 0 0 6px; }
.steps { display: flex; gap: 8px; list-style: none; padding: 0; margin: 14px 0 0; font-size: .85rem; font-weight: 600; }
.steps li { flex: 1; padding: 6px 10px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); color: var(--muted); text-align: center; }
.steps .is-current { border-color: var(--primary); color: var(--primary); }
.steps .is-done { background: var(--tint-green); border-color: transparent; color: var(--ok); }
.criterion { background: var(--surface); border: 1.5px solid var(--line); border-radius: 16px; padding: 14px; margin: 0 0 12px; transition: border-color .2s; }
.criterion.is-done { border-color: color-mix(in srgb, var(--ok) 50%, var(--line)); }
.criterion legend { float: left; width: 100%; font-size: 1.05rem; font-weight: 700; margin: 0 0 4px; padding: 0; }
.criterion legend + * { clear: both; }
.criterion legend small { color: var(--muted); font-weight: 500; font-size: .85rem; }
.criterion-def { color: var(--muted); font-size: .92rem; margin: 0 0 10px; }
.levels { display: grid; gap: 8px; }
.level-option { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; align-items: center; min-height: 56px; padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); cursor: pointer; user-select: none; transition: background-color .15s, border-color .15s; }
.level-name { font-weight: 700; }
.level-points { font-weight: 700; font-size: 1.2rem; color: var(--lv); }
.level-desc { grid-column: 1 / -1; color: var(--muted); font-size: .85rem; }
.btn-check:checked + .level-option { border-color: var(--lv); background: color-mix(in srgb, var(--lv) 22%, var(--surface)); box-shadow: 0 0 0 2px var(--lv); }
.btn-check:checked + .level-option .level-name::before { content: '✓ '; color: var(--lv); }
.btn-check:focus-visible + .level-option { outline: 3px solid var(--primary); outline-offset: 2px; }
.jury-submit .btn { white-space: nowrap; }
.jury-submit { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.jury-review { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.review-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.review-list li:first-child { border-top: 0; }
.review-list small { display: block; color: var(--muted); }
.review-list strong { color: var(--lv); white-space: nowrap; }
.review-total { font-size: 1.4rem; text-align: right; margin: 8px 0 16px; padding-top: 10px; border-top: 2px solid var(--text); }
.review-total span { color: var(--muted); font-size: 1rem; }
.confirm-check { padding: 12px 12px 12px 2.4em; border-radius: 12px; background: var(--tint-orange); }
.jury-empty { text-align: center; padding: 56px 16px; color: var(--muted); }
.jury-empty .bi { font-size: 3rem; display: block; margin-bottom: 10px; }
.jury-empty h1, .jury-empty h2 { color: var(--text); font-size: 1.4rem; }
.jury-empty.is-ok .bi { color: var(--ok); }
@media (min-width: 576px) { .levels { grid-template-columns: repeat(3, 1fr); } .level-option { grid-template-columns: 1fr; text-align: center; } }

@media (prefers-reduced-motion: reduce) {
    .live-dot[data-mode="live"] i, .tl-item.is-new, .btn.is-sending::after { animation: none; }
}

/* Colores del isotipo: color sobre fondo claro; versión clara en fondos oscuros y en modo oscuro */
.brand-svg .ev-s1 { stop-color: #0A2353; }
.brand-svg .ev-s2 { stop-color: #1B5FAF; }
.brand-svg .ev-s3 { stop-color: #19A7DB; }
.brand-svg-light .ev-s1, [data-bs-theme="dark"] .brand-svg .ev-s1 { stop-color: #9CC0F0; }
.brand-svg-light .ev-s2, [data-bs-theme="dark"] .brand-svg .ev-s2 { stop-color: #5CC2EE; }
.brand-svg-light .ev-s3, [data-bs-theme="dark"] .brand-svg .ev-s3 { stop-color: #2FC0F0; }

/* Jurado: lista de equipos de la categoría abierta */
.back-link { display: inline-flex; align-items: center; gap: 6px; margin-bottom: 12px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: .9rem; }
.back-link:hover { color: var(--primary); }
.jury-progress { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.jury-progress span { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--brand-gradient); transition: width .6s var(--ease-out); }
.team-picker { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
/* minmax(0, 1fr): sin esto, una descripción larga ensancha la columna y desborda la pantalla del teléfono */
.jury-main { min-width: 0; overflow-wrap: anywhere; }
.team-picker a { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1.5px solid var(--line); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.team-picker a:hover { border-color: var(--primary); }
.team-picker a:active { transform: scale(.99); }
.team-picker-name { min-width: 0; display: flex; flex-direction: column; }
.team-picker-name small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.team-picker-state { flex-shrink: 0; font-weight: 700; font-size: .9rem; color: var(--muted); white-space: nowrap; }
.team-picker .is-enviada { border-color: color-mix(in srgb, var(--ok) 40%, var(--line)); background: color-mix(in srgb, var(--ok) 6%, var(--surface)); }
.team-picker .is-enviada .team-picker-state { color: var(--ok); }
.team-picker .is-borrador { border-color: color-mix(in srgb, var(--brand-orange) 45%, var(--line)); }
.team-picker .is-borrador .team-picker-state { color: var(--brand-orange); }
[data-bs-theme="dark"] .team-picker .is-borrador .team-picker-state { color: #FDBA74; }
@media (prefers-reduced-motion: reduce) { .jury-progress span { transition: none; } }

/* Barra de estado de la evaluación por categoría */
.eval-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; border-left: 4px solid var(--line); }
.eval-bar-info { display: flex; flex-direction: column; gap: 2px; }
.eval-badge { font-weight: 700; font-size: 1.05rem; }
.eval-bar-help { flex-basis: 100%; color: var(--muted); font-size: .9rem; }
.eval-abierta { border-left-color: var(--brand-cyan); }
.eval-abierta .eval-badge { color: var(--brand-cyan-ink); }
.eval-cerrada { border-left-color: var(--muted); }
.steps-list { padding-left: 1.2rem; color: var(--muted); font-size: .92rem; }
.steps-list li { margin-bottom: 4px; }
/* Puntos repartidos en la rúbrica */
.score-total { font-size: 1.4rem; }
.score-total strong { font-size: 1.9rem; letter-spacing: -.03em; }
.score-meter { display: flex; height: 14px; border-radius: 99px; background: var(--line); overflow: hidden; gap: 2px; }
.score-meter .seg { display: block; height: 100%; }
.seg-0 { background: var(--brand-navy); }
.seg-1 { background: var(--brand-blue); }
.seg-2 { background: var(--brand-cyan); }
.seg-3 { background: #5B8FD6; }
[data-bs-theme="dark"] .seg-0 { background: #7CC8F2; }

.btn-outline-warning { --bs-btn-color: var(--brand-orange); --bs-btn-border-color: color-mix(in srgb, var(--brand-orange) 55%, var(--line)); --bs-btn-hover-bg: var(--brand-orange); --bs-btn-hover-border-color: var(--brand-orange); --bs-btn-hover-color: #fff; }
.btn-warning { --bs-btn-bg: var(--brand-orange); --bs-btn-border-color: var(--brand-orange); --bs-btn-color: #fff; --bs-btn-hover-bg: #8F3F08; --bs-btn-hover-border-color: #8F3F08; --bs-btn-hover-color: #fff; }
[data-bs-theme="dark"] .btn-outline-warning { --bs-btn-color: #FDBA74; --bs-btn-border-color: #9A5B26; }
.reopen-note { border-left: 4px solid var(--brand-orange); }
.team-picker .is-reabierta { border-color: var(--brand-orange); background: color-mix(in srgb, var(--brand-orange) 7%, var(--surface)); }
.team-picker .is-reabierta .team-picker-state { color: var(--brand-orange); }
[data-bs-theme="dark"] .team-picker .is-reabierta .team-picker-state { color: #FDBA74; }

/* Control de accesos */
.reopen-panel { border-color: color-mix(in srgb, var(--brand-cyan) 45%, var(--line)); }
.reopen-panel fieldset legend { float: none; width: auto; font-size: 1rem; }
.reopen-panel .form-check { margin-bottom: 6px; }
.pending-list { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 6px; font-size: .92rem; }
.pending-list small { color: var(--muted); }
