:root {
    --bg: #f7f7f5;
    --surface: #ffffff;
    --surface-soft: #fafaf8;
    --text: #15171a;
    --muted: #66676b;
    --line: #e4e3df;
    --green: #177a2f;
    --green-dark: #0f5f24;
    --green-soft: #e8f4ec;
    --black: #0b1013;
    --sidebar: #0d1215;
    --shadow: 0 12px 34px rgba(var(--ui-sombra-rgb), .08);
    --radius: 16px;
    /* Paleta central: blanco predominante, negro/gris oscuro para texto y estados, dorado solo como acento.
       Las variables --home-blue* conservan su nombre (se usan en todo el archivo) pero ya no son azules. */
    --home-blue: #1f2328;
    --home-blue-dark: #0b0d10;
    --home-blue-soft: #f4f1ea;
    --ui-negro: #0b0d10;
    --ui-gris: #57534e;
    --ui-hover: #faf8f3;
    --ui-tinte-fuerte: #ece6d8;
    --ui-borde-acento: #e0d3b1;
    --ui-acento-rgb: 31, 35, 40;
    --ui-sombra-rgb: 12, 12, 14;
    --oro: #b8913f;
    --oro-claro: #d2b265;
    --oro-suave: #f7f0dd;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; font-family: Inter, "Segoe UI", Arial, sans-serif; color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }

.login-body {
    min-height: 100vh;
    background:
        linear-gradient(90deg, rgba(0,0,0,.56), rgba(255,255,255,.08)),
        url('/img/Fondo.webp') center / cover no-repeat;
    display: grid;
    place-items: center;
    padding: 24px;
}

.login-shell { width: min(100%, 520px); }
.login-card {
    width: 100%;
    border-radius: 22px;
    padding: 42px 42px 38px;
    background: rgba(255,255,255,.74);
    border: 1px solid rgba(255,255,255,.55);
    box-shadow: 0 30px 80px rgba(0,0,0,.24);
    backdrop-filter: blur(14px);
}
.login-card.small { text-align: center; }
.login-logo-wrap { text-align: center; margin-bottom: 32px; }
.login-logo-wrap img { max-width: 260px; width: 74%; height: auto; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-weight: 700; margin-bottom: 8px; color: #1c1c1e; }
.form-group input {
    width: 100%; height: 50px; padding: 0 16px; border-radius: 12px;
    border: 1px solid #8b9aa9; background: rgba(255,255,255,.86);
    outline: none; transition: border .2s, box-shadow .2s;
}
.form-group input:focus { border-color: var(--home-blue); box-shadow: 0 0 0 4px rgba(var(--ui-acento-rgb), .14); }
.remember-row { display: inline-flex; align-items: center; gap: 10px; margin-bottom: 18px; font-weight: 600; color: #29313a; }
.remember-row input { width: 18px; height: 18px; }
.login-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
    border: 0;
    cursor: pointer;
    border-radius: 10px;
    padding: 12px 18px;
    font-weight: 800;
    transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease, filter .18s ease;
}
.btn:hover:not(:disabled) {
    transform: translateY(-3px);
    filter: brightness(1.03);
}
.btn:active:not(:disabled) {
    transform: translateY(-1px);
}
.btn:disabled { cursor: not-allowed; opacity: .65; }
.btn-primary { background: var(--home-blue); color: #fff; box-shadow: 0 10px 20px rgba(var(--ui-acento-rgb), .2); }
.btn-primary:hover:not(:disabled) { background: var(--home-blue-dark); box-shadow: 0 16px 30px rgba(var(--ui-acento-rgb), .3); }
.btn-secondary { background: #151a1f; color: #fff; box-shadow: 0 8px 18px rgba(var(--ui-sombra-rgb), .14); }
.btn-secondary:hover:not(:disabled) { box-shadow: 0 15px 28px rgba(var(--ui-sombra-rgb), .26); }
.btn.full, .btn-outline.full { width: 100%; text-align: center; }
.validation-summary { color: #a92828; font-weight: 700; margin-bottom: 14px; }
.field-error { display: block; color: #a92828; font-size: 13px; margin-top: 6px; }

.app-body { min-height: 100vh; display: flex; overflow-x: hidden; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; width: 286px; z-index: 20;
    background: linear-gradient(180deg, rgba(12,18,21,.98), rgba(11,16,19,.96));
    color: #fff; display: flex; flex-direction: column;
    border-right: 1px solid rgba(255,255,255,.06);
}
.sidebar-brand { padding: 24px 28px 28px; }
.sidebar-brand img { width: 172px; max-width: 86%; }
.sidebar-nav { display: grid; gap: 10px; padding: 6px 16px; }
.nav-item {
    display: flex;
    align-items: center;
    gap: 16px;
    min-height: 64px;
    padding: 0 18px;
    border-radius: 10px;
    color: rgba(255,255,255,.9);
    font-weight: 700;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease, color .18s ease;
}
.nav-item:hover:not(.disabled) {
    transform: translateX(4px);
    background: rgba(255,255,255,.1);
    box-shadow: 0 12px 24px rgba(0,0,0,.18);
    color: #fff;
}
.nav-item.active { background: linear-gradient(90deg, rgba(23,122,47,.95), rgba(20,94,38,.92)); }
.nav-item.disabled { opacity: .92; }
.nav-icon { width: 24px; text-align: center; font-size: 22px; }
.sidebar-cow {
    margin-top: auto; min-height: 360px; background:
        linear-gradient(180deg, rgba(13,18,21,0), rgba(13,18,21,.68) 20%, rgba(13,18,21,.95)),
        url('/img/sidebar-cow.jpg') center bottom / cover no-repeat;
    opacity: .65;
}
.sidebar-logout { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 22px; }
.sidebar-logout button {
    width: 100%;
    background: transparent;
    border: 0;
    color: #fff;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 16px;
    border-radius: 10px;
    padding: 10px 0;
    transition: transform .18s ease, color .18s ease, text-shadow .18s ease;
}
.sidebar-logout button:hover {
    transform: translateX(4px);
    color: #fff;
    text-shadow: 0 8px 18px rgba(255,255,255,.18);
}
.app-shell { margin-left: 286px; min-height: 100vh; width: calc(100% - 286px); }
.topbar { height: 78px; background: rgba(255,255,255,.92); border-bottom: 1px solid var(--line); display: flex; align-items: center; padding: 0 32px; gap: 22px; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.menu-toggle {
    border: 0;
    background: transparent;
    font-size: 28px;
    cursor: pointer;
    color: #141416;
    border-radius: 8px;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.menu-toggle:hover {
    transform: translateY(-2px);
    background: #f3f2ef;
    box-shadow: 0 10px 20px rgba(var(--ui-sombra-rgb), .1);
}
.menu-toggle:active {
    transform: translateY(0);
}
.topbar-title { font-size: 22px; font-weight: 900; }
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 12px; font-weight: 800; }
.avatar { width: 42px; height: 42px; display: inline-grid; place-items: center; border-radius: 50%; background: #e9edf1; color: #111; font-size: 16px; }
.chevron { font-size: 22px; color: #1f2933; }
.main-content { padding: 34px 38px 18px; }
.dashboard-page { max-width: 1510px; margin: 0 auto; }
.dashboard-date { font-size: 25px; font-weight: 900; margin-bottom: 24px; }
.api-alert { margin-bottom: 18px; background: #fff7e6; border: 1px solid #f5d28a; border-radius: 14px; padding: 14px 16px; display: grid; gap: 4px; color: #6f4d00; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 430px; gap: 22px; align-items: start; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 24px; }
.card-title { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.card-title h2 { margin: 0; font-size: 20px; font-weight: 900; }
.title-icon { color: var(--green); font-size: 25px; font-weight: 900; }
.recinto-card { min-height: 326px; }
.recinto-body { display: grid; grid-template-columns: 240px 1fr; gap: 26px; align-items: center; }
.recinto-img { width: 194px; height: 150px; object-fit: cover; border-radius: 50%; box-shadow: 0 8px 20px rgba(0,0,0,.14); justify-self: center; }
.recinto-info { display: grid; gap: 15px; }
.info-row { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; }
.info-row small { display: block; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.info-row strong { font-size: 17px; }
.clock-icon { color: var(--green); }
.card-divider { height: 1px; background: var(--line); margin: 22px 0 14px; }
.recinto-footer { display: flex; gap: 34px; flex-wrap: wrap; color: #3f4b58; }
.recinto-footer strong { color: var(--green); }
.progreso-card { min-height: 326px; }
.progress-header { display: flex; justify-content: space-between; font-weight: 700; margin: 4px 0 12px; }
.progress-track { height: 16px; border-radius: 20px; background: #dce1e6; overflow: hidden; margin-bottom: 24px; }
.progress-bar { height: 100%; background: linear-gradient(90deg, var(--green), var(--green-dark)); border-radius: inherit; }
.time-list { display: grid; gap: 16px; margin-bottom: 20px; }
.time-list div { display: grid; grid-template-columns: 26px 1fr; gap: 10px; }
.time-list span { color: var(--green); }
.time-list p { margin: 0; color: #1c1c1e; }
.time-list strong { display: block; font-size: 18px; margin-top: 4px; }
.btn-outline {
    border: 1px solid var(--home-blue);
    color: var(--home-blue);
    background: #fff;
    border-radius: 10px;
    padding: 11px 20px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(var(--ui-sombra-rgb), .06);
    transition: transform .18s ease, border-color .18s ease, color .18s ease, background .18s ease, box-shadow .18s ease, opacity .18s ease;
}
.btn-outline:hover:not(:disabled):not(.disabled) {
    transform: translateY(-3px);
    background: #f5f8ff;
    border-color: var(--home-blue-dark);
    color: var(--home-blue-dark);
    box-shadow: 0 16px 30px rgba(var(--ui-acento-rgb), .18);
}
.btn-outline:active:not(:disabled):not(.disabled) {
    transform: translateY(-1px);
}
.btn-outline.disabled { border-color: #c9d1d8; color: #a5adb6; background: #f7f8fa; }
.ferias-card { grid-column: 3; grid-row: 1 / span 3; padding: 22px 28px; }
.ferias-list { display: grid; gap: 19px; }
.feria-block { border-top: 1px solid var(--line); padding-top: 17px; }
.feria-block:first-child { border-top: 0; padding-top: 0; }
.feria-block h3 { margin: 0 0 12px; font-size: 17px; display: flex; align-items: center; gap: 12px; }
.feria-block h3 span { width: 10px; height: 10px; background: var(--green); border-radius: 50%; display: inline-block; }
.fecha-pill { background: var(--surface-soft); border: 1px solid var(--line); border-radius: 9px; padding: 10px 14px; margin: 8px 0; color: #3f4b58; font-weight: 700; }
.calendar { display: block; margin: 24px auto 0; }
.stream-card { grid-column: 1 / span 2; padding: 18px 20px 20px; }
.stream-header { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.stream-header h2 { margin: 0; font-size: 22px; font-weight: 900; }
.stream-header h2 span { color: var(--green); }
.live-badge { background: var(--green); color: #fff; border-radius: 999px; padding: 7px 16px; font-weight: 900; font-size: 13px; }
.stream-meta { font-weight: 800; color: #2c3845; }
.stream-body { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 18px; }
.video-frame, .video-empty { min-height: 285px; border-radius: 10px; overflow: hidden; position: relative; background: #111; }
.video-frame video,
.video-frame iframe {
    width: 100%;
    height: 100%;
    min-height: 285px;
    object-fit: cover;
    display: block;
    border: 0;
}
.video-live-tag { position: absolute; top: 16px; right: 16px; background: #df1d1d; color: #fff; padding: 6px 12px; border-radius: 6px; font-weight: 900; font-size: 13px; }
.video-empty { background: #f8fafb; border: 1px dashed #cbd4de; display: grid; place-items: center; text-align: center; color: #526071; padding: 26px; }
.video-empty h3 { margin: 8px 0 4px; color: #1a1a1c; font-size: 24px; }
.video-empty p { max-width: 520px; margin: 0; }
.stream-panel { background: #f8fafb; border-radius: 10px; padding: 18px; display: grid; align-content: start; gap: 10px; }
.stream-panel small { color: var(--muted); font-weight: 700; }
.stream-panel strong { font-size: 18px; }
.state-pill { justify-self: start; background: var(--green-soft); color: var(--green-dark); border-radius: 7px; padding: 6px 10px; font-weight: 900; }
.banner-card { grid-column: 1 / span 2; min-height: 170px; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); display: grid; grid-template-columns: 330px 1fr; background: #0d1215; color: #fff; }
.banner-image { background: url('/img/banner-ganaderia.jpg') center / cover no-repeat; filter: grayscale(1); opacity: .72; }
.banner-content { padding: 28px 34px; background: linear-gradient(90deg, rgba(13,18,21,.95), rgba(13,18,21,.88)); }
.banner-logo { font-size: 32px; font-weight: 950; letter-spacing: 1px; margin-bottom: 8px; }
.banner-logo span { display: block; font-size: 12px; letter-spacing: 4px; text-transform: uppercase; }
.banner-content h2 { margin: 0 0 20px; font-size: 23px; }
.banner-features { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 16px; border-top: 1px solid rgba(32,145,57,.7); padding-top: 16px; }
.banner-features div { display: flex; gap: 8px; font-size: 13px; align-items: center; }
.banner-features span { color: #2eb64f; font-size: 20px; }
.empty-state { text-align: center; color: #526071; }
.empty-state h3 { color: #1c1c1e; margin: 8px 0 4px; }
.empty-state p { margin: 0; }
.empty-state.compact { padding: 18px 0 22px; }
.empty-state.no-line { border: 1px dashed #cbd4de; border-radius: 12px; padding: 24px 18px; }
.empty-icon { width: 64px; height: 64px; display: inline-grid; place-items: center; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 30px; }
.app-footer { display: flex; justify-content: space-between; gap: 12px; color: #5d6875; padding: 22px 4px 0; }

@media (max-width: 1320px) {
    .dashboard-grid { grid-template-columns: 1fr 1fr; }
    .ferias-card { grid-column: 1 / span 2; grid-row: auto; }
    .banner-features { grid-template-columns: repeat(2, minmax(0,1fr)); }
}

@media (max-width: 980px) {
    .sidebar { transform: translateX(-100%); transition: transform .2s; }
    .sidebar.open { transform: translateX(0); }
    .app-shell { margin-left: 0; width: 100%; }
    .topbar-user span:first-child { display: none; }
    .main-content { padding: 24px 18px; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .ferias-card, .stream-card, .banner-card { grid-column: auto; }
    .stream-body { grid-template-columns: 1fr; }
    .banner-card { grid-template-columns: 1fr; }
    .banner-image { display: none; }
}

@media (max-width: 680px) {
    .login-card { padding: 30px 22px; }
    .login-actions { display: grid; }
    .topbar { padding: 0 18px; height: 68px; }
    .dashboard-date { font-size: 20px; }
    .card { padding: 18px; }
    .recinto-body { grid-template-columns: 1fr; text-align: left; }
    .recinto-img { width: 160px; height: 126px; }
    .recinto-footer { gap: 14px; }
    .banner-features { grid-template-columns: 1fr; }
    .app-footer { flex-direction: column; }
}

/* App shell refinements */
.app-body {
    background: #f4f6f8;
}

.sidebar {
    width: 292px;
    background:
        linear-gradient(180deg, rgba(8, 13, 16, .18), rgba(8, 13, 16, .18)),
        url('/img/Side-bar.webp') center bottom / cover no-repeat;
    border-right: 1px solid rgba(255,255,255,.08);
    transition: transform .24s ease, opacity .24s ease;
}

.sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(9, 15, 18, .1), rgba(9, 15, 18, .38));
    pointer-events: none;
}

.sidebar-brand,
.sidebar-nav,
.sidebar-logout {
    position: relative;
    z-index: 1;
}

.sidebar-brand {
    padding: 26px 24px 30px;
}

.sidebar-brand img {
    display: block;
    width: 184px;
    max-width: 92%;
}

.sidebar-nav {
    gap: 12px;
    padding: 0 15px;
}

.nav-item {
    min-height: 66px;
    padding: 0 18px;
    border-radius: 8px;
    color: rgba(255,255,255,.95);
}

.nav-item.active {
    background: linear-gradient(90deg, #1f893d, #1b7334);
    box-shadow: 0 10px 26px rgba(20, 113, 51, .24);
}

.nav-item.disabled {
    pointer-events: none;
}

.nav-icon {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 900;
    color: #fff;
    border: 1px solid rgba(255,255,255,.2);
    background: rgba(255,255,255,.08);
}

.sidebar-logout {
    margin-top: auto;
    padding: 22px 28px;
    background: rgba(8, 13, 16, .72);
    border-top: 1px solid rgba(255,255,255,.12);
}

.sidebar-logout button {
    font-size: 17px;
}

.app-shell {
    margin-left: 292px;
    width: calc(100% - 292px);
    transition: margin-left .24s ease, width .24s ease;
}

.app-body.sidebar-collapsed .sidebar {
    transform: translateX(-100%);
    opacity: 0;
}

.app-body.sidebar-collapsed .app-shell {
    margin-left: 0;
    width: 100%;
}

.topbar {
    height: 84px;
    padding: 0 36px;
    background: rgba(255,255,255,.96);
}

.menu-toggle {
    width: 34px;
    height: 34px;
    display: inline-grid;
    align-content: center;
    gap: 5px;
    padding: 0;
}

.menu-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    border-radius: 999px;
    background: #141416;
}

.topbar-title {
    font-size: 21px;
}

.avatar {
    position: relative;
}

.avatar::before {
    content: "";
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #151a1f;
    align-self: center;
    justify-self: center;
    margin-top: 8px;
}

.avatar::after {
    content: "";
    position: absolute;
    left: 11px;
    right: 11px;
    bottom: 8px;
    height: 12px;
    border-radius: 999px 999px 8px 8px;
    background: #151a1f;
}

.chevron {
    width: 9px;
    height: 9px;
    border-right: 2px solid #141416;
    border-bottom: 2px solid #141416;
    transform: rotate(45deg);
    margin-top: -5px;
}

.main-content {
    padding: 34px 46px 20px;
}

.dashboard-page {
    max-width: 1540px;
}

.dashboard-date {
    margin: 0 0 22px;
    font-size: 27px;
}

.card {
    border-radius: 10px;
    border-color: #e3e8ed;
    box-shadow: 0 14px 32px rgba(var(--ui-sombra-rgb), .08);
}

.card-title {
    margin-bottom: 18px;
}

.title-icon,
.row-icon,
.pill-icon {
    display: inline-grid;
    place-items: center;
    color: var(--green);
    border: 1px solid rgba(23,122,47,.34);
    background: rgba(23,122,47,.08);
    font-weight: 900;
}

.title-icon {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    font-size: 13px;
}

.row-icon,
.pill-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 11px;
}

.recinto-img {
    border: 6px solid #fff;
}

.progress-track {
    height: 15px;
}

.progress-bar {
    min-width: 0;
}

.btn-outline.disabled,
.btn-outline:disabled,
.btn:disabled {
    cursor: not-allowed;
    opacity: .62;
}

.fecha-pill {
    display: flex;
    align-items: center;
    gap: 10px;
}

.stream-header h2 span {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-right: 8px;
    border-radius: 50%;
    background: rgba(23,122,47,.1);
    color: var(--green);
    font-size: 13px;
}

.video-empty {
    min-height: 318px;
}

.stream-panel {
    min-height: 318px;
}

.banner-card {
    grid-template-columns: 330px 1fr;
}

.banner-logo-img {
    width: 250px;
    max-width: 100%;
    margin-bottom: 12px;
}

@media (max-width: 980px) {
    .sidebar {
        width: 286px;
        opacity: 0;
    }

    .sidebar.open {
        opacity: 1;
    }

    .app-body.sidebar-collapsed .sidebar {
        transform: translateX(-100%);
    }

    .app-body:not(.sidebar-collapsed) .sidebar {
        transform: translateX(-100%);
    }

    .app-body:not(.sidebar-collapsed) .sidebar.open {
        transform: translateX(0);
    }

    .app-shell,
    .app-body.sidebar-collapsed .app-shell {
        margin-left: 0;
        width: 100%;
    }

    .main-content {
        padding: 24px 18px;
    }
}

/* Final home/sidebar polish */
:root {
    --sidebar-width: 292px;
}

.app-body {
    display: block;
    overflow-x: hidden;
}

.sidebar {
    width: var(--sidebar-width);
    will-change: transform;
}

.app-shell {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    min-width: 0;
}

.app-body.sidebar-collapsed .app-shell {
    margin-left: 0;
    width: 100%;
}

.app-body.sidebar-collapsed .dashboard-grid {
    grid-template-columns: minmax(420px, 1fr) minmax(360px, .9fr) 430px;
}

.dashboard-grid {
    grid-template-columns: minmax(430px, 1.08fr) minmax(360px, .92fr) minmax(360px, 430px);
}

.card,
.recinto-info,
.info-row > div,
.time-list p {
    min-width: 0;
}

.recinto-body {
    grid-template-columns: minmax(170px, 210px) minmax(0, 1fr);
    gap: 22px;
}

.recinto-img {
    width: 178px;
    height: 142px;
}

.info-row,
.time-list div {
    align-items: start;
}

.info-row strong,
.time-list strong {
    overflow-wrap: anywhere;
}

.api-alert {
    display: none;
}

.nav-icon,
.title-icon,
.row-icon,
.pill-icon,
.button-icon,
.stream-title-icon,
.empty-icon,
.feature-icon,
.logout-icon,
.avatar {
    flex: 0 0 auto;
}

.nav-icon svg,
.title-icon svg,
.row-icon svg,
.pill-icon svg,
.button-icon svg,
.stream-title-icon svg,
.empty-icon svg,
.feature-icon svg,
.logout-icon svg,
.avatar svg {
    display: block;
    width: 1em;
    height: 1em;
}

.nav-icon {
    font-size: 22px;
    border: 0;
    background: transparent;
}

.nav-item.active .nav-icon {
    color: #fff;
}

.title-icon {
    font-size: 24px;
    border: 0;
    background: transparent;
}

.row-icon,
.pill-icon {
    font-size: 17px;
    border: 0;
    background: transparent;
}

.pill-icon {
    color: #647082;
}

.button-icon {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    vertical-align: -3px;
}

.btn-primary .button-icon {
    color: #fff;
}

.stream-title-icon {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-right: 8px;
    color: var(--green);
    vertical-align: -5px;
}

.empty-icon {
    margin: 0 auto 10px;
    font-size: 34px;
}

.empty-icon.neutral {
    color: #6f7782;
    background: #eef0f3;
}

.feature-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    color: #2eb64f;
    font-size: 24px;
}

.dashboard-page .title-icon,
.dashboard-page .row-icon,
.dashboard-page .pill-icon,
.dashboard-page .stream-title-icon,
.dashboard-page .empty-icon,
.dashboard-page .feature-icon {
    color: var(--home-blue);
}

.dashboard-page .empty-icon,
.dashboard-page .stream-header h2 span {
    background: var(--home-blue-soft);
}

.dashboard-page .feria-block h3 span {
    background: var(--home-blue);
}

.dashboard-page .state-pill {
    background: var(--home-blue-soft);
    color: var(--home-blue-dark);
}

.logout-icon {
    display: inline-grid;
    place-items: center;
    width: 24px;
    height: 24px;
    font-size: 22px;
}

.avatar {
    color: #151a1f;
    font-size: 22px;
}

.avatar::before,
.avatar::after {
    content: none;
}

.calendar {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn.full,
.btn-outline.full {
    display: flex;
    align-items: center;
    justify-content: center;
}

.empty-state.no-line {
    min-height: 214px;
    display: grid;
    place-items: center;
    align-content: center;
}

.video-empty {
    align-content: center;
}

@media (max-width: 1500px) {
    .dashboard-grid,
    .app-body.sidebar-collapsed .dashboard-grid {
        grid-template-columns: minmax(390px, 1fr) minmax(350px, .9fr) minmax(340px, 390px);
    }

    .recinto-body {
        grid-template-columns: minmax(150px, 190px) minmax(0, 1fr);
        gap: 18px;
    }

    .recinto-img {
        width: 164px;
        height: 132px;
    }
}

@media (max-width: 1320px) {
    .dashboard-grid,
    .app-body.sidebar-collapsed .dashboard-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

    .ferias-card {
        grid-column: 1 / span 2;
        grid-row: auto;
    }
}

@media (max-width: 980px) {
    .sidebar {
        width: var(--sidebar-width);
    }

    .app-shell,
    .app-body.sidebar-collapsed .app-shell {
        margin-left: 0;
        width: 100%;
    }

    .dashboard-grid,
    .app-body.sidebar-collapsed .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .ferias-card,
    .stream-card,
    .banner-card {
        grid-column: auto;
    }
}

/* Corredores */
.broker-page {
    max-width: 1540px;
    margin: 0 auto;
}

.broker-hero {
    margin-bottom: 30px;
}

.broker-hero h1 {
    margin: 0 0 10px;
    color: #141416;
    font-size: 30px;
    line-height: 1.15;
    font-weight: 950;
}

.broker-hero p {
    margin: 0;
    color: #657286;
    font-size: 16px;
}

.broker-section {
    margin-top: 30px;
}

.broker-section h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 18px;
    color: #1a1a1c;
    font-size: 22px;
    font-weight: 900;
}

.broker-section-icon {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    color: var(--home-blue);
}

.broker-section-icon svg,
.broker-action-icon svg,
.broker-action-arrow svg {
    display: block;
    width: 1em;
    height: 1em;
}

.broker-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.broker-actions-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.broker-actions-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.broker-actions-1 {
    grid-template-columns: minmax(0, 1fr);
}

.broker-action-card {
    min-width: 0;
    min-height: 118px;
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) 28px;
    align-items: center;
    gap: 20px;
    padding: 24px 26px;
    border: 1px solid var(--home-blue-soft);
    border-radius: 14px;
    background: #fff;
    color: #1a1a1c;
    text-decoration: none;
    text-align: left;
    cursor: default;
    box-shadow: 0 12px 28px rgba(var(--ui-sombra-rgb), .06);
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

/* Fegosa usuarios */
.users-review-page {
    width: 100%;
    max-width: 1680px;
    margin: 0 auto;
}

.users-review-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    align-items: center;
    margin-bottom: 28px;
}

.users-review-title h1 {
    margin: 0 0 10px;
    color: #121214;
    font-size: 32px;
    line-height: 1.12;
    font-weight: 950;
}

.users-review-title p {
    margin: 0;
    color: #657286;
    font-size: 16px;
}

.users-review-summary {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.users-kpi-card {
    min-width: 220px;
    min-height: 86px;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 22px;
    border: 1px solid var(--home-blue-soft);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(var(--ui-sombra-rgb), .06);
}

.users-kpi-icon,
.users-section-icon,
.users-search-icon,
.users-clear-icon,
.users-button-icon,
.users-edit-icon,
.users-page-icon {
    display: inline-grid;
    place-items: center;
}

.users-kpi-icon svg,
.users-section-icon svg,
.users-search-icon svg,
.users-clear-icon svg,
.users-button-icon svg,
.users-edit-icon svg,
.users-page-icon svg {
    display: block;
    width: 1em;
    height: 1em;
}

.users-kpi-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--home-blue-soft);
    color: var(--home-blue);
    font-size: 25px;
}

.users-kpi-card span {
    display: grid;
    gap: 4px;
}

.users-kpi-card small {
    color: #6b6a66;
    font-size: 14px;
}

.users-kpi-card strong {
    color: #121214;
    font-size: 24px;
    font-weight: 950;
}

.users-primary-button {
    min-height: 56px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0 26px;
    border: 1px solid var(--home-blue-dark);
    border-radius: 10px;
    background: var(--home-blue);
    color: #fff;
    font-weight: 900;
    text-decoration: none;
    box-shadow: 0 14px 24px rgba(var(--ui-acento-rgb), .22);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.users-primary-button:hover {
    transform: translateY(-2px);
    background: var(--home-blue-dark);
    box-shadow: 0 18px 34px rgba(var(--ui-acento-rgb), .28);
}

.users-button-icon {
    font-size: 20px;
}

.users-alert {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid var(--ui-borde-acento);
    border-radius: 12px;
    background: var(--home-blue-soft);
    color: var(--home-blue-dark);
    font-weight: 800;
}

.users-filter-card,
.users-table-card {
    border: 1px solid var(--home-blue-soft);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(var(--ui-sombra-rgb), .07);
}

.users-filter-card {
    padding: 24px 24px 22px;
    margin-bottom: 22px;
}

.users-filter-card h2,
.users-table-header h2 {
    margin: 0;
    color: #121214;
    font-size: 20px;
    font-weight: 950;
}

.users-filter-card h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.users-section-icon {
    color: var(--home-blue);
    font-size: 24px;
}

.users-filter-form {
    display: grid;
    gap: 14px;
}

.users-search-box {
    width: min(680px, 100%);
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr) 48px;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 0 0 0 16px;
    border: 1px solid #d6d4cf;
    border-radius: 28px;
    background: #fff;
    overflow: hidden;
}

.users-search-icon {
    color: #6b6a66;
    font-size: 21px;
}

.users-search-box input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    color: #1a1a1c;
    font: inherit;
}

.users-search-box input::placeholder {
    color: #7a8799;
}

.users-clear-search {
    height: 54px;
    display: grid;
    place-items: center;
    border-left: 1px solid #e4e3df;
    color: #6b6a66;
    text-decoration: none;
    transition: color .18s ease, background .18s ease;
}

.users-clear-search:hover {
    background: var(--home-blue-soft);
    color: var(--home-blue-dark);
}

.users-clear-icon {
    font-size: 21px;
}

.users-filter-form p {
    margin: 0;
    color: #6b6a66;
    font-size: 14px;
}

.users-table-card {
    overflow: hidden;
}

.users-table-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 22px 16px;
}

.users-table-header span {
    color: #6b6a66;
    font-size: 14px;
}

.users-table-wrap {
    margin: 0 22px;
    overflow-x: auto;
    border: 1px solid var(--home-blue-soft);
    border-radius: 10px;
}

.users-table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    color: #1a1a1c;
}

.users-table th,
.users-table td {
    padding: 16px 18px;
    border-bottom: 1px solid var(--home-blue-soft);
    text-align: left;
    vertical-align: middle;
}

.users-table th {
    background: #fafaf8;
    color: #121214;
    font-size: 14px;
    font-weight: 950;
}

.users-table tr:last-child td {
    border-bottom: 0;
}

.users-table th:last-child,
.users-table td:last-child {
    width: 150px;
    text-align: right;
}

.users-edit-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--home-blue);
    border-radius: 10px;
    background: #fff;
    color: var(--home-blue);
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}

.users-edit-button:hover {
    transform: translateY(-1px);
    background: var(--home-blue-soft);
    box-shadow: 0 10px 18px rgba(var(--ui-acento-rgb), .14);
}

.users-edit-icon {
    font-size: 16px;
}

.users-empty {
    padding: 34px 18px !important;
    color: #6b6a66;
    text-align: center !important;
    font-weight: 800;
}

.users-pagination {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 16px;
    padding: 22px;
}

.users-page-size {
    justify-self: start;
}

.users-page-size select {
    min-height: 42px;
    padding: 0 42px 0 14px;
    border: 1px solid #d6d4cf;
    border-radius: 8px;
    background: #fff;
    color: #1a1a1c;
    font: inherit;
}

.users-page-nav {
    justify-self: center;
    display: flex;
    align-items: center;
    gap: 8px;
}

.users-page-link,
.users-page-ellipsis {
    min-width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border-radius: 8px;
    color: #2a2a2c;
    font-weight: 800;
    text-decoration: none;
}

.users-page-link {
    border: 1px solid transparent;
    background: transparent;
    transition: background .18s ease, border-color .18s ease, color .18s ease, box-shadow .18s ease;
}

.users-page-link:hover {
    border-color: var(--ui-borde-acento);
    background: var(--home-blue-soft);
    color: var(--home-blue-dark);
}

.users-page-link.active {
    background: var(--home-blue);
    color: #fff;
    box-shadow: 0 10px 20px rgba(var(--ui-acento-rgb), .22);
}

.users-page-link.disabled {
    pointer-events: none;
    opacity: .45;
    border-color: #d6d4cf;
    background: #fafaf8;
}

@media (max-width: 1180px) {
    .users-review-header {
        grid-template-columns: 1fr;
    }

    .users-review-summary {
        justify-content: flex-start;
    }
}

@media (max-width: 760px) {
    .users-review-title h1 {
        font-size: 27px;
    }

    .users-kpi-card,
    .users-primary-button {
        width: 100%;
    }

    .users-table-header,
    .users-pagination {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .users-table-header {
        display: grid;
    }

    .users-page-size,
    .users-page-nav {
        justify-self: stretch;
    }

    .users-page-nav {
        justify-content: center;
        flex-wrap: wrap;
    }
}

.modal-locked {
    overflow: hidden;
}

.email-confirm-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(var(--ui-sombra-rgb), .58);
    backdrop-filter: blur(4px);
}

.email-confirm-modal[hidden],
.email-change-field[hidden],
.email-confirm-error[hidden] {
    display: none !important;
}

.email-confirm-dialog {
    width: min(520px, 100%);
    padding: 28px;
    border-radius: 14px;
    border: 1px solid var(--home-blue-soft);
    background: #fff;
    box-shadow: 0 28px 64px rgba(var(--ui-sombra-rgb), .28);
}

.email-confirm-dialog h2 {
    margin: 0 0 12px;
    color: #121214;
    font-size: 24px;
    font-weight: 950;
}

.email-confirm-dialog p {
    margin: 0 0 20px;
    color: #526176;
    line-height: 1.5;
}

.email-change-field {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
    color: #121214;
    font-weight: 850;
}

.email-change-field input {
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid #d6d4cf;
    border-radius: 8px;
    font: inherit;
}

.email-confirm-error {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 8px;
    background: #fee2e2;
    color: #991b1b;
    font-weight: 800;
}

.email-confirm-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    flex-wrap: wrap;
}

.email-confirm-primary,
.email-confirm-secondary {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 8px;
    font-weight: 900;
    cursor: pointer;
}

.email-confirm-primary {
    border: 1px solid var(--home-blue);
    background: var(--home-blue);
    color: #fff;
}

.email-confirm-secondary {
    border: 1px solid #d6d4cf;
    background: #fff;
    color: #1a1a1c;
}

/* Fegosa editar usuario */
.edit-user-page {
    max-width: 1680px;
    margin: 0 auto;
}

.edit-user-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 28px;
}

.edit-user-title {
    display: flex;
    align-items: center;
    gap: 18px;
}

.edit-user-title h1 {
    margin: 0 0 6px;
    color: #121214;
    font-size: 31px;
    font-weight: 950;
}

.edit-user-title p {
    margin: 0;
    color: #657286;
}

.edit-user-avatar {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--home-blue-soft);
    color: var(--home-blue);
    font-size: 27px;
}

.edit-user-avatar-icon svg,
.edit-user-button-icon svg,
.edit-card-icon svg,
.edit-input-icon svg,
.account-icon svg {
    display: block;
    width: 1em;
    height: 1em;
}

.edit-user-reset,
.edit-back,
.edit-cancel,
.edit-save,
.edit-secondary-primary {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 900;
    text-decoration: none;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.edit-user-reset {
    border: 1px solid #ef4444;
    background: #fff;
    color: #dc2626;
}

.edit-user-reset:disabled {
    opacity: .85;
}

.edit-user-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(340px, .98fr);
    gap: 24px;
    align-items: start;
}

.edit-user-main,
.edit-user-side {
    display: grid;
    gap: 20px;
}

.edit-card {
    padding: 24px;
    border: 1px solid var(--home-blue-soft);
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 14px 34px rgba(var(--ui-sombra-rgb), .07);
}

.edit-card h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 24px;
    color: #121214;
    font-size: 18px;
    font-weight: 850;
}

.edit-card-icon {
    width: 30px;
    height: 30px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--home-blue-soft);
    color: var(--home-blue);
    font-size: 17px;
}

.edit-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

.edit-field {
    display: grid;
    gap: 9px;
    min-width: 0;
    color: #121214;
    font-weight: 650;
}

.edit-field b {
    color: #dc2626;
}

.edit-field-full {
    grid-column: 1 / -1;
}

.edit-input,
.edit-phone-row {
    min-height: 48px;
    display: grid;
    align-items: center;
    border: 1px solid #d6d4cf;
    border-radius: 8px;
    background: #fff;
    color: #1a1a1c;
}

.edit-input {
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 12px;
    padding: 0 14px;
}

.edit-input.readonly {
    background: #fafaf8;
}

.edit-input-icon {
    color: #6b6a66;
    font-size: 18px;
}

.edit-input input,
.edit-input select,
.edit-phone-row input {
    min-width: 0;
    width: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: #1a1a1c;
    font: inherit;
    font-weight: 500;
}

.edit-phone-row {
    grid-template-columns: 120px minmax(0, 1fr);
    overflow: hidden;
}

.edit-prefix {
    height: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 14px;
    border-right: 1px solid #d6d4cf;
    color: #334155;
    font-weight: 650;
}

.edit-phone-row input {
    padding: 0 14px;
}

.edit-radio-group {
    min-height: 48px;
    display: flex;
    align-items: center;
    gap: 22px;
}

.edit-radio-group label,
.edit-check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #1a1a1c;
    font-weight: 550;
}

.edit-toggle-row > span:last-child > span {
    font-weight: 650;
}

.edit-radio-group input,
.edit-check input {
    width: 17px;
    height: 17px;
    accent-color: var(--home-blue);
}

.edit-toggle-row {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    column-gap: 14px;
    align-items: center;
}

.edit-toggle-row input {
    position: absolute;
    opacity: 0;
}

.edit-toggle-ui {
    width: 44px;
    height: 24px;
    position: relative;
    border-radius: 999px;
    background: #d4d2cc;
    transition: background .18s ease;
}

.edit-toggle-ui::after {
    content: "";
    width: 20px;
    height: 20px;
    position: absolute;
    top: 2px;
    left: 2px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 8px rgba(var(--ui-sombra-rgb), .22);
    transition: transform .18s ease;
}

.edit-toggle-row input:checked + .edit-toggle-ui {
    background: var(--home-blue);
}

.edit-toggle-row input:checked + .edit-toggle-ui::after {
    transform: translateX(20px);
}

.edit-toggle-row small,
.edit-note-help {
    display: block;
    margin-top: 4px;
    color: #6b6a66;
    font-size: 13px;
    font-weight: 500;
}

.edit-validation {
    display: grid;
    gap: 4px;
    margin-top: 12px;
    color: #dc2626;
    font-size: 13px;
    font-weight: 800;
}

.account-list {
    display: grid;
    gap: 24px;
    margin: 0;
}

.account-list div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
}

.account-list dt {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #1a1a1c;
    font-weight: 700;
}

.account-list dd {
    margin: 0;
    color: #526176;
    text-align: right;
    font-weight: 650;
}

.account-icon {
    color: #6b6a66;
    font-size: 18px;
}

.account-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 13px;
}

.account-badge.active {
    background: #dcfce7;
    color: #15803d;
}

.account-badge.pending {
    background: #fef3c7;
    color: #92400e;
}

.edit-notes {
    width: 100%;
    min-height: 168px;
    resize: vertical;
    padding: 14px;
    border: 1px solid #d6d4cf;
    border-radius: 8px;
    color: #1a1a1c;
    font: inherit;
    outline: 0;
}

.edit-notes-count {
    margin-top: 8px;
    color: #6b6a66;
    text-align: right;
    font-weight: 700;
}

.edit-tabs {
    display: grid;
    grid-template-columns: repeat(3, max-content) minmax(0, 1fr);
    gap: 0 28px;
}

.edit-tabs > input {
    position: absolute;
    opacity: 0;
}

.edit-tabs > label {
    padding: 0 0 13px;
    border-bottom: 2px solid transparent;
    color: #526176;
    cursor: pointer;
    font-weight: 900;
}

#tab-roles:checked + label,
#tab-ruts:checked + label,
#tab-rups:checked + label {
    color: var(--home-blue);
    border-bottom-color: var(--home-blue);
}

.edit-tab-panel {
    display: none;
    grid-column: 1 / -1;
    padding-top: 20px;
}

#tab-roles:checked ~ .roles-panel,
#tab-ruts:checked ~ .rut-panel,
#tab-rups:checked ~ .rup-panel {
    display: block;
}

.edit-roles-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px 34px;
    margin-bottom: 24px;
}

.edit-secondary-primary {
    margin-left: auto;
    border: 1px solid var(--home-blue);
    background: var(--home-blue);
    color: #fff;
}

.empty-panel p {
    margin: 0;
    padding: 28px;
    border: 1px dashed #d4d2cc;
    border-radius: 10px;
    color: #6b6a66;
    text-align: center;
    font-weight: 800;
}

.edit-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 22px;
}

.edit-actions > div {
    display: flex;
    gap: 14px;
}

.edit-back,
.edit-cancel {
    border: 1px solid #d6d4cf;
    background: #fff;
    color: #1a1a1c;
}

.edit-save {
    border: 1px solid var(--home-blue);
    background: var(--home-blue);
    color: #fff;
    box-shadow: 0 12px 22px rgba(var(--ui-acento-rgb), .22);
}

.edit-back:hover,
.edit-cancel:hover,
.edit-secondary-primary:hover,
.edit-save:hover {
    transform: translateY(-2px);
}

.users-alert.success {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

@media (max-width: 1180px) {
    .edit-user-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .edit-user-header,
    .edit-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .edit-user-title {
        align-items: flex-start;
    }

    .edit-form-grid,
    .edit-roles-grid {
        grid-template-columns: 1fr;
    }

    .edit-actions > div,
    .edit-back,
    .edit-cancel,
    .edit-save,
    .edit-user-reset {
        width: 100%;
    }
}

.broker-action-card:hover {
    transform: translateY(-4px);
    border-color: var(--home-blue);
    background: #fbfdff;
    box-shadow: 0 20px 38px rgba(var(--ui-acento-rgb), .15);
}

.broker-action-card:focus-visible {
    outline: 3px solid rgba(var(--ui-acento-rgb), .22);
    outline-offset: 3px;
}

.broker-action-icon {
    display: inline-grid;
    place-items: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--home-blue-soft);
    color: var(--home-blue-dark);
    font-size: 26px;
    transition: transform .18s ease, background .18s ease, color .18s ease;
}

.broker-action-card:hover .broker-action-icon {
    transform: scale(1.05);
    background: var(--home-blue-soft);
    color: var(--home-blue-dark);
}

.broker-action-copy {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.broker-action-copy strong {
    color: #121214;
    font-size: 17px;
    font-weight: 900;
}

.broker-action-copy small {
    color: #6b6a66;
    font-size: 14px;
    line-height: 1.45;
}

.broker-action-arrow {
    display: inline-grid;
    place-items: center;
    justify-self: end;
    color: #52514d;
    font-size: 24px;
    transition: transform .18s ease, color .18s ease;
}

.broker-action-card:hover .broker-action-arrow {
    transform: translateX(4px);
    color: var(--home-blue-dark);
}

@media (max-width: 980px) {
    .broker-actions,
    .broker-actions-3,
    .broker-actions-2,
    .broker-actions-1 {
        grid-template-columns: 1fr;
    }

    .broker-hero h1 {
        font-size: 26px;
    }
}

@media (max-width: 560px) {
    .broker-section {
        margin-top: 24px;
    }

    .broker-action-card {
        grid-template-columns: 52px minmax(0, 1fr) 22px;
        min-height: 104px;
        gap: 14px;
        padding: 20px 18px;
    }

    .broker-action-icon {
        width: 48px;
        height: 48px;
        font-size: 23px;
    }
}

/* Home dashboard layout */
.dashboard-page {
    width: 100%;
    max-width: 1680px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.top-dashboard-card {
    min-height: 330px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.recinto-card,
.progreso-card,
.ferias-card {
    grid-column: auto;
    grid-row: auto;
}

.recinto-body {
    grid-template-columns: minmax(138px, 180px) minmax(0, 1fr);
    gap: 18px;
    flex: 1;
}

.recinto-img {
    width: 150px;
    height: 124px;
}

.recinto-info {
    gap: 12px;
}

.recinto-footer {
    gap: 18px;
    margin-top: auto;
}

.progreso-card .btn-outline {
    margin-top: auto;
    align-self: start;
}

.compact-ferias-list {
    gap: 12px;
    flex: 1;
}

.compact-feria {
    padding-top: 12px;
}

.compact-feria:first-child {
    padding-top: 0;
}

.compact-feria h3 {
    margin-bottom: 8px;
}

.ferias-card .calendar {
    margin-top: auto;
}

.stream-card {
    grid-column: 1 / -1;
    padding: 22px 24px 24px;
}

.stream-body {
    grid-template-columns: minmax(0, 1fr) 260px;
}

.video-frame,
.video-empty,
.stream-panel {
    min-height: 380px;
}

.video-frame iframe,
.video-frame video {
    min-height: 380px;
}

.publicidad-card {
    grid-column: 1 / -1;
    position: relative;
    min-height: 260px;
    border-radius: 12px;
    overflow: hidden;
    background: #0d1215;
    box-shadow: var(--shadow);
}

.publicidad-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .8s ease;
}

.publicidad-slide.active {
    opacity: 1;
}

.calendar-modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.calendar-modal.open {
    display: flex;
}

.calendar-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 16, 20, .52);
    backdrop-filter: blur(4px);
}

.calendar-dialog {
    position: relative;
    width: min(980px, 100%);
    max-height: min(820px, 92vh);
    overflow: hidden;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 30px 80px rgba(0,0,0,.24);
}

.calendar-dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 28px;
    border-bottom: 1px solid var(--line);
}

.calendar-dialog-header h2 {
    margin: 0 0 4px;
    font-size: 24px;
    font-weight: 950;
}

.calendar-dialog-header p {
    margin: 0;
    color: var(--muted);
    text-transform: capitalize;
}

.calendar-close {
    width: 38px;
    height: 38px;
    border: 0;
    border-radius: 50%;
    background: #f1f0ed;
    color: #1c1c1e;
    cursor: pointer;
    font-weight: 900;
    transition: transform .18s ease, background .18s ease;
}

.calendar-close:hover {
    transform: translateY(-2px);
    background: #e4e3df;
}

.calendar-dialog-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 24px;
    padding: 26px 28px 30px;
    overflow: auto;
    max-height: calc(92vh - 92px);
}

.calendar-weekdays,
.calendar-days {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    gap: 8px;
}

.calendar-weekdays {
    margin-bottom: 10px;
    color: var(--muted);
    font-weight: 800;
    font-size: 13px;
    text-align: center;
}

.calendar-day {
    min-height: 54px;
    display: grid;
    place-items: center;
    border-radius: 10px;
    background: #f8fafb;
    border: 1px solid #edf1f4;
    font-weight: 800;
    color: #2a2a2c;
}

.calendar-day.empty {
    background: transparent;
    border: 0;
}

.calendar-day.has-feria {
    background: var(--green-soft);
    border-color: rgba(23,122,47,.34);
    color: var(--green-dark);
    box-shadow: inset 0 0 0 2px rgba(23,122,47,.08);
}

.calendar-list {
    display: grid;
    align-content: start;
    gap: 12px;
}

.calendar-list h3 {
    margin: 0 0 4px;
    font-size: 18px;
    font-weight: 900;
}

.calendar-list-item {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fbfcfd;
}

.calendar-list-item > span {
    width: 10px;
    height: 10px;
    margin-top: 6px;
    border-radius: 50%;
    background: var(--green);
}

.calendar-list-item strong,
.calendar-list-item small {
    display: block;
}

.calendar-list-item small {
    margin-top: 4px;
    color: var(--muted);
}

@media (max-width: 1320px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ferias-card,
    .stream-card,
    .publicidad-card {
        grid-column: 1 / -1;
    }

    .top-dashboard-card {
        min-height: 310px;
    }
}

@media (max-width: 980px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .top-dashboard-card {
        min-height: auto;
    }

    .stream-body {
        grid-template-columns: 1fr;
    }

    .video-frame,
    .video-empty,
    .stream-panel,
    .video-frame iframe,
    .video-frame video {
        min-height: 300px;
    }

    .calendar-dialog-body {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .recinto-body {
        grid-template-columns: 1fr;
    }

    .recinto-img {
        width: 150px;
        height: 118px;
    }

    .publicidad-card {
        min-height: 150px;
    }

    .calendar-modal {
        padding: 12px;
    }

    .calendar-dialog-header,
    .calendar-dialog-body {
        padding-left: 18px;
        padding-right: 18px;
    }

    .calendar-day {
        min-height: 42px;
        border-radius: 8px;
    }
}

/* =====================================================================
   Administración (usuarios y roles)
   ===================================================================== */
.admin-page { display: grid; gap: 22px; }

.admin-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .86rem; color: var(--muted); }
.admin-breadcrumb a { color: var(--home-blue); font-weight: 600; text-decoration: none; }
.admin-breadcrumb a:hover { text-decoration: underline; }

.admin-hero {
    display: flex; align-items: center; gap: 20px; padding: 28px 30px;
    border-radius: var(--radius);
    background: linear-gradient(120deg, var(--sidebar) 0%, var(--ui-negro) 55%, var(--home-blue-dark) 100%);
    color: #fff; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.admin-hero::after {
    content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 70%);
}
.admin-hero h1 { margin: 0 0 6px; font-size: 1.7rem; }
.admin-hero p { margin: 0; max-width: 680px; color: rgba(255, 255, 255, .82); line-height: 1.5; }
.admin-hero-badge {
    flex: 0 0 auto; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2);
}
.admin-hero-icon svg { width: 32px; height: 32px; }

.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; }
.admin-card {
    display: flex; align-items: center; gap: 18px; padding: 24px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
    color: var(--text); text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.admin-card:hover { transform: translateY(-3px); border-color: var(--home-blue); box-shadow: 0 18px 40px rgba(var(--ui-acento-rgb), .14); }
.admin-card:focus-visible { outline: 3px solid var(--home-blue-soft); outline-offset: 2px; }
.admin-card-icon {
    flex: 0 0 auto; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px;
    background: var(--home-blue-soft); color: var(--home-blue);
}
.admin-card-icon.alt { background: var(--home-blue-soft); color: var(--home-blue); }
.admin-card-icon svg { width: 28px; height: 28px; }
.admin-card-body { display: grid; gap: 4px; flex: 1; }
.admin-card-body strong { font-size: 1.08rem; }
.admin-card-body small { color: var(--muted); line-height: 1.45; }
.admin-card-go { color: var(--muted); transition: transform .18s ease, color .18s ease; }
.admin-card-go svg { width: 22px; height: 22px; }
.admin-card:hover .admin-card-go { color: var(--home-blue); transform: translateX(4px); }

.admin-note {
    display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; border-radius: 12px;
    background: var(--surface-soft); border: 1px dashed var(--line); color: var(--muted); font-size: .92rem;
}
.admin-note p { margin: 0; line-height: 1.5; }
.admin-note-icon svg { width: 20px; height: 20px; color: var(--home-blue); }

.users-kpi-card.kpi-warning { border-color: #f5c46b; background: #fff8e8; }

/* Roles: listado */
.roles-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.role-card {
    display: flex; flex-direction: column; gap: 16px; padding: 20px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
    transition: border-color .18s ease, box-shadow .18s ease;
}
.role-card:hover { border-color: rgba(var(--ui-acento-rgb), .45); box-shadow: 0 16px 36px rgba(var(--ui-sombra-rgb), .1); }
.role-card-admin { background: linear-gradient(180deg, #f3f7ff 0%, var(--surface) 60%); border-color: rgba(var(--ui-acento-rgb), .35); }
.role-card-head { display: flex; gap: 14px; align-items: flex-start; }
.role-card-head h2 { margin: 0 0 6px; font-size: 1.08rem; word-break: break-word; }
.role-card-avatar {
    flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
    background: var(--home-blue-soft); color: var(--home-blue);
}
.role-card-avatar svg { width: 22px; height: 22px; }
.role-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.role-badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
    font-size: .74rem; font-weight: 600; background: #f0efec; color: #4a5565;
}
.role-badge-admin { background: var(--home-blue); color: #fff; }
.role-badge-custom { background: var(--home-blue-soft); color: var(--home-blue-dark); }
.role-badge-users { background: transparent; border: 1px solid var(--line); }
.role-badge-icon svg { width: 13px; height: 13px; }
.role-modules { flex: 1; }
.role-modules-note { margin: 0; font-size: .88rem; color: var(--muted); line-height: 1.45; }
.role-modules-note.warning { color: #9a6200; }
.role-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.role-chips li {
    padding: 5px 10px; border-radius: 8px; font-size: .8rem; font-weight: 600;
    background: var(--home-blue-soft); color: var(--home-blue-dark);
}
.role-chips li.role-chip-more { background: #f0efec; color: var(--muted); }
.role-card-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.role-card-actions form { margin: 0; }
.role-action {
    display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--surface); color: var(--text);
    font: inherit; font-size: .88rem; font-weight: 600; text-decoration: none; cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.role-action:hover { border-color: var(--home-blue); color: var(--home-blue); background: var(--home-blue-soft); }
.role-action.danger:hover { border-color: #d64545; color: #b42318; background: #fdecec; }
.role-action:disabled { opacity: .45; cursor: not-allowed; background: var(--surface); color: var(--muted); border-color: var(--line); }
.role-action-icon svg { width: 16px; height: 16px; }
.role-locked { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--muted); }
.roles-empty {
    display: grid; place-items: center; gap: 10px; padding: 48px 20px; border-radius: var(--radius);
    background: var(--surface); border: 1px dashed var(--line); color: var(--muted);
}
.roles-empty-icon svg { width: 36px; height: 36px; }

/* Roles: edición */
.role-field-help { display: block; margin-top: 6px; font-size: .8rem; color: var(--muted); }
.role-field-error { display: block; margin-top: 4px; font-size: .82rem; color: #b42318; }
.role-modules-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.role-modules-head h2 { margin: 0; }
.role-modules-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.role-module-search {
    display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 10px;
    border: 1px solid var(--line); background: var(--surface-soft);
}
.role-module-search input { border: 0; outline: 0; background: transparent; font: inherit; min-width: 170px; }
.role-search-icon svg { width: 16px; height: 16px; color: var(--muted); }
.role-tool, .role-group-toggle {
    padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
    font: inherit; font-size: .84rem; font-weight: 600; color: var(--text); cursor: pointer;
}
.role-tool:hover, .role-group-toggle:hover { border-color: var(--home-blue); color: var(--home-blue); }
.role-group { border: 0; margin: 18px 0 0; padding: 0; }
.role-group legend {
    display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 10px; padding: 0 0 10px;
    font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}
.role-group-toggle { text-transform: none; letter-spacing: 0; padding: 4px 10px; font-size: .78rem; }
.role-module-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.role-module {
    position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 12px;
    border: 1.5px solid var(--line); background: var(--surface); cursor: pointer;
    transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.role-module:hover { border-color: rgba(var(--ui-acento-rgb), .5); }
.role-module input { position: absolute; opacity: 0; pointer-events: none; }
.role-module-check {
    flex: 0 0 auto; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px;
    border: 1.5px solid #c5cdd6; background: var(--surface); color: transparent; transition: all .15s ease;
}
.role-module-check svg { width: 14px; height: 14px; }
.role-module input:checked ~ .role-module-check { background: var(--home-blue); border-color: var(--home-blue); color: #fff; }
.role-module:has(input:checked) { border-color: var(--home-blue); background: var(--home-blue-soft); box-shadow: 0 6px 16px rgba(var(--ui-acento-rgb), .1); }
.role-module input:focus-visible ~ .role-module-check { outline: 3px solid rgba(var(--ui-acento-rgb), .3); outline-offset: 2px; }
.role-module-body { display: grid; gap: 3px; }
.role-module-body strong { font-size: .93rem; }
.role-module-body small { font-size: .8rem; color: var(--muted); line-height: 1.4; }
.role-module.locked { cursor: not-allowed; opacity: .75; background: var(--surface-soft); }
.role-module-lock { margin-left: auto; color: var(--muted); }
.role-module-lock svg { width: 16px; height: 16px; }
.role-summary-help { margin: 14px 0 0; font-size: .82rem; color: var(--muted); line-height: 1.45; }
[data-role-module][hidden], [data-role-group][hidden] { display: none !important; }

@media (max-width: 980px) {
    .admin-cards { grid-template-columns: 1fr; }
    .admin-hero { padding: 22px; }
}
@media (max-width: 560px) {
    .admin-hero { flex-direction: column; align-items: flex-start; }
    .role-module-search input { min-width: 0; width: 100%; }
}

/* =====================================================================
   Modal global de notificaciones (Fegosa.notificar / Fegosa.confirmar)
   ===================================================================== */
.fx-modal { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 20px; }
.fx-modal[hidden] { display: none; }
.fx-modal-backdrop { position: absolute; inset: 0; background: rgba(11, 16, 19, .55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .18s ease; }
.fx-modal-dialog {
    position: relative; width: min(440px, 100%); padding: 30px 28px 24px; border-radius: 20px; text-align: center;
    background: var(--surface); box-shadow: 0 30px 70px rgba(0, 0, 0, .28);
    transform: translateY(12px) scale(.97); opacity: 0; transition: transform .2s ease, opacity .2s ease;
}
.fx-modal.abierto .fx-modal-backdrop { opacity: 1; }
.fx-modal.abierto .fx-modal-dialog { transform: none; opacity: 1; }
.fx-modal-icon {
    display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 14px; border-radius: 50%;
    --fx-color: var(--home-blue); --fx-fondo: var(--home-blue-soft);
    color: var(--fx-color); background: var(--fx-fondo); box-shadow: 0 0 0 8px color-mix(in srgb, var(--fx-fondo) 55%, transparent);
}
.fx-modal-icon svg { width: 32px; height: 32px; }
.fx-modal[data-tipo="exito"] .fx-modal-icon { --fx-color: var(--green); --fx-fondo: var(--green-soft); }
.fx-modal[data-tipo="advertencia"] .fx-modal-icon { --fx-color: #b7791f; --fx-fondo: #fff4dc; }
.fx-modal[data-tipo="error"] .fx-modal-icon { --fx-color: #c53030; --fx-fondo: #fdecec; }
.fx-modal[data-tipo="confirmar"] .fx-modal-icon { --fx-color: var(--text); --fx-fondo: #f0efec; }
.fx-modal-dialog h2 { margin: 0 0 8px; font-size: 1.25rem; color: var(--text); }
.fx-modal-dialog p { margin: 0; color: var(--muted); line-height: 1.55; white-space: pre-line; word-break: break-word; }
.fx-modal-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; }
.fx-btn {
    min-width: 120px; padding: 11px 20px; border-radius: 12px; border: 1px solid transparent;
    font: inherit; font-weight: 700; cursor: pointer; transition: filter .15s ease, background .15s ease;
}
.fx-btn-primario { background: var(--home-blue); color: #fff; }
.fx-btn-primario:hover { background: var(--home-blue-dark); }
.fx-modal[data-tipo="error"] .fx-btn-primario { background: #c53030; }
.fx-modal[data-tipo="error"] .fx-btn-primario:hover { background: #a61f1f; }
.fx-modal[data-tipo="advertencia"] .fx-btn-primario { background: #b7791f; }
.fx-btn-secundario { background: var(--surface); border-color: var(--line); color: var(--text); }
.fx-btn-secundario:hover { background: var(--surface-soft); }
.fx-btn:focus-visible { outline: 3px solid rgba(var(--ui-acento-rgb), .35); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
    .fx-modal-dialog, .fx-modal-backdrop, .admin-card, .role-card { transition: none; }
}

/* ================================================================
   Página de error amigable (Views/Shared/Error.cshtml)
   ================================================================ */
.error-body {
    min-height: 100vh; margin: 0; display: flex; flex-direction: column;
    background:
        radial-gradient(1200px 600px at 10% -10%, rgba(var(--ui-acento-rgb), .10), transparent 60%),
        radial-gradient(900px 500px at 110% 110%, rgba(var(--ui-acento-rgb), .08), transparent 60%),
        var(--bg);
}
.error-shell { flex: 1; display: grid; place-items: center; align-content: center; gap: 18px; padding: 32px 18px; }
.error-card {
    width: min(620px, 100%); padding: 36px 36px 32px; text-align: center;
    background: var(--surface); border: 1px solid var(--line); border-radius: 24px;
    box-shadow: 0 24px 60px rgba(var(--ui-sombra-rgb), .10);
    animation: error-entrada .35s ease-out both;
}
@keyframes error-entrada { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.error-logo { display: block; width: 170px; max-width: 60%; height: auto; margin: 0 auto 22px; }
.error-badge {
    display: inline-grid; place-items: center; width: 76px; height: 76px; border-radius: 50%;
    position: relative; margin-bottom: 14px;
}
.error-badge::after { content: ""; position: absolute; inset: -8px; border-radius: 50%; border: 2px solid currentColor; opacity: .14; }
.error-badge.danger { background: #fdecec; color: #c62828; }
.error-badge.warning { background: #fff5e0; color: #b26a00; }
.error-badge-icon svg { width: 36px; height: 36px; }
.error-status { margin: 0; font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.error-card h1 { margin: 6px 0 10px; font-size: clamp(1.45rem, 3.5vw, 1.85rem); line-height: 1.2; color: var(--text); }
.error-text { margin: 0 auto 24px; max-width: 440px; color: var(--muted); line-height: 1.55; }
.error-code {
    display: flex; align-items: center; justify-content: space-between; gap: 14px; text-align: left;
    padding: 14px 16px; border-radius: 14px; background: var(--surface-soft); border: 1px dashed #c9d3dd;
}
.error-code-info { display: grid; gap: 3px; min-width: 0; }
.error-code-info small { color: var(--muted); font-size: .76rem; }
.error-code-info code {
    font-family: "Cascadia Mono", Consolas, "SFMono-Regular", monospace; font-size: .92rem; font-weight: 600;
    color: var(--text); overflow-wrap: anywhere; user-select: all;
}
.error-copy {
    flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; cursor: pointer;
    border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.error-copy svg { width: 16px; height: 16px; }
.error-copy:hover { border-color: var(--home-blue); color: var(--home-blue); }
.error-copy.copiado { background: var(--home-blue-soft); border-color: var(--home-blue); color: var(--home-blue-dark); }
.error-copy:focus-visible, .error-btn:focus-visible { outline: 3px solid var(--home-blue-soft); outline-offset: 2px; }
.error-help {
    display: flex; gap: 10px; align-items: flex-start; margin: 18px 0 26px; padding: 12px 14px; text-align: left;
    border-radius: 12px; background: var(--home-blue-soft); color: var(--home-blue-dark); font-size: .92rem; line-height: 1.5;
}
.error-help-icon svg { width: 18px; height: 18px; margin-top: 2px; }
.error-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.error-btn {
    display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; cursor: pointer;
    border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.error-btn svg { width: 18px; height: 18px; }
.error-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(var(--ui-sombra-rgb), .08); }
.error-btn.primary { background: var(--home-blue); border-color: var(--home-blue); color: #fff; }
.error-btn.primary:hover { background: var(--home-blue-dark); }
.error-foot { margin: 0; color: var(--muted); font-size: .8rem; }

.error-preview-bar {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
    padding: 12px 20px; background: var(--sidebar); color: #ebeae6; font-size: .9rem;
}
.error-preview-label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.error-preview-icon svg, .error-preview-back svg { width: 18px; height: 18px; }
.error-preview-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.error-preview-tabs a { padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .18); color: #cfd8e0; }
.error-preview-tabs a:hover { border-color: rgba(255, 255, 255, .45); color: #fff; }
.error-preview-tabs a.active { background: var(--home-blue); border-color: var(--home-blue); color: #fff; }
.error-preview-back { display: inline-flex; align-items: center; gap: 6px; color: #fff; font-weight: 600; }
.error-preview-back:hover { text-decoration: underline; }

.admin-card-icon.alt2 { background: #fff5e0; color: #b26a00; }

@media (max-width: 560px) {
    .error-card { padding: 30px 20px 24px; border-radius: 20px; }
    .error-code { flex-direction: column; align-items: stretch; }
    .error-copy { justify-content: center; }
    .error-btn { flex: 1 1 100%; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
    .error-card { animation: none; }
    .error-btn, .error-copy { transition: none; }
}

/* =====================================================================
   Menú lateral: logo centrado, contraer a íconos (escritorio) y panel móvil
   ===================================================================== */
:root {
    --sidebar-width: 280px;
    --sidebar-rail: 84px;
}

.app-body .sidebar {
    width: var(--sidebar-width);
    transition: width .24s ease, transform .24s ease, box-shadow .24s ease;
}
.app-body .app-shell {
    margin-left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
    transition: margin-left .24s ease, width .24s ease;
}

.sidebar-brand {
    position: relative; display: flex; align-items: center; justify-content: center;
    min-height: 116px; padding: 26px 22px 24px;
}
.sidebar-logo { display: flex; justify-content: center; width: 100%; border-radius: 12px; }
.sidebar-logo:focus-visible { outline: 2px solid rgba(255, 255, 255, .6); outline-offset: 4px; }
.sidebar-brand img { display: block; width: 176px; max-width: 82%; margin: 0 auto; transition: width .24s ease; }

.sidebar-collapse,
.sidebar-close {
    display: grid; place-items: center; cursor: pointer; padding: 0;
    transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.sidebar-collapse {
    position: absolute; top: 50%; right: -15px; transform: translateY(-50%); z-index: 3;
    width: 30px; height: 30px; border-radius: 50%;
    background: #fff; color: #141416; border: 1px solid var(--line);
    box-shadow: 0 6px 16px rgba(8, 13, 16, .22);
}
.sidebar-collapse:hover { background: var(--green); color: #fff; border-color: var(--green); }
.sidebar-collapse:focus-visible { outline: 3px solid rgba(23, 122, 47, .35); outline-offset: 2px; }
.sidebar-collapse svg { width: 16px; height: 16px; transition: transform .24s ease; }
.sidebar-close {
    display: none; position: absolute; top: 16px; right: 14px;
    width: 38px; height: 38px; border-radius: 10px;
    background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .18);
}
.sidebar-close:hover { background: rgba(255, 255, 255, .2); }
.sidebar-close svg { width: 20px; height: 20px; }

.sidebar-nav { overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .25) transparent; }
.nav-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-item.disabled { opacity: .62; cursor: not-allowed; }
.nav-soon {
    margin-left: auto; padding: 3px 9px; border-radius: 999px;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .16);
    color: rgba(255, 255, 255, .8); font-size: 11px; font-weight: 700; letter-spacing: .03em;
}
.nav-item:focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: -2px; }
.sidebar-logout button { justify-content: flex-start; }

.sidebar-backdrop {
    position: fixed; inset: 0; z-index: 19;
    background: rgba(8, 13, 16, .52); backdrop-filter: blur(2px);
    animation: sidebar-fade .2s ease both;
}
.sidebar-backdrop[hidden] { display: none; }
@keyframes sidebar-fade { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 981px) {
    .topbar .menu-toggle { display: none; }

    html.sidebar-rail .app-body .sidebar { width: var(--sidebar-rail); }
    html.sidebar-rail .app-body .app-shell { margin-left: var(--sidebar-rail); width: calc(100% - var(--sidebar-rail)); }
    html.sidebar-rail .sidebar-brand { flex-direction: column; gap: 12px; padding: 22px 8px 20px; }
    html.sidebar-rail .sidebar-brand img { width: 62px; max-width: 100%; }
    html.sidebar-rail .sidebar-collapse { position: static; transform: none; }
    html.sidebar-rail .sidebar-collapse svg { transform: rotate(180deg); }
    html.sidebar-rail .sidebar-nav { padding: 0 12px; overflow: visible; }
    html.sidebar-rail .nav-item { position: relative; justify-content: center; gap: 0; padding: 0; min-height: 56px; }
    html.sidebar-rail .nav-item:hover:not(.disabled) { transform: none; }
    html.sidebar-rail .nav-text,
    html.sidebar-rail .nav-soon { display: none; }
    html.sidebar-rail .sidebar-logout { padding: 18px 12px; }
    html.sidebar-rail .sidebar-logout button { position: relative; justify-content: center; gap: 0; }

    /* Etiqueta flotante con el nombre del módulo cuando el menú está contraído */
    html.sidebar-rail .nav-item::after,
    html.sidebar-rail .sidebar-logout button::after {
        content: attr(data-label); position: absolute; left: calc(100% + 16px); top: 50%; z-index: 30;
        transform: translate(-6px, -50%); padding: 7px 12px; border-radius: 8px;
        background: #141416; color: #fff; font-size: 13px; font-weight: 600; white-space: nowrap;
        box-shadow: 0 10px 24px rgba(8, 13, 16, .28); opacity: 0; pointer-events: none;
        transition: opacity .15s ease, transform .15s ease;
    }
    html.sidebar-rail .nav-item:hover::after,
    html.sidebar-rail .nav-item:focus-visible::after,
    html.sidebar-rail .sidebar-logout button:hover::after,
    html.sidebar-rail .sidebar-logout button:focus-visible::after { opacity: 1; transform: translate(0, -50%); }
}

@media (max-width: 980px) {
    .app-body .sidebar,
    .app-body:not(.sidebar-collapsed) .sidebar {
        width: min(300px, 86vw); opacity: 1; transform: translateX(-100%);
    }
    .app-body .sidebar.open,
    .app-body:not(.sidebar-collapsed) .sidebar.open {
        transform: translateX(0); box-shadow: 18px 0 40px rgba(8, 13, 16, .35);
    }
    .app-body .app-shell { margin-left: 0; width: 100%; }
    .sidebar-collapse { display: none; }
    .sidebar-close { display: grid; }
    .sidebar-brand { justify-content: center; padding: 24px 60px 22px; min-height: 100px; }
    .sidebar-brand img { width: 150px; max-width: 100%; }
    .nav-item { min-height: 56px; }
    body.sidebar-drawer-open { overflow: hidden; }
    .topbar { gap: 14px; }
    .topbar-title { font-size: 19px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
}

@media (max-width: 680px) {
    .topbar { padding: 0 16px; height: 64px; }
    .topbar-user .avatar { width: 38px; height: 38px; }
    .main-content { padding: 20px 14px; }
}

@media (prefers-reduced-motion: reduce) {
    .app-body .sidebar, .app-body .app-shell, .sidebar-brand img, .sidebar-collapse svg { transition: none; }
}

/* =====================================================================
   Menús de módulo (Corredores, Fegosa): encabezado y tarjetas
   ===================================================================== */
.broker-hero {
    display: flex; align-items: center; gap: 20px; margin-bottom: 8px; padding: 28px 30px;
    border-radius: var(--radius); position: relative; overflow: hidden;
    background: linear-gradient(120deg, var(--sidebar) 0%, var(--ui-negro) 55%, var(--home-blue-dark) 100%);
    color: #fff; box-shadow: var(--shadow);
}
.broker-hero::after {
    content: ""; position: absolute; right: -60px; top: -60px; width: 240px; height: 240px; border-radius: 50%;
    background: radial-gradient(circle, rgba(255, 255, 255, .14), transparent 70%); pointer-events: none;
}
.broker-hero-badge {
    flex: 0 0 auto; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 18px;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2);
}
.broker-hero-icon svg { display: block; width: 32px; height: 32px; }
.broker-hero-copy { position: relative; z-index: 1; min-width: 0; }
.broker-hero h1 { margin: 0 0 6px; color: #fff; font-size: 1.7rem; font-weight: 800; }
.broker-hero p { margin: 0; max-width: 680px; color: rgba(255, 255, 255, .82); font-size: 15px; line-height: 1.5; }

.broker-section { margin-top: 32px; }
.broker-section h2 { font-size: 19px; font-weight: 800; gap: 12px; }
.broker-section-icon {
    width: 36px; height: 36px; border-radius: 10px; font-size: 19px;
    background: var(--home-blue-soft); color: var(--home-blue);
}

.broker-action-card {
    min-height: 108px; padding: 22px 24px; border-color: var(--line); border-radius: var(--radius);
    box-shadow: 0 10px 26px rgba(var(--ui-sombra-rgb), .06);
}
.broker-action-card:hover { border-color: var(--home-blue); background: #fff; box-shadow: 0 18px 36px rgba(var(--ui-acento-rgb), .12); }
.broker-action-card:focus-visible { outline-color: rgba(var(--ui-acento-rgb), .3); }
.broker-action-icon { border-radius: 16px; background: var(--home-blue-soft); color: var(--home-blue); }
.broker-action-card:hover .broker-action-icon { background: var(--home-blue); color: #fff; }
.broker-action-card:hover .broker-action-arrow { color: var(--home-blue); }
.broker-action-copy strong { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 16px; font-weight: 800; }

/* Accesos aún no disponibles en la Web */
.broker-action-card.is-soon { cursor: not-allowed; }
.broker-action-card.is-soon:hover { transform: none; border-color: var(--line); box-shadow: 0 10px 26px rgba(var(--ui-sombra-rgb), .06); }
.broker-action-card.is-soon:hover .broker-action-icon { background: var(--home-blue-soft); color: var(--home-blue); transform: none; }
.broker-action-card.is-soon .broker-action-arrow { opacity: .35; }
.broker-action-card.is-soon:hover .broker-action-arrow { transform: none; color: #52514d; }
.soon-pill {
    display: inline-flex; align-items: center; padding: 2px 9px; border-radius: 999px;
    background: #fff5e0; color: #8a5300; border: 1px solid #f4d9a6;
    font-size: 11px; font-weight: 700; letter-spacing: .02em; white-space: nowrap;
}

/* La cantidad de columnas se ajusta sola al espacio disponible (con o sin menú contraído). */
.broker-page .broker-actions,
.broker-page .broker-actions-1,
.broker-page .broker-actions-2,
.broker-page .broker-actions-3 { grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); }
@media (max-width: 680px) {
    .broker-hero { flex-direction: column; align-items: flex-start; padding: 22px; gap: 14px; }
    .broker-hero h1 { font-size: 1.4rem; }
    .broker-hero-badge { width: 52px; height: 52px; border-radius: 14px; }
    .broker-hero-icon svg { width: 26px; height: 26px; }
    .admin-hero { padding: 22px; }
}

/* =====================================================================
   Corredores: anunciar ganado, mis anuncios, edición y detalle de loteo
   ===================================================================== */
a.broker-action-card { cursor: pointer; }

.an-page { max-width: 1180px; margin: 0 auto; display: grid; gap: 22px; }
.an-page.narrow, .an-page:has(#anuncio-form) { max-width: 880px; }
.an-page [hidden] { display: none !important; }
.an-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Encabezado de página ---------- */
.an-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.an-head-icon {
    flex: 0 0 auto; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 14px;
    background: var(--home-blue-soft); color: var(--home-blue);
}
.an-head-icon svg { width: 26px; height: 26px; }
.an-head-copy { flex: 1 1 260px; min-width: 0; }
.an-head-copy h1 { margin: 0 0 4px; font-size: 1.6rem; line-height: 1.2; }
.an-head-copy p { margin: 0; color: var(--muted); line-height: 1.5; }

/* ---------- Tarjetas y campos base ---------- */
.an-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: 0 8px 24px rgba(var(--ui-sombra-rgb), .05); padding: 22px 24px;
}
.an-card-flush { padding: 0; overflow: hidden; }
.an-card-title { display: flex; align-items: center; gap: 10px; margin: 0 0 18px; font-size: 1.05rem; }
.an-card-badge {
    display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px;
    background: var(--home-blue-soft); color: var(--home-blue);
}
.an-card-badge svg { width: 17px; height: 17px; }

.an-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 18px; }
.an-span-2 { grid-column: span 2; }
.an-field { display: grid; gap: 7px; min-width: 0; align-content: start; }
.an-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.an-fieldset > legend { padding: 0; margin-bottom: 8px; }
.an-label { font-weight: 700; font-size: .9rem; color: var(--text); }
.an-label small { font-weight: 500; color: var(--muted); }
.an-req { color: #c62828; font-weight: 800; }
.an-input {
    width: 100%; min-height: 46px; padding: 10px 13px; border-radius: 11px;
    border: 1px solid #d6d4cf; background: #fff; color: var(--text); font: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.an-input:hover:not(:disabled) { border-color: #a9b8ca; }
.an-input:focus { outline: none; border-color: var(--home-blue); box-shadow: 0 0 0 4px rgba(var(--ui-acento-rgb), .14); }
.an-input:disabled { background: var(--surface-soft); color: #98a2b3; cursor: not-allowed; }
select.an-input { cursor: pointer; }
.an-hint { color: var(--muted); font-size: .82rem; line-height: 1.45; margin: 0; }
.an-hint.warn { color: #8a5300; }

/* ---------- Botones ---------- */
.an-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
    border-radius: 12px; border: 1px solid transparent; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.an-btn svg { width: 18px; height: 18px; }
.an-btn.primary { background: var(--home-blue); color: #fff; box-shadow: 0 8px 18px rgba(var(--ui-acento-rgb), .22); }
.an-btn.primary:hover:not(:disabled) { background: var(--home-blue-dark); transform: translateY(-1px); }
.an-btn.secondary { background: var(--home-blue-soft); color: var(--home-blue-dark); border-color: var(--ui-borde-acento); }
.an-btn.secondary:hover:not(:disabled) { background: var(--ui-tinte-fuerte); }
.an-btn.ghost { background: #fff; color: var(--text); border-color: var(--line); }
.an-btn.ghost:hover { border-color: var(--home-blue); color: var(--home-blue); }
.an-btn.big { min-height: 52px; padding: 12px 28px; font-size: 1.05rem; }
.an-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.an-btn:focus-visible { outline: 3px solid rgba(var(--ui-acento-rgb), .3); outline-offset: 2px; }
.an-btn.block { width: 100%; }

.an-icon-btn {
    display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; padding: 0;
    border: 1px solid var(--line); background: #fff; color: #334155; cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.an-icon-btn svg { width: 17px; height: 17px; }
.an-icon-btn:hover { border-color: var(--home-blue); color: var(--home-blue); background: var(--home-blue-soft); }
.an-icon-btn.danger:hover { border-color: #e57373; color: #c62828; background: #fdecec; }
.an-icon-btn:focus-visible { outline: 3px solid rgba(var(--ui-acento-rgb), .3); outline-offset: 2px; }
.an-inline-form { display: inline; margin: 0; }

/* ---------- Anunciar: indicador de pasos ---------- */
.an-steps {
    list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px;
    counter-reset: paso;
}
.an-steps li { display: flex; align-items: center; gap: 10px; position: relative; color: var(--muted); font-weight: 600; font-size: .9rem; min-width: 0; }
.an-steps li:not(:last-child)::after {
    content: ""; flex: 1 1 auto; height: 2px; border-radius: 2px; background: var(--line); min-width: 12px;
}
.an-steps-num {
    flex: 0 0 auto; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%;
    background: #fff; border: 2px solid #d6d4cf; color: var(--muted); font-weight: 800; font-size: .85rem;
}
.an-steps-txt { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.an-steps li.is-active { color: var(--home-blue-dark); }
.an-steps li.is-active .an-steps-num { border-color: var(--home-blue); color: var(--home-blue); box-shadow: 0 0 0 4px rgba(var(--ui-acento-rgb), .12); }
.an-steps li.is-done { color: var(--text); }
.an-steps li.is-done .an-steps-num { background: var(--home-blue); border-color: var(--home-blue); color: #fff; }
.an-steps li.is-done::after { background: var(--home-blue); }

/* ---------- Anunciar: pasos en columna ---------- */
.an-flow { display: grid; gap: 18px; }
.an-step {
    position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
    box-shadow: 0 8px 24px rgba(var(--ui-sombra-rgb), .05); padding: 22px 24px 24px; scroll-margin-top: 104px;
    display: grid; gap: 18px; transition: border-color .2s ease, box-shadow .2s ease;
}
.an-step.is-active { border-color: rgba(var(--ui-acento-rgb), .45); box-shadow: 0 12px 30px rgba(var(--ui-acento-rgb), .10); }
.an-secuencial .an-step[data-revelado="false"] { display: none; }
.an-step.is-entering { animation: an-aparecer .35s ease-out both; }
@keyframes an-aparecer { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.an-step-head { display: flex; align-items: center; gap: 14px; }
.an-step-head h2 { margin: 0 0 2px; font-size: 1.15rem; }
.an-step-head p { margin: 0; color: var(--muted); font-size: .92rem; }
.an-step-head > div { flex: 1 1 auto; min-width: 0; }
.an-step-num {
    flex: 0 0 auto; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px;
    background: var(--home-blue-soft); color: var(--home-blue); font-weight: 800; font-size: 1.05rem;
}
.an-step-ok {
    flex: 0 0 auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%;
    background: #e8f6ee; color: #15803d; opacity: 0; transform: scale(.6); transition: opacity .2s ease, transform .2s ease;
}
.an-step-ok svg { width: 16px; height: 16px; }
.an-step.is-done .an-step-ok { opacity: 1; transform: none; }
.an-step.is-done .an-step-num { background: var(--home-blue); color: #fff; }
.an-field-fecha { max-width: 320px; }

.an-step-wait {
    display: flex; align-items: center; gap: 8px; margin: 0; padding: 12px 14px; border-radius: 12px;
    background: var(--surface-soft); border: 1px dashed #d6d4cf; color: var(--muted); font-size: .92rem;
}
.an-step-wait svg { width: 16px; height: 16px; flex: 0 0 auto; }
.an-step[data-bloqueado="true"] .an-detalle-body { opacity: .55; }

/* Recintos como opciones */
.an-pills { display: flex; flex-wrap: wrap; gap: 10px; }
.an-pill { position: relative; }
.an-pill input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.an-pill > span {
    display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 16px; border-radius: 12px;
    border: 1px solid #d6d4cf; background: #fff; font-weight: 600; cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.an-pill > span svg { width: 16px; height: 16px; color: var(--muted); }
.an-pill:hover > span { border-color: var(--home-blue); }
.an-pill input:checked + span { background: var(--home-blue); border-color: var(--home-blue); color: #fff; box-shadow: 0 6px 16px rgba(var(--ui-acento-rgb), .22); }
.an-pill input:checked + span svg { color: #fff; }
.an-pill input:focus-visible + span { outline: 3px solid rgba(var(--ui-acento-rgb), .3); outline-offset: 2px; }

/* Tipo de gestión como tarjetas */
.an-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.an-option { position: relative; }
.an-option input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }
.an-option-box {
    display: flex; align-items: center; gap: 12px; height: 100%; padding: 14px 16px; border-radius: 14px;
    border: 1px solid #d6d4cf; background: #fff; cursor: pointer; transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.an-option-box strong { display: block; }
.an-option-box small { display: block; color: var(--muted); font-size: .82rem; margin-top: 2px; }
.an-option-icon { flex: 0 0 auto; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 11px; background: var(--surface-soft); color: var(--muted); }
.an-option-icon svg { width: 20px; height: 20px; }
.an-option:hover .an-option-box { border-color: var(--home-blue); }
.an-option input:checked + .an-option-box { border-color: var(--home-blue); background: #f5f8ff; box-shadow: 0 0 0 3px rgba(var(--ui-acento-rgb), .14); }
.an-option input:checked + .an-option-box .an-option-icon { background: var(--home-blue); color: #fff; }
.an-option input:focus-visible + .an-option-box { outline: 3px solid rgba(var(--ui-acento-rgb), .3); outline-offset: 2px; }

/* Selector de cliente con búsqueda */
.an-combo { position: relative; }
.an-combo-input { padding-right: 40px; }
.an-combo-clear {
    position: absolute; right: 8px; top: 23px; transform: translateY(-50%); display: none; width: 28px; height: 28px;
    border: 0; border-radius: 8px; background: transparent; color: var(--muted); font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.an-combo-clear:hover { background: var(--surface-soft); color: var(--text); }
.an-combo.has-value .an-combo-clear { display: block; }
.an-combo-list {
    position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 6px); max-height: 280px; overflow-y: auto;
    margin: 0; padding: 6px; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 12px;
    box-shadow: 0 18px 40px rgba(var(--ui-sombra-rgb), .16);
}
.an-combo-list li { padding: 10px 12px; border-radius: 8px; cursor: pointer; font-size: .94rem; }
.an-combo-list li:hover, .an-combo-list li[aria-selected="true"] { background: var(--home-blue-soft); color: var(--home-blue-dark); }
.an-combo-list li.is-current { font-weight: 700; }
.an-combo-list li.an-combo-empty { color: var(--muted); cursor: default; background: transparent; font-size: .86rem; }

/* Línea de ganado */
.an-detalle-body { display: grid; gap: 16px; }
.an-linea-form {
    display: grid; grid-template-columns: 110px minmax(0, 1fr) minmax(0, 1.2fr) auto; gap: 12px; align-items: end;
    padding: 16px; border-radius: 14px; background: var(--surface-soft); border: 1px solid var(--line);
}
.an-linea-form .an-btn { min-height: 46px; }
.an-lineas { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.an-linea {
    display: flex; align-items: center; gap: 14px; padding: 12px 12px 12px 14px; border-radius: 14px;
    border: 1px solid var(--line); background: #fff; animation: an-aparecer .25s ease-out both;
}
.an-linea-cant {
    flex: 0 0 auto; min-width: 52px; padding: 8px 10px; border-radius: 10px; text-align: center;
    background: var(--home-blue-soft); color: var(--home-blue-dark); font-weight: 800; font-size: 1.1rem;
}
.an-linea-info { flex: 1 1 auto; min-width: 0; }
.an-linea-info strong { display: block; }
.an-linea-info small { display: block; color: var(--muted); overflow-wrap: anywhere; }
.an-lineas-vacio { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 18px; color: var(--muted); border: 1px dashed #d6d4cf; border-radius: 14px; }
.an-lineas-vacio svg { width: 18px; height: 18px; }

/* Paso final: resumen */
.an-step-final { background: linear-gradient(180deg, #f7faff 0%, #fff 60%); border-color: var(--ui-borde-acento); }
.an-check { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.an-check li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); min-width: 0; }
.an-check li > span:last-child { min-width: 0; }
.an-check small { display: block; color: var(--muted); font-size: .78rem; }
.an-check strong { display: block; overflow-wrap: anywhere; }
.an-check-dot { flex: 0 0 auto; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-soft); color: var(--muted); }
.an-check-dot svg { width: 17px; height: 17px; }
.an-check li.is-ok .an-check-dot { background: var(--home-blue-soft); color: var(--home-blue); }
.an-check li:not(.is-ok) strong { color: var(--muted); font-weight: 500; }
.an-final-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-top: 4px; }
.an-total { display: flex; align-items: baseline; gap: 8px; }
.an-total strong { font-size: 2rem; line-height: 1; color: var(--home-blue-dark); }
.an-total span { color: var(--muted); }
.an-final-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Mis anuncios ---------- */
.an-toolbar {
    display: flex; flex-wrap: wrap; align-items: end; gap: 12px; padding: 16px 18px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.an-tool { display: grid; gap: 6px; flex: 1 1 200px; }
.an-tool > span { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 700; color: var(--muted); }
.an-tool > span svg { width: 15px; height: 15px; }
.an-toolbar .an-btn { flex: 0 0 auto; min-height: 46px; }

.an-context { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.an-context h2 { margin: 0; font-size: 1.35rem; }
.an-context p { margin: 2px 0 0; color: var(--muted); font-weight: 600; }
.an-rule { position: relative; }
.an-rule summary {
    display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none; padding: 8px 12px; border-radius: 999px;
    background: #fff; border: 1px solid var(--line); color: var(--home-blue-dark); font-weight: 600; font-size: .88rem;
}
.an-rule summary::-webkit-details-marker { display: none; }
.an-rule summary svg { width: 15px; height: 15px; }
.an-rule[open] summary { border-color: var(--home-blue); }
.an-rule p {
    position: absolute; right: 0; top: calc(100% + 8px); z-index: 12; width: min(360px, 86vw); margin: 0; padding: 14px 16px;
    background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px rgba(var(--ui-sombra-rgb), .14);
    color: var(--text); font-size: .9rem; line-height: 1.5;
}

.an-stats {
    display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(var(--ui-sombra-rgb), .05);
}
.an-stat { display: flex; align-items: center; gap: 14px; padding: 18px 20px; min-width: 0; }
.an-stat + .an-stat { border-left: 1px solid var(--line); }
.an-stat strong { display: block; font-size: 1.6rem; line-height: 1.1; }
.an-stat strong em { font-style: normal; font-size: 1rem; color: var(--muted); font-weight: 600; }
.an-stat small { display: block; color: var(--muted); font-size: .84rem; }
.an-stat-grow { flex: 1 1 auto; min-width: 0; }
.an-stat-icon { flex: 0 0 auto; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px; background: var(--home-blue-soft); color: var(--home-blue); }
.an-stat-icon.alt { background: var(--home-blue-soft); color: var(--home-blue); }
.an-stat-icon.alt2 { background: #fff5e0; color: #b26a00; }
.an-stat-icon svg { width: 21px; height: 21px; }

.an-prog { display: block; height: 8px; border-radius: 999px; background: #ecebe7; overflow: hidden; margin-top: 8px; }
.an-prog > span { display: block; height: 100%; border-radius: inherit; background: var(--home-blue); }
.an-prog.full > span { background: #16a34a; }

.an-tabs { display: flex; gap: 4px; padding: 6px 10px 0; border-bottom: 1px solid var(--line); background: var(--surface-soft); }
.an-tab {
    display: inline-flex; align-items: center; gap: 8px; padding: 12px 14px; margin-bottom: -1px;
    border: 0; border-bottom: 3px solid transparent; background: transparent; font: inherit; font-weight: 700; color: var(--muted); cursor: pointer;
}
.an-tab svg { width: 17px; height: 17px; }
.an-tab[aria-selected="true"] { color: var(--home-blue-dark); border-bottom-color: var(--home-blue); }
.an-tab:focus-visible { outline: 3px solid rgba(var(--ui-acento-rgb), .3); outline-offset: -3px; border-radius: 8px 8px 0 0; }
.an-tab-panel { padding: 8px 0 0; }

.an-clientes { list-style: none; margin: 0; padding: 0; }
.an-cliente {
    display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) 150px 220px; align-items: center; gap: 18px;
    padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.an-cliente:hover { background: #fafcff; }
.an-cliente-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
.an-avatar {
    flex: 0 0 auto; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
    background: #f1f0ed; color: #52514d; font-weight: 800; font-size: .9rem;
}
.an-avatar.on { background: var(--home-blue-soft); color: var(--home-blue-dark); }
.an-cliente-nombre { min-width: 0; }
.an-cliente-nombre strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-cliente-nombre small { display: block; color: var(--muted); font-size: .82rem; }
.an-avance-txt { display: flex; justify-content: space-between; gap: 8px; font-size: .86rem; color: var(--muted); }
.an-avance-txt b { color: var(--text); }
.an-cliente-avance .an-prog { margin-top: 6px; }
.an-cliente-estado { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.an-cliente-acciones { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; }
.an-act {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff; color: #334155; font: inherit; font-size: .86rem; font-weight: 600;
    cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.an-act svg { width: 15px; height: 15px; }
.an-act:hover { border-color: var(--home-blue); color: var(--home-blue); background: var(--home-blue-soft); }
.an-act.danger:hover { border-color: #e57373; color: #c62828; background: #fdecec; }
.an-act:focus-visible { outline: 3px solid rgba(var(--ui-acento-rgb), .3); outline-offset: 2px; }

.an-list-foot { display: flex; justify-content: space-between; gap: 12px; padding: 14px 20px; background: var(--surface-soft); color: var(--muted); font-weight: 600; }
.an-list-foot b { color: var(--text); }

.an-ganado { list-style: none; margin: 0; padding: 8px 20px; display: grid; gap: 4px; }
.an-ganado li { display: grid; grid-template-columns: minmax(120px, 220px) minmax(0, 1fr) 70px; align-items: center; gap: 14px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.an-ganado li:last-child { border-bottom: 0; }
.an-ganado-nombre { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.an-ganado-barra { display: block; height: 12px; border-radius: 999px; background: #f1f0ed; overflow: hidden; }
.an-ganado-barra > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--oro-claro), var(--home-blue)); }
.an-ganado-cant { text-align: right; font-size: 1.05rem; }

/* ---------- Distintivos ---------- */
.an-badge {
    display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px;
    font-size: .78rem; font-weight: 700; white-space: nowrap; border: 1px solid transparent;
}
.an-badge svg { width: 13px; height: 13px; }
.an-badge.neutral { background: #f3f2ef; color: #52514d; border-color: #e4e3df; }
.an-badge.blue { background: var(--home-blue-soft); color: var(--home-blue-dark); border-color: var(--ui-borde-acento); }
.an-badge.red { background: #fdecec; color: #b42318; border-color: #f7c7c7; }
.an-badge.ok { background: #e8f6ee; color: #146c3a; border-color: #bfe5cd; }
.an-badge.warn { background: #fff5e0; color: #8a5300; border-color: #f4d9a6; }

/* ---------- Tablas (detalle de loteo) ---------- */
.an-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; }
.an-table { width: 100%; border-collapse: collapse; font-size: .94rem; }
.an-table th, .an-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.an-table thead th { background: var(--surface-soft); color: var(--muted); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.an-table tbody tr:hover { background: var(--ui-hover); }
.an-table tfoot td { background: var(--surface-soft); font-weight: 800; border-bottom: 0; }
.an-table .num { text-align: right; white-space: nowrap; }
.an-cell-main strong { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.an-sub { display: block; color: var(--muted); font-size: .8rem; margin-top: 2px; }

.an-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.an-kpis.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.an-kpi {
    display: flex; align-items: center; gap: 14px; padding: 18px 20px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(var(--ui-sombra-rgb), .05);
}
.an-kpi small { display: block; color: var(--muted); font-size: .82rem; }
.an-kpi strong { display: block; font-size: 1.5rem; line-height: 1.2; }
.an-kpi-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: var(--home-blue-soft); color: var(--home-blue); flex: 0 0 auto; }
.an-kpi-icon.alt { background: var(--home-blue-soft); color: var(--home-blue); }
.an-kpi-icon.alt2 { background: #fff5e0; color: #b26a00; }
.an-kpi-icon.ok { background: #e8f6ee; color: #15803d; }
.an-kpi-icon svg { width: 22px; height: 22px; }
.an-callout { display: flex; gap: 8px; padding: 10px 14px; border-radius: 10px; background: var(--home-blue-soft); color: var(--home-blue-dark); }
.an-callout svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 2px; }

/* ---------- Editar ---------- */
.an-datos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 0; }
.an-datos dt { color: var(--muted); font-size: .82rem; margin-bottom: 4px; }
.an-datos dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.an-datos dd small { display: block; color: var(--muted); font-weight: 500; }
.an-form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.an-form-actions.start { justify-content: flex-start; margin-top: 0; }

/* ---------- Estados vacíos ---------- */
.an-empty { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 36px 20px; color: var(--muted); }
.an-empty.compact { padding: 30px 16px; }
.an-empty h2 { margin: 0; color: var(--text); font-size: 1.1rem; }
.an-empty p { margin: 0; }
.an-empty-icon svg { width: 40px; height: 40px; color: var(--home-blue); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
    .an-cliente { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .an-cliente-estado { flex-direction: row; flex-wrap: wrap; }
    .an-kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .an-page { gap: 18px; }
    .an-head-copy h1 { font-size: 1.35rem; }
    .an-head > .an-btn { width: 100%; }
    .an-card, .an-step { padding: 18px 16px; }
    .an-grid { grid-template-columns: 1fr; }
    .an-span-2 { grid-column: auto; }
    .an-field-fecha { max-width: none; }

    .an-steps-txt { display: none; }
    .an-steps { margin-bottom: 12px; }
    .an-options { grid-template-columns: 1fr; }
    .an-pill { flex: 1 1 calc(50% - 10px); }
    .an-pill > span { width: 100%; justify-content: center; }
    .an-linea-form { grid-template-columns: 96px minmax(0, 1fr); }
    .an-linea-form .an-f-det, .an-linea-form .an-f-btn { grid-column: 1 / -1; }
    .an-check { grid-template-columns: 1fr; }
    .an-final-bar { flex-direction: column; align-items: stretch; }
    .an-final-actions { flex-direction: column-reverse; }
    .an-final-actions .an-btn { width: 100%; }

    .an-toolbar .an-btn { width: 100%; }
    .an-rule p { right: auto; left: 0; }
    .an-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .an-stat { flex-direction: column; align-items: flex-start; gap: 6px; padding: 12px; }
    .an-stat-icon { width: 32px; height: 32px; border-radius: 9px; }
    .an-stat-icon svg { width: 17px; height: 17px; }
    .an-stat strong { font-size: 1.3rem; }
    .an-stat small { font-size: .74rem; line-height: 1.3; }
    .an-stat-grow { width: 100%; }
    .an-card.an-card-flush { padding: 0; }
    .an-tabs { padding: 4px 6px 0; }
    .an-tab { flex: 1 1 0; justify-content: center; padding: 12px 8px; font-size: .9rem; white-space: nowrap; }
    .an-tab svg { display: none; }
    .an-cliente { grid-template-columns: 1fr; gap: 12px; padding: 16px; }
    .an-cliente-acciones { justify-content: flex-start; }
    .an-cliente-acciones .an-act, .an-cliente-acciones .an-inline-form { flex: 1 1 auto; }
    .an-cliente-acciones .an-inline-form .an-act { width: 100%; justify-content: center; }
    .an-cliente-acciones .an-act { justify-content: center; }
    .an-ganado { padding: 8px 16px; }
    .an-ganado li { grid-template-columns: minmax(0, 1fr) 60px; gap: 6px 10px; }
    .an-ganado-barra { grid-column: 1 / -1; grid-row: 2; }

    .an-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
    .an-kpis.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .an-kpi { flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
    .an-kpi-icon { width: 34px; height: 34px; border-radius: 10px; }
    .an-kpi-icon svg { width: 18px; height: 18px; }
    .an-kpi small { font-size: .74rem; line-height: 1.3; }
    .an-kpi strong { font-size: 1.25rem; }
    .an-datos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .an-form-actions .an-btn { flex: 1 1 auto; }

    /* Tabla de loteo como tarjetas */
    .an-table-wrap:has(.an-table-cards) { border: 0; overflow: visible; }
    .an-table-cards thead { display: none; }
    .an-table-cards, .an-table-cards tbody, .an-table-cards tfoot, .an-table-cards tr, .an-table-cards td { display: block; width: 100%; }
    .an-table-cards tr { border: 1px solid var(--line); border-radius: 12px; margin-bottom: 12px; padding: 6px 4px; background: #fff; }
    .an-table-cards td { display: flex; justify-content: space-between; align-items: center; gap: 12px; border-bottom: 0; padding: 7px 12px; text-align: right; }
    .an-table-cards td::before { content: attr(data-label); color: var(--muted); font-size: .82rem; font-weight: 600; text-align: left; }
    .an-table-cards td:not([data-label])::before { content: none; }
    .an-table-cards td.an-cell-main { display: block; text-align: left; padding-top: 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
    .an-table-cards td.an-cell-main::before { content: none; }
    .an-table-cards tfoot tr { background: var(--surface-soft); }
    .an-table-cards tfoot td[colspan] { display: none; }
}
@media (max-width: 420px) {
    .an-datos { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
    .an-step.is-entering, .an-linea { animation: none; }
}

/* =====================================================================
   Ruta de navegación en la barra superior y ancho completo en escritorio
   ===================================================================== */
.topbar-title { min-width: 0; }
.topbar-crumbs { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 19px; white-space: nowrap; }
.topbar-crumbs a { color: var(--muted); font-weight: 600; text-decoration: none; }
.topbar-crumbs a:hover { color: var(--home-blue); }
.topbar-crumbs a:focus-visible { outline: 3px solid rgba(var(--ui-acento-rgb), .3); outline-offset: 2px; border-radius: 6px; }
.topbar-crumbs > span[aria-hidden="true"] { color: #bdbbb6; font-weight: 400; }
.topbar-crumbs > span:last-child { color: var(--text); font-weight: 900; overflow: hidden; text-overflow: ellipsis; }

/* Las pantallas de anuncios usan todo el ancho disponible */
.an-page, .an-page.narrow, .an-page:has(#anuncio-form) { max-width: none; }

@media (min-width: 1100px) {
    .an-step { column-gap: 28px; }
    .an-step > .an-step-head,
    .an-step > .an-step-wait,
    .an-step > .an-detalle-body,
    .an-step > .an-check,
    .an-step > .an-final-bar { grid-column: 1 / -1; }

    /* Paso 1: fecha a la izquierda, recintos a la derecha */
    .an-step[data-paso="1"] { grid-template-columns: minmax(240px, 340px) minmax(0, 1fr); align-items: start; }
    .an-field-fecha { max-width: none; }
    /* Paso 2: cliente y tipo de gestión lado a lado */
    .an-step[data-paso="2"] { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
    /* Paso 3: líneas en columnas */
    .an-lineas { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
    /* Paso 4: resumen en una fila */
    .an-check { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
    /* En pantallas chicas se muestra solo la página actual */
    .topbar-crumbs { font-size: 17px; }
    .topbar-crumbs > a, .topbar-crumbs > span[aria-hidden="true"] { display: none; }
}

/* =====================================================================
   Inicio (Views/Home/Index.cshtml)
   ===================================================================== */
.ho-page { display: grid; gap: 22px; }
.ho-page [hidden] { display: none !important; }

.ho-hero {
    display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
    min-height: 180px; padding: 28px 30px; border-radius: 20px; color: #fff; position: relative; overflow: hidden;
    /* Banner panorámico: se recorta solo (cover) y mantiene a la vista el sector derecho (volcán y ganado)
       tanto con el menú abierto como contraído. El degradado asegura la lectura del texto. */
    background:
        linear-gradient(90deg, rgba(var(--ui-sombra-rgb), .88) 0%, rgba(var(--ui-sombra-rgb), .62) 38%, rgba(var(--ui-sombra-rgb), .12) 70%, rgba(var(--ui-sombra-rgb), 0) 100%),
        url('/img/banner-inicio.jpg') 70% center / cover no-repeat, var(--ui-negro);
    box-shadow: 0 16px 36px rgba(var(--ui-sombra-rgb), .18);
}
.ho-date { margin: 0 0 4px; color: rgba(255, 255, 255, .78); font-weight: 600; }
.ho-hero-copy { position: relative; z-index: 1; text-shadow: 0 2px 12px rgba(0, 0, 0, .35); }
.ho-hero h1 { margin: 0 0 12px; font-size: clamp(1.5rem, 2.6vw, 2.1rem); line-height: 1.15; }
.ho-status {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px;
    background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); font-weight: 600; font-size: .9rem;
}
.ho-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #d4d2cc; }
.ho-status.on .ho-status-dot { background: #4ade80; box-shadow: 0 0 0 4px rgba(74, 222, 128, .25); }
.ho-live-link {
    display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 12px;
    background: #fff; color: #b91c1c; font-weight: 800; text-decoration: none; box-shadow: 0 8px 20px rgba(0, 0, 0, .15);
}
.ho-live-link:hover { background: #fff5f5; }
.ho-live-dot { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; animation: ho-pulso 1.6s ease-in-out infinite; }
@keyframes ho-pulso { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .55); } 50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); } }

.ho-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
    box-shadow: 0 8px 24px rgba(var(--ui-sombra-rgb), .05); padding: 22px 24px; min-width: 0;
}
.ho-card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.ho-card-head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 1.1rem; }
.ho-h-icon svg { width: 20px; height: 20px; color: var(--home-blue); display: block; }

/* Transmisión */
.ho-live { padding: 0; overflow: hidden; scroll-margin-top: 100px; }
.ho-live-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.ho-live-head h2 { margin: 0; font-size: 1.1rem; }
.ho-live-badge {
    display: inline-flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 999px;
    background: #fee2e2; color: #b91c1c; font-weight: 800; font-size: .76rem; letter-spacing: .06em;
}
.ho-live-meta { margin-left: auto; color: var(--muted); font-weight: 600; }
.ho-live-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; }
.ho-video { position: relative; aspect-ratio: 16 / 9; background: #0b1013; }
.ho-video iframe, .ho-video video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ho-live-side { display: grid; align-content: start; gap: 10px; padding: 20px; border-left: 1px solid var(--line); background: var(--surface-soft); }
.ho-live-side dl { display: grid; gap: 14px; margin: 0 0 8px; }
.ho-live-side dt { color: var(--muted); font-size: .8rem; margin-bottom: 2px; }
.ho-live-side dd { margin: 0; font-weight: 700; }

.ho-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 16px;
    border-radius: 11px; border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; font-weight: 700; cursor: pointer;
    transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.ho-btn:hover { border-color: var(--home-blue); color: var(--home-blue); }
.ho-btn.primary { background: var(--home-blue); border-color: var(--home-blue); color: #fff; }
.ho-btn.primary:hover { background: var(--home-blue-dark); color: #fff; }
.ho-btn.small { min-height: 36px; padding: 6px 12px; font-size: .86rem; }
.ho-btn:focus-visible { outline: 3px solid rgba(var(--ui-acento-rgb), .3); outline-offset: 2px; }
.ho-btn-icon svg { width: 17px; height: 17px; display: block; }

.ho-pill { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; background: #f3f2ef; color: #52514d; }
.ho-pill.on { background: #e8f6ee; color: #146c3a; }


/* Recinto y próximas ferias */
.ho-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; align-items: stretch; }

.ho-empty { display: grid; justify-items: center; gap: 8px; padding: 26px 10px; color: var(--muted); text-align: center; }
.ho-empty p { margin: 0; }
.ho-empty-icon svg { width: 36px; height: 36px; color: var(--home-blue); }

.ho-publicidad { border-radius: 18px; }

@media (max-width: 1280px) {
    .ho-grid { grid-template-columns: 1fr; }
}
@media (max-width: 980px) {
    .ho-live-body { grid-template-columns: 1fr; }
    .ho-live-side { border-left: 0; border-top: 1px solid var(--line); grid-template-columns: 1fr 1fr; }
    .ho-live-side dl { grid-column: 1 / -1; grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
    .ho-hero { min-height: 0; padding: 20px; border-radius: 16px; background-position: 0 0, 78% center, 0 0; }
    .ho-hero { background-image: linear-gradient(180deg, rgba(var(--ui-sombra-rgb), .55) 0%, rgba(var(--ui-sombra-rgb), .85) 100%), url('/img/banner-inicio.jpg'); }
    .ho-live-link { width: 100%; justify-content: center; }
    .ho-live-meta { margin-left: 0; width: 100%; }
    .ho-live-side { grid-template-columns: 1fr; }
    .ho-live-side dl { grid-template-columns: 1fr 1fr; }
    .ho-card { padding: 18px 16px; }
    .ho-live { padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
    .ho-live-dot { animation: none; }
}

/* =====================================================================
   Recintos (Views/Recintos/Index.cshtml)
   ===================================================================== */
.rc-page { display: grid; gap: 18px; }
.rc-page [hidden] { display: none !important; }
.rc-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.rc-head h1 { margin: 0 0 4px; font-size: 1.6rem; }
.rc-head p { margin: 0; color: var(--muted); }
.rc-counter { padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-weight: 600; }
.rc-counter b { color: var(--home-blue-dark); }

/* Pestañas de recintos */
.rc-tabs {
    display: flex; gap: 8px; overflow-x: auto; padding: 4px; margin: 0 -4px; scrollbar-width: none;
    scroll-snap-type: x proximity;
}
.rc-tabs::-webkit-scrollbar { display: none; }
.rc-tab {
    flex: 0 0 auto; display: grid; text-align: left; gap: 1px; padding: 10px 18px; border-radius: 14px; scroll-snap-align: center;
    border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.rc-tab-nombre { font-weight: 800; }
.rc-tab small { color: var(--muted); font-size: .78rem; }
.rc-tab:hover { border-color: var(--home-blue); transform: translateY(-1px); }
.rc-tab[aria-selected="true"] { background: var(--home-blue); border-color: var(--home-blue); color: #fff; box-shadow: 0 10px 22px rgba(var(--ui-acento-rgb), .25); }
.rc-tab[aria-selected="true"] small { color: rgba(255, 255, 255, .8); }
.rc-tab:focus-visible { outline: 3px solid rgba(var(--ui-acento-rgb), .3); outline-offset: 2px; }

/* Carrusel */
.rc-viewport { position: relative; border-radius: 22px; }
.rc-viewport:focus-visible { outline: 3px solid rgba(var(--ui-acento-rgb), .3); outline-offset: 4px; }
.rc-track { display: grid; gap: 22px; }
.rc-js .rc-viewport { overflow: hidden; transition: height .45s ease; }
.rc-js .rc-track {
    display: flex; gap: 0; align-items: flex-start; will-change: transform; touch-action: pan-y;
    transition: transform .6s cubic-bezier(.22, .8, .22, 1);
}
.rc-js .rc-track.is-dragging, .rc-js .rc-track.sin-transicion { transition: none; }
.rc-js .rc-viewport { margin-inline: -12px; }
.rc-js .rc-slide { flex: 0 0 100%; min-width: 0; padding: 0 12px; }
.rc-page:not(.rc-js) .rc-tabs, .rc-page:not(.rc-js) .rc-nav, .rc-page:not(.rc-js) .rc-dots, .rc-page:not(.rc-js) .rc-counter { display: none; }

.rc-nav {
    position: absolute; z-index: 5; top: 190px; transform: translateY(-50%); display: grid; place-items: center;
    width: 46px; height: 46px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .92); color: var(--text);
    box-shadow: 0 10px 26px rgba(8, 13, 16, .25); cursor: pointer; transition: transform .2s ease, background .2s ease;
}
.rc-nav svg { width: 20px; height: 20px; }
.rc-nav.prev { left: 26px; }
.rc-nav.next { right: 26px; }
.rc-nav:hover { background: #fff; transform: translateY(-50%) scale(1.06); }
.rc-nav:focus-visible { outline: 3px solid rgba(var(--ui-acento-rgb), .45); outline-offset: 2px; }

/* Portada del recinto */
.rc-hero { position: relative; height: 380px; border-radius: 22px; overflow: hidden; background: #0b1013; }
.rc-fotos { position: absolute; inset: 0; }
.rc-foto { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .6s ease; }
.rc-foto.is-on { opacity: 1; }
.rc-js .rc-slide.is-active .rc-foto.is-on { animation: rc-zoom 12s ease-out both; }
@keyframes rc-zoom { from { transform: scale(1.08); } to { transform: scale(1); } }
.rc-hero::after {
    content: ""; position: absolute; inset: 0; pointer-events: none;
    background: linear-gradient(0deg, rgba(var(--ui-sombra-rgb), .88) 0%, rgba(var(--ui-sombra-rgb), .35) 45%, rgba(var(--ui-sombra-rgb), 0) 75%),
                linear-gradient(90deg, rgba(var(--ui-sombra-rgb), .45) 0%, rgba(var(--ui-sombra-rgb), 0) 60%);
}
.rc-hero-copy { position: absolute; z-index: 2; left: 30px; right: 30px; bottom: 26px; color: #fff; }
.rc-kicker { margin: 0; text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 700; color: rgba(255, 255, 255, .78); }
.rc-hero-copy h2 { margin: 2px 0 12px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.05; text-shadow: 0 4px 18px rgba(0, 0, 0, .35); }
.rc-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.rc-chip {
    display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font-weight: 600; font-size: .86rem;
    background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .26); backdrop-filter: blur(6px);
}
.rc-chip svg { width: 15px; height: 15px; }
.rc-js .rc-slide.is-active .rc-hero-copy > * { animation: rc-subir .6s cubic-bezier(.22, .8, .22, 1) both; }
.rc-js .rc-slide.is-active .rc-hero-copy h2 { animation-delay: .08s; }
.rc-js .rc-slide.is-active .rc-hero-copy .rc-chips { animation-delay: .16s; }
@keyframes rc-subir { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.rc-fotos-nav { position: absolute; z-index: 3; right: 22px; bottom: 24px; display: flex; gap: 6px; }
.rc-fotos-nav button { width: 10px; height: 10px; padding: 0; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .5); cursor: pointer; transition: width .25s ease, background .25s ease; }
.rc-fotos-nav button.is-on { width: 26px; background: #fff; }

/* Fichas */
.rc-body { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-top: 16px; align-items: start; }
.rc-card {
    background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 20px 22px;
    box-shadow: 0 8px 24px rgba(var(--ui-sombra-rgb), .05); min-width: 0;
}
.rc-js .rc-slide.is-active .rc-card { animation: rc-subir .55s cubic-bezier(.22, .8, .22, 1) both; }
.rc-js .rc-slide.is-active .rc-card:nth-child(2) { animation-delay: .06s; }
.rc-js .rc-slide.is-active .rc-card:nth-child(3) { animation-delay: .12s; }
.rc-js .rc-slide.is-active .rc-card:nth-child(4) { animation-delay: .18s; }
.rc-card h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; font-size: 1rem; }
.rc-h-icon svg { width: 19px; height: 19px; color: var(--home-blue); display: block; }
.rc-equipo { grid-column: 1 / -1; }

.rc-horas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; }
.rc-horas div { padding: 10px 12px; border-radius: 12px; background: var(--surface-soft); }
.rc-horas dt { color: var(--muted); font-size: .78rem; }
.rc-horas dd { margin: 2px 0 0; font-weight: 800; font-size: 1.05rem; }

.rc-direccion { margin: 0; font-weight: 700; font-size: 1.05rem; }
.rc-muted { margin: 2px 0 14px; color: var(--muted); }
.rc-acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.rc-acciones .an-btn { min-height: 40px; padding: 8px 14px; font-size: .9rem; }
.rc-mapa { margin-top: 14px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); aspect-ratio: 16 / 10; }
.rc-mapa iframe { width: 100%; height: 100%; border: 0; display: block; }

.rc-agente { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--home-blue-soft); margin-bottom: 14px; }
.rc-agente small { display: block; color: var(--home-blue-dark); font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.rc-agente strong { display: block; font-size: 1.05rem; }
.rc-avatar { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--home-blue); color: #fff; font-weight: 800; flex: 0 0 auto; }
.rc-rol { display: flex; align-items: center; gap: 6px; margin: 12px 0 8px; color: var(--muted); font-weight: 700; font-size: .85rem; }
.rc-rol svg { width: 15px; height: 15px; }
.rc-personas { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.rc-personas li { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-weight: 600; font-size: .92rem; }
.rc-mini { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: #f1f0ed; color: #52514d; font-size: .72rem; font-weight: 800; }
.rc-mini.alt { background: var(--home-blue-soft); color: var(--home-blue); }

.rc-datos { display: grid; gap: 10px; margin: 0 0 14px; }
.rc-datos dt { color: var(--muted); font-size: .78rem; }
.rc-datos dd { margin: 2px 0 0; font-weight: 700; }
.rc-canal {
    display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; text-decoration: none; color: var(--text);
    border: 1px solid #fecaca; background: #fff5f5; transition: border-color .2s ease, box-shadow .2s ease;
}
.rc-canal:hover { border-color: #ef4444; box-shadow: 0 8px 20px rgba(239, 68, 68, .15); }
.rc-canal-icon { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; background: #ef4444; color: #fff; flex: 0 0 auto; }
.rc-canal-icon svg { width: 20px; height: 20px; }
.rc-canal strong { display: block; }
.rc-canal small { display: block; color: var(--muted); }
.rc-canal-ext { margin-left: auto; color: #b91c1c; }
.rc-canal-ext svg { width: 16px; height: 16px; display: block; }

.rc-dots { display: flex; justify-content: center; gap: 8px; }
.rc-dots button { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 999px; background: #d6d4cf; cursor: pointer; transition: width .3s ease, background .3s ease; }
.rc-dots button.is-on { width: 30px; background: var(--home-blue); }

.rc-empty { display: grid; justify-items: center; gap: 10px; padding: 44px 20px; text-align: center; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; }
.rc-empty h2 { margin: 0; color: var(--text); font-size: 1.15rem; }
.rc-empty p { margin: 0; }
.rc-empty-icon svg { width: 42px; height: 42px; color: var(--home-blue); }

@media (max-width: 1100px) {
    .rc-body { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rc-empresa { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
    .rc-head h1 { font-size: 1.35rem; }
    .rc-hero { height: 260px; border-radius: 18px; }
    .rc-hero-copy { left: 18px; right: 18px; bottom: 18px; }
    .rc-chip { font-size: .78rem; padding: 5px 10px; }
    /* En pantallas chicas se navega deslizando, con las pestañas o los puntos. */
    .rc-nav { display: none; }
    .rc-fotos-nav { top: 16px; bottom: auto; right: 16px; }
    .rc-body { grid-template-columns: 1fr; }
    .rc-card { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
    .rc-js .rc-track, .rc-js .rc-viewport { transition: none; }
    .rc-js .rc-slide.is-active .rc-foto.is-on,
    .rc-js .rc-slide.is-active .rc-hero-copy > *,
    .rc-js .rc-slide.is-active .rc-card { animation: none; }
}

/* ==========================================================================
   Calendario de ferias (inicio, modal, Ingresar / Revisar fechas)
   ========================================================================== */
.cal-r-0  { --c: #a3a19c; }
.cal-r-1  { --c: var(--home-blue); } /* Osorno */
.cal-r-6  { --c: #0d9488; } /* Paillaco */
.cal-r-3  { --c: #7c3aed; } /* Puerto Montt */
.cal-r-2  { --c: #ea580c; } /* Purranque */
.cal-r-4  { --c: #db2777; } /* Puerto Varas */
.cal-r-10 { --c: #ca8a04; } /* La Junta */
.cal-r-9  { --c: #16a34a; } /* Feria AFC */
.cal-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c, #a3a19c); flex: none; }
.cal-dot.feriado { background: #fecaca; box-shadow: inset 0 0 0 1.5px #ef4444; }

/* ---- Mini calendario del inicio ---- */
.ho-cal { display: flex; flex-direction: column; gap: 14px; }
.cal-mini { display: grid; gap: 6px; }
.cal-semana { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.cal-mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-mini-dia {
    position: relative; display: grid; place-items: center; gap: 2px; aspect-ratio: 1 / .86; padding: 4px 0;
    border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; font-size: .86rem; cursor: pointer;
    transition: background .15s, transform .15s, box-shadow .15s;
}
.cal-mini-dia:hover { background: var(--home-blue-soft); transform: translateY(-1px); }
.cal-mini-dia:focus-visible { outline: 2px solid var(--home-blue); outline-offset: 1px; }
.cal-mini-dia.con-feria { background: #fafaf8; font-weight: 700; }
.cal-mini-dia.pasado { color: #a3a19c; }
.cal-mini-dia.pasado .cal-dot { opacity: .45; }
.cal-mini-dia.feriado { color: #dc2626; background: #fef2f2; }
.cal-mini-dia.hoy { background: var(--home-blue); color: #fff; box-shadow: 0 6px 16px rgba(var(--ui-acento-rgb), .30); }
.cal-mini-dia.hoy .cal-dot { box-shadow: 0 0 0 1.5px #fff; }
.cal-dots { display: flex; gap: 3px; min-height: 6px; }
.cal-dots .cal-dot { width: 6px; height: 6px; }

.cal-proximas { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.cal-proximas button {
    width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 10px; text-align: left;
    border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: inherit; cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}
.cal-proximas button:hover { border-color: var(--home-blue); box-shadow: 0 6px 16px rgba(var(--ui-acento-rgb), .08); }
.cal-prox-fecha {
    display: grid; place-items: center; width: 44px; height: 44px; border-radius: 10px; flex: none; line-height: 1;
    background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--c); border-left: 3px solid var(--c);
}
.cal-prox-fecha b { font-size: 1.05rem; }
.cal-prox-fecha small { font-size: .66rem; text-transform: uppercase; font-weight: 700; }
.cal-prox-info { display: grid; gap: 2px; flex: 1; min-width: 0; }
.cal-prox-info small { color: var(--muted); }
.cal-sin-proximas { margin: 0; color: var(--muted); font-size: .9rem; text-align: center; }

/* ---- Modal calendario completo ---- */
.cal-modal { position: fixed; inset: 0; z-index: 1200; display: grid; place-items: center; padding: 20px; }
.cal-modal[hidden] { display: none !important; }
.cal-backdrop { position: absolute; inset: 0; background: rgba(var(--ui-sombra-rgb), .55); backdrop-filter: blur(3px); opacity: 0; transition: opacity .2s; }
.cal-dialog {
    position: relative; width: min(1180px, 100%); max-height: calc(100vh - 40px); display: flex; flex-direction: column;
    background: #fff; border-radius: 20px; box-shadow: 0 30px 80px rgba(var(--ui-sombra-rgb), .35); overflow: hidden;
    opacity: 0; transform: translateY(16px) scale(.98); transition: opacity .22s, transform .22s cubic-bezier(.22, .8, .22, 1);
}
.cal-modal.abierto .cal-backdrop { opacity: 1; }
.cal-modal.abierto .cal-dialog { opacity: 1; transform: none; }
.cal-dialog-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.cal-dialog-head h2 { margin: 0; flex: 1; text-align: center; font-size: 1.25rem; }
.cal-nav, .cal-cerrar {
    display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line);
    background: #fff; color: var(--text); cursor: pointer; transition: background .15s, border-color .15s;
}
.cal-nav:hover { border-color: var(--home-blue); color: var(--home-blue); }
.cal-cerrar { border-color: transparent; margin-left: 6px; }
.cal-cerrar:hover { background: #f3f2ef; }
.cal-nav svg, .cal-cerrar svg { width: 18px; height: 18px; }
.cal-dialog-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; min-height: 0; overflow: hidden; flex: 1; }
.cal-grande { padding: 16px 20px 20px; overflow: auto; display: grid; gap: 8px; align-content: start; }
.cal-semana.grande { font-size: .74rem; }
.cal-grande-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; transition: opacity .15s; }
.cal-grande-grid.cargando { opacity: .4; pointer-events: none; }
.cal-grande-grid[data-direccion="adelante"] .cal-g-dia { animation: cal-entra-der .28s ease both; }
.cal-grande-grid[data-direccion="atras"] .cal-g-dia { animation: cal-entra-izq .28s ease both; }
@keyframes cal-entra-der { from { opacity: 0; transform: translateX(14px); } }
@keyframes cal-entra-izq { from { opacity: 0; transform: translateX(-14px); } }
.cal-g-dia {
    display: flex; flex-direction: column; align-items: stretch; gap: 4px; min-height: 92px; padding: 6px; text-align: left;
    border: 1px solid var(--line); border-radius: 12px; background: #fff; font: inherit; color: var(--text); cursor: pointer;
    transition: border-color .15s, box-shadow .15s, transform .15s;
}
.cal-g-dia:hover { border-color: var(--home-blue); transform: translateY(-1px); }
.cal-g-dia:focus-visible { outline: 2px solid var(--home-blue); outline-offset: 1px; }
.cal-g-dia.activo { border-color: var(--home-blue); box-shadow: 0 0 0 3px rgba(var(--ui-acento-rgb), .18); }
.cal-g-dia.pasado { background: #fafaf8; }
.cal-g-dia.pasado .cal-g-chip { opacity: .55; }
.cal-g-dia.feriado { background: #fef2f2; border-color: #fecaca; }
.cal-g-num { font-weight: 700; font-size: .9rem; }
.cal-g-dia.hoy .cal-g-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--home-blue); color: #fff; }
.cal-g-feriado { font-size: .7rem; font-weight: 600; color: #dc2626; line-height: 1.2; }
.cal-g-ferias { display: grid; gap: 3px; }
.cal-g-chip {
    display: block; padding: 2px 6px; border-radius: 6px; font-size: .72rem; font-weight: 600; line-height: 1.35;
    background: color-mix(in srgb, var(--c) 14%, #fff); color: color-mix(in srgb, var(--c) 80%, #000); border-left: 3px solid var(--c);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-g-chip.especial { background: var(--c); color: #fff; }
.cal-g-vacio { min-height: 92px; }
.cal-leyenda { display: flex; flex-wrap: wrap; gap: 8px 16px; padding-top: 8px; font-size: .8rem; color: var(--muted); }
.cal-leyenda-item { display: inline-flex; align-items: center; gap: 6px; }

.cal-detalle { border-left: 1px solid var(--line); background: #fafaf8; padding: 18px; overflow: auto; display: grid; gap: 14px; align-content: start; }
.cal-detalle.entrando > * { animation: cal-detalle .3s cubic-bezier(.22, .8, .22, 1) both; }
.cal-detalle.entrando > *:nth-child(2) { animation-delay: .05s; }
.cal-detalle.entrando > *:nth-child(3) { animation-delay: .1s; }
@keyframes cal-detalle { from { opacity: 0; transform: translateY(10px); } }
.cal-detalle-vacio { display: grid; justify-items: center; gap: 8px; padding: 40px 10px; color: var(--muted); text-align: center; }
.cal-detalle-vacio svg { width: 36px; height: 36px; color: var(--home-blue); }
.cal-det-head h3 { margin: 0; font-size: 1.15rem; }
.cal-det-kicker { margin: 0 0 2px; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--home-blue); }
.cal-det-aviso { display: grid; gap: 4px; padding: 14px; border-radius: 12px; background: #fff; border: 1px dashed var(--line); color: var(--muted); }
.cal-det-aviso.feriado { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; }
.cal-det-feria { background: #fff; border-radius: 14px; overflow: hidden; box-shadow: 0 8px 24px rgba(var(--ui-sombra-rgb), .08); border-top: 4px solid var(--c); }
.cal-det-foto { position: relative; aspect-ratio: 16 / 9; background: #e4e3df; }
.cal-det-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cal-det-foto::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(var(--ui-sombra-rgb), .75)); }
.cal-det-nombre { position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 1; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #fff; }
.cal-det-recinto { font-size: 1.1rem; font-weight: 800; }
.cal-det-badge { padding: 2px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; background: var(--c); color: #fff; }
.cal-det-badge.suave { background: rgba(255, 255, 255, .9); color: #141414; }
.cal-det-datos { display: grid; gap: 6px; padding: 12px 14px 4px; }
.cal-det-fila { display: flex; gap: 8px; margin: 0; font-size: .88rem; }
.cal-det-fila svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--c); }
.cal-det-acciones { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px 14px; }
.cal-det-acciones svg { width: 15px; height: 15px; vertical-align: -3px; }
.cal-det-mapa { padding: 0 14px 14px; }
.cal-det-mapa[hidden] { display: none; }
.cal-det-mapa iframe { width: 100%; height: 220px; border: 0; border-radius: 10px; }

@media (max-width: 900px) {
    .cal-modal { padding: 0; }
    .cal-dialog { max-height: 100vh; height: 100%; border-radius: 0; }
    .cal-dialog-body { grid-template-columns: 1fr; overflow: auto; }
    .cal-grande { overflow: visible; }
    .cal-detalle { border-left: 0; border-top: 1px solid var(--line); overflow: visible; }
    .cal-g-dia, .cal-g-vacio { min-height: 64px; }
}
@media (max-width: 560px) {
    .cal-grande { padding: 12px; }
    .cal-grande-grid { gap: 3px; }
    .cal-g-dia { min-height: 54px; padding: 4px; align-items: center; }
    .cal-g-chip { width: 8px; height: 8px; padding: 0; border: 0; border-radius: 50%; background: var(--c); font-size: 0; }
    .cal-g-ferias { display: flex; gap: 3px; justify-content: center; }
    .cal-g-feriado { font-size: 0; width: 8px; height: 8px; border-radius: 50%; background: #ef4444; }
}

/* ---- Ingresar / Revisar fechas ---- */
.cf-page [hidden] { display: none !important; }
.cf-recintos { display: flex; flex-wrap: wrap; gap: 8px; }
.cf-pill {
    display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; text-decoration: none;
    border: 1px solid var(--line); background: #fff; color: var(--text); font-weight: 600; font-size: .9rem;
    transition: border-color .15s, background .15s;
}
.cf-pill:hover { border-color: var(--c); }
.cf-pill.is-active { background: color-mix(in srgb, var(--c) 10%, #fff); border-color: var(--c); color: color-mix(in srgb, var(--c) 75%, #000); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c) 18%, transparent); }
.cf-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.cf-mes { display: flex; align-items: center; gap: 10px; }
.cf-mes h2 { margin: 0; min-width: 190px; text-align: center; font-size: 1.25rem; }
.cf-nav { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); }
.cf-nav:hover { border-color: var(--home-blue); color: var(--home-blue); }
.cf-nav svg { width: 18px; height: 18px; }
.cf-estado { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-radius: 12px; font-size: .88rem; }
.cf-estado.def { background: var(--home-blue-soft); color: var(--home-blue-dark); }
.cf-estado.mod { background: #fff7ed; color: #9a3412; }
.cf-estado strong { padding: 2px 8px; border-radius: 999px; background: #fff; font-size: .76rem; text-transform: uppercase; letter-spacing: .04em; }
.cf-form { display: grid; gap: 14px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.cf-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.cf-semana { text-align: center; font-size: .74rem; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.cf-dia {
    position: relative; display: flex; flex-direction: column; gap: 4px; min-height: 84px; padding: 8px; border-radius: 12px; cursor: pointer;
    border: 1.5px solid var(--line); background: #fff; transition: border-color .15s, background .15s, transform .15s;
}
.cf-dia input { position: absolute; opacity: 0; pointer-events: none; }
.cf-dia:hover { border-color: var(--home-blue); }
.cf-dia:focus-within { outline: 2px solid var(--home-blue); outline-offset: 2px; }
.cf-dia.finde:not(.on) { background: #fafbfc; }
.cf-num { font-weight: 700; }
.cf-dia.hoy .cf-num { color: var(--home-blue); }
.cf-check { position: absolute; top: 8px; right: 8px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid #d4d2cc; color: transparent; transition: all .15s; }
.cf-check svg { width: 13px; height: 13px; stroke-width: 3; }
.cf-dia.on { border-color: var(--home-blue); background: var(--home-blue-soft); }
.cf-dia.on .cf-check { background: var(--home-blue); border-color: var(--home-blue); color: #fff; transform: scale(1.05); }
.cf-dia.pasado { cursor: not-allowed; opacity: .55; }
.cf-dia.pasado:hover { border-color: var(--line); }
.cf-dia.pasado.on { border-color: #a3a19c; background: #f3f2ef; }
.cf-dia.pasado.on .cf-check { background: #a3a19c; border-color: #a3a19c; }
.cf-dia.feriado { cursor: not-allowed; background: #fef2f2; border-color: #fecaca; }
.cf-dia.feriado:hover { border-color: #fecaca; }
.cf-feriado { font-size: .72rem; line-height: 1.2; color: #dc2626; font-weight: 600; }
.cf-otras { display: flex; gap: 3px; margin-top: auto; }
.cf-leyenda { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .8rem; color: var(--muted); }
.cf-leyenda span { display: inline-flex; align-items: center; gap: 6px; }
.cf-mini { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid #d4d2cc; }
.cf-mini.on { background: var(--home-blue); border-color: var(--home-blue); }
.cf-mini.feriado { background: #fef2f2; border-color: #fecaca; }
.cf-mini.pasado { background: #f3f2ef; }
.cf-obs { display: grid; gap: 6px; font-weight: 600; font-size: .9rem; }
.cf-obs small { color: var(--muted); font-weight: 400; }
.cf-obs textarea { resize: vertical; }
.cf-acciones { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cf-contador { margin: 0; color: var(--muted); font-size: .9rem; }
.cf-restaurar { display: flex; justify-content: flex-end; }

.cf-revisar { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cf-rec { display: grid; gap: 12px; align-content: start; padding: 16px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--c); border-radius: 14px; }
.cf-rec header { display: flex; align-items: center; gap: 10px; }
.cf-rec header div { flex: 1; min-width: 0; }
.cf-rec h3 { margin: 0; font-size: 1rem; }
.cf-rec small { color: var(--muted); }
.cf-rec .cal-dot { width: 12px; height: 12px; }
.cf-tag { padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; white-space: nowrap; }
.cf-tag.def { background: var(--home-blue-soft); color: var(--home-blue-dark); }
.cf-tag.mod { background: #fff7ed; color: #9a3412; }
.cf-tag.vacio { background: #f3f2ef; color: #6b6a66; }
.cf-fechas { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.cf-fechas li { display: grid; place-items: center; width: 46px; padding: 5px 0; border-radius: 10px; line-height: 1.1; background: color-mix(in srgb, var(--c) 12%, #fff); color: color-mix(in srgb, var(--c) 80%, #000); }
.cf-fechas li span { font-size: .66rem; text-transform: uppercase; font-weight: 700; }
.cf-fechas li.pasado { opacity: .45; }
.cf-sin { margin: 0; color: var(--muted); font-size: .9rem; }
.cf-editar { display: inline-flex; align-items: center; gap: 6px; justify-self: start; font-weight: 600; font-size: .88rem; color: var(--home-blue); text-decoration: none; }
.cf-editar svg { width: 15px; height: 15px; }
.cf-feriados { padding: 16px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.cf-feriados h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 1rem; }
.cf-feriados h3 svg { width: 18px; height: 18px; color: #dc2626; }
.cf-feriados ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.cf-feriados li { display: flex; gap: 12px; padding: 8px 12px; border-radius: 10px; background: #fef2f2; color: #991b1b; font-size: .9rem; }
.cf-feriados li strong { min-width: 110px; }

@media (max-width: 680px) {
    .cf-grid { gap: 4px; }
    .cf-dia { min-height: 58px; padding: 5px; }
    .cf-check { width: 16px; height: 16px; top: 4px; right: 4px; }
    .cf-check svg { width: 10px; height: 10px; }
    .cf-feriado { font-size: 0; }
    .cf-feriado::before { content: "Feriado"; font-size: .6rem; }
    .cf-mes h2 { min-width: 0; font-size: 1.05rem; }
}
@media (prefers-reduced-motion: reduce) {
    .cal-dialog, .cal-backdrop, .cal-g-dia, .cal-detalle > *, .cal-mini-dia { animation: none !important; transition: none !important; }
}

/* ==========================================================================
   Fondo de las vistas: gris pizarra frío (acompaña al azul de acción y a las tarjetas blancas).
   El paisaje acompaña el scroll y cierra la página sobre el pie, como un footer.
   ========================================================================== */
:root { --fondo-app: #f6f6f3; }
body.app-body { background: var(--fondo-app); }
.app-body .app-shell {
    display: flex; flex-direction: column; min-height: 100vh;
    background: var(--fondo-app) url('/img/fondo-app.jpg?v=2') repeat-x center bottom / auto clamp(210px, 21vw, 320px);
}
.app-body .app-shell > .main-content { flex: 1 0 auto; }
/* Pie: deja espacio para el paisaje y el texto queda sobre el pasto, bajo el cerco */
.app-pie {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 16px;
    padding: clamp(130px, 14vw, 220px) 46px 18px; color: #52514d; font-size: .84rem;
}
.app-pie span { padding: 4px 10px; border-radius: 999px; background: rgba(255, 255, 255, .55); backdrop-filter: blur(2px); }
@media (max-width: 900px) {
    .app-body .app-shell { background-size: auto 230px; }
    .app-pie { padding: 170px 18px 12px; justify-content: center; text-align: center; font-size: .74rem; gap: 4px; }
}
.app-body .topbar { background: rgba(255, 255, 255, .86); border-bottom-color: rgba(148, 163, 184, .28); }

.ho-grid { align-items: start; }

/* ==========================================================================
   Encabezado con ícono del módulo (sin título repetido dentro de la vista)
   ========================================================================== */
.topbar-title { display: flex; align-items: center; gap: 12px; }
.topbar-icon {
    flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
    background: var(--home-blue-soft); color: var(--home-blue);
}
.topbar-icon svg { width: 20px; height: 20px; }
@media (max-width: 680px) { .topbar-icon { width: 32px; height: 32px; border-radius: 9px; } .topbar-icon svg { width: 17px; height: 17px; } }

/* Fila de acciones que reemplaza el antiguo bloque título/subtítulo */
.page-acciones { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.page-contexto { margin: 0 auto 0 0; display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .92rem; }
.page-contexto strong { color: var(--text); }
.page-contexto svg { width: 18px; height: 18px; color: var(--home-blue); }
.users-review-header { grid-template-columns: 1fr; }
.users-review-summary { justify-content: flex-start; }
.edit-user-header { justify-content: flex-end; }

/* ==========================================================================
   Corredores · Ganado por recinto
   ========================================================================== */
.gr-hoy { display: inline-block; margin-left: 8px; padding: 2px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; vertical-align: middle; background: var(--home-blue-soft); color: var(--home-blue); }
.gr-page .an-context small { color: var(--muted); }
.gr-principal { font-size: 1.05rem !important; line-height: 1.25; }
.gr-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 16px 18px; border-bottom: 1px solid var(--line, #e4e3df); }
.gr-head h2 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 1rem; }
.gr-head h2 svg { width: 18px; height: 18px; color: var(--home-blue); }
.gr-orden { display: inline-flex; padding: 3px; border-radius: 10px; background: #f3f2ef; }
.gr-orden a { padding: 6px 12px; border-radius: 8px; font-size: .85rem; font-weight: 600; color: var(--muted); text-decoration: none; }
.gr-orden a.is-on { background: #fff; color: var(--home-blue-dark); box-shadow: 0 1px 3px rgba(var(--ui-sombra-rgb), .12); }
.gr-tabla { display: grid; }
.gr-fila { display: grid; grid-template-columns: minmax(180px, 1.3fr) minmax(160px, 2fr) 90px 110px; gap: 14px; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line, #f1f0ed); }
.gr-fila:hover:not(.gr-cab) { background: var(--ui-hover); }
.gr-cab { padding-top: 10px; padding-bottom: 10px; background: #fafaf8; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.gr-fila .num { text-align: right; font-variant-numeric: tabular-nums; }
.gr-fila strong.num { font-size: 1.02rem; }
.gr-cat { display: flex; align-items: center; gap: 10px; min-width: 0; }
.gr-cat b { flex: none; min-width: 34px; padding: 3px 6px; border-radius: 8px; text-align: center; font-size: .78rem; background: var(--home-blue-soft); color: var(--home-blue-dark); }
.gr-cat span { font-weight: 600; overflow-wrap: anywhere; }
.gr-col-barra { display: flex; align-items: center; gap: 10px; }
.gr-col-barra .an-ganado-barra { flex: 1; }
.gr-col-barra small { width: 48px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.gr-anuncios { color: var(--muted); }
.gr-nota { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: .85rem; }
.gr-nota svg { width: 16px; height: 16px; flex: none; }
@media (max-width: 760px) {
    .gr-cab { display: none; }
    .gr-fila { grid-template-columns: 1fr auto; grid-template-areas: "cat cab" "barra barra"; row-gap: 8px; }
    .gr-fila .gr-cat { grid-area: cat; }
    .gr-fila strong.num { grid-area: cab; }
    .gr-fila .gr-col-barra { grid-area: barra; }
    .gr-fila .gr-anuncios { display: none; }
}

/* Botón volver del encabezado */
.topbar-volver {
    flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 14px 0 10px;
    border-radius: 11px; border: 1px solid var(--line, #e4e3df); background: #fff; color: var(--text);
    font-size: .9rem; font-weight: 700; text-decoration: none; transition: border-color .15s, color .15s, transform .15s;
}
.topbar-volver svg { width: 18px; height: 18px; }
.topbar-volver:hover { border-color: var(--home-blue); color: var(--home-blue); transform: translateX(-2px); }
.topbar-volver:focus-visible { outline: 3px solid rgba(var(--ui-acento-rgb), .3); outline-offset: 2px; }
@media (max-width: 680px) {
    .topbar-volver { width: 36px; height: 36px; padding: 0; justify-content: center; }
    .topbar-volver span { display: none; }
    .topbar-volver + .topbar-icon { display: none; }
}

/* ==========================================================================
   Administración · Reglas de negocio (índice lateral tipo documento)
   ========================================================================== */
.rn-page { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 20px; align-items: start; }
.rn-page [hidden] { display: none !important; }
.rn-indice {
    position: sticky; top: 96px; display: flex; flex-direction: column; max-height: calc(100vh - 116px);
    background: #fff; border: 1px solid var(--line, #e4e3df); border-radius: 16px; overflow: hidden;
}
.rn-indice-head { display: grid; gap: 10px; padding: 14px; border-bottom: 1px solid var(--line, #f1f0ed); }
.rn-resumen { display: flex; gap: 14px; font-size: .82rem; color: var(--muted); }
.rn-resumen b { color: var(--text); font-size: .95rem; }
.rn-buscar { display: flex; align-items: center; gap: 8px; padding: 0 10px; height: 38px; border-radius: 10px; border: 1px solid var(--line, #e4e3df); background: #fafaf8; }
.rn-buscar:focus-within { border-color: var(--home-blue); background: #fff; box-shadow: 0 0 0 3px rgba(var(--ui-acento-rgb), .12); }
.rn-buscar svg { width: 16px; height: 16px; color: var(--muted); flex: none; }
.rn-buscar input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: .9rem; outline: none; }
.rn-nav { overflow: auto; padding: 8px; flex: 1; }
.rn-grupo + .rn-grupo { margin-top: 6px; }
.rn-grupo-titulo { margin: 8px 10px 4px; font-size: .7rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: #a3a19c; }
.rn-grupo ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.rn-link {
    position: relative; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px;
    color: var(--text); text-decoration: none; font-size: .92rem; font-weight: 600; transition: background .15s, color .15s;
}
.rn-link:hover { background: #f3f2ef; }
.rn-link:focus-visible { outline: 2px solid var(--home-blue); outline-offset: -2px; }
.rn-link.is-active { background: var(--home-blue-soft); color: var(--home-blue-dark); }
.rn-link.is-active::before { content: ""; position: absolute; left: -8px; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: var(--home-blue); }
.rn-link-nombre { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rn-link small { padding: 1px 7px; border-radius: 999px; background: #f1f0ed; color: var(--muted); font-size: .72rem; font-weight: 700; }
.rn-link.is-active small { background: #fff; color: var(--home-blue); }
.rn-dot { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: #d4d2cc; }
.rn-dot.renovado { background: #16a34a; }
.rn-dot.parcial { background: #f59e0b; }
.rn-sin-resultados { margin: 12px; color: var(--muted); font-size: .88rem; text-align: center; }
.rn-leyenda { display: flex; flex-wrap: wrap; gap: 6px 12px; padding: 10px 14px; border-top: 1px solid var(--line, #f1f0ed); font-size: .74rem; color: var(--muted); }
.rn-leyenda span { display: inline-flex; align-items: center; gap: 5px; }

.rn-contenido { min-width: 0; scroll-margin-top: 96px; }
.rn-doc { background: #fff; border: 1px solid var(--line, #e4e3df); border-radius: 18px; padding: 28px 32px; box-shadow: 0 10px 30px rgba(var(--ui-sombra-rgb), .05); }
.rn-doc.entra-abajo { animation: rn-entra-abajo .32s cubic-bezier(.22, .8, .22, 1) both; }
.rn-doc.entra-arriba { animation: rn-entra-arriba .32s cubic-bezier(.22, .8, .22, 1) both; }
@keyframes rn-entra-abajo { from { opacity: 0; transform: translateY(16px); } }
@keyframes rn-entra-arriba { from { opacity: 0; transform: translateY(-16px); } }
.rn-doc-head { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 12px; padding-bottom: 18px; border-bottom: 1px solid var(--line, #f1f0ed); }
.rn-doc-grupo { grid-column: 1 / -1; margin: 0; font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: var(--home-blue); }
.rn-doc-head h2 { margin: 0; font-size: 1.7rem; line-height: 1.15; }
.rn-estado { align-self: center; padding: 4px 12px; border-radius: 999px; font-size: .76rem; font-weight: 700; background: #f3f2ef; color: #6b6a66; }
.rn-estado.renovado { background: #dcfce7; color: #166534; }
.rn-estado.parcial { background: #fef3c7; color: #92400e; }
.rn-bloque { padding-top: 20px; }
.rn-bloque h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: .95rem; color: #334155; }
.rn-bloque h3 svg { width: 18px; height: 18px; color: var(--home-blue); }
.rn-resumen-texto { margin: 0; font-size: 1.02rem; line-height: 1.6; color: #202022; }
.rn-permisos { display: flex; gap: 8px; margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: #fafaf8; font-size: .9rem; color: #52514d; }
.rn-permisos svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: #6b6a66; }
.rn-pantallas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.rn-pantallas li { display: grid; gap: 3px; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line, #e4e3df); }
.rn-pantallas strong { font-size: .92rem; }
.rn-pantallas span { font-size: .84rem; color: var(--muted); line-height: 1.45; }
.rn-reglas { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: none; }
.rn-regla { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 12px; padding: 14px 16px; border-radius: 12px; background: #fafaf8; border: 1px solid transparent; transition: border-color .15s, background .15s; }
.rn-regla:hover { background: #fff; border-color: var(--line, #e4e3df); }
.rn-num { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: #fff; border: 1px solid var(--line, #e4e3df); font-weight: 800; font-size: .85rem; color: var(--home-blue-dark); }
.rn-regla-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 4px; }
.rn-regla-head strong { font-size: .97rem; margin-right: 4px; }
.rn-regla p { margin: 0; line-height: 1.55; color: #334155; font-size: .93rem; }
.rn-tag { padding: 2px 8px; border-radius: 999px; font-size: .7rem; font-weight: 700; background: #f1f0ed; color: #52514d; }
.rn-tag.original { background: var(--home-blue-soft); color: var(--home-blue-dark); }
.rn-tag.nuevo { background: #dcfce7; color: #166534; }
.rn-pendiente { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 12px; border: 1px dashed #d4d2cc; color: var(--muted); }
.rn-pendiente svg { width: 22px; height: 22px; flex: none; color: #a3a19c; }
.rn-pendiente p { margin: 0; }
.rn-doc-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line, #f1f0ed); }
.rn-doc-pie small { color: var(--muted); }
.rn-paso { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line, #e4e3df); background: #fff; font: inherit; font-size: .88rem; font-weight: 600; color: var(--text); cursor: pointer; }
.rn-paso svg { width: 16px; height: 16px; }
.rn-paso:hover:not(:disabled) { border-color: var(--home-blue); color: var(--home-blue); }
.rn-paso:disabled { opacity: .4; cursor: default; }

@media (max-width: 980px) {
    .rn-page { grid-template-columns: 1fr; }
    .rn-indice { position: static; max-height: none; }
    .rn-nav { display: flex; gap: 6px; overflow-x: auto; padding: 10px; }
    .rn-grupo { display: contents; }
    .rn-grupo-titulo { display: none; }
    .rn-grupo ul { display: contents; }
    .rn-link { white-space: nowrap; border: 1px solid var(--line, #e4e3df); }
    .rn-link.is-active::before { display: none; }
    .rn-leyenda { display: none; }
    .rn-doc { padding: 20px; }
    .rn-doc-head h2 { font-size: 1.35rem; }
}
@media (prefers-reduced-motion: reduce) { .rn-doc { animation: none !important; } }

/* ==========================================================================
   Privados (Nuevo privado y Mis privados)
   ========================================================================== */
.pv-page [hidden] { display: none !important; }
.pv-grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.pv-grid-5 { display: grid; grid-template-columns: 1.6fr repeat(4, minmax(0, 1fr)); gap: 12px; }
.pv-grid-opciones { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 4px; }
.pv-grid-opciones .pv-compartido { max-width: 260px; }
.pv-grid-opciones .pv-obs { flex: 1 1 240px; }
.an-step.pv-entra { animation: pv-entra .35s cubic-bezier(.22, .8, .22, 1) both; }
@keyframes pv-entra { from { opacity: 0; transform: translateY(12px); } }
.an-step.is-done { border-color: rgba(22, 163, 74, .35); }
.an-step.is-done .an-step-ok { opacity: 1; transform: none; }
.an-steps li.is-done .an-steps-num { background: #16a34a; border-color: #16a34a; color: #fff; }

.pv-rut { position: relative; }
.pv-rut .an-input { padding-right: 38px; }
.pv-rut-estado { position: absolute; right: 12px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: #d4d2cc; transition: background .2s; }
.pv-rut-estado.ok { background: #16a34a; box-shadow: 0 0 0 4px rgba(22, 163, 74, .15); }
.pv-nombre { min-height: 44px; display: flex; align-items: center; padding: 0 14px; border-radius: 12px; background: #fafaf8; border: 1px dashed #d4d2cc; font-weight: 700; color: var(--text); }
.an-input.is-invalid { border-color: #ef4444 !important; box-shadow: 0 0 0 3px rgba(239, 68, 68, .12); }
.an-input.is-valid { border-color: #16a34a; }
.an-hint.ok { color: #15803d; }
.an-hint.warn { color: #b91c1c; }
.pv-guia { display: flex; align-items: center; gap: 12px; }
.pv-guia .an-input { flex: 1; }
.pv-switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-weight: 600; font-size: .9rem; user-select: none; }
.pv-switch input { width: 18px; height: 18px; accent-color: var(--home-blue); }
.pv-switch small { color: var(--muted); font-weight: 400; }
.pv-switch:has(input:disabled) { opacity: .5; cursor: not-allowed; }

.pv-adjuntos { margin-top: 6px; }
.pv-drop { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border: 1.5px dashed var(--ui-borde-acento); border-radius: 14px; background: var(--ui-hover); cursor: pointer; color: #334155; transition: background .15s, border-color .15s; }
.pv-drop:hover { background: var(--home-blue-soft); border-color: var(--home-blue); }
.pv-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.pv-drop svg { width: 20px; height: 20px; color: var(--home-blue); vertical-align: -4px; }
.pv-drop:focus-within { outline: 2px solid var(--home-blue); outline-offset: 2px; }
.pv-archivos { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 6px; }
.pv-archivos li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 10px; background: #f3f2ef; font-size: .88rem; }
.pv-quitar { border: 0; background: transparent; color: #b91c1c; font: inherit; font-size: .82rem; font-weight: 700; cursor: pointer; padding: 4px 8px; border-radius: 8px; }
.pv-quitar:hover { background: #fee2e2; }

.pv-linea { display: grid; gap: 12px; padding: 16px; border-radius: 14px; background: #fafaf8; border: 1px solid var(--line, #e4e3df); }
.pv-linea-pie { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.pv-detalle { margin-top: 16px; border: 1px solid var(--line, #e4e3df); border-radius: 14px; overflow: hidden; background: #fff; }
.pv-detalle-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; border-bottom: 1px solid var(--line, #f1f0ed); }
.pv-detalle-head h3 { display: flex; align-items: center; gap: 8px; margin: 0; font-size: .98rem; }
.pv-detalle-head h3 svg { width: 18px; height: 18px; color: var(--home-blue); }
.pv-totales { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .88rem; color: var(--muted); }
.pv-totales b { color: var(--text); }
.pv-tabla { display: grid; }
.pv-fila { display: grid; grid-template-columns: minmax(180px, 2fr) minmax(110px, 1.2fr) 70px 110px 80px 70px 80px; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line, #f1f0ed); font-size: .9rem; }
.pv-fila:last-child { border-bottom: 0; }
.pv-fila.pv-cab { background: #fafaf8; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pv-fila .num { text-align: right; font-variant-numeric: tabular-nums; }
.pv-c-comprador { display: grid; min-width: 0; }
.pv-c-comprador > span { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-c-comprador small { color: var(--muted); font-size: .78rem; overflow-wrap: anywhere; }
.pv-c-acc { text-align: right; }
.pv-fila-res { grid-template-columns: minmax(180px, 2fr) minmax(100px, 1.1fr) 60px 100px 70px 110px 64px 100px; }

.pv-resumen dt { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.pv-resumen { display: grid; grid-template-columns: max-content 1fr; column-gap: 18px; row-gap: 8px; margin: 0; padding: 14px 16px; border-radius: 14px; background: #fafaf8; }
.pv-resumen dd { margin: 0; font-weight: 700; color: var(--text); overflow-wrap: anywhere; }
.pv-errores { padding: 12px 16px; border-radius: 12px; background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.pv-errores ul { margin: 6px 0 0; padding-left: 18px; }
.pv-errores p { margin: 6px 0 0; }
.pv-registrar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; }
.an-btn.big { padding: 12px 22px; font-size: 1rem; }
.an-btn.is-loading { position: relative; color: transparent !important; }
.an-btn.is-loading::after { content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .5); border-top-color: #fff; animation: pv-gira .7s linear infinite; }
@keyframes pv-gira { to { transform: rotate(360deg); } }

/* Mis privados */
.pv-filtro { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line, #e4e3df); background: #fff; min-width: 240px; }
.pv-filtro svg { width: 16px; height: 16px; color: var(--muted); }
.pv-filtro input { flex: 1; border: 0; outline: none; font: inherit; font-size: .9rem; background: transparent; }
.gr-orden a small { margin-left: 4px; padding: 0 6px; border-radius: 999px; background: rgba(148, 163, 184, .2); font-size: .72rem; }
.pv-lista { list-style: none; margin: 0; padding: 0; }
.pv-item { border-bottom: 1px solid var(--line, #f1f0ed); transition: background .15s; }
.pv-item:last-child { border-bottom: 0; }
.pv-item.is-open { background: #fbfdff; }
.pv-item.is-nulo .pv-item-cliente strong { text-decoration: line-through; color: var(--muted); }
.pv-item-main { display: grid; grid-template-columns: 34px 52px minmax(180px, 1.6fr) minmax(260px, 2fr) 110px 44px; gap: 14px; align-items: center; padding: 12px 18px; }
.pv-expandir { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line, #e4e3df); background: #fff; color: var(--muted); cursor: pointer; transition: transform .2s, color .15s, border-color .15s; }
.pv-expandir svg { width: 16px; height: 16px; transition: transform .2s; }
.pv-expandir:hover { color: var(--home-blue); border-color: var(--home-blue); }
.pv-expandir[aria-expanded="true"] svg { transform: rotate(90deg); }
.pv-fecha-chip { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 12px; background: var(--home-blue-soft); color: var(--home-blue-dark); line-height: 1; }
.pv-fecha-chip b { font-size: 1.1rem; }
.pv-fecha-chip small { font-size: .68rem; text-transform: uppercase; font-weight: 700; }
.pv-item-cliente { display: grid; min-width: 0; }
.pv-item-cliente strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-item-cliente small { color: var(--muted); }
.pv-item-datos { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pv-item-datos span { display: grid; }
.pv-item-datos b { font-variant-numeric: tabular-nums; }
.pv-item-datos small { color: var(--muted); font-size: .74rem; }
.pv-estado { justify-self: start; padding: 4px 10px; border-radius: 999px; font-size: .76rem; font-weight: 700; white-space: nowrap; }
.pv-estado.ok { background: #dcfce7; color: #166534; }
.pv-estado.pend { background: #fef3c7; color: #92400e; }
.pv-estado.edit { background: var(--home-blue-soft); color: var(--home-blue-dark); }
.pv-estado.nulo { background: #fee2e2; color: #991b1b; }
.pv-item-acciones { display: flex; justify-content: flex-end; }
.pv-icono { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 1px solid var(--line, #e4e3df); background: #fff; color: var(--text); cursor: pointer; transition: color .15s, border-color .15s, background .15s; }
.pv-icono svg { width: 16px; height: 16px; }
.pv-icono:hover { color: var(--home-blue); border-color: var(--home-blue); }
.pv-icono.danger:hover { color: #b91c1c; border-color: #fca5a5; background: #fef2f2; }
.pv-aviso { display: flex; align-items: center; gap: 8px; margin: 0 18px 10px 116px; padding: 8px 12px; border-radius: 10px; background: #fffbeb; color: #92400e; font-size: .85rem; }
.pv-aviso svg { width: 16px; height: 16px; flex: none; }
.pv-resumen-panel { margin: 0 18px 16px 116px; border: 1px solid var(--line, #e4e3df); border-radius: 14px; background: #fff; overflow: hidden; animation: pv-entra .25s ease both; }
.pv-res-cab { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px 16px; padding: 14px 16px; border-bottom: 1px solid var(--line, #f1f0ed); background: #fafaf8; }
.pv-res-cab div { display: grid; }
.pv-res-cab small { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 700; }
.pv-cargando { margin: 0; padding: 16px; color: var(--muted); }

@media (max-width: 1100px) {
    .pv-item-main { grid-template-columns: 34px 52px minmax(0, 1fr) auto 44px; }
    .pv-item-datos { grid-column: 3 / -1; grid-row: 2; }
    .pv-aviso, .pv-resumen-panel { margin-left: 18px; }
    .pv-fila, .pv-fila-res { grid-template-columns: minmax(0, 1fr) auto; }
    .pv-fila.pv-cab { display: none; }
    .pv-fila > span:not(.pv-c-comprador):not(.pv-c-acc) { font-size: .82rem; color: var(--muted); }
}
@media (max-width: 760px) {
    .pv-grid-2, .pv-grid-5 { grid-template-columns: 1fr; }
    .pv-item-main { grid-template-columns: 34px minmax(0, 1fr) auto; }
    .pv-fecha-chip { display: none; }
    .pv-item-datos { grid-column: 1 / -1; grid-template-columns: repeat(2, 1fr); }
    .pv-estado { grid-column: 2; }
    .pv-item-acciones { grid-row: 1; grid-column: 3; }
    .pv-filtro { min-width: 0; width: 100%; }
    .pv-resumen { grid-template-columns: 1fr; }
}

/* ==========================================================================
   Transportistas
   ========================================================================== */
.tr-page [hidden] { display: none !important; }
.tr-busqueda { flex: 1 1 360px; }
.tr-conteo { margin: 0; color: var(--muted); }
.tr-conteo b { color: var(--text); }
.tr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.tr-card { display: grid; gap: 12px; padding: 16px; border-radius: 16px; background: #fff; border: 1px solid var(--line, #e4e3df); color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s, transform .15s; }
.tr-card:hover { border-color: var(--home-blue); box-shadow: 0 10px 26px rgba(var(--ui-acento-rgb), .10); transform: translateY(-2px); }
.tr-card:focus-visible { outline: 3px solid rgba(var(--ui-acento-rgb), .35); outline-offset: 2px; }
.tr-card header { display: flex; align-items: center; gap: 12px; }
.tr-card header div { flex: 1; min-width: 0; display: grid; }
.tr-card header strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-card header small { color: var(--muted); }
.tr-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--home-blue-soft); color: var(--home-blue); flex: none; }
.tr-avatar svg { width: 22px; height: 22px; }
.tr-avatar.grande { width: 58px; height: 58px; border-radius: 16px; }
.tr-avatar.grande svg { width: 30px; height: 30px; }
.tr-go svg { width: 18px; height: 18px; color: var(--muted); }
.tr-cuentas { display: flex; gap: 16px; font-size: .88rem; color: var(--muted); }
.tr-cuentas span { display: inline-flex; align-items: center; gap: 6px; }
.tr-cuentas svg { width: 15px; height: 15px; }
.tr-cuentas b { color: var(--text); }
.tr-patentes { display: flex; flex-wrap: wrap; gap: 6px; }
.tr-patente { display: inline-block; padding: 3px 8px; border-radius: 6px; border: 1.5px solid #202022; background: #fff; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .78rem; font-weight: 800; letter-spacing: .06em; color: #141414; }
.tr-patente.grande { padding: 6px 10px; font-size: .9rem; }
.tr-mas { align-self: center; font-size: .8rem; color: var(--muted); font-weight: 700; }
.tr-choferes { margin: 0; font-size: .84rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-paginas { display: flex; align-items: center; justify-content: center; gap: 14px; color: var(--muted); }
.tr-paginas.mini { padding: 10px; border-top: 1px solid var(--line, #f1f0ed); }
.tr-paginas.mini a { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line, #e4e3df); color: var(--text); }
.tr-paginas.mini svg { width: 16px; height: 16px; }

.tr-ficha { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 18px 20px; border-radius: 18px; background: #fff; border: 1px solid var(--line, #e4e3df); }
.tr-ficha-datos { flex: 1; min-width: 200px; }
.tr-ficha-datos h2 { margin: 0; font-size: 1.35rem; }
.tr-ficha-datos p { margin: 2px 0 0; color: var(--muted); }
.tr-ficha-acciones { display: flex; gap: 8px; flex-wrap: wrap; }
.an-btn.danger { color: #b91c1c; }
.an-btn.danger:hover { border-color: #fca5a5; background: #fef2f2; }
.an-btn.small { padding: 7px 12px; font-size: .85rem; }
.tr-paneles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.tr-panel .gr-head h2 small { padding: 1px 8px; border-radius: 999px; background: #f1f0ed; color: var(--muted); font-size: .74rem; }
.tr-filas { list-style: none; margin: 0; padding: 0; }
.tr-filas li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line, #f1f0ed); }
.tr-filas li:last-child { border-bottom: 0; }
.tr-filas li div:not(.tr-fila-acc) { display: grid; min-width: 0; }
.tr-filas strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-filas small { color: var(--muted); }
.tr-fila-ico { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #f3f2ef; color: #6b6a66; }
.tr-fila-ico svg { width: 16px; height: 16px; }
.tr-fila-acc { display: flex; gap: 6px; }

.tr-dialog { width: min(460px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px; box-shadow: 0 30px 80px rgba(var(--ui-sombra-rgb), .35); }
.tr-dialog::backdrop { background: rgba(var(--ui-sombra-rgb), .5); backdrop-filter: blur(2px); }
.tr-dialog[open] { animation: pv-entra .22s cubic-bezier(.22, .8, .22, 1); }
.tr-form { display: grid; gap: 14px; padding: 20px 22px; }
.tr-form header { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.tr-form header h2 { margin: 0; font-size: 1.15rem; }
.tr-form footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.tr-x { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.tr-x:hover { background: #f3f2ef; }
.tr-x svg { width: 18px; height: 18px; }
.tr-error { margin: 0; padding: 10px 12px; border-radius: 10px; background: #fef2f2; color: #991b1b; font-size: .88rem; }
.tr-mayus { text-transform: uppercase; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .06em; }
.tr-destinos { list-style: none; margin: 0; padding: 0; max-height: 240px; overflow: auto; display: grid; gap: 4px; }
.tr-dest { width: 100%; display: grid; text-align: left; gap: 2px; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--line, #e4e3df); background: #fff; font: inherit; cursor: pointer; }
.tr-dest small { color: var(--muted); }
.tr-dest:hover { border-color: var(--home-blue); }
.tr-dest.is-on { border-color: var(--home-blue); background: var(--home-blue-soft); box-shadow: 0 0 0 3px rgba(var(--ui-acento-rgb), .12); }
.tr-dest-info { padding: 10px; color: var(--muted); font-size: .88rem; }
@media (max-width: 900px) { .tr-paneles { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .an-step.pv-entra, .tr-dialog[open], .pv-resumen-panel { animation: none !important; } }

/* ==========================================================================
   Capa visual común: menú lateral, encabezado e Inicio.
   Sobrescribe reglas anteriores (mismo archivo) sin cambiar clases ni comportamiento.
   ========================================================================== */
:root {
    --ui-radius-sm: 10px;
    --ui-radius: 16px;
    --ui-shadow-sm: 0 1px 2px rgba(var(--ui-sombra-rgb), .05), 0 2px 8px rgba(var(--ui-sombra-rgb), .04);
    --ui-shadow-md: 0 6px 18px rgba(var(--ui-sombra-rgb), .09);
    --ui-acento-menu: #3fb26a;
    --ui-foco: 0 0 0 3px rgba(var(--ui-acento-rgb), .3);
    --topbar-alto: 72px;
}

/* ---------- Menú lateral: ítems compactos, grupos y estado activo con barra ---------- */
.app-body .sidebar-nav { gap: 2px; padding: 2px 14px 14px; align-content: start; }
.nav-grupo {
    margin: 16px 0 6px; padding: 0 14px;
    font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    color: rgba(255, 255, 255, .5);
}
.app-body .nav-item {
    position: relative; min-height: 46px; gap: 14px; padding: 0 14px;
    border-radius: var(--ui-radius-sm); background: transparent; box-shadow: none;
    color: rgba(255, 255, 255, .8); font-size: 15px; font-weight: 600;
    transition: background-color .15s ease, color .15s ease;
}
.app-body .nav-item:hover:not(.disabled) { transform: none; background: rgba(255, 255, 255, .08); box-shadow: none; color: #fff; }
.app-body .nav-item.active { background: rgba(255, 255, 255, .14); box-shadow: none; color: #fff; }
.app-body .nav-item.active::before {
    content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 3px;
    border-radius: 0 3px 3px 0; background: var(--ui-acento-menu);
}
.app-body .nav-item .nav-icon { width: 22px; height: 22px; font-size: 20px; color: rgba(255, 255, 255, .7); }
.app-body .nav-item:hover .nav-icon,
.app-body .nav-item.active .nav-icon { color: #fff; }
.app-body .nav-soon { padding: 2px 8px; font-size: 10.5px; font-weight: 600; }

.app-body .sidebar-logout { padding: 12px 14px; }
.app-body .sidebar-logout button {
    padding: 11px 14px; border-radius: var(--ui-radius-sm);
    color: rgba(255, 255, 255, .8); font-size: 15px; font-weight: 600;
    transition: background-color .15s ease, color .15s ease;
}
.app-body .sidebar-logout button:hover { transform: none; text-shadow: none; background: rgba(255, 255, 255, .08); color: #fff; }
.app-body .sidebar-logout button:focus-visible { outline: 2px solid rgba(255, 255, 255, .7); outline-offset: -2px; }

@media (min-width: 981px) {
    html.sidebar-rail .app-body .nav-item { min-height: 46px; }
    /* Contraído: el título del grupo pasa a ser un separador fino */
    html.sidebar-rail .nav-grupo { height: 1px; margin: 10px 8px; padding: 0; overflow: hidden; font-size: 0; background: rgba(255, 255, 255, .14); }
}
@media (max-width: 980px) {
    .app-body .nav-item { min-height: 48px; }
}

/* ---------- Encabezado ---------- */
.app-body .topbar {
    height: var(--topbar-alto); padding: 0 32px; gap: 16px;
    background: rgba(255, 255, 255, .94); border-bottom: 1px solid rgba(148, 163, 184, .25);
}
.app-body .topbar-title { font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.app-body .topbar-user { flex: none; gap: 12px; font-weight: 400; }
/* Mayor especificidad que la regla antigua ".topbar-user span:first-child { display: none }" (≤980 px) */
.app-body .topbar-user .topbar-user-texto { display: grid; }
.app-body .topbar-user .topbar-salir button > span { display: grid; }
.topbar-user-texto { justify-items: end; line-height: 1.25; max-width: 260px; min-width: 0; }
.topbar-nombre { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 700; color: var(--text); }
.topbar-meta { color: var(--muted); font-size: 12px; white-space: nowrap; }
.topbar-avatar {
    flex: none; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%;
    background: var(--home-blue-soft); color: var(--home-blue-dark); border: 1px solid rgba(var(--ui-acento-rgb), .16);
    font-size: 13.5px; font-weight: 700; letter-spacing: .02em;
}
.topbar-salir { margin: 0; padding-left: 12px; border-left: 1px solid var(--line); }
.topbar-salir button {
    display: grid; place-items: center; width: 38px; height: 38px; padding: 0; cursor: pointer;
    border-radius: var(--ui-radius-sm); border: 1px solid var(--line); background: #fff; color: #52514d;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.topbar-salir svg { width: 18px; height: 18px; display: block; }
.topbar-salir button:hover { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.topbar-salir button:focus-visible { outline: none; box-shadow: var(--ui-foco); }

@media (max-width: 980px) {
    .app-body .topbar { padding: 0 20px; }
    .topbar-user-texto { max-width: 180px; }
}
@media (max-width: 680px) {
    .app-body .topbar { height: 60px; padding: 0 14px; gap: 10px; }
    .app-body .topbar-title { font-size: 17px; }
    .app-body .topbar-user .topbar-user-texto { display: none; }
    .topbar-avatar, .topbar-salir button { width: 34px; height: 34px; }
    .topbar-salir { padding-left: 8px; }
}

/* ---------- Inicio ---------- */
.ho-page { gap: 20px; }
.ho-hero { border-radius: var(--ui-radius); min-height: 160px; }
.ho-card { border-radius: var(--ui-radius); box-shadow: var(--ui-shadow-sm); }

.ho-seccion-titulo {
    margin: 0 0 10px; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
}

@media (prefers-reduced-motion: reduce) {
    .app-body .nav-item, .app-body .sidebar-logout button, .topbar-salir button { transition: none; }
}

/* ==========================================================================
   Despacho · Mis guías (dg-*)
   ========================================================================== */
.dg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dg-tool-buscar { flex: 2 1 240px; }
.dg-toolbar-acciones { display: flex; gap: 8px; }
.dg-filtro-error { flex-basis: 100%; margin: 0; color: #b91c1c; font-size: .86rem; font-weight: 600; }
.dg-conteo { margin: 0 0 0 auto; color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.gr-orden a small { margin-left: 4px; color: var(--muted); font-weight: 600; }

/* Filas: misma grilla para cabecera e ítems */
.dg-cab,
.dg-fila {
    display: grid; align-items: center; gap: 14px;
    grid-template-columns: 84px 96px minmax(0, 1fr) 76px 112px 100px 186px;
    padding: 12px 18px;
}
.dg-cab {
    padding-top: 10px; padding-bottom: 10px; background: #fafaf8; border-bottom: 1px solid var(--line);
    font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
}
.dg-cab .num, .dg-fila .num { text-align: right; font-variant-numeric: tabular-nums; }
.dg-lista { list-style: none; margin: 0; padding: 0; }
.dg-item { border-bottom: 1px solid var(--line); }
.dg-item:last-child { border-bottom: 0; }
.dg-item:hover > .dg-fila, .dg-item.is-abierta > .dg-fila { background: var(--ui-hover); }
.dg-folio small { display: none; }
.dg-folio b { font-size: 1.02rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.dg-fecha { color: var(--text); font-variant-numeric: tabular-nums; }
.dg-cliente { display: grid; min-width: 0; }
.dg-cliente strong { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dg-cliente small { color: var(--muted); font-size: .8rem; }
.dg-cant small { color: var(--muted); font-size: .78rem; }
.dg-total { font-weight: 700; }

/* Estado: texto + color sobrio */
.dg-estado {
    display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
    font-size: .78rem; font-weight: 700; border: 1px solid transparent; white-space: nowrap;
}
.dg-estado::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dg-estado.vigente { background: #ecfdf3; color: #146c3a; border-color: #c6ead3; }
.dg-estado.nula { background: #fef2f2; color: #a61b1b; border-color: #f6caca; }
.dg-item.is-nula .dg-folio b, .dg-item.is-nula .dg-total { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }

/* Acciones de la fila */
.dg-acciones { display: flex; justify-content: flex-end; gap: 6px; }
.dg-btn {
    display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: var(--ui-radius-sm, 10px);
    border: 1px solid var(--line); background: #fff; color: var(--text); font: inherit; font-size: .85rem; font-weight: 600;
    cursor: pointer; text-decoration: none; transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}
.dg-btn svg { width: 16px; height: 16px; display: block; }
.dg-btn:hover { border-color: var(--home-blue); color: var(--home-blue); }
.dg-btn:focus-visible { outline: none; box-shadow: var(--ui-foco, 0 0 0 3px rgba(var(--ui-acento-rgb), .3)); }
.dg-btn.is-busy { opacity: .6; cursor: progress; }
.dg-expandir[aria-expanded="true"] { background: var(--home-blue-soft); border-color: var(--ui-borde-acento); color: var(--home-blue-dark); }

/* Panel de detalle */
.dg-panel { padding: 4px 18px 18px; background: #fbfcfe; border-top: 1px dashed var(--line); }
.dg-panel-cuerpo { display: grid; gap: 14px; padding-top: 14px; }
.dg-cargando { margin: 0; color: var(--muted); font-size: .9rem; }
.dg-error { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; color: #a61b1b; font-weight: 600; }
.dg-error p { margin: 0; }
.dg-aviso { margin: 0; color: var(--muted); }
.dg-bloques { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.dg-bloque { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; min-width: 0; }
.dg-bloque h3 { margin: 0 0 8px; font-size: .74rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.dg-bloque dl { display: grid; gap: 6px; margin: 0; }
.dg-bloque dl > div { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 8px; font-size: .88rem; }
.dg-bloque dt { color: var(--muted); }
.dg-bloque dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.dg-tabla { border: 1px solid var(--line); border-radius: 12px; background: #fff; overflow: hidden; }
.dg-tfila { display: grid; grid-template-columns: 80px minmax(0, 1fr) 130px 130px; gap: 12px; padding: 9px 14px; border-bottom: 1px solid #f1f0ed; font-size: .9rem; }
.dg-tfila:last-child { border-bottom: 0; }
.dg-tfila .num { text-align: right; font-variant-numeric: tabular-nums; }
.dg-tcab { background: #fafaf8; font-size: .74rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.dg-tdesc { overflow-wrap: anywhere; }
.dg-totales { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px 22px; margin: 0; }
.dg-totales > div { display: flex; align-items: baseline; gap: 8px; }
.dg-totales dt { color: var(--muted); font-size: .85rem; }
.dg-totales dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.dg-totales > div:last-child dd { font-size: 1.1rem; color: var(--text); }
.dg-panel-acciones { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.dg-panel-acciones .an-btn { min-height: 40px; padding: 8px 14px; font-size: .9rem; }
.dg-anular { margin: 0 0 0 auto; }
.dg-panel .an-btn.danger { background: #fff; border-color: #f6caca; }
.dg-panel-acciones .an-btn[aria-busy="true"] { cursor: progress; }

/* Paginación */
.dg-paginacion { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; padding: 14px; border-top: 1px solid var(--line); }
.dg-paginacion a, .dg-paginacion span {
    display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 10px; border-radius: 10px;
    border: 1px solid var(--line); background: #fff; color: var(--text); font-weight: 600; text-decoration: none; font-variant-numeric: tabular-nums;
}
.dg-paginacion a:hover { border-color: var(--home-blue); color: var(--home-blue); }
.dg-paginacion a:focus-visible { outline: none; box-shadow: var(--ui-foco, 0 0 0 3px rgba(var(--ui-acento-rgb), .3)); }
.dg-paginacion span.is-on { background: var(--home-blue); border-color: var(--home-blue); color: #fff; }
.dg-paginacion svg { width: 16px; height: 16px; display: block; }

.dg-estado-error { display: grid; justify-items: center; gap: 10px; text-align: center; color: var(--muted); }
.dg-estado-error h2 { margin: 0; font-size: 1.1rem; color: var(--text); }
.dg-estado-error p { margin: 0; }
.dg-estado-error .an-empty-icon svg { color: #b45309; }

@media (max-width: 980px) {
    .dg-bloques { grid-template-columns: 1fr 1fr; }
    .dg-bloques > :last-child { grid-column: 1 / -1; }
}
/* Móvil y tablet angosta: cada guía pasa a tarjeta (sin desplazamiento horizontal) */
@media (max-width: 760px) {
    .dg-cab { display: none; }
    .dg-fila {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas: "folio estado" "cliente cliente" "fecha total" "cant cant" "acciones acciones";
        gap: 6px 12px; padding: 14px 16px;
    }
    .dg-folio { grid-area: folio; display: flex; align-items: baseline; gap: 6px; }
    .dg-folio small { display: inline; color: var(--muted); font-size: .78rem; font-weight: 600; }
    .dg-estado-celda { grid-area: estado; justify-self: end; }
    .dg-cliente { grid-area: cliente; }
    .dg-cliente strong { white-space: normal; }
    .dg-fecha { grid-area: fecha; color: var(--muted); font-size: .88rem; }
    .dg-total { grid-area: total; text-align: right; }
    .dg-fila .dg-cant { grid-area: cant; text-align: left; color: var(--muted); font-size: .88rem; }
    .dg-acciones { grid-area: acciones; justify-content: stretch; margin-top: 6px; }
    .dg-acciones .dg-btn { flex: 1 1 0; justify-content: center; min-height: 40px; }
    .dg-panel { padding: 4px 14px 14px; }
    .dg-bloques { grid-template-columns: 1fr; }
    .dg-tfila { grid-template-columns: 38px minmax(0, 1fr) 74px 82px; gap: 8px; padding: 9px 10px; font-size: .82rem; }
    .dg-tcab { font-size: .66rem; letter-spacing: .02em; }
    .dg-totales { justify-content: space-between; }
    .dg-panel-acciones .an-btn { flex: 1 1 100%; }
    .dg-anular { margin: 0; flex: 1 1 100%; }
    .dg-anular .an-btn { width: 100%; }
    .dg-conteo { flex-basis: 100%; margin: 0; }
    .dg-toolbar-acciones { flex: 1 1 100%; }
    .dg-toolbar-acciones .an-btn { flex: 1 1 0; }
}
@media (prefers-reduced-motion: reduce) { .dg-btn { transition: none; } }

/* ==========================================================================
   Despacho · Nueva guía (ng-*)
   ========================================================================== */
.ng-form { display: grid; gap: 16px; }
.ng-seccion { display: grid; gap: 16px; }
.ng-seccion[hidden] { display: none; }
.ng-seccion-head { display: flex; align-items: flex-start; gap: 12px; }
.ng-seccion-head h2 { margin: 0; font-size: 1.05rem; }
.ng-seccion-head p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.ng-num {
    flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px;
    background: var(--home-blue-soft); color: var(--home-blue-dark); font-weight: 800; font-size: .9rem;
}
.ng-num svg { width: 16px; height: 16px; }
.ng-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.ng-span-2 { grid-column: span 2; }
.ng-mayus { text-transform: uppercase; }
.ng-mayus::placeholder { text-transform: none; }
.ng-error { color: #b91c1c; font-size: .82rem; font-weight: 600; }
.ng-error:empty { display: none; }
.ng-form .an-input[aria-invalid="true"] { border-color: #dc2626; box-shadow: 0 0 0 3px rgba(220, 38, 38, .12); }
.ng-rut { display: flex; gap: 8px; }
.ng-rut .an-btn { flex: none; min-height: 46px; }
.ng-bloqueo { display: flex; align-items: center; gap: 8px; margin: 0; padding: 10px 14px; border-radius: 10px; background: #fef2f2; border: 1px solid #f6caca; color: #a61b1b; font-weight: 700; }
.ng-bloqueo svg { width: 18px; height: 18px; flex: none; }
.ng-estado-error { color: #a61b1b; }
.ng-link { padding: 0; border: 0; background: none; color: var(--home-blue); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

/* Combobox de chofer */
.ng-combo { position: relative; }
.ng-combo[hidden] { display: none; }
.ng-combo .an-input[aria-busy="true"] { background-image: linear-gradient(90deg, transparent, rgba(var(--ui-acento-rgb), .08), transparent); background-size: 200% 100%; }
.ng-opciones {
    position: absolute; z-index: 15; left: 0; right: 0; top: calc(100% + 4px); max-height: 300px; overflow: auto;
    list-style: none; margin: 0; padding: 4px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--ui-shadow-md, 0 6px 18px rgba(var(--ui-sombra-rgb), .09));
}
.ng-opcion { display: grid; gap: 1px; padding: 9px 12px; border-radius: 9px; cursor: pointer; }
.ng-opcion strong { font-weight: 700; }
.ng-opcion small { color: var(--muted); font-size: .8rem; }
.ng-opcion:hover, .ng-opcion.is-activo { background: var(--home-blue-soft); }
.ng-mas { color: var(--home-blue); font-weight: 700; text-align: center; }
.ng-elegido { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--ui-borde-acento); border-radius: 12px; background: var(--ui-hover); }
.ng-elegido[hidden] { display: none; }
.ng-elegido-icono { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: #fff; color: var(--home-blue); }
.ng-elegido-icono svg { width: 18px; height: 18px; }
.ng-elegido-texto { display: grid; min-width: 0; flex: 1; }
.ng-elegido-texto small { color: var(--muted); font-size: .82rem; overflow-wrap: anywhere; }

/* Camiones */
.ng-camiones[hidden], .ng-acoplado[hidden], .ng-camion-filtro[hidden] { display: none; }
.ng-camion-filtro { max-width: 280px; }
.ng-patentes { display: flex; flex-wrap: wrap; gap: 8px; }
.ng-patente { position: relative; cursor: pointer; }
.ng-patente input { position: absolute; opacity: 0; pointer-events: none; }
.ng-patente span {
    display: grid; gap: 1px; min-width: 128px; padding: 9px 14px; border-radius: 11px; border: 1px solid #d6d4cf; background: #fff;
    transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.ng-patente b { font-size: 1rem; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.ng-patente small { color: var(--muted); font-size: .76rem; }
.ng-patente:hover span { border-color: var(--home-blue); }
.ng-patente input:checked + span { border-color: var(--home-blue); background: var(--home-blue-soft); box-shadow: inset 0 0 0 1px var(--home-blue); }
.ng-patente input:focus-visible + span { box-shadow: var(--ui-foco, 0 0 0 3px rgba(var(--ui-acento-rgb), .3)); }
.ng-mas-camiones { align-self: center; }
.ng-acoplado { align-items: center; }
.ng-sin-acoplado[hidden] { display: none; }

/* Detalle */
.ng-linea { display: grid; grid-template-columns: 110px minmax(0, 1fr) 160px auto; gap: 12px; align-items: end; }
.ng-detalle[hidden] { display: none; }
.ng-detalle { display: grid; gap: 8px; }
.ng-detalle-head { display: flex; align-items: center; justify-content: space-between; }
.ng-detalle-head h3 { margin: 0; font-size: .95rem; }
.ng-contador { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.dg-tfila.ng-tfila { grid-template-columns: 70px minmax(0, 1fr) 110px 120px 36px; align-items: center; }
.ng-quitar {
    display: grid; place-items: center; width: 30px; height: 30px; padding: 0; border-radius: 8px; border: 1px solid var(--line);
    background: #fff; color: #6b6a66; font-size: 1.1rem; line-height: 1; cursor: pointer;
}
.ng-quitar:hover { color: #b91c1c; border-color: #f6caca; background: #fef2f2; }
.ng-quitar:focus-visible { outline: none; box-shadow: var(--ui-foco, 0 0 0 3px rgba(var(--ui-acento-rgb), .3)); }

/* Resumen */
.ng-resumen-datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; margin: 0; }
.ng-resumen-datos > div { display: grid; gap: 2px; min-width: 0; }
.ng-resumen-datos dt { color: var(--muted); font-size: .8rem; }
.ng-resumen-datos dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.ng-resumen-datos .is-falta dd { color: #a1a9b6; font-weight: 500; font-style: italic; }
.ng-alerta { padding: 12px 14px; border-radius: 10px; font-weight: 600; }
.ng-alerta[hidden] { display: none; }
.ng-alerta.error { background: #fef2f2; border: 1px solid #f6caca; color: #a61b1b; }
.ng-acciones { display: flex; justify-content: flex-end; }
.ng-form[aria-busy="true"] [data-ng-generar] { cursor: progress; }

/* Resultado */
.ng-resultado { display: grid; justify-items: center; gap: 10px; text-align: center; padding: 32px 24px; }
.ng-resultado[hidden] { display: none; }
.ng-resultado:focus { outline: none; }
.ng-resultado h2 { margin: 0; font-size: 1.25rem; }
.ng-resultado p { margin: 0; max-width: 560px; color: var(--muted); }
.ng-resultado-icono { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: #ecfdf3; color: #146c3a; }
.ng-resultado-icono svg { width: 26px; height: 26px; }
.ng-resultado.advertencia .ng-resultado-icono { background: #fff5e0; color: #8a5300; }
.ng-resultado.info .ng-resultado-icono { background: var(--home-blue-soft); color: var(--home-blue-dark); }
.ng-resultado-envios { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; color: var(--text); font-size: .9rem; }
.ng-resultado-acciones { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 6px; }
.ng-resultado-acciones [hidden] { display: none; }

@media (max-width: 760px) {
    .ng-grid, .ng-resumen-datos { grid-template-columns: 1fr; }
    .ng-span-2 { grid-column: auto; }
    .ng-linea { grid-template-columns: 1fr 1fr; }
    .ng-linea-desc { grid-column: 1 / -1; order: -1; }
    .ng-linea-btn { grid-column: 1 / -1; }
    .ng-linea-btn .an-label { display: none; }
    .ng-linea-btn .an-btn { width: 100%; }
    .dg-tfila.ng-tfila { grid-template-columns: 36px minmax(0, 1fr) 70px 78px 30px; gap: 6px; padding: 8px 10px; font-size: .82rem; }
    .ng-acciones .an-btn { width: 100%; }
    .ng-patente { flex: 1 1 calc(50% - 8px); }
    .ng-patente span { min-width: 0; }
    .ng-camion-filtro { max-width: none; }
}
@media (prefers-reduced-motion: reduce) { .ng-patente span { transition: none; } }

/* ==========================================================================
   Login: tarjeta negra centrada sobre Fondo.jpg, con acentos dorados del fondo
   ========================================================================== */
:root {
    --login-oro: var(--oro-claro);
    --login-oro-osc: var(--oro);
}
.login-body {
    background:
        linear-gradient(180deg, rgba(4, 9, 20, .30), rgba(4, 9, 20, .55)),
        url('/img/Fondo.webp') center / cover no-repeat,
        #0b0b0d;
}
.login-shell { width: min(100%, 420px); }
.login-card {
    position: relative;
    padding: 34px 34px 30px;
    border-radius: 18px;
    background: rgba(8, 10, 14, .92);
    border: 1px solid rgba(210, 178, 101, .28);
    box-shadow: 0 30px 80px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .04);
    backdrop-filter: blur(6px);
    color: #e5e7eb;
}
/* logo1.png trae mucho margen transparente: se muestra solo la franja del logotipo */
.login-logo-wrap {
    display: flex; align-items: center; justify-content: center;
    height: 92px; margin: 0 0 4px; overflow: hidden;
}
.login-logo-wrap img { width: 280px; max-width: none; height: auto; }
.login-sub { margin: 0 0 26px; text-align: center; color: rgba(255, 255, 255, .6); font-size: .92rem; }

.login-card .form-group label { color: #e5e7eb; font-weight: 600; font-size: .9rem; }
.login-card .form-group input {
    background: rgba(255, 255, 255, .06);
    border-color: rgba(255, 255, 255, .16);
    color: #fff;
}
.login-card .form-group input::placeholder { color: rgba(255, 255, 255, .38); }
.login-card .form-group input:hover { border-color: rgba(255, 255, 255, .28); }
.login-card .form-group input:focus { border-color: var(--login-oro); box-shadow: 0 0 0 4px rgba(210, 178, 101, .18); }
/* Autocompletado del navegador sin fondo amarillo/blanco */
.login-card .form-group input:-webkit-autofill {
    -webkit-text-fill-color: #fff;
    box-shadow: 0 0 0 1000px #15171c inset;
    caret-color: #fff;
}
.login-card .remember-row { color: rgba(255, 255, 255, .78); font-weight: 500; }
.login-card .remember-row input { accent-color: var(--login-oro); }

.login-card .login-actions { display: grid; gap: 10px; margin-top: 4px; }
.login-card .btn { width: 100%; min-height: 48px; }
.login-card .btn:hover:not(:disabled) { transform: translateY(-1px); }
.login-card .btn-primary {
    background: linear-gradient(180deg, #e0c27a, var(--login-oro-osc));
    color: #15120a;
    box-shadow: 0 10px 24px rgba(184, 145, 63, .25);
}
.login-card .btn-primary:hover:not(:disabled) { background: linear-gradient(180deg, #e8cd8a, #c49c48); box-shadow: 0 14px 28px rgba(184, 145, 63, .32); }
.login-card .btn-primary:focus-visible, .login-card .btn-secondary:focus-visible { outline: 3px solid rgba(210, 178, 101, .45); outline-offset: 2px; }
.login-card .btn-secondary { background: transparent; color: rgba(255, 255, 255, .72); border: 1px solid rgba(255, 255, 255, .18); box-shadow: none; }
.login-card .validation-summary, .login-card .field-error { color: #fca5a5; }
.login-card .validation-summary ul { margin: 0; padding-left: 18px; }

/* Acceso denegado reutiliza la tarjeta */
.login-card.small { display: grid; justify-items: center; gap: 10px; text-align: center; }
.login-card.small h1 { margin: 0; color: #fff; font-size: 1.35rem; }
.login-card.small p { margin: 0 0 8px; color: rgba(255, 255, 255, .7); }
.login-card.small .btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }

@media (max-width: 680px) {
    .login-body { padding: 16px; background-position: 0 0, 62% center, 0 0; }
    .login-card { padding: 28px 20px 24px; }
    .login-logo-wrap { height: 80px; }
    .login-logo-wrap img { width: 240px; }
}
@media (prefers-reduced-motion: reduce) { .login-card .btn { transition: none; } }

/* ==========================================================================
   Botones: estilo único para toda la Web (el login conserva su estilo dorado propio).
   Normal: blanco con texto oscuro · Hover/activo: negro con texto blanco · Focus: negro con halo dorado.
   ========================================================================== */
:root {
    --btn-borde: #d6d4cf;
    --btn-texto: #15171a;
    --btn-peligro: #b42318;
    --btn-peligro-borde: #efc2bd;
    --btn-foco: 0 0 0 2px #fff, 0 0 0 4px var(--ui-negro), 0 0 0 7px rgba(210, 178, 101, .45);
}
:is(.an-btn, .an-icon-btn, .ho-btn, .dg-btn, .fx-btn, .error-btn, .users-primary-button, .users-edit-button,
    .an-btn.primary, .an-btn.secondary, .an-btn.ghost, .ho-btn.primary, .fx-btn-primario, .fx-btn-secundario, .error-btn.primary) {
    background: #fff;
    color: var(--btn-texto);
    border: 1px solid var(--btn-borde);
    box-shadow: none;
    transform: none;
    filter: none;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
/* Acción principal: mismo fondo blanco, borde y peso más marcados */
:is(.an-btn.primary, .ho-btn.primary, .fx-btn-primario, .error-btn.primary, .users-primary-button) {
    border: 1.5px solid var(--ui-negro);
    font-weight: 700;
}
:is(.an-btn, .an-icon-btn, .ho-btn, .dg-btn, .fx-btn, .error-btn, .users-primary-button, .users-edit-button):is(:hover, :active):not(:disabled):not([aria-disabled="true"]):not(.is-soon),
.dg-expandir[aria-expanded="true"] {
    background: var(--ui-negro);
    color: #fff;
    border-color: var(--ui-negro);
    box-shadow: none;
    transform: none;
}
/* Acciones peligrosas: rojo sobrio, se rellenan al pasar el cursor */
:is(.an-btn.danger, .an-icon-btn.danger, .fx-modal[data-tipo="error"] .fx-btn-primario) {
    background: #fff;
    color: var(--btn-peligro);
    border-color: var(--btn-peligro-borde);
}
:is(.an-btn.danger, .an-icon-btn.danger, .fx-modal[data-tipo="error"] .fx-btn-primario):is(:hover, :active):not(:disabled) {
    background: var(--btn-peligro);
    color: #fff;
    border-color: var(--btn-peligro);
}
:is(.an-btn, .an-icon-btn, .ho-btn, .dg-btn, .fx-btn, .error-btn, .users-primary-button, .users-edit-button,
    .topbar-salir button, .topbar-volver, .ng-quitar, .dg-paginacion a):focus-visible {
    outline: none;
    box-shadow: var(--btn-foco);
}
:is(.an-btn, .an-icon-btn, .ho-btn, .dg-btn, .fx-btn, .error-btn, .users-primary-button, .users-edit-button):is(:disabled, [aria-disabled="true"]) {
    background: #fff;
    color: #9a9a9e;
    border-color: #e4e3df;
    opacity: .7;
    cursor: not-allowed;
}
/* Enlaces y selección de la interfaz: negro con subrayado dorado en vez de azul */
.ng-link, .topbar-crumbs a:hover { color: var(--ui-negro); text-decoration-color: var(--oro); }
.gr-orden a.is-on { color: var(--ui-negro); box-shadow: inset 0 -2px 0 var(--oro), 0 1px 3px rgba(var(--ui-sombra-rgb), .12); }
.dg-paginacion span.is-on { background: var(--ui-negro); border-color: var(--ui-negro); }
.ng-patente input:checked + span { border-color: var(--ui-negro); background: var(--oro-suave); box-shadow: inset 0 0 0 1px var(--ui-negro); }
.ng-opcion:hover, .ng-opcion.is-activo { background: var(--oro-suave); }
@media (prefers-reduced-motion: reduce) {
    :is(.an-btn, .an-icon-btn, .ho-btn, .dg-btn, .fx-btn, .error-btn, .users-primary-button, .users-edit-button) { transition: none; }
}

/* ==========================================================================
   Inicio: banner (imagen + tratamiento oscuro neutro), hora/clima y recintos del día
   ========================================================================== */
.ho-hero {
    align-items: flex-end; gap: 20px; min-height: 240px; padding: 28px 30px;
    border: 1px solid rgba(210, 178, 101, .22);
    background:
        linear-gradient(90deg, rgba(8, 8, 10, .80) 0%, rgba(8, 8, 10, .52) 40%, rgba(8, 8, 10, .16) 72%, rgba(8, 8, 10, .06) 100%),
        linear-gradient(180deg, rgba(8, 8, 10, 0) 45%, rgba(8, 8, 10, .45) 100%),
        url('/img/banner-inicio.webp') center 62% / cover no-repeat,
        #1b1b1d;
    box-shadow: 0 16px 36px rgba(12, 12, 14, .16);
}
.ho-hero .ho-date { color: rgba(255, 255, 255, .78); }
.ho-hero .ho-live-link { margin-top: 12px; }
.ho-status.on .ho-status-dot { background: var(--oro-claro); box-shadow: 0 0 0 4px rgba(210, 178, 101, .28); }
.ho-hero-info {
    position: relative; z-index: 1; display: grid; gap: 10px; min-width: 250px; padding: 14px 16px;
    border-radius: 14px; background: rgba(10, 10, 12, .58); border: 1px solid rgba(255, 255, 255, .14);
    backdrop-filter: blur(4px); color: #fff;
}
.ho-hora { display: grid; gap: 2px; }
.ho-hora small, .ho-clima-recinto { color: rgba(255, 255, 255, .66); font-size: .74rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.ho-hora time { font-size: 2rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.ho-climas { list-style: none; margin: 0; padding: 10px 0 0; display: grid; gap: 8px; border-top: 1px solid rgba(255, 255, 255, .14); }
.ho-clima { display: grid; gap: 1px; }
.ho-clima-dato { font-size: .95rem; font-weight: 700; }
.ho-clima-dato.ok { color: #fff; }
.ho-clima-dato.cargando, .ho-clima-dato.sin-dato { color: rgba(255, 255, 255, .62); font-weight: 500; }
.ho-clima-dato.error { color: #fecaca; font-weight: 500; }
.ho-clima-reintentar { padding: 0; border: 0; background: none; color: var(--oro-claro); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.ho-clima-reintentar:focus-visible { outline: 2px solid var(--oro-claro); outline-offset: 2px; border-radius: 4px; }

/* Recintos del día: una tarjeta por recinto, con sus datos y la feria en curso */
.ho-grid { grid-template-columns: minmax(0, 1.6fr) minmax(300px, 1fr); align-items: start; }
.ho-recintos { display: grid; gap: 12px; align-content: start; min-width: 0; }
.ho-recintos .ho-seccion-titulo { margin: 0; }
.ho-recintos.doble { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.ho-recintos.doble .ho-seccion-titulo, .ho-recintos .ho-estado { grid-column: 1 / -1; }
.ho-rc {
    display: grid; grid-template-columns: 220px minmax(0, 1fr); min-width: 0; overflow: hidden;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--ui-radius); box-shadow: var(--ui-shadow-sm);
}
.ho-rc.en-curso { border-color: var(--ui-borde-acento); box-shadow: inset 0 3px 0 var(--oro-claro), var(--ui-shadow-sm); }
.ho-rc-media { min-height: 100%; background: var(--surface-soft); }
.ho-rc-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ho-recintos.doble .ho-rc { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
.ho-recintos.doble .ho-rc-media { aspect-ratio: 16 / 7; min-height: 0; }
.ho-rc-cuerpo { display: grid; gap: 14px; align-content: start; padding: 18px 20px; min-width: 0; }
.ho-rc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.ho-rc-head h3 { margin: 0; font-size: 1.2rem; font-weight: 800; color: var(--text); }
.ho-rc-dir { margin: 2px 0 0; color: var(--muted); font-size: .85rem; }
.ho-rc-estado {
    flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
    font-size: .76rem; font-weight: 700; white-space: nowrap; background: #f3f2ef; color: var(--ui-gris); border: 1px solid var(--line);
}
.ho-rc-estado.on { background: var(--oro-suave); color: #6b5216; border-color: var(--ui-borde-acento); }
.ho-rc-estado.on::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--oro); }
.ho-rc-datos { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px 16px; margin: 0; }
.ho-rc-datos dt, .ho-kpis dt { color: var(--muted); font-size: .78rem; }
.ho-rc-datos dd { margin: 0; font-weight: 700; overflow-wrap: anywhere; }
.ho-feria { display: grid; gap: 10px; padding-top: 14px; border-top: 1px solid var(--line); }
.ho-feria-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; font-weight: 600; }
.ho-feria-head strong { font-size: 1.45rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.ho-progreso { appearance: none; -webkit-appearance: none; display: block; width: 100%; height: 12px; border: 0; border-radius: 999px; background: #ecebe7; overflow: hidden; }
.ho-progreso::-webkit-progress-bar { background: #ecebe7; border-radius: 999px; }
.ho-progreso::-webkit-progress-value { background: linear-gradient(90deg, var(--oro), var(--oro-claro)); border-radius: 999px; }
.ho-progreso::-moz-progress-bar { background: linear-gradient(90deg, var(--oro), var(--oro-claro)); border-radius: 999px; }
.ho-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin: 4px 0 0; }
.ho-kpis > div { padding: 10px 12px; border-radius: 12px; background: var(--surface-soft); border: 1px solid var(--line); min-width: 0; }
.ho-kpis dd { margin: 2px 0 0; font-size: 1.1rem; font-weight: 800; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.ho-kpis dd.ho-kpi-detalle { margin: 0; font-size: .78rem; font-weight: 500; color: var(--muted); }
.ho-estado {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 20px;
    border-radius: var(--ui-radius); background: var(--surface); border: 1px dashed #d4d2cc; color: var(--muted);
}
.ho-estado p { margin: 0; }
.ho-estado.error { border-style: solid; border-color: #f6caca; background: #fffafa; color: #a61b1b; }
.ho-h-icon svg { color: var(--oro); }

/* Calendario: blanco, texto negro/gris y dorado para hoy y la selección */
.cal-r-0  { --c: #a3a19c; }
.cal-r-1  { --c: #1f2328; } /* Osorno */
.cal-r-6  { --c: #8a6d3b; } /* Paillaco */
.cal-r-3  { --c: #6b6a66; } /* Puerto Montt */
.cal-r-2  { --c: #9a4f2b; } /* Purranque */
.cal-r-4  { --c: #55623f; } /* Puerto Varas */
.cal-r-10 { --c: #b8913f; } /* La Junta */
.cal-r-9  { --c: #7d8a6a; } /* Feria AFC */
.cal-mini-dia:hover { background: #f3f2ef; }
.cal-mini-dia:focus-visible, .cal-g-dia:focus-visible { outline: 2px solid var(--ui-negro); outline-offset: 1px; }
.cal-mini-dia.con-feria { background: #fafaf8; }
.cal-mini-dia.hoy { background: #fff; color: var(--ui-negro); font-weight: 800; box-shadow: inset 0 0 0 2px var(--oro-claro); }
.cal-mini-dia.hoy .cal-dot { box-shadow: none; }
.cal-g-dia:hover { border-color: var(--ui-negro); }
.cal-g-dia.activo { border-color: var(--ui-negro); box-shadow: 0 0 0 3px rgba(210, 178, 101, .38); }
.cal-g-dia.hoy .cal-g-num { background: var(--oro-claro); color: var(--ui-negro); }
.cal-proximas button:hover { border-color: var(--ui-negro); }
.cal-nav:hover { background: var(--ui-negro); border-color: var(--ui-negro); color: #fff; }
.cal-nav:focus-visible, .cal-cerrar:focus-visible, .cal-proximas button:focus-visible { outline: none; box-shadow: var(--btn-foco); }
.cal-det-kicker { color: #8a6a24; }
.cal-detalle-vacio svg { color: var(--oro); }

@media (max-width: 1180px) {
    .ho-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .ho-hero {
        min-height: 0; padding: 20px; flex-direction: column; align-items: stretch;
        background:
            linear-gradient(180deg, rgba(8, 8, 10, .50) 0%, rgba(8, 8, 10, .80) 100%),
            url('/img/banner-inicio-movil.webp') 72% center / cover no-repeat,
            #1b1b1d;
    }
    .ho-hero-info { min-width: 0; }
    .ho-hora time { font-size: 1.6rem; }
    .ho-recintos.doble, .ho-rc { grid-template-columns: 1fr; }
    .ho-rc-media { aspect-ratio: 16 / 8; min-height: 0; }
    .ho-rc-cuerpo { padding: 16px; }
    .ho-rc-head { flex-direction: column; }
}

/* ==========================================================================
   Revisión de corredores · Revisar anuncios (rv-*): tabla en escritorio, tarjetas en móvil
   ========================================================================== */
.rv-filtros .an-tool { flex: 1 1 160px; }
.rv-filtros .rv-tool-tamano { flex: 0 1 120px; }
.rv-resumen { margin: 0; font-size: .9rem; font-weight: 600; color: var(--text); }
.rv-tabla-wrap { overflow-x: auto; }
.rv-tabla { width: 100%; border-collapse: collapse; font-size: .9rem; }
.rv-tabla th, .rv-tabla td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rv-tabla thead th {
    background: var(--surface-soft); color: var(--muted); font-size: .74rem; font-weight: 700;
    letter-spacing: .04em; text-transform: uppercase; white-space: nowrap;
}
.rv-tabla tbody tr:hover { background: var(--ui-hover); }
.rv-tabla tbody tr:last-child td { border-bottom: 0; }
.rv-tabla .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rv-tabla td.num { font-weight: 700; }
.rv-corredor { font-weight: 600; }
.rv-fecha { white-space: nowrap; font-variant-numeric: tabular-nums; }
.rv-cliente strong { display: block; font-weight: 600; }
.rv-cliente small { color: var(--muted); font-size: .8rem; }

@media (max-width: 760px) {
    .rv-tabla-wrap { overflow: visible; }
    .rv-tabla thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
    .rv-tabla, .rv-tabla tbody, .rv-tabla tr, .rv-tabla td { display: block; }
    .rv-tabla tr {
        display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px 12px;
        padding: 14px 16px; border-bottom: 1px solid var(--line);
    }
    .rv-tabla td { padding: 0; border: 0; }
    .rv-tabla td.rv-corredor, .rv-tabla td.rv-cliente { grid-column: 1 / -1; }
    .rv-tabla td.rv-corredor { font-size: .95rem; }
    .rv-tabla td[data-label]::before {
        content: attr(data-label); display: block; color: var(--muted); font-size: .72rem; font-weight: 600;
        letter-spacing: .03em; text-transform: uppercase;
    }
    .rv-tabla td.rv-corredor::before { display: none; }
    .rv-tabla .num { text-align: left; }
    .rv-filtros .rv-tool-tamano { flex: 1 1 120px; }
}

/* ==========================================================================
   Revisión de corredores · Clientes por corredor (rcl-*): reutiliza rv-tabla, dg-* y an-*
   ========================================================================== */
.rcl-resumen { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px 24px; align-items: center; }
.rcl-corredor { display: flex; align-items: center; gap: 14px; min-width: 0; }
.rcl-avatar { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--oro-suave); color: #6b5216; border: 1px solid var(--ui-borde-acento); }
.rcl-avatar svg { width: 22px; height: 22px; }
.rcl-kicker { margin: 0; font-size: .74rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: #8a6a24; }
.rcl-corredor h2 { margin: 2px 0; font-size: 1.25rem; }
.rcl-meta { margin: 0; color: var(--muted); font-size: .88rem; }
.rcl-totales { display: flex; gap: 10px; margin: 0; }
.rcl-totales > div { min-width: 92px; padding: 8px 12px; border-radius: 12px; background: var(--surface-soft); border: 1px solid var(--line); }
.rcl-totales dt { color: var(--muted); font-size: .76rem; }
.rcl-totales dd { margin: 0; font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.rcl-resumen-acciones { grid-column: 1 / -1; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.rcl-accion { text-align: right; white-space: nowrap; }
.rcl-permiso { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid transparent; }
.rcl-permiso::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.rcl-permiso.si { background: var(--oro-suave); color: #6b5216; border-color: var(--ui-borde-acento); }
.rcl-permiso.no { background: #f3f2ef; color: var(--muted); border-color: var(--line); }
.rcl-tabla tr.rcl-nueva { background: var(--oro-suave); }

/* Diálogo de agregar cliente (no modal, con fondo propio bajo el modal global de confirmación) */
.rcl-dialogo[open] {
    position: fixed; inset: 0; z-index: 1500; display: grid; place-items: center; width: 100%; height: 100%; max-width: none; max-height: none;
    margin: 0; padding: 20px; border: 0; background: rgba(var(--ui-sombra-rgb), .5);
}
body.rcl-dialogo-abierto { overflow: hidden; }
.rcl-form {
    display: grid; gap: 14px; width: min(480px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 22px 24px;
    background: #fff; border-radius: var(--ui-radius); border: 1px solid var(--line); box-shadow: 0 24px 60px rgba(var(--ui-sombra-rgb), .3);
}
.rcl-dialogo-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rcl-dialogo-head h2 { margin: 0; font-size: 1.15rem; }
.rcl-dialogo-sub { margin: -6px 0 0; color: var(--muted); font-size: .9rem; }
.rcl-cerrar { display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text); cursor: pointer; }
.rcl-cerrar:hover { background: var(--ui-negro); border-color: var(--ui-negro); color: #fff; }
.rcl-cerrar:focus-visible { outline: none; box-shadow: var(--btn-foco); }
.rcl-cerrar svg { width: 16px; height: 16px; }
.rcl-nombre { min-height: 46px; display: flex; align-items: center; padding: 0 13px; border-radius: 11px; background: var(--surface-soft); border: 1px solid var(--line); font-weight: 600; }
.rcl-opciones { display: flex; flex-wrap: wrap; gap: 10px 20px; }
.rcl-estado { margin: 0; min-height: 1.3em; font-size: .88rem; font-weight: 600; }
.rcl-estado.ok { color: #146c3a; }
.rcl-estado.info { color: var(--muted); font-weight: 500; }
.rcl-estado.advertencia { color: #8a5300; }
.rcl-estado.error { color: #b42318; }
.rcl-dialogo-acciones { display: flex; justify-content: flex-end; gap: 10px; }

@media (max-width: 760px) {
    .rcl-resumen { grid-template-columns: 1fr; }
    .rcl-totales > div { flex: 1 1 0; min-width: 0; }
    .rcl-resumen-acciones .an-btn { flex: 1 1 100%; }
    .rcl-tabla tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .rcl-tabla td.rcl-celda-cliente, .rv-tabla td.rcl-accion { grid-column: 1 / -1; }
    .rv-tabla td.rcl-accion { text-align: left; }
    .rv-tabla td.rcl-accion :is(.an-btn, .dg-btn) { width: 100%; justify-content: center; }
    .rcl-dialogo[open] { padding: 0; place-items: end center; }
    .rcl-form { width: 100%; max-height: 92vh; border-radius: var(--ui-radius) var(--ui-radius) 0 0; }
    .rcl-dialogo-acciones .an-btn { flex: 1 1 0; }
}

/* ==========================================================================
   Revisión de corredores · Cambios de anuncios (ca-*): consulta, cambio e historial diferenciados
   ========================================================================== */
.ca-page .page-acciones { justify-content: flex-start; }
.ca-seccion-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.ca-seccion-head h2 { margin: 0; font-size: 1.1rem; flex: 1 1 auto; }
.ca-etiqueta {
    padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase;
    background: #f3f2ef; color: var(--ui-gris); border: 1px solid var(--line);
}
.ca-etiqueta.edicion { background: var(--oro-suave); color: #6b5216; border-color: var(--ui-borde-acento); }
.ca-estado { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; border: 1px solid transparent; white-space: nowrap; }
.ca-estado::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ca-estado.editado { background: var(--oro-suave); color: #6b5216; border-color: var(--ui-borde-acento); }
.ca-estado.original { background: #f3f2ef; color: var(--muted); border-color: var(--line); }
.ca-datos { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 20px; margin: 0; }
.ca-datos dt { color: var(--muted); font-size: .78rem; }
.ca-datos dd { margin: 2px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.ca-datos dd small { color: var(--muted); font-weight: 500; }
.ca-dato-ancho { grid-column: 1 / -1; }
.ca-edicion { border-color: var(--ui-borde-acento); box-shadow: inset 0 3px 0 var(--oro-claro), var(--ui-shadow-sm); }
.ca-form { display: grid; gap: 14px; }
.ca-campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 18px; }
.ca-comparacion { width: 100%; border-collapse: collapse; font-size: .9rem; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.ca-comparacion th, .ca-comparacion td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); }
.ca-comparacion thead th { background: var(--surface-soft); color: var(--muted); font-size: .74rem; letter-spacing: .04em; text-transform: uppercase; }
.ca-comparacion tbody th { width: 110px; color: var(--muted); font-weight: 600; }
.ca-comparacion tbody tr:last-child > * { border-bottom: 0; }
.ca-comparacion tr.cambiado td:last-child { background: var(--oro-suave); font-weight: 700; color: #4d3b10; }
.ca-conflicto { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #fff7ed; border: 1px solid #f3d5ae; color: #7a4510; font-weight: 600; }
.ca-conflicto[hidden] { display: none; }
.ca-conflicto p { margin: 0; }
.ca-acciones { display: flex; justify-content: flex-end; gap: 10px; }
.ca-historial-lista { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ca-historial-lista li { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 10px; padding: 9px 12px; border-radius: 10px; background: var(--surface-soft); border: 1px solid var(--line); font-size: .88rem; }
.ca-h-fecha { color: var(--muted); font-variant-numeric: tabular-nums; }
.ca-h-texto { overflow-wrap: anywhere; }

@media (max-width: 760px) {
    .ca-datos, .ca-campos { grid-template-columns: 1fr; }
    .ca-comparacion tbody th { width: 80px; }
    .ca-acciones .an-btn { flex: 1 1 0; }
    .ca-historial-lista li { grid-template-columns: 1fr; gap: 2px; }
}

/* Nueva guía por pasos + gestión de transporte desde la guía */
.ng-page .an-steps { margin-bottom: 4px; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.ng-transporte-acciones { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.ng-transporte-acciones[hidden] { display: none; }
.rcl-dialogo.ng-dlg-encima[open] { z-index: 1600; }
.rcl-dialogo .ng-elegido { flex-wrap: wrap; }
.rcl-dialogo .ng-opciones { position: static; margin-top: 4px; max-height: 220px; }

/* =====================================================================
   Menú de corredores: tarjetas con fondo fotográfico (sprite 3x3 exacto)
   El fondo vive en un pseudo-elemento con la proporción real del recuadro
   (640x204), anclado a la derecha: nunca se deforma y el objeto queda a la derecha.
   ===================================================================== */
.broker-action-card.bk-foto {
    position: relative; isolation: isolate; overflow: hidden; height: 100%; min-height: 124px;
    background: #fff; border-color: var(--line);
}
.broker-action-card.bk-foto::before,
.broker-action-card.bk-foto::after { content: ""; position: absolute; top: 0; bottom: 0; right: 0; z-index: -1; pointer-events: none; }
.broker-action-card.bk-foto::before {
    height: 100%; aspect-ratio: 640 / 204;
    background: url("../img/corredores-menu-fondos.webp") no-repeat;
    background-size: 300% 300%; background-position: var(--bk-x, 50%) var(--bk-y, 100%);
    /* Se atenúa el tono durazno de las fotos para que conviva con el blanco, negro y dorado de la paleta. */
    filter: saturate(.55); transform: var(--bk-mover, none);
    -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 38%); mask-image: linear-gradient(90deg, transparent 0%, #000 38%);
    transition: filter .18s ease;
}
/* Velo claro hacia la izquierda para asegurar la lectura del texto. */
.broker-action-card.bk-foto::after {
    left: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .86) 46%, rgba(255, 255, 255, .3) 70%, rgba(255, 255, 255, 0) 92%);
}
.bk-vaca { --bk-x: 0%; --bk-y: 0%; }
.bk-recinto { --bk-x: 50%; --bk-y: 0%; }
.bk-campo { --bk-x: 100%; --bk-y: 0%; }
.bk-martillo { --bk-x: 0%; --bk-y: 50%; }
/* En este recuadro los animales están más al centro: se corre la foto para que no queden bajo el texto. */
.bk-grupo { --bk-x: 50%; --bk-y: 50%; --bk-mover: translateX(4%); }
.bk-acuerdo { --bk-x: 100%; --bk-y: 50%; }
.bk-camion { --bk-x: 0%; --bk-y: 100%; }
.bk-documentos { --bk-x: 100%; --bk-y: 100%; }

.broker-action-card.bk-foto .broker-action-icon { background: rgba(255, 255, 255, .88); color: var(--ui-negro); box-shadow: 0 0 0 1px var(--ui-borde-acento); }
.broker-action-card.bk-foto .broker-action-copy strong { color: var(--ui-negro); }
.broker-action-card.bk-foto .broker-action-copy { text-shadow: 0 0 6px rgba(255, 255, 255, .95), 0 0 2px rgba(255, 255, 255, .95); }
.broker-action-card.bk-foto .broker-action-copy small { color: var(--ui-gris); }
/* La flecha taparía el objeto de la foto; toda la tarjeta ya es el enlace. */
.broker-action-card.bk-foto { grid-template-columns: 64px minmax(0, 1fr); }
.broker-action-card.bk-foto .broker-action-arrow { display: none; }
.broker-action-card.bk-foto:hover { background: #fff; border-color: var(--oro); transform: translateY(-2px); box-shadow: 0 16px 30px rgba(var(--ui-sombra-rgb), .14); }
.broker-action-card.bk-foto:hover::before { filter: saturate(.55) brightness(.9); }
.broker-action-card.bk-foto:hover .broker-action-icon { background: var(--ui-negro); color: #fff; transform: none; }
.broker-action-card.bk-foto:focus-visible { outline: 3px solid var(--oro); outline-offset: 3px; }
@media (max-width: 560px) {
    .broker-action-card.bk-foto { min-height: 140px; grid-template-columns: 52px minmax(0, 1fr); }
    .broker-action-card.bk-foto::after {
        background: linear-gradient(90deg, rgba(255, 255, 255, .95) 0%, rgba(255, 255, 255, .88) 52%, rgba(255, 255, 255, .45) 78%, rgba(255, 255, 255, .1) 100%);
    }
}
@media (prefers-reduced-motion: reduce) {
    .broker-action-card.bk-foto,
    .broker-action-card.bk-foto::before,
    .broker-action-card.bk-foto .broker-action-icon { transition: none; }
    .broker-action-card.bk-foto:hover { transform: none; }
}

/* ==========================================================================
   Revisión de corredores · Análisis de clientes por recinto (acr-*): reutiliza an-*, rv-tabla y dg-*
   ========================================================================== */
.acr-filtros .an-tool { flex: 1 1 170px; }
.acr-filtros .acr-tool-recintos { flex: 1 1 240px; position: relative; }
.acr-multi { position: relative; }
.acr-multi > summary {
    list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px;
    min-width: 0; user-select: none;
}
.acr-multi > summary::-webkit-details-marker { display: none; }
.acr-multi > summary > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acr-multi > summary::after {
    content: ""; flex: 0 0 auto; width: 8px; height: 8px; margin-top: -3px;
    border-right: 2px solid var(--ui-gris); border-bottom: 2px solid var(--ui-gris); transform: rotate(45deg);
}
.acr-multi[open] > summary::after { margin-top: 3px; transform: rotate(-135deg); }
.acr-multi-menu {
    position: absolute; z-index: 40; top: calc(100% + 6px); left: 0; width: max(100%, 280px); max-width: calc(100vw - 32px);
    display: grid; gap: 10px; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px;
    box-shadow: 0 18px 40px rgba(var(--ui-sombra-rgb), .14);
}
.acr-multi-acciones { display: flex; flex-wrap: wrap; gap: 8px; }
.acr-multi-acciones .an-btn { min-height: 36px; padding: 6px 12px; font-size: .85rem; flex: 1 1 auto; }
.acr-multi-lista { display: grid; gap: 2px; max-height: 260px; overflow-y: auto; }
.acr-check { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 9px; cursor: pointer; font-size: .92rem; }
.acr-check:hover { background: var(--ui-hover); }
.acr-check input, .acr-recuperar input { width: 18px; height: 18px; accent-color: var(--ui-negro); flex: 0 0 auto; }
.acr-recuperar {
    flex: 1 1 260px; display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 14px; cursor: pointer;
    border: 1px solid var(--ui-borde-acento); border-radius: 12px; background: var(--oro-suave);
}
.acr-recuperar strong { display: block; font-size: .9rem; }
.acr-recuperar small { display: block; color: var(--ui-gris); font-size: .8rem; }
.acr-cargando {
    display: flex; align-items: center; gap: 10px; margin: 0; padding: 10px 14px; border-radius: 12px;
    background: var(--oro-suave); border: 1px solid var(--ui-borde-acento); color: var(--text); font-weight: 600; font-size: .9rem;
}
.acr-cargando[hidden] { display: none; }
.acr-cargando::before {
    content: ""; width: 16px; height: 16px; flex: 0 0 auto; border-radius: 50%;
    border: 2px solid var(--ui-borde-acento); border-top-color: var(--ui-negro); animation: pv-gira .7s linear infinite;
}
.acr-page.is-cargando :is(.acr-kpis, .an-card, .acr-contexto) { opacity: .5; pointer-events: none; transition: opacity .15s ease; }
.acr-errores { margin: 0; padding-left: 18px; text-align: left; color: var(--text); }
.acr-contexto h2 { font-size: 1.15rem; }
.acr-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.acr-kpis .an-kpi { padding: 16px 18px; min-width: 0; }
.acr-kpis .an-kpi > div { min-width: 0; }
.acr-kpis .an-kpi strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.acr-kpi-recuperar { border-color: var(--ui-borde-acento); background: var(--oro-suave); }
.acr-kpi-recuperar .an-kpi-icon { background: #fff; color: var(--oro); }
.acr-tabla-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.acr-tabla-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.acr-buscar { position: relative; display: block; width: min(300px, 100%); }
.acr-buscar-icono { position: absolute; left: 12px; top: 50%; display: grid; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.acr-buscar-icono svg { width: 16px; height: 16px; }
.acr-buscar .an-input { width: 100%; padding-left: 36px; }
.acr-tamano { display: flex; align-items: center; gap: 8px; font-size: .85rem; font-weight: 700; color: var(--muted); }
.acr-tamano .an-input { width: auto; }
.acr-conteo { margin: 0; padding: 10px 18px 0; }
.acr-orden { color: inherit; text-decoration: none; white-space: nowrap; }
.acr-orden:hover, .acr-orden.is-on { color: var(--ui-negro); }
.acr-orden:focus-visible { outline: none; border-radius: 4px; box-shadow: var(--btn-foco); }
.acr-tabla th, .acr-tabla td { padding: 10px 12px; }
.acr-tabla thead th { white-space: normal; }
.acr-tabla .acr-orden { white-space: normal; display: inline-block; }
.acr-cliente { min-width: 190px; }
.acr-cliente small { display: block; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acr-sino {
    display: inline-block; min-width: 38px; padding: 2px 10px; border-radius: 999px; text-align: center;
    font-size: .78rem; font-weight: 700; background: var(--surface-soft); color: var(--ui-gris); border: 1px solid var(--line);
}
.acr-sino.is-si { background: var(--oro-suave); color: #6b4f12; border-color: var(--ui-borde-acento); }
[data-acr-exportar].is-ocupado { pointer-events: none; opacity: .6; }
@media (max-width: 1100px) {
    .acr-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .acr-tabla-tools, .acr-buscar { width: 100%; }
    .acr-tabla .rv-cliente { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
    .acr-kpis { gap: 10px; }
    .acr-kpis .an-kpi { padding: 12px; gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
    .acr-cargando::before { animation: none; }
    .acr-page.is-cargando :is(.acr-kpis, .an-card, .acr-contexto) { transition: none; }
}
/* La ruta del encabezado no se monta sobre el usuario cuando no cabe: se recorta con puntos suspensivos. */
.topbar-crumbs { overflow: hidden; }
.topbar-crumbs > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 1280px) {
    /* Con poco espacio queda solo la página actual; "Volver" sigue llevando al nivel anterior. */
    .topbar-crumbs:has(> a ~ span:last-child) > :not(:last-child) { display: none; }
}

/* ==========================================================================
   Info Ferias · Resumen feria (rf-*): reutiliza an-*, rv-tabla y dg-*
   ========================================================================== */
.rf-aviso { margin: 0; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--ui-borde-acento); background: var(--oro-suave); font-size: .85rem; font-weight: 600; }
.rf-aviso[hidden] { display: none; }
.rf-page [data-rf-contenido] { display: grid; gap: 18px; }
.rf-cabecera h2 { font-size: 1.35rem; }
.rf-cabecera p { text-transform: capitalize; }
.rf-estado { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.rf-actualizado { color: var(--muted); font-size: .82rem; font-variant-numeric: tabular-nums; }
.rf-badge {
    display: inline-block; padding: 3px 11px; border-radius: 999px; font-size: .8rem; font-weight: 700; white-space: nowrap;
    background: var(--surface-soft); color: var(--text); border: 1px solid var(--line);
}
.rf-badge.is-curso { background: var(--oro-suave); color: #6b4f12; border-color: var(--ui-borde-acento); }
.rf-badge.is-curso::before { content: ""; display: inline-block; width: 7px; height: 7px; margin-right: 7px; border-radius: 50%; background: var(--oro); vertical-align: 1px; }
.rf-kpis { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.rf-kpis .an-kpi { min-width: 0; }
.rf-kpis .an-kpi > div { min-width: 0; }
.rf-kpis .an-kpi strong { overflow-wrap: break-word; font-variant-numeric: tabular-nums; }
.rf-kpis .an-kpi strong em { font-style: normal; font-size: .9rem; font-weight: 600; color: var(--muted); }
.rf-cabecera h2 { display: flex; align-items: center; gap: 10px; }
.rf-cabecera-icono { display: grid; color: var(--oro); }
.rf-cabecera-icono svg { width: 22px; height: 22px; }
.rf-kpi-total { border-color: var(--ui-borde-acento); background: var(--oro-suave); }
.rf-kpi-total .an-kpi-icon { background: #fff; color: var(--oro); }
.rf-bloque-titulo { margin: 0 0 14px; font-size: 1rem; }
.rf-progreso { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 16px 22px; }
.rf-barra-item { display: grid; gap: 6px; }
.rf-barra-menor { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.rf-barra-texto { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: .9rem; }
.rf-barra-texto span { font-weight: 600; }
.rf-barra-texto small { color: var(--muted); font-weight: 400; }
.rf-barra-texto strong { font-size: .85rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rf-barra { -webkit-appearance: none; appearance: none; width: 100%; height: 9px; border: 0; border-radius: 999px; overflow: hidden; background: var(--line); color: var(--ui-negro); }
.rf-barra::-webkit-progress-bar { background: var(--line); border-radius: 999px; }
.rf-barra::-webkit-progress-value { background: linear-gradient(90deg, var(--ui-negro), var(--oro)); border-radius: 999px; }
.rf-barra::-moz-progress-bar { background: linear-gradient(90deg, var(--ui-negro), var(--oro)); border-radius: 999px; }
.rf-grupo { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.rf-grupo-total { font-weight: 800; font-variant-numeric: tabular-nums; }
.rf-vacio { margin: 0; padding: 16px 18px; color: var(--muted); }
.rf-bloque .rf-progreso + .rf-vacio, .rf-bloque > .rf-vacio:first-child { padding: 0; }
.rf-tabla th:last-child, .rf-tabla td:last-child { width: 30%; }
@media (max-width: 760px) {
    .rf-kpis { grid-template-columns: 1fr; gap: 10px; }
    .rf-tabla tr { grid-template-columns: minmax(0, 1fr) auto; }
    .rf-tabla td:last-child { width: auto; text-align: right; }
}
.ho-feria .ho-feria-detalle { justify-self: start; margin-top: 4px; }
/* Aviso del reproductor HLS del Inicio (reintento o navegador sin soporte). */
.ho-live-aviso { position: absolute; left: 12px; right: 12px; bottom: 56px; z-index: 1; margin: 0; padding: 8px 12px; border-radius: 10px; border: 1px solid var(--ui-borde-acento); background: var(--oro-suave); color: var(--text); font-size: .85rem; font-weight: 600; }
.ho-live-aviso[hidden] { display: none; }
