/* ==========================================================================
   TVCI Business Suite · UI
   Layout maestro (sidebar plegable con dock izquierda/derecha/abajo), componentes
   y la miniatura de temas (.tp). Solo consume tokens de tvci-themes.css.
   Reglas: bordes 1px, iconos 1.5px, numerales tabulares en montos, placas y tiempos.
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
    font-family: var(--font);
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
p { margin: 0 0 12px; }
code { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: .85em; color: var(--muted); }
kbd {
    display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px;
    font: 500 11px/1 var(--font); color: var(--muted); background: var(--surface-2);
    border: 1px solid var(--border); border-radius: 4px;
}
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.num, .mono, .plate, .timer { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; }
.mono, .plate { font-family: ui-monospace, 'Cascadia Mono', Consolas, monospace; font-size: 12.5px; letter-spacing: .02em; }
.muted { color: var(--muted); }
.r { text-align: right; }
.ic { width: 18px; height: 18px; flex: none; }
.ic--sm { width: 14px; height: 14px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--surface); padding: 8px 12px; border: 1px solid var(--border); }
.skip:focus { left: 8px; }

/* ───────────── Layout maestro ───────────── */
.app { display: grid; grid-template-columns: var(--sbw) minmax(0, 1fr); min-height: 100vh; }
html[data-collapsed="1"] .app { grid-template-columns: var(--sbw-collapsed) minmax(0, 1fr); }
html[data-dock="right"] .app { grid-template-columns: minmax(0, 1fr) var(--sbw); }
html[data-dock="right"][data-collapsed="1"] .app { grid-template-columns: minmax(0, 1fr) var(--sbw-collapsed); }
html[data-dock="right"] .sb { order: 2; border-right: 0; border-left: 1px solid var(--sb-border); }
html[data-dock="bottom"] .app { grid-template-columns: minmax(0, 1fr); padding-bottom: 64px; }

.main { min-width: 0; display: flex; flex-direction: column; }
.content { flex: 1; padding: 24px; max-width: 1440px; width: 100%; margin: 0 auto; outline: none; }
.foot { display: flex; justify-content: space-between; gap: 12px; padding: 14px 24px; border-top: 1px solid var(--border); color: var(--muted-2); font-size: 12px; }

/* Sidebar */
.sb {
    position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
    background: var(--sb-bg); color: var(--sb-text); border-right: 1px solid var(--sb-border);
    overflow: hidden; z-index: 30;
}
.sb__brand { display: flex; align-items: center; gap: 10px; height: var(--tbh); padding: 0 16px; border-bottom: 1px solid var(--sb-border); flex: none; }
.sb__logo {
    width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: var(--radius-sm);
    background: var(--accent); color: var(--accent-ink); font: 700 15px/1 var(--font-display);
}
.sb__brandtxt { display: flex; flex-direction: column; min-width: 0; line-height: 1.2; }
.sb__brandtxt b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--font-display); font-weight: var(--display-weight); }
.sb__brandtxt small { color: var(--sb-muted); font-size: 11.5px; }
.sb__nav { flex: 1; overflow-y: auto; padding: 12px 10px; }
.sb__group + .sb__group { margin-top: 14px; }
.sb__title { padding: 0 10px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--sb-muted); white-space: nowrap; }
.sb__link {
    position: relative; display: flex; align-items: center; gap: 10px; width: 100%; height: 36px; padding: 0 10px;
    border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--sb-text); cursor: pointer;
    white-space: nowrap; font-size: 13.5px; text-align: left;
}
.sb__link:hover { background: var(--sb-hover); }
.sb__link.is-active { background: var(--sb-active-bg); color: var(--sb-active-text); font-weight: 500; }
.sb__link.is-active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--sb-active-bar); }
.sb__label { overflow: hidden; text-overflow: ellipsis; }
.sb__foot { padding: 10px; border-top: 1px solid var(--sb-border); flex: none; }

/* Plegado */
html[data-collapsed="1"] .sb__brandtxt,
html[data-collapsed="1"] .sb__label,
html[data-collapsed="1"] .sb__title { display: none; }
html[data-collapsed="1"] .sb__brand { justify-content: center; padding: 0; }
html[data-collapsed="1"] .sb__link { justify-content: center; padding: 0; }
html[data-collapsed="1"] .sb__group + .sb__group { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--sb-border); }
html[data-collapsed="1"] .sb__collapse .ic { transform: scaleX(-1); }
html[data-dock="right"] .sb__collapse .ic { transform: scaleX(-1); }
html[data-dock="right"][data-collapsed="1"] .sb__collapse .ic { transform: none; }

/* Dock abajo: barra horizontal fija */
html[data-dock="bottom"] .sb {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto; height: 64px; flex-direction: row; align-items: center;
    border-right: 0; border-top: 1px solid var(--sb-border);
}
html[data-dock="bottom"] .sb__brand { border-bottom: 0; border-right: 1px solid var(--sb-border); height: 100%; }
html[data-dock="bottom"] .sb__nav { display: flex; align-items: center; gap: 4px; overflow-x: auto; overflow-y: hidden; padding: 0 10px; height: 100%; }
html[data-dock="bottom"] .sb__group { display: flex; gap: 4px; margin: 0 !important; padding: 0 !important; border: 0 !important; }
html[data-dock="bottom"] .sb__group + .sb__group { padding-left: 8px !important; border-left: 1px solid var(--sb-border) !important; }
html[data-dock="bottom"] .sb__title { display: none; }
html[data-dock="bottom"] .sb__link { width: auto; }
html[data-dock="bottom"] .sb__link.is-active::before { left: 10px; right: 10px; top: auto; bottom: -12px; width: auto; height: 2px; }
html[data-dock="bottom"] .sb__foot { display: none; }

/* Topbar */
.tb {
    position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 12px; height: var(--tbh); padding: 0 24px;
    background: var(--tb-bg); border-bottom: 1px solid var(--border); backdrop-filter: saturate(140%) blur(10px);
}
.tb__menu { display: none; }
.tb__title { flex: 1; min-width: 0; }
.tb__title h1 { font: var(--display-weight) 18px/1.15 var(--font-display); overflow-wrap: break-word; text-wrap: balance; }
[data-theme="sapphire_gold"] .tb__title h1 { font-size: 22px; }
.tb__title p { margin: 0; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tb__search {
    display: flex; align-items: center; gap: 8px; width: 280px; height: 36px; padding: 0 8px 0 12px; cursor: pointer;
    background: var(--surface); color: var(--muted); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.tb__search span { flex: 1; text-align: left; font-size: 13px; }
.tb__search:hover { border-color: var(--border-strong); }
.tb__user { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 8px 0 4px; background: transparent; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer; }
.tb__user:hover { border-color: var(--border); }
.tb__who { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.tb__who b { font-size: 13px; font-weight: 600; }
.tb__who small { font-size: 11.5px; color: var(--muted); }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; border: 1px solid var(--border); }

.icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); cursor: pointer; }

/* Segmentado */
.seg { display: inline-flex; padding: 2px; gap: 2px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.seg__btn { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 8px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; white-space: nowrap; }
.seg__btn:hover { color: var(--text); }
.seg__btn[aria-pressed="true"], .seg__btn:has(input:checked) { background: var(--surface-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--border-strong); }
.seg__btn input { position: absolute; opacity: 0; pointer-events: none; }
.seg--text .seg__btn { padding: 0 12px; }

/* Menú de usuario */
.menu { position: relative; }
.menu__pop {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 230px; padding: 6px; display: none; z-index: 40;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.menu.is-open .menu__pop { display: block; }
.menu__head { padding: 8px 10px 10px; border-bottom: 1px solid var(--border); margin-bottom: 4px; display: flex; flex-direction: column; }
.menu__head small { color: var(--muted); }
.menu__pop a, .menu__pop button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px; border: 0; background: transparent; border-radius: 4px; cursor: pointer; font-size: 13px; text-align: left; }
.menu__pop a:hover, .menu__pop button:hover { background: var(--surface-2); }
.menu__pop form { margin: 0; }

/* ───────────── Componentes ───────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.card + .card, .grid-2 + .card, .kpis + .card, .kpis + .grid-2 { margin-top: 16px; }
.card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.card__head h2 { font: var(--display-weight) 16px/1.3 var(--font-display); }
[data-theme="sapphire_gold"] .card__head h2 { font-size: 21px; }
.card__head p { margin: 4px 0 0; font-size: 13px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi__head { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.kpi__head .ic { color: var(--accent); }
.kpi__label { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.kpi__value { margin-top: 10px; font: var(--display-weight) 28px/1.1 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="sapphire_gold"] .kpi__value { font-size: 34px; }
.kpi__value small { font: 500 14px var(--font); color: var(--muted); }
.kpi__foot { margin-top: 8px; font-size: 12px; color: var(--muted); }
.meter { margin-top: 12px; height: 4px; background: var(--surface-3); border-radius: 2px; overflow: hidden; }
.meter span { display: block; height: 100%; background: var(--accent); }

.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
    border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text);
    cursor: pointer; font-weight: 500; font-size: 13.5px; white-space: nowrap;
}
.btn:hover { border-color: var(--border-strong); }
.btn--primary { background: var(--btn-bg); color: var(--btn-text); border-color: var(--btn-border); }
.btn--primary:hover { filter: brightness(1.06); border-color: var(--btn-border); }
.btn--ghost { background: transparent; }
.btn--block { width: 100%; }

.badge { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border: 1px solid var(--border); border-radius: 999px; font-size: 11.5px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.badge--ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.badge--bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }

.alert { display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-size: 13.5px; }
.alert--ok { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.alert--ok .ic { color: var(--good); }
.alert--bad { border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.alert--bad .ic { color: var(--bad); }

.tbl-wrap { overflow-x: auto; margin: 0 -20px -20px; border-top: 1px solid var(--border); }
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl th { padding: 10px 20px; text-align: left; font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl td { padding: 12px 20px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl .r { text-align: right; }
.empty { text-align: center; color: var(--muted); padding: 32px !important; }

.feat { list-style: none; margin: 0; padding: 0; }
.feat li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.feat li:last-child { border-bottom: 0; }
.feat li > span { flex: 1; }
.feat li .ic { color: var(--accent); }
.feat li.is-off { color: var(--muted-2); }
.feat li.is-off .ic { color: var(--muted-2); }
.feat__st { color: var(--good) !important; }
.feat li.is-off .feat__st { color: var(--muted-2) !important; }

.dl { display: grid; grid-template-columns: max-content 1fr; gap: 10px 24px; margin: 16px 0 0; }
.dl dt { color: var(--muted); font-size: 13px; }
.dl dd { margin: 0; font-weight: 500; }

.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.plan--top { border-color: var(--accent); }
.plan__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 12px; }
.plan__head h2 { font: var(--display-weight) 18px var(--font-display); }
.plan__price { font: var(--display-weight) 30px/1.1 var(--font-display); margin-bottom: 8px; }
.plan__price small { font: 400 13px var(--font); color: var(--muted); margin-left: 4px; }

/* Formularios */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span, .field legend { font-size: 12.5px; font-weight: 500; color: var(--muted); padding: 0; margin-bottom: 6px; }
.field input[type="text"], .field input[type="email"], .field input[type="password"] {
    height: 40px; padding: 0 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.field input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.color { display: flex; gap: 8px; }
.color input[type="color"] { width: 44px; height: 40px; padding: 3px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-2); cursor: pointer; }
.color input[type="text"] { width: 110px; }
.actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.actions .muted { flex: 1; font-size: 13px; }

/* Login */
.auth { display: grid; place-items: center; min-height: 100vh; padding: 16px; background: var(--bg); }
.auth__card { width: 100%; max-width: 400px; padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.auth__brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.auth__brand div { display: flex; flex-direction: column; line-height: 1.25; }
.auth__brand small { color: var(--muted); font-size: 12px; }
.auth__title { font: var(--display-weight) 24px var(--font-display); margin-bottom: 4px; }
.auth__foot { margin: 24px 0 0; font-size: 11.5px; color: var(--muted-2); text-align: center; }

/* Paginación (vista por defecto de Laravel) */
.pagination { display: flex; gap: 4px; list-style: none; padding: 16px 0 0; margin: 0; }
.pagination li > * { display: grid; place-items: center; min-width: 32px; height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }
.pagination .active > * { background: var(--surface-3); border-color: var(--border-strong); }

/* ───────────── Buscador rápido (modal) ───────────── */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); }
.modal__box { position: relative; width: 100%; max-width: 600px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .6); overflow: hidden; }
.pal__input { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 52px; border-bottom: 1px solid var(--border); color: var(--muted); }
.pal__input input { flex: 1; height: 100%; border: 0; background: transparent; outline: none; font-size: 15px; color: var(--text); }
.pal__list { list-style: none; margin: 0; padding: 6px; max-height: 360px; overflow-y: auto; }
.pal__list li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 4px; cursor: pointer; }
.pal__list li small { margin-left: auto; color: var(--muted-2); font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; }
.pal__list li span em { display: block; font-style: normal; color: var(--muted); font-size: 12px; }
.pal__list li[aria-selected="true"] { background: var(--accent-soft); }
.pal__list .pal__empty { color: var(--muted); cursor: default; justify-content: center; }
.pal__foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--border); color: var(--muted-2); font-size: 12px; }
.pal__foot span { display: inline-flex; align-items: center; gap: 4px; }

/* ───────────── Galería de temas ───────────── */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.theme { position: relative; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface-2); cursor: pointer; overflow: hidden; transition: border-color .15s; }
.theme:hover { border-color: var(--border-strong); }
.theme input { position: absolute; opacity: 0; pointer-events: none; }
.theme:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.theme:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.theme__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 12px 14px 14px; border-top: 1px solid var(--border); }
.theme__meta b { font-size: 13.5px; }
.theme__meta small { flex-basis: 100%; color: var(--muted); font-size: 12px; line-height: 1.45; }
.theme__check { position: absolute; top: 8px; right: 8px; display: none; width: 22px; height: 22px; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); }
.theme__check .ic { width: 13px; height: 13px; }
.theme:has(input:checked) .theme__check { display: grid; }
.theme--follow .tp { filter: saturate(.85); }
.brandkit__grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.brandkit[hidden] { display: none; }

/* Miniatura real del tema: mismos tokens, escala reducida */
.tp {
    display: grid; grid-template-columns: 34% 1fr; height: 168px; overflow: hidden;
    background: var(--bg); color: var(--text); font-family: var(--font); font-size: 8.5px; line-height: 1.3;
    pointer-events: none; user-select: none;
}
.tp__sb { display: flex; flex-direction: column; gap: 2px; padding: 8px 6px; background: var(--sb-bg); color: var(--sb-text); border-right: 1px solid var(--sb-border); min-width: 0; }
.tp__brand { display: flex; align-items: center; gap: 5px; padding: 0 3px 7px; margin-bottom: 4px; border-bottom: 1px solid var(--sb-border); font-weight: 600; white-space: nowrap; overflow: hidden; font-family: var(--font-display); font-size: 9px; }
.tp__logo { width: 14px; height: 14px; flex: none; display: grid; place-items: center; border-radius: 3px; background: var(--accent); color: var(--accent-ink); font-size: 8px; font-weight: 700; }
.tp__navtitle { padding: 2px 4px; font-size: 6.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--sb-muted); }
.tp__link { position: relative; display: flex; align-items: center; gap: 5px; height: 17px; padding: 0 5px; border-radius: 3px; white-space: nowrap; }
.tp__link.is-active { background: var(--sb-active-bg); color: var(--sb-active-text); font-weight: 600; }
.tp__link.is-active::before { content: ""; position: absolute; left: -6px; top: 4px; bottom: 4px; width: 1.5px; background: var(--sb-active-bar); }
.tp__ic { width: 9px; height: 9px; flex: none; }
.tp__main { display: flex; flex-direction: column; min-width: 0; }
.tp__tb { display: flex; align-items: center; justify-content: space-between; gap: 6px; height: 26px; padding: 0 8px; background: var(--tb-bg); border-bottom: 1px solid var(--border); }
.tp__h { font: var(--display-weight) 9.5px var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="sapphire_gold"] .tp__h { font-size: 11px; }
.tp__search { display: inline-flex; align-items: center; gap: 3px; height: 14px; padding: 0 5px; border: 1px solid var(--border); border-radius: 3px; background: var(--surface); color: var(--muted); font-size: 7px; }
.tp__body { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 8px; align-content: start; }
.tp__kpi { display: flex; flex-direction: column; gap: 1px; padding: 6px 7px; background: var(--surface); border: 1px solid var(--border); border-radius: 4px; box-shadow: var(--shadow); min-width: 0; }
.tp__kl { font-size: 6px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.tp__kv { font: var(--display-weight) 13px/1.1 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-theme="sapphire_gold"] .tp__kv { font-size: 15px; }
.tp__kd { font-size: 6.5px; color: var(--good); }
.tp__kpi:nth-child(2) .tp__kd { color: var(--muted); font-family: ui-monospace, Consolas, monospace; }
.tp__btn { grid-column: 1 / -1; justify-self: start; display: inline-flex; align-items: center; height: 18px; padding: 0 9px; border-radius: 3px; background: var(--btn-bg); color: var(--btn-text); border: 1px solid var(--btn-border); font-weight: 600; font-size: 7.5px; }

/* ───────────── Responsivo ───────────── */
@media (max-width: 1100px) {
    .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .plans { grid-template-columns: 1fr; }
    .tb__search { width: auto; }
    .tb__search span, .tb__search kbd { display: none; }
    .brandkit__grid { grid-template-columns: 1fr 1fr; }
    .grid-2 { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    html:not([data-dock="bottom"]) .app { grid-template-columns: minmax(0, 1fr) !important; }
    html:not([data-dock="bottom"]) .sb { position: fixed; left: 0; top: 0; bottom: 0; width: var(--sbw); transform: translateX(-100%); transition: transform .2s ease; }
    html[data-dock="right"] .sb { left: auto; right: 0; transform: translateX(100%); }
    html.drawer-open .sb { transform: none !important; }
    html.drawer-open .sb-backdrop { display: block; }
    html:not([data-dock="bottom"]) .tb__menu { display: grid; }
    html:not([data-dock="bottom"])[data-collapsed="1"] .sb__label,
    html:not([data-dock="bottom"])[data-collapsed="1"] .sb__brandtxt,
    html:not([data-dock="bottom"])[data-collapsed="1"] .sb__title { display: revert; }
    .sb__collapse { display: none; }
    .tb { padding: 0 14px; }
    .tb__who { display: none; }
    .content { padding: 16px; }
    .grid-2, .brandkit__grid { grid-template-columns: 1fr; }
    .foot { flex-direction: column; }
}
@media (max-width: 520px) { .kpis { grid-template-columns: 1fr; } }
.sb-backdrop { display: none; position: fixed; inset: 0; z-index: 25; background: rgba(0, 0, 0, .45); }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.theme[hidden] { display: none; }

/* ───────────── Fase 2 · Mantenimiento ───────────── */
.btn--sm { height: 30px; padding: 0 10px; font-size: 12.5px; gap: 6px; }
.btn--danger { background: color-mix(in srgb, var(--bad) 14%, var(--surface)); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn--danger:hover { border-color: var(--bad); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.badge--warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.inline { display: inline; margin: 0; }
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.row-actions form { margin: 0; }
.tbl-wrap--flat { margin: 0; border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tbl td .btn + .inline, .tbl td .btn + .btn { margin-left: 4px; }
.sep { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }
.danger { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding: 14px; border: 1px solid color-mix(in srgb, var(--bad) 35%, transparent); border-radius: var(--radius-sm); }
.danger p { margin: 4px 0 0; font-size: 13px; }
.field input[type="file"] { padding: 8px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.confirm { padding: 20px; max-width: 460px; }
.confirm h2 { display: flex; align-items: center; gap: 8px; font: var(--display-weight) 17px var(--font-display); margin-bottom: 8px; }
.confirm h2 .ic { color: var(--bad); }
.confirm .field input { height: 40px; padding: 0 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); font-family: ui-monospace, Consolas, monospace; letter-spacing: .08em; }

/* ───────────── Fase 3 · Seguridad ───────────── */
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs__tab { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: 13.5px; }
.tabs__tab:hover { color: var(--text); }
.tabs__tab.is-active { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }
.narrow { max-width: 560px; }
.small { font-size: 12px; }
.otp-input { font-family: ui-monospace, Consolas, monospace !important; font-size: 20px !important; letter-spacing: .35em; text-align: center; font-variant-numeric: tabular-nums; }
.tfa { display: grid; grid-template-columns: 220px 1fr; gap: 24px; align-items: start; }
.tfa__qr { width: 220px; height: 220px; padding: 10px; background: #ffffff; border: 1px solid var(--border); border-radius: var(--radius); }
.tfa__qr svg { display: block; width: 100%; height: 100%; }
.steps { margin: 0 0 10px; padding-left: 18px; color: var(--muted); font-size: 13.5px; }
.steps li { margin-bottom: 6px; }
.secret { display: block; margin-bottom: 16px; padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-size: 15px; letter-spacing: .12em; word-break: break-all; }
.codes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0 0 12px; max-width: 420px; }
.codes li { padding: 8px 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); text-align: center; letter-spacing: .08em; }
.field select, .field input[type="date"], .field input[type="search"] { height: 40px; padding: 0 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); }
.field--otp { max-width: 220px; }
.field--otp input { height: 40px; padding: 0 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; margin-bottom: 16px; }
.filters .field { min-width: 150px; }
.filters__btns { display: flex; gap: 8px; }
.tbl--audit td { vertical-align: top; }
.diff { white-space: normal !important; min-width: 260px; font-size: 12.5px; }
.diff del { color: var(--bad); text-decoration: line-through; }
.diff ins { color: var(--good); text-decoration: none; }
.alert--dev { border-style: dashed; }
.search-inline { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); min-width: 260px; }
.search-inline input { flex: 1; border: 0; background: transparent; outline: none; color: var(--text); }
.form--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form__full, .form--grid .kv { grid-column: 1 / -1; }
@media (max-width: 860px) { .tfa, .form--grid { grid-template-columns: 1fr; } .tfa__qr { margin: 0 auto; } }

/* ───────────── Fase 4 · Líneas y WhatsApp ───────────── */
.status-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.inline-form { display: inline-flex; align-items: center; gap: 8px; margin: 0; }
.inline-form input[type="tel"], .inline-form input[type="text"] { height: 32px; padding: 0 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); width: 170px; }
.otp-input--sm { width: 120px !important; font-size: 15px !important; letter-spacing: .25em; }
.lines { display: grid; gap: 12px; margin-bottom: 16px; }
.line.is-verified { border-left: 2px solid var(--good); }
.line__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; align-items: center; }
.line__num { display: flex; align-items: center; gap: 10px; }
.line__num .ic { color: var(--accent); }
.line__num b { font-size: 16px; letter-spacing: .02em; }
.line__badges { display: flex; flex-wrap: wrap; gap: 6px; }
.badge--accent { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.line__meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 16px; margin: 14px 0 8px; }
.line__meta dt { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.line__meta dd { margin: 2px 0 0; font-size: 13px; }
.line__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.line__actions .spacer { flex: 1; }
.line__edit { margin-top: 12px; border-top: 1px solid var(--border); padding-top: 10px; }
.line__edit summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: var(--muted); font-size: 13px; list-style: none; }
.line__edit[open] summary .ic { transform: rotate(90deg); }
.line__edit form { margin-top: 12px; }
.checks { display: flex; flex-wrap: wrap; gap: 16px; }
.field input[type="time"], .field input[type="number"], .field input[type="tel"] { height: 40px; padding: 0 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); }
.link { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
@media (max-width: 860px) { .line__meta { grid-template-columns: 1fr 1fr; } }

/* ───────────── Fase 5 · Flota ───────────── */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chip { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12.5px; }
.chip b { color: var(--text); }
.chip.is-active { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.tbl--dense td { padding: 9px 14px; }
.tbl--dense th { padding: 9px 14px; }
.nowrap { white-space: nowrap; }
.link-plain:hover { color: var(--accent); }
.rank { font-family: ui-monospace, Consolas, monospace; letter-spacing: .02em; }
.rank--1 { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: var(--accent-soft); }
.rank--2 { color: var(--text); }
.rank--3 { color: var(--muted); border-style: dashed; }
.status-select { height: 28px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font-size: 12px; }
.status-select.badge--ok { border-color: color-mix(in srgb, var(--good) 50%, transparent); color: var(--good); }
.status-select.badge--bad { border-color: color-mix(in srgb, var(--bad) 50%, transparent); color: var(--bad); }
.status-select.badge--warn { border-color: color-mix(in srgb, var(--warn) 50%, transparent); color: var(--warn); }
.status-select.badge--accent { border-color: var(--accent); color: var(--accent); }
.feats { white-space: normal !important; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; margin: 2px 4px 2px 0; border-radius: 999px; border: 1px solid var(--border); font-size: 11.5px; color: var(--muted); background: var(--surface-2); }
.semaforo--vigente::before, .semaforo--por_vencer::before, .semaforo--critico::before, .semaforo--vencido::before, .semaforo--sin_dato::before { content: ""; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; background: currentColor; }
.rank-pick { display: grid; gap: 8px; }
.rank-opt { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); cursor: pointer; }
.rank-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.rank-opt span { display: flex; flex-direction: column; }
.rank-opt small { color: var(--muted); font-size: 12px; }
.checks--col { flex-direction: column; gap: 10px; margin: 8px 0 4px; }
.confirm .field select, .confirm .field input[type="number"] { height: 40px; padding: 0 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); }
.confirm { display: flex; flex-direction: column; gap: 12px; }
.sub-card { padding: 14px; border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); }
.docs { display: grid; gap: 10px; }
.doc { padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); margin: 0; }
.doc__head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.doc__fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.doc__fields input[type="text"], .doc__fields input[type="date"] { height: 32px; padding: 0 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); }
.doc__fields input[type="text"] { width: 120px; }
.doc__fields input[type="file"] { font-size: 12px; max-width: 200px; }
.perm-grid { display: grid; gap: 6px; }
.perm-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); font-size: 13px; }
.perm-row select { height: 32px; padding: 0 8px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); }
.portal { display: flex; flex-direction: column; gap: 16px; }
.portal__status { display: flex; flex-direction: column; gap: 4px; }
.portal__big { font: var(--display-weight) 30px/1.1 var(--font-display); }
.portal__switch { display: flex; flex-direction: column; gap: 14px; }
.portal__btns { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.btn--xl { height: 64px; font-size: 16px; }
.seg--big .seg__btn { height: 40px; padding: 0 18px; font-size: 14px; }
@media (max-width: 600px) { .portal__btns { grid-template-columns: 1fr; } }

/* ───────────── Fase 6 · Tarifas ───────────── */
.split { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.cell-input { height: 32px; padding: 0 8px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); max-width: 120px; }
.tbl--edit td.r .cell-input { text-align: right; }
.add-rate { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.gia-preview { position: sticky; top: calc(var(--tbh) + 16px); }
.wa-bubble { margin: 0; padding: 14px 16px; white-space: pre-wrap; font: 13px/1.55 var(--font); color: var(--text); background: var(--surface-2); border: 1px solid var(--border); border-radius: 4px var(--radius) var(--radius) var(--radius); max-height: 560px; overflow: auto; }
.field textarea { padding: 10px 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); resize: vertical; font: inherit; }
.field input[type="datetime-local"] { height: 40px; padding: 0 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); }
.quote__total { font: var(--display-weight) 36px/1.1 var(--font-display); margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.quote__lines { list-style: none; margin: 6px 0 16px; padding: 0; }
.quote__lines li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.quote__lines--muted li { color: var(--muted); font-size: 12.5px; }
@media (max-width: 1100px) { .split { grid-template-columns: 1fr; } .gia-preview { position: static; } }

/* ───────────── Fase 7 · Bordes suaves y diseño ejecutivo ───────────── */
:root { --radius-card: 16px; --radius-modal: 18px; --radius-input: 10px; --radius-pill: 9999px; --ease: 180ms ease;
    --shadow-soft: 0 1px 2px rgba(0, 0, 0, .06), 0 8px 24px -12px rgba(0, 0, 0, .28), 0 24px 48px -32px rgba(0, 0, 0, .35); }
[data-mode="light"] { --shadow-soft: 0 1px 2px rgba(40, 30, 20, .05), 0 8px 22px -14px rgba(40, 30, 20, .22), 0 22px 44px -30px rgba(40, 30, 20, .25); }
.card, .kpi, .theme, .auth__card, .tfa__qr, .doc, .line, .sub-card { border-radius: var(--radius-card); }
.card, .kpi { box-shadow: var(--shadow-soft); border-color: color-mix(in srgb, var(--border) 85%, transparent); transition: box-shadow var(--ease), border-color var(--ease), transform var(--ease); }
.card { padding: 22px; }
.modal__box { border-radius: var(--radius-modal); }
.btn, .icon-btn, .tb__search, .seg, .search-inline, .field input, .field select, .field textarea, .cell-input, .status-select, .inline-form input,
.doc__fields input, .alert, .secret, .codes li, .perm-row, .rank-opt, .wa-bubble, .tbl-wrap--flat, .tb__user, .menu__pop, .color input { border-radius: var(--radius-input) !important; }
.seg__btn, .menu__pop a, .menu__pop button, .sb__link { border-radius: calc(var(--radius-input) - 2px); }
.badge, .pill, .chip, .avatar, .status-select { border-radius: var(--radius-pill) !important; }
.btn, .seg__btn, .chip, .pill, .sb__link, .tabs__tab, .theme, .icon-btn { transition: background-color var(--ease), border-color var(--ease), color var(--ease), box-shadow var(--ease), transform var(--ease); }
.btn:active { transform: translateY(1px); }
.tbl td { padding-top: 13px; padding-bottom: 13px; }
.tbl-wrap { border-radius: 0 0 var(--radius-card) var(--radius-card); }
.field { gap: 8px; }
.form { gap: 16px; }
.kpis, .grid-2, .plans { gap: 18px; }
.content > * + * { margin-top: 18px; }
.content > .tabs + * { margin-top: 0; }

/* Fase 7 · Clientes, drawer y fondo */
.search-inline--wide { min-width: 340px; flex: 1; max-width: 520px; }
.tbl--click tbody tr { cursor: pointer; }
.tbl--click tbody tr:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.drawer { position: fixed; inset: 0; z-index: 55; }
.drawer[hidden] { display: none; }
.drawer__backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .45); animation: fadeIn var(--ease); }
.drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(560px, 100%); display: flex; flex-direction: column; background: var(--surface);
    border-left: 1px solid var(--border); box-shadow: -24px 0 60px -30px rgba(0, 0, 0, .6); border-radius: var(--radius-modal) 0 0 var(--radius-modal); animation: slideIn 220ms cubic-bezier(.22, 1, .36, 1); }
.drawer__head { display: flex; justify-content: space-between; gap: 12px; padding: 18px 20px; border-bottom: 1px solid var(--border); }
.drawer__head h2 { font: var(--display-weight) 18px var(--font-display); }
.drawer__body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.drawer__foot { display: flex; align-items: center; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); }
.drawer__foot .muted { flex: 1; }
@keyframes slideIn { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.mini-list { display: grid; gap: 8px; margin-bottom: 8px; }
.mini-row { display: grid; grid-template-columns: 1.2fr 1fr auto auto; gap: 8px; align-items: center; }
.mini-row--addr { grid-template-columns: 110px 1.4fr 1fr 90px auto; }
.mini-row input, .mini-row select { height: 34px; padding: 0 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-input); color: var(--text); min-width: 0; }
.icon-btn--sm { width: 30px; height: 30px; font-size: 16px; }
.pills-bar { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.pill--btn { cursor: pointer; background: var(--surface-2); }
.pill--btn:hover { border-color: var(--accent); color: var(--text); }
.trip-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.stars { display: inline-flex; gap: 1px; }
.star { border: 0; background: none; color: var(--muted-2); cursor: pointer; font-size: 15px; padding: 0 1px; line-height: 1; }
.star.is-on { color: var(--accent); }
.kpis--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.goal { padding: 12px 0; border-bottom: 1px solid var(--border); }
.goal:last-of-type { border-bottom: 0; }
.goal__head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.meter--lg { height: 8px; border-radius: var(--radius-pill); }
.meter--lg span { border-radius: var(--radius-pill); transition: width 600ms cubic-bezier(.22, 1, .36, 1); }
.neg { color: var(--bad); }
.pos { color: var(--good); }
tr.is-voided td { opacity: .55; text-decoration: line-through; }
tr.is-voided td:last-child, tr.is-voided td:nth-child(6) { text-decoration: none; }
@media (max-width: 860px) { .kpis--3 { grid-template-columns: 1fr; } .mini-row, .mini-row--addr { grid-template-columns: 1fr 1fr; } .search-inline--wide { min-width: 0; } }
.field input:not([type]), .field input[type="url"] { height: 40px; padding: 0 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-input); color: var(--text); }
html.drawer-panel-open { overflow: hidden; }
.main { overflow-x: clip; }

/* ───────────── Fase 8 · Caja y facturación ───────────── */
.print-bar { flex-wrap: wrap; }
.print-bar span { flex: 1; }
.items { display: grid; gap: 8px; margin-bottom: 8px; }
.items__row { display: grid; grid-template-columns: 1fr 90px 120px; gap: 8px; }
.items__row input, .inline-form select { height: 38px; padding: 0 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-input); color: var(--text); }
.contract-row { padding: 10px 0; border-bottom: 1px solid var(--border); }
.sign-pad { width: 100%; height: 200px; background: #ffffff; border: 1px dashed var(--border-strong); border-radius: var(--radius-input); touch-action: none; cursor: crosshair; }
#tplBody { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; line-height: 1.55; }

/* ───────────── Fase 9 · Despacho en vivo ───────────── */
.live { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 18px; align-items: start; }
.live__form { position: sticky; top: calc(var(--tbh) + 16px); }
.live__btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.live__stats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); animation: pulse 1.8s infinite; display: inline-block; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 55%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.ride-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.ride { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-soft); }
.ride--88 { border-color: color-mix(in srgb, var(--bad) 45%, var(--border)); }
.ride--completed, .ride--cancelled { opacity: .6; }
.ride--pre_assigned_group { border-color: var(--accent); }
.ride__head { display: flex; align-items: center; gap: 8px; }
.ride__head .badge { margin-left: auto; }
.prio { display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 6px; border-radius: var(--radius-pill); font: 700 12px/1 ui-monospace, Consolas, monospace; background: var(--surface-3); }
.prio--88 { background: var(--bad); color: #fff; }
.prio--66 { background: var(--accent); color: var(--accent-ink); }
.ride__pub { font-weight: 500; font-size: 13.5px; }
.ride__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.ride__meta b { color: var(--text); }
.ride__timers { display: flex; flex-wrap: wrap; gap: 8px; }
.timer { display: inline-flex; gap: 6px; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--radius-pill); background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; }
.timer--hot { border-color: var(--warn); color: var(--warn); }
.ride__alert { padding: 6px 10px; border-radius: var(--radius-input); background: color-mix(in srgb, var(--bad) 12%, transparent); color: var(--bad); font-size: 12.5px; }
.ride__notes { padding: 6px 10px; border-radius: var(--radius-input); background: var(--surface-2); font-size: 12.5px; white-space: pre-line; }
.ride__btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.cust-card { padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-input); background: var(--surface-2); display: grid; gap: 6px; font-size: 13px; }
.fare-line { display: flex; align-items: center; gap: 10px; }
.fare-line b { font: var(--display-weight) 22px var(--font-display); }
.fare-line .cell-input { margin-left: auto; width: 100px; }
.more summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-bottom: 8px; }
.bl-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border); margin: 0; }
.bl-row .muted { flex: 1; }
@media (max-width: 1100px) { .live { grid-template-columns: 1fr; } .live__form { position: static; } }
.cust-card[hidden] { display: none; }

/* ───────────── Fase 10 · Agenda y objetos ───────────── */
.spacer { flex: 1; }
.timeline { display: grid; gap: 0; }
.tl-item { display: grid; grid-template-columns: 64px 1fr; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); position: relative; }
.tl-time { font: var(--display-weight) 18px var(--font-display); color: var(--accent); }
.tl-body { display: grid; gap: 6px; }
.tl-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tl-item--cancelled { opacity: .5; }
.tl-item--rescued_88 .tl-time { color: var(--bad); }
.semaforo-row { display: flex; gap: 6px; }
.sem { display: inline-grid; place-items: center; min-width: 42px; height: 22px; padding: 0 8px; border-radius: var(--radius-pill); font: 600 11px ui-monospace, Consolas, monospace; border: 1px solid var(--border); color: var(--muted); }
.sem--ok { background: color-mix(in srgb, var(--good) 18%, transparent); color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.sem--due { background: color-mix(in srgb, var(--warn) 18%, transparent); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.sem--bad { background: color-mix(in srgb, var(--bad) 18%, transparent); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }

/* ───────────── Fase 11 · Bots y bandeja ───────────── */
.bot-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.bot-card { display: flex; flex-direction: column; gap: 10px; transition: transform var(--ease), box-shadow var(--ease); }
.bot-card:hover { transform: translateY(-2px); }
.bot-card__head { display: flex; align-items: center; gap: 10px; }
.bot-card__head .chip { margin-left: auto; }
.bot-avatar { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--border); }
.bot-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin: 0; }
.bot-metrics dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.bot-metrics dd { margin: 2px 0 0; font: var(--display-weight) 18px var(--font-display); }
.tone-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.small-h { font-size: 13px; margin: 16px 0 6px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.sim { display: grid; gap: 10px; }
.sim__log, .chat-log { display: flex; flex-direction: column; gap: 8px; min-height: 260px; max-height: 480px; overflow-y: auto; padding: 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-input); }
.sim__form { display: grid; grid-template-columns: 180px 1fr auto; gap: 8px; margin-top: 10px; }
.sim__form input { height: 40px; padding: 0 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-input); color: var(--text); }
.bubble { max-width: 80%; padding: 8px 12px; border-radius: 14px; font-size: 13.5px; white-space: pre-wrap; line-height: 1.45; }
.bubble--in { align-self: flex-start; background: var(--surface); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.bubble--out { align-self: flex-end; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-bottom-right-radius: 4px; }
.bubble--meta { align-self: center; font-size: 11px; color: var(--muted-2); max-width: 100%; }
.bubble--err { align-self: center; color: var(--bad); }
.bubble__time { display: block; font-size: 10.5px; color: var(--muted-2); margin-top: 2px; text-align: right; }
.inbox { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 16px; align-items: start; }
.inbox__list { padding: 8px; max-height: 720px; overflow-y: auto; }
.inbox__item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: var(--radius-input); }
.inbox__item:hover, .inbox__item.is-active { background: var(--surface-2); }
.inbox__who { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.inbox__who b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 13px; }
.unread { min-width: 20px; height: 20px; display: grid; place-items: center; border-radius: var(--radius-pill); background: var(--accent); color: var(--accent-ink); font-size: 11px; }
.autopilot select { height: 34px; padding: 0 10px; border-radius: var(--radius-pill); border: 1px solid var(--border); background: var(--surface); color: var(--text); font-size: 12.5px; }
.autopilot.is-on select { border-color: var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); }
@media (max-width: 1100px) { .bot-grid { grid-template-columns: 1fr 1fr; } .inbox { grid-template-columns: 1fr; } }
@media (max-width: 860px) { .autopilot { display: none; } .sim__form { grid-template-columns: 1fr; } }

/* ───────────── Fase 12 · Comandos y Código Rojo ───────────── */
.red-banner { position: sticky; top: calc(var(--tbh) + 8px); z-index: 18; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 16px; margin-bottom: 16px;
    border-radius: var(--radius-card); background: color-mix(in srgb, var(--bad) 88%, #000); color: #fff; box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--bad) 70%, transparent); animation: redPulse 1.2s ease-in-out infinite; }
.red-banner span { flex: 1; }
.red-banner .btn { background: rgba(255,255,255,.14); color: #fff; border-color: rgba(255,255,255,.35); }
@keyframes redPulse { 0%, 100% { opacity: 1; } 50% { opacity: .82; } }
.incident-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.incident { display: grid; gap: 8px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.incident--activo { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad); }
.incident--resuelto { opacity: .65; }
.contact-row { display: grid; grid-template-columns: 1.3fr 1fr 1fr auto auto; gap: 6px; align-items: center; margin: 0; }
.contact-row input, .contact-row select { height: 34px; padding: 0 10px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-input); color: var(--text); min-width: 0; }
.sos-form { margin-bottom: 16px; }
@media (max-width: 860px) { .contact-row { grid-template-columns: 1fr 1fr; } }

/* ═══ Fase 13 · Tesorería, sorteos y app del conductor ═══ */
.is-voided { opacity: .55; }
.tombola { max-width: 520px; text-align: center; }
.tombola__screen { margin: 18px 0; padding: 26px 12px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); font: 700 34px/1.1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .08em; color: var(--accent); }
.tombola__screen small { display: block; margin-top: 10px; font: 600 16px/1.3 var(--font-display); letter-spacing: 0; color: var(--text); }
.print-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.btn--lg { height: 52px; font-size: 15px; padding: 0 18px; }
.btn--danger-ghost { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); }
.btn--danger-ghost:hover { background: color-mix(in srgb, var(--bad) 10%, transparent); }

.drv { display: flex; flex-direction: column; gap: 14px; max-width: 760px; margin: 0 auto; }
.drv__bar { display: flex; align-items: center; gap: 8px; }
.drv__gps { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; }
.drv__gps.is-ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.drv__gps.is-bad { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.drv__tabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; padding: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; position: sticky; top: 0; z-index: 5; }
.drv__tab { position: relative; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 8px 4px; border-radius: 10px; color: var(--muted); font-size: 12px; text-decoration: none; }
.drv__tab.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.drv__dot { position: absolute; top: 4px; right: 14%; min-width: 18px; height: 18px; display: grid; place-items: center; border-radius: 9px; background: var(--bad); color: #fff; font-size: 11px; }

.drv-ride { display: flex; flex-direction: column; gap: 14px; border-width: 2px; border-color: var(--accent); }
.drv-ride--in_progress { border-color: var(--good); }
.drv-ride__head { display: flex; align-items: center; gap: 8px; }
.drv-ride__pin { display: flex; flex-direction: column; align-items: center; padding: 12px; border-radius: 12px; background: var(--bg-2); border: 1px dashed var(--border); }
.drv-ride__pin b { font-size: 46px; line-height: 1.05; letter-spacing: .25em; color: var(--accent); padding-left: .25em; }
.drv-ride__dl { margin: 0; }
.drv-ride__vip { display: flex; gap: 10px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--warn) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--warn) 40%, transparent); }
.drv-ride__vip .ic { color: var(--warn); flex: none; margin-top: 2px; }
.drv-ride__money { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.drv-ride__money > div, .drv-today > div { display: flex; flex-direction: column; gap: 2px; padding: 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border); min-width: 0; }
.drv-ride__money b { font-size: 18px; }
.drv-ride__nav { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.drv-ride__nav .btn { justify-content: center; }
.drv-pin { display: grid; grid-template-columns: 120px 1fr; gap: 8px; margin: 0; }
.drv-pin input { height: 64px; font-size: 28px; text-align: center; letter-spacing: .2em; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--border); color: var(--text); }
.drv-ride__cont summary { cursor: pointer; color: var(--muted); display: flex; align-items: center; gap: 6px; padding: 6px 0; }
.drv-ride__delay { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 8px 0 12px; }
.drv-stars { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; margin: 8px 0 12px; }
.drv-stars input { position: absolute; opacity: 0; pointer-events: none; }
.drv-stars label { cursor: pointer; color: var(--border); }
.drv-stars label .ic { width: 34px; height: 34px; }
.drv-stars input:checked ~ label, .drv-stars label:hover, .drv-stars label:hover ~ label { color: var(--warn); }
.drv-stars input:focus-visible + label { outline: 2px solid var(--accent); border-radius: 4px; }

.drv-status { display: flex; flex-direction: column; gap: 14px; }
.drv-status__now { display: flex; flex-direction: column; gap: 4px; }
.drv-status__form { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.drv-zones { flex-wrap: wrap; }
.drv-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.drv-switch__btn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 112px; border-radius: 18px; border: 2px solid var(--border); background: var(--surface-2); color: var(--text); font: 700 16px/1.1 var(--font-display); cursor: pointer; transition: transform .08s, border-color .15s; }
.drv-switch__btn .ic { width: 30px; height: 30px; }
.drv-switch__btn:active { transform: scale(.97); }
.drv-switch__btn--on.is-on, .drv-switch__btn--on:hover { border-color: var(--good); color: var(--good); background: color-mix(in srgb, var(--good) 12%, var(--surface)); }
.drv-switch__btn--busy.is-on, .drv-switch__btn--busy:hover { border-color: var(--warn); color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.drv-switch__btn--off.is-on, .drv-switch__btn--off:hover { border-color: var(--muted); color: var(--muted); }
.drv-today { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.drv-today b { font-size: 16px; }

.drv-wallet { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.drv-wallet__amt { font: 700 40px/1.1 var(--font-display); }
.drv-wallet.is-blocked .drv-wallet__amt { color: var(--bad); }
.drv-payacc { display: flex; align-items: center; gap: 12px; padding: 10px; margin-bottom: 10px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--border); }
.drv-payacc img { border-radius: 8px; background: #fff; flex: none; }
.drv-tickets { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.drv-ticket { display: flex; flex-direction: column; gap: 4px; padding: 12px; border-radius: 10px; border: 1px dashed var(--accent); background: var(--accent-soft); }
.drv-ticket .mono { font-size: 17px; font-weight: 700; color: var(--accent); }
.drv-lost .btn { min-width: 120px; }
.drv-toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 1000; max-width: min(92vw, 460px); padding: 14px 18px; border-radius: 12px; background: var(--surface); color: var(--text); border: 1px solid var(--border); box-shadow: 0 10px 30px rgb(0 0 0 / .35); font-weight: 500; }
.drv-toast.is-ok { border-color: var(--good); }
.drv-toast.is-bad { border-color: var(--bad); }

/* Modo noche: negro puro, texto ámbar suave, sin destellos (visión nocturna al volante) */
html[data-night] { --bg: #000; --bg-2: #050505; --surface: #0a0a0a; --surface-2: #101010; --border: #2a2116; --text: #f3d9a4; --muted: #a8926a; --accent: #f5b301; --accent-soft: rgb(245 179 1 / .12); --accent-ink: #000; color-scheme: dark; }
html[data-night] body { background: #000; }
html[data-night] img { filter: brightness(.85); }

@media (max-width: 600px) {
    .drv-switch { grid-template-columns: 1fr; }
    .drv-switch__btn { min-height: 76px; flex-direction: row; font-size: 18px; }
    .drv-today { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .drv-ride__money b { font-size: 15px; }
    .drv__tab span { font-size: 11px; }
}
.drv, .drv .grid-2 > *, .drv .card { min-width: 0; }
.drv input[type="file"] { width: 100%; max-width: 100%; }
@media (max-width: 600px) { .drv .grid-2 { grid-template-columns: minmax(0, 1fr); } .drv .form--grid { grid-template-columns: minmax(0, 1fr); } }

/* ═══════════════════════════════════════════════════════════════════════════
   Fase 14 · Rediseño fluido y orgánico («cero diseño tieso»)
   Solo usa tokens de tema: los 4 temas (obsidian_brand, sapphire_gold, nude_rosegold, pearl_noir) siguen intactos.
   ═══════════════════════════════════════════════════════════════════════════ */
:root {
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --radius-card: 18px;
    --radius-ctl: 12px;
    --radius-pill: 9999px;
    --shadow-card: var(--shadow), 0 1px 2px rgb(0 0 0 / .06);
    --shadow-float: 0 2px 6px -2px rgb(0 0 0 / .18), 0 22px 48px -22px rgb(0 0 0 / .55);
    --glass: color-mix(in srgb, var(--surface) 72%, transparent);
    --gap-block: 20px;
}
[data-theme="nude_rosegold"], [data-theme="pearl_noir"] {
    --shadow-float: 0 2px 6px -2px rgb(60 40 30 / .12), 0 22px 44px -24px rgb(60 40 30 / .35);
}

/* Radios orgánicos */
.card, .kpi, .modal__box, .auth__card, .theme, .bell__pop, .ntf { border-radius: var(--radius-card); }
.btn, .icon-btn, .field input, .field select, .field textarea, .seg, .tb__search, .tb__user, .alert, .tbl-wrap--flat, .tbl-wrap { border-radius: var(--radius-ctl); }
.seg__btn { border-radius: calc(var(--radius-ctl) - 3px); }
.badge, .chip, .avatar, .drv__gps, .zone-sel, .bell__count, kbd { border-radius: var(--radius-pill); }

/* Profundidad y capas */
.card, .kpi { box-shadow: var(--shadow-card); }
.tb { background: var(--glass); -webkit-backdrop-filter: saturate(150%) blur(14px); backdrop-filter: saturate(150%) blur(14px); }
@media (max-width: 1024px) {
    html:not([data-dock="bottom"]) .sb { -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow-float); }
}
.sb-backdrop, .modal__backdrop { -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.modal__box { box-shadow: var(--shadow-float); animation: pop-in .32s var(--ease); }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }
.content > * + * { margin-top: var(--gap-block); }
.content > .alert + *, .content > .red-banner + * { margin-top: 0; }
.kpis { gap: 14px; }
.kpis + .kpis { margin-top: 14px; }

/* Micro-interacciones */
.btn, .icon-btn, .chip, .kpi, .seg__btn, .theme, .drv-switch__btn, .tbl--cards tr, .card--lift { transition: transform .28s var(--ease), box-shadow .28s var(--ease), background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease); }
.kpi:hover, .card--lift:hover, .theme:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); }
.btn:hover:not(:disabled), .chip:hover { transform: translateY(-1px); }
.btn:active:not(:disabled) { transform: translateY(0) scale(.98); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Indicador en vivo */
.live-dot { position: relative; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); flex: none; vertical-align: middle; margin-left: 6px; }
.live-dot::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--good); animation: live-pulse 2s var(--ease) infinite; }
@keyframes live-pulse { 0% { transform: scale(1); opacity: .6; } 80%, 100% { transform: scale(2.8); opacity: 0; } }

/* Barras de progreso animadas */
.meter span { width: 0; transition: width 1.1s var(--ease); }
html.is-ready .meter span[style*="--w"] { width: var(--w); }
.meter span:not([style*="--w"]) { width: auto; }
.meter span[data-w]:not([style*="--w"]) { width: 0; }
.meter--live { height: 6px; border-radius: var(--radius-pill); }
.meter--live span { border-radius: inherit; background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, var(--brand-2, var(--accent)))); position: relative; overflow: hidden; }
.meter--live span::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgb(255 255 255 / .28), transparent); transform: translateX(-100%); animation: shimmer 2.4s var(--ease) infinite; }
.meter.is-warn span { background: var(--warn); }
.meter.is-bad span { background: var(--bad); }
@keyframes shimmer { to { transform: translateX(100%); } }

/* KPI con Sparkline */
.kpis--fluid { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.kpi--spark { position: relative; overflow: hidden; }
.kpi--spark .kpi__value { position: relative; z-index: 1; }
.spark { display: block; width: 100%; height: 38px; margin-top: 8px; color: var(--accent); overflow: visible; }
.spark--down { color: var(--muted); }
.spark__line { fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linejoin: round; stroke-linecap: round; }
.spark__area { fill: currentColor; opacity: .12; }
.spark__dot { fill: currentColor; }
.kpi__head .live-dot { margin-left: auto; }

/* Avatares con anillo de estado */
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar--ring { position: relative; width: 36px; height: 36px; flex: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ring, var(--border)); border: 0; }
.avatar--ring .live-dot { position: absolute; right: -2px; bottom: -2px; margin: 0; box-shadow: 0 0 0 2px var(--surface); }
.avatar--disponible { --ring: var(--good); }
.avatar--en_carrera { --ring: var(--accent); }
.avatar--ocupado_temporal { --ring: var(--warn); }
.avatar--fuera_de_turno { --ring: var(--muted); }
.avatar--suspendido, .avatar--suspendido_documentos { --ring: var(--bad); }

/* Selector global de zona y barra de vista */
.zone-sel { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 6px 0 12px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); margin: 0; }
.zone-sel select { height: 30px; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 13px; cursor: pointer; padding-right: 4px; }
.zone-sel select:focus-visible { outline: 2px solid var(--accent); border-radius: 8px; }
.view-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 10px; }

/* Vista Tarjetas: la misma tabla se reacomoda en tarjetas (sin duplicar markup) */
.view-list[data-view-mode="cards"] { border: 0; background: transparent; overflow: visible; }
.view-list[data-view-mode="cards"] .tbl--cards, .view-list[data-view-mode="cards"] .tbl--cards tbody { display: block; }
.view-list[data-view-mode="cards"] .tbl--cards thead { display: none; }
.view-list[data-view-mode="cards"] .tbl--cards tbody { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.view-list[data-view-mode="cards"] .tbl--cards tr { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-card); box-shadow: var(--shadow-card); }
.view-list[data-view-mode="cards"] .tbl--cards tr:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); }
.view-list[data-view-mode="cards"] .tbl--cards td { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0; border: 0; text-align: left; }
.view-list[data-view-mode="cards"] .tbl--cards td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; flex: none; }
.view-list[data-view-mode="cards"] .tbl--cards td:first-child::before, .view-list[data-view-mode="cards"] .tbl--cards td:nth-child(2)::before { display: none; }
.view-list[data-view-mode="cards"] .tbl--cards td.r:last-child { justify-content: flex-end; margin-top: 4px; }
.view-list[data-view-mode="cards"] .tbl--cards .empty { justify-content: center; }
tr.is-off td { opacity: .6; }
tr.row--bad td:first-child { box-shadow: inset 3px 0 0 var(--bad); }
tr.row--warn td:first-child { box-shadow: inset 3px 0 0 var(--warn); }

/* Campana y Centro de Alertas */
.bell { position: relative; }
.bell__btn { position: relative; }
.bell.has-critical .bell__btn { border-color: var(--bad); color: var(--bad); }
.bell__count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; background: var(--accent); color: var(--accent-ink); font: 600 11px/1 var(--font-body, inherit); box-shadow: 0 0 0 2px var(--surface); }
.bell.has-critical .bell__count { background: var(--bad); color: #fff; }
.bell__pop { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; width: min(420px, calc(100vw - 24px)); max-height: min(70vh, 560px); display: flex; flex-direction: column; background: var(--glass); -webkit-backdrop-filter: saturate(150%) blur(14px); backdrop-filter: saturate(150%) blur(14px); border: 1px solid var(--border-strong); box-shadow: var(--shadow-float); animation: pop-in .28s var(--ease); }
.bell__head { display: flex; align-items: center; gap: 4px; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.bell__list { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.bell__empty { padding: 18px; text-align: center; margin: 0; }
.ntf { position: relative; display: flex; gap: 10px; padding: 12px; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--muted); }
.ntf--critical { border-left-color: var(--bad); }
.ntf--warn { border-left-color: var(--warn); }
.ntf--info { border-left-color: var(--accent); }
.ntf__ic { flex: none; margin-top: 2px; color: var(--muted); }
.ntf--critical .ntf__ic { color: var(--bad); }
.ntf--warn .ntf__ic { color: var(--warn); }
.ntf__body { min-width: 0; flex: 1; }
.ntf__body b { display: block; font-size: 13.5px; }
.ntf__body p { margin: 2px 0 8px; color: var(--muted); font-size: 12.5px; }
.ntf__meta { display: flex; justify-content: space-between; gap: 8px; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 2px; }
.ntf__acts { display: flex; flex-wrap: wrap; gap: 4px; }
.ntf__acts .btn { height: 28px; padding: 0 10px; font-size: 12px; }
.ntf__close { position: absolute; top: 8px; right: 8px; width: 26px; height: 26px; display: grid; place-items: center; border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 50%; }
.ntf__close:hover { background: var(--surface-2); color: var(--text); }
.toasts { position: fixed; right: 18px; bottom: 18px; z-index: 900; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 24px)); pointer-events: none; }
.ntf--toast { pointer-events: auto; padding-right: 36px; box-shadow: var(--shadow-float); background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); opacity: 0; transform: translateY(16px) scale(.98); transition: opacity .32s var(--ease), transform .32s var(--ease); }
.ntf--toast.is-in { opacity: 1; transform: none; }
html[data-dock="bottom"] .toasts { bottom: 84px; }

/* Banner del Contador (modo consulta blindado) */
.ro-banner { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--radius-card); border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent); background: linear-gradient(120deg, var(--accent-soft), transparent 70%), var(--surface); box-shadow: var(--shadow-card); }
.ro-banner > .ic { color: var(--accent); flex: none; width: 22px; height: 22px; }
.ro-banner > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ro-banner span { color: var(--muted); font-size: 13px; }
form.is-readonly { position: relative; opacity: .55; cursor: not-allowed; }
form.is-readonly * { pointer-events: none; }

/* Workspace contable */
.acc-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.acc-head .chips { margin: 0; }
.acc-period { margin: 0; }
.field--inline { flex-direction: row; align-items: center; gap: 8px; }

@media (max-width: 760px) {
    .zone-sel { display: none; }
    .toasts { right: 12px; left: 12px; width: auto; }
    .ro-banner { flex-wrap: wrap; }
}
.bell__pop[hidden] { display: none; }
.tbl .meter { min-width: 90px; margin-top: 0; }
.view-list[data-view-mode="cards"] .tbl--cards td .meter { flex: 1; max-width: 60%; }

/* ═══ Fase 15 · Dashboards CEO y 360° + tvciChart ═══ */
.dash-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dash-filters .seg__btn { text-decoration: none; display: inline-flex; align-items: center; padding: 0 12px; height: 32px; font-size: 13px; color: var(--muted); }
.dash-filters .seg__btn.is-active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.dash-range { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.dash-range input { height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-ctl); background: var(--bg-2); color: var(--text); font: inherit; font-size: 13px; }
.kpi__split { display: flex; gap: 12px; font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.kpi__split b { color: var(--text); }
.kpi__split .neg b { color: var(--bad); }
.dash-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.dash-wide { grid-column: span 2; }
.dash-stack { display: grid; gap: 12px; }
.dash-fund__nums { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; }
.dash-fund__nums b { display: block; font-size: 15px; }
.bots { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 8px; }
.bot { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-ctl); background: var(--bg-2); }
.bot.is-off { opacity: .55; }
.bot__av { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--accent-soft); color: var(--accent); flex: none; }
.bot__who { flex: 1; min-width: 0; }
.bot__who small, .bot__st small, .gps small { display: block; color: var(--muted); font-size: 11.5px; }
.bot__st { text-align: right; }
.gps-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 8px; }
.gps { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-ctl); min-width: 0; }
.gps > span:nth-child(2) { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gps.is-live { border-color: color-mix(in srgb, var(--good) 40%, var(--border)); }
.gps .icon-btn { width: 30px; height: 30px; }

.chart { position: relative; width: 100%; }
.chart__svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart__grid { stroke: var(--border); stroke-width: 1; }
.chart__tick { fill: var(--muted); font-size: 10.5px; font-family: inherit; font-variant-numeric: tabular-nums; }
.chart__big { fill: var(--text); font: var(--display-weight, 600) 26px/1 var(--font-display); font-variant-numeric: tabular-nums; }
.chart__bar { transition: y .9s var(--ease), height .9s var(--ease), opacity .2s; }
.chart__bar:hover { opacity: .78; }
.chart__line { fill: none; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; transition: stroke-dashoffset 1.3s var(--ease); }
.chart__area { opacity: .12; }
.chart__pt { stroke: var(--surface); stroke-width: 1.5; }
.chart__ring { fill: none; stroke: var(--surface-3); stroke-width: 22; }
.chart__seg { transition: stroke-dasharray 1.1s var(--ease); }
.chart__donut { display: block; width: min(220px, 100%); margin: 0 auto; }
.chart__gauge { display: block; width: min(280px, 100%); margin: 0 auto; }
.chart__gauge .chart__ring { stroke-width: 16; }
.chart__gfill { transition: stroke-dashoffset 1.2s var(--ease); }
.chart__gtick { stroke: var(--muted); stroke-width: 1.2; opacity: .6; }
.chart__needle line { stroke: var(--text); stroke-width: 2.4; stroke-linecap: round; }
.chart__needle { transition: transform 1.2s var(--ease); }
.chart__hub { fill: var(--text); }
.chart__legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 14px; margin-top: 10px; font-size: 12px; color: var(--muted); }
.chart__legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.chart__hbars { display: grid; gap: 10px; }
.chart__hrow { display: grid; grid-template-columns: 120px 1fr auto; align-items: center; gap: 10px; font-size: 13px; }
.chart__htrack { height: 10px; border-radius: var(--radius-pill); background: var(--surface-3); overflow: hidden; }
.chart__hfill { display: block; height: 100%; width: 0; border-radius: inherit; transition: width 1s var(--ease); }

.ceo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.ceo-grid .dash-wide { grid-column: span 2; }
.audit-feed { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; max-height: 360px; overflow-y: auto; }
.audit-feed li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.audit-feed small { color: var(--muted); }

@media (max-width: 1200px) { .dash-grid, .ceo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 760px) {
    .dash-grid, .ceo-grid { grid-template-columns: minmax(0, 1fr); }
    .dash-wide, .ceo-grid .dash-wide { grid-column: auto; }
    .chart__hrow { grid-template-columns: 92px 1fr auto; }
}
.dash-grid, .ceo-grid { grid-auto-flow: row dense; }
.dash-grid > .card, .ceo-grid > .card { min-width: 0; }
.audit-feed { overflow-x: hidden; }
.audit-feed li > span:nth-child(2) { min-width: 0; overflow-wrap: anywhere; }
.audit-feed li small { display: block; }
.offline-bar { display: flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 12px; border-radius: var(--radius-ctl); border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 10%, var(--surface)); font-size: 13px; }
.offline-bar[hidden] { display: none; }
.offline-bar span { flex: 1; }
.rent-actions { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 14px; }
.drv-chain { display: flex; flex-direction: column; gap: 6px; border: 2px solid var(--accent); }
.drv-chain.is-queued { border-color: var(--good); background: color-mix(in srgb, var(--good) 8%, var(--surface)); }
.prepaid-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.prepaid-row b { font-size: 18px; margin-right: auto; }
.prepaid-row input, .prepaid-row select { height: 32px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--radius-ctl); background: var(--bg-2); color: var(--text); width: 96px; }
.ride__alert--watch { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 16%, var(--surface)); animation: watch-pulse 1.6s var(--ease) infinite; }
@keyframes watch-pulse { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--bad) 25%, transparent); } }
.desk { display: flex; flex-direction: column; gap: 16px; max-width: 820px; margin: 0 auto; }
.desk__form { display: flex; flex-direction: column; gap: 12px; margin: 0; }
.desk__btn { display: flex; align-items: center; justify-content: center; gap: 18px; min-height: 150px; border-radius: var(--radius-card); border: 0; background: var(--accent); color: var(--accent-ink); cursor: pointer; box-shadow: var(--shadow-float); transition: transform .2s var(--ease); font: inherit; text-align: left; }
.desk__btn .ic { width: 54px; height: 54px; }
.desk__btn b { display: block; font: 700 28px/1.1 var(--font-display); }
.desk__btn small { display: block; opacity: .85; font-size: 14px; margin-top: 4px; }
.desk__btn:active { transform: scale(.98); }
.desk__btn:disabled { opacity: .6; }
.desk__msg { margin: 0; font-weight: 600; text-align: center; }
.desk__list { display: grid; gap: 10px; }
.desk__ride { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-ctl); }
.desk__ride > div:first-child { flex: 1; min-width: 180px; }
.desk__ride.is-ready { border-color: var(--good); background: color-mix(in srgb, var(--good) 8%, var(--surface)); }
.desk__ride.is-done { opacity: .6; }
.desk__car, .desk__pin { display: flex; flex-direction: column; align-items: center; padding: 6px 12px; border-radius: var(--radius-ctl); background: var(--bg-2); }
.desk__car span, .desk__pin span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.desk__car b { font-size: 20px; }
.desk__car small { color: var(--muted); }
.desk__pin b { font-size: 34px; letter-spacing: .2em; color: var(--accent); }
.fence-map { display: block; width: 100%; height: auto; border-radius: var(--radius-ctl); border: 1px solid var(--border); }
.fence-map__bg { fill: var(--bg-2); }
.fence { stroke-width: 2; fill-opacity: .18; }
.fence--zone { fill: var(--accent); stroke: var(--accent); }
.fence--peripheral { fill: var(--muted); stroke: var(--muted); stroke-dasharray: 5 4; }
.fence--night_caution { fill: var(--bad); stroke: var(--bad); }
.fence.is-off { opacity: .35; }
.fence-map__pin { fill: var(--warn); stroke: var(--surface); stroke-width: 2; }
.lg-zone { background: var(--accent); } .lg-peripheral { background: var(--muted); } .lg-night { background: var(--bad); }
.paste { margin-bottom: 10px; border: 1px dashed var(--accent); border-radius: var(--radius-ctl); padding: 8px 10px; }
.paste summary { cursor: pointer; display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--accent); }
.paste textarea { width: 100%; margin-top: 8px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-ctl); background: var(--bg-2); color: var(--text); font: inherit; font-size: 13px; resize: vertical; }
.paste__bar { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.kbd-help { margin: 0 0 8px; }
.kbd-help kbd { display: inline-block; padding: 1px 6px; border: 1px solid var(--border); border-bottom-width: 2px; background: var(--surface-2); font-size: 11px; }
[data-priority].is-suggested { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }
.drv-wait { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px; border-radius: var(--radius-ctl); border: 1px solid var(--border); background: var(--bg-2); }
.drv-wait b { font-size: 34px; }
.drv-wait.is-over { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, var(--surface)); }
.drv-wait.is-over b { color: var(--warn); }
.drv-change { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.drv-change b { margin-left: auto; font-size: 18px; }
.qr-full__box { max-width: 420px; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 24px; background: #fff; color: #111; cursor: pointer; }
.qr-full__box img { width: min(80vw, 360px); height: auto; image-rendering: pixelated; }
.qr-full__box small { color: #555; }
.drv-return { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }
.drv-return > span { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 13px; margin-right: 4px; }
.drv-act { border: 2px solid var(--warn); }
#voiceToggle.is-off { opacity: .55; }
.rules { display: flex; flex-direction: column; gap: 12px; }
.rule { display: flex; gap: 14px; align-items: flex-start; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius-ctl); }
.rule__body p { margin: 4px 0 0; line-height: 2; }
.rule__body input { height: 30px; padding: 0 6px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-2); color: var(--text); font: inherit; font-size: 13px; }
.rule__ic { width: 44px; display: grid; place-items: center; color: var(--accent); }
.switch { position: relative; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; }
.switch__track { display: block; width: 44px; height: 24px; border-radius: 9999px; background: var(--surface-3); border: 1px solid var(--border); transition: background .25s var(--ease); }
.switch__thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .25s var(--ease), background .25s var(--ease); }
.switch input:checked + .switch__track { background: color-mix(in srgb, var(--accent) 35%, var(--surface)); }
.switch input:checked + .switch__track .switch__thumb { transform: translateX(20px); background: var(--accent); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--accent); outline-offset: 2px; }
.acts { display: grid; gap: 10px; }
.act__imgs { display: flex; gap: 4px; margin-top: 4px; }
.act__imgs img { border-radius: 6px; object-fit: cover; border: 1px solid var(--border); }
.drv__bar { flex-wrap: wrap; }
.drv__tabs { grid-template-columns: repeat(auto-fit, minmax(62px, 1fr)); }
.drv-stops ol { list-style: none; margin: 6px 0; padding: 0; display: grid; gap: 6px; }
.drv-stops li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border); border-radius: var(--radius-ctl); }
.drv-stops li > span:nth-child(2) { flex: 1; min-width: 0; }
.drv-stops li small { display: block; }
.drv-stops li.is-done { opacity: .55; }
.drv-stops__n { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.drv-parcel { display: flex; flex-direction: column; gap: 6px; padding: 12px; border-radius: var(--radius-ctl); border: 1px dashed var(--accent); }
.drv-pin__in { font-size: 24px; letter-spacing: .3em; text-align: center; }
.drv-student { display: flex; flex-direction: column; gap: 8px; border: 2px solid var(--border); }
.drv-student.is-onboard { border-color: var(--warn); }
.drv-student__head { display: flex; align-items: center; gap: 10px; }
.drv-student__head > div { flex: 1; min-width: 0; }
.drv-student__head small { display: block; }
.drv-student__go { border-color: var(--good); color: var(--good); }
.replay__map { height: 460px; border-radius: var(--radius-ctl); overflow: hidden; border: 1px solid var(--border); background: var(--bg-2); }
.replay__bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; }
.replay__bar input[type=range] { flex: 1; min-width: 160px; accent-color: var(--accent); }
.league-top td { background: color-mix(in srgb, var(--accent) 6%, transparent); }
.league-top--1 td:first-child b { color: var(--accent); font-size: 18px; }
.selfies { display: grid; gap: 8px; }
.selfie { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--border); border-radius: var(--radius-ctl); }
.selfie img, .selfie__empty { width: 56px; height: 56px; border-radius: 12px; object-fit: cover; flex: none; display: grid; place-items: center; background: var(--bg-2); color: var(--muted); }
.selfie > div { flex: 1; min-width: 0; }
.selfie small { display: block; color: var(--muted); font-size: 11.5px; }
.selfie__acts { display: flex; flex-direction: column; gap: 4px; margin: 0; }
.selfie.is-taken { border-color: var(--accent); }
.drv-selfie { border: 2px solid var(--accent); }
.drv-selfie__cam { position: relative; aspect-ratio: 3 / 4; max-height: 420px; border-radius: var(--radius-card); overflow: hidden; background: #000; margin: 8px auto; width: 100%; max-width: 340px; }
.drv-selfie__cam video, .drv-selfie__cam img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.drv-selfie__btns { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.drv-card { background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface) 60%); border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border)); }
.drv-card__head { display: flex; align-items: center; gap: 10px; }
.drv-card__head > div { flex: 1; } .drv-card__head small { display: block; color: var(--muted); }
.drv-card__logo { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.drv-card__body { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin: 14px 0; }
.drv-card__who { display: flex; align-items: center; gap: 12px; } .drv-card__who small { display: block; }
.drv-card__qr { width: 150px; height: 150px; padding: 8px; background: #fff; border-radius: 12px; }
.drv-card__qr svg { width: 100%; height: 100%; } .drv-card__qr svg path, .drv-card__qr svg rect { fill: #000; }
.wiz { display: flex; flex-direction: column; gap: 14px; max-width: 920px; margin: 0 auto; }
.wiz__steps { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.wiz__step { display: flex; align-items: center; gap: 8px; padding: 10px; border: 1px solid var(--border); border-radius: var(--radius-ctl); color: var(--muted); text-decoration: none; font-size: 13px; }
.wiz__n { width: 26px; height: 26px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); color: var(--text); font-weight: 700; }
.wiz__step.is-done .wiz__n { background: var(--good); color: #fff; }
.wiz__step.is-current { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
@media (max-width: 760px) { .wiz__steps { grid-template-columns: 1fr 1fr; } }
.drv-hot { border: 2px solid color-mix(in srgb, var(--warn) 55%, var(--border)); }
.drv-hot__list { display: grid; gap: 8px; }
.drv-hot__item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--radius-ctl); border: 1px solid var(--border); background: var(--bg-2); color: var(--text); text-decoration: none; }
.drv-hot__item > span:nth-child(2) { flex: 1; min-width: 0; } .drv-hot__item small { display: block; }
.drv-hot__n { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--warn); color: #000; font-weight: 700; flex: none; }
.rule__body select { height: 30px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg-2); color: var(--text); }

/* ── Fase 24 · Mando Móvil Ejecutivo ─────────────────────────────── */
.cmd { max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }
.cmd__bar { display: flex; align-items: center; gap: 8px; }
.cmd__live { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.dot-live { width: 9px; height: 9px; border-radius: 9999px; background: var(--good); box-shadow: 0 0 0 4px color-mix(in srgb, var(--good) 22%, transparent); animation: cmdPulse 2s ease-in-out infinite; }
@keyframes cmdPulse { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--good) 6%, transparent); } }
@media (prefers-reduced-motion: reduce) { .dot-live { animation: none; } }
.cmd-pilot { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-card); margin: 0; }
.cmd-pilot.is-on { border-color: color-mix(in srgb, var(--accent) 60%, transparent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
.cmd-pilot__txt b { display: block; font-size: 17px; }
.cmd-pilot__txt span { color: var(--muted); font-size: 13px; }
.cmd-pilot__seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.cmd-pilot__opt { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; min-height: 76px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--bg-2); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; transition: background var(--ease), border-color var(--ease); }
.cmd-pilot__opt .ic { width: 24px; height: 24px; }
.cmd-pilot__opt.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.cmd-pilot__opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.cmd-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .cmd-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cmd-kpi { padding: 14px; border-radius: 18px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-card); min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cmd-kpi span { color: var(--muted); font-size: 12px; }
.cmd-kpi b { font-size: 21px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.cmd-kpi small { color: var(--muted); font-size: 11.5px; }
.cmd-kpi.is-warn { border-color: color-mix(in srgb, var(--warn) 55%, transparent); }
.cmd-card { border-radius: 18px; border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-card); overflow: hidden; }
.cmd-card > header { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cmd-card > header h2 { font-size: 15px; margin: 0; flex: 1; }
.cmd-card--red { border-color: color-mix(in srgb, var(--bad) 60%, transparent); }
.cmd-card--red > header { background: color-mix(in srgb, var(--bad) 12%, var(--surface)); color: var(--bad); }
.cmd-count { min-width: 28px; height: 28px; padding: 0 8px; border-radius: 9999px; display: inline-grid; place-items: center; background: var(--bg-2); font-size: 13px; }
.cmd-item { display: flex; flex-direction: column; gap: 10px; padding: 14px 16px; border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); }
.cmd-item:last-child { border-bottom: 0; }
.cmd-item__main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cmd-item__main b { overflow-wrap: anywhere; }
.cmd-item__act { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.cmd-item__act form { margin: 0; }
.cmd-item__act select, .cmd-reassign select { height: 46px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-2); color: var(--text); padding: 0 10px; max-width: 100%; min-width: 0; flex: 1 1 140px; }
.cmd-item__act .field--otp { flex: 1 1 100%; margin: 0; }
.cmd-reassign { display: flex; gap: 8px; flex: 1 1 220px; margin: 0; }
.cmd-tap { min-height: 46px; padding: 0 18px; border-radius: 12px; font-weight: 600; }
.cmd-tap.is-busy { opacity: .6; }
.cmd-empty { display: flex; align-items: center; gap: 8px; padding: 16px; margin: 0; color: var(--muted); }
.cmd-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .cmd-links { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cmd-link { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; }
.cmd-link:hover { border-color: var(--accent); }

/* ── Fase 24 · Liquidación masiva y salud del sistema ─────────────── */
.settle-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.settle-bar .field { margin: 0; }
.settle-sum { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.health-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 14px; }
.health-state { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.health-state::before { content: ''; width: 10px; height: 10px; border-radius: 9999px; background: var(--muted); }
.health-state.is-ok::before { background: var(--good); } .health-state.is-warn::before { background: var(--warn); } .health-state.is-down::before { background: var(--bad); }
.health-state.is-ok { color: var(--good); } .health-state.is-warn { color: var(--warn); } .health-state.is-down { color: var(--bad); }
.health-kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
.health-kv dt { color: var(--muted); } .health-kv dd { margin: 0; text-align: right; overflow-wrap: anywhere; }
.health-log { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 12.5px; }
.health-log li { padding: 8px 10px; border-radius: 9px; background: var(--bg-2); overflow-wrap: anywhere; }
.health-log b { margin-right: 6px; }
.text-bad { color: var(--bad); } .text-warn { color: var(--warn); }
.cmd [hidden] { display: none !important; }
.cmd-reassign { flex: 1 1 100%; min-width: 0; }
.cmd-reassign select { flex: 1 1 0; min-width: 0; width: auto; }
.cmd-reassign .btn { flex: none; }

/* ── Fase 25 · Postulantes y Centro de Disputas ─────────────────── */
.tabs-inline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.tabs-inline .pill { height: 34px; padding: 0 14px; font-size: 13px; text-decoration: none; gap: 8px; margin: 0; }
.tabs-inline .pill.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.apps { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 14px; }
.app-card { display: flex; flex-direction: column; gap: 12px; }
.app-card__head { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.app-card__kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0; font-size: 13.5px; }
.app-card__kv dt { color: var(--muted); } .app-card__kv dd { margin: 0; overflow-wrap: anywhere; }
.app-card__docs { display: flex; flex-wrap: wrap; gap: 10px; }
.app-doc { display: flex; flex-direction: column; gap: 4px; align-items: center; text-decoration: none; color: var(--muted); font-size: 12px; }
.app-doc img, .app-doc__pdf { width: 120px; height: 80px; object-fit: cover; border-radius: 12px; border: 1px solid var(--border); background: var(--bg-2); display: grid; place-items: center; }
.app-card .actions { flex-wrap: wrap; }
.app-card .actions .cell-input { max-width: none; flex: 1 1 180px; }
.split--wide { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); }
@media (max-width: 980px) { .split--wide { grid-template-columns: 1fr; } }
.dsp-list { list-style: none; margin: 0 -8px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.dsp-item { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; text-decoration: none; color: var(--text); border: 1px solid transparent; }
.dsp-item:hover { background: var(--surface-2); }
.dsp-item.is-active { border-color: var(--accent); background: var(--accent-soft); }
.dsp-item__ic { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 9999px; background: var(--surface-2); color: var(--accent); }
.dsp-item__ic.is-bad { color: var(--bad); }
.dsp-item__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dsp-item__main b { font-size: 13.5px; overflow-wrap: anywhere; } .dsp-item__main small { font-size: 12px; }
.dsp-case { display: flex; flex-direction: column; gap: 14px; }
.dsp-quote { margin: 0; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 12px 12px 0; white-space: pre-line; }
.dsp-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.dsp-facts .kpi__value { font-size: 22px; }
.dsp-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; }
.dsp-grid .field small { display: block; margin-top: 4px; font-size: 11.5px; }
.dsp-res { padding: 14px; border-radius: 12px; background: var(--surface-2); }
.dsp-res p { margin: 6px 0 10px; white-space: pre-line; }
.drv-dispute summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; list-style: none; }
.drv-dispute summary::-webkit-details-marker { display: none; }
.drv-dispute[open] summary { margin-bottom: 12px; }

/* ── Fase 26 · Convoy, kardex y cartel ─────────────────────────── */
.feat-pick { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.feat-pick legend { margin-bottom: 6px; }
.feat-pick .pill { height: 32px; gap: 6px; }
.feat-pick .pill:has(input:checked) { border-color: var(--accent); color: var(--text); background: var(--accent-soft); }
.cv-list { display: flex; flex-direction: column; gap: 12px; }
.cv { padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.cv > header { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.cv p { margin: 0; }
.cv__bar { height: 6px; border-radius: 9999px; background: var(--surface-3); overflow: hidden; }
.cv__bar i { display: block; height: 100%; background: var(--accent); border-radius: 9999px; }
.cv__units { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.cv__units li { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 8px; border-radius: 9px; border: 1px solid var(--border); font-size: 12.5px; }
.cv__units li.is-on { border-color: color-mix(in srgb, var(--good) 50%, transparent); }
.cv__units li > .num { width: 20px; height: 20px; border-radius: 9999px; display: inline-grid; place-items: center; background: var(--surface-3); font-size: 11px; }
.cv .actions { flex-wrap: wrap; margin: 0; }
.cv .actions form { margin: 0; }
.drv-earn { display: flex; flex-direction: column; gap: 10px; }
.drv-earn__big { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.drv-earn__big b { font-size: 30px; font-family: var(--font-display); }
.drv-earn__big b.is-neg { color: var(--bad); }
.drv-earn dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 0; font-size: 13px; }
.drv-earn dt { color: var(--muted); } .drv-earn dd { margin: 0; text-align: right; font-family: var(--font-mono, ui-monospace, monospace); }
.sign { position: fixed; inset: 0; z-index: 200; background: #000; color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vh; padding: 5vh 5vw; text-align: center; }
.sign[hidden] { display: none; }
.sign__brand { display: flex; align-items: center; gap: 14px; font-size: clamp(18px, 4vw, 34px); font-weight: 700; letter-spacing: .02em; color: var(--brand, #f5b301); }
.sign__mark { width: 1.8em; height: 1.8em; display: grid; place-items: center; border-radius: 18px; background: var(--brand, #f5b301); color: #000; }
.sign__name { font-size: clamp(42px, 13vw, 150px); line-height: 1; font-weight: 800; letter-spacing: -.02em; overflow-wrap: anywhere; }
.sign__sub { font-size: clamp(16px, 3.6vw, 30px); color: #d4d4d8; }
.sign__close { position: absolute; top: 16px; right: 16px; width: 52px; height: 52px; border-radius: 9999px; border: 1px solid #3f3f46; background: #18181b; color: #fff; display: grid; place-items: center; cursor: pointer; }
.sign__flip { position: absolute; bottom: 16px; right: 16px; border-radius: 9999px; border: 1px solid #3f3f46; background: #18181b; color: #fff; padding: 10px 16px; font: inherit; cursor: pointer; }
.sign.is-light { background: #fff; color: #000; } .sign.is-light .sign__sub { color: #3f3f46; }
.amen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.amen { padding: 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; }
.amen header { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.amen__stock { font-size: 26px; font-family: var(--font-display); }
.amen.is-low { border-color: color-mix(in srgb, var(--warn) 60%, transparent); }
.amen details summary { cursor: pointer; font-size: 13px; color: var(--accent); }
.amen form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; align-items: flex-end; }
.amen form .field { margin: 0; flex: 1 1 110px; }
.pub-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--muted); }
.pub-check input { margin-top: 3px; accent-color: var(--accent); }

/* ── Fase 27 · Terceros, bóveda, paquetes y préstamos ────────────── */
.third-party { border: 1px dashed var(--border-strong); border-radius: 12px; padding: 8px 12px; }
.third-party summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--accent); list-style: none; }
.third-party summary::-webkit-details-marker { display: none; }
.third-party[open] { display: flex; flex-direction: column; gap: 10px; }
.vault-row { display: grid; grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(0, 1fr)); gap: 10px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.vault-row:last-child { border-bottom: 0; }
@media (max-width: 860px) { .vault-row { grid-template-columns: 1fr; } }
.vault-doc { display: flex; flex-direction: column; gap: 2px; font-size: 12.5px; }
.vault-doc .badge { align-self: flex-start; }
.vault-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-end; margin-top: 6px; }
.vault-form .field { margin: 0; flex: 1 1 120px; }
.seal { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 9999px; font-size: 12px; font-weight: 600; color: var(--good); border: 1px solid color-mix(in srgb, var(--good) 45%, transparent); }
.inst { display: flex; flex-wrap: wrap; gap: 4px; }
.inst span { padding: 2px 8px; border-radius: 9999px; font-size: 11.5px; border: 1px solid var(--border); color: var(--muted); }
.inst span.is-due { border-color: var(--warn); color: var(--warn); } .inst span.is-paid { border-color: var(--good); color: var(--good); }

/* ── Fase 28 · Simulador y campañas ─────────────────────────────── */
.sim { display: grid; grid-template-columns: minmax(280px, .8fr) minmax(0, 1.2fr); gap: 16px; align-items: start; }
@media (max-width: 980px) { .sim { grid-template-columns: 1fr; } }
.sim__controls { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 76px; }
@media (max-width: 980px) { .sim__controls { position: static; } }
.sim__row { display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 70%, transparent); font-size: 13px; }
.sim__row input[type=range] { grid-column: 1 / -1; width: 100%; accent-color: var(--accent); height: 28px; }
.sim__row output { font-weight: 700; color: var(--accent); }
.sim__results { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sim__bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 12px; }
.sim__bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; min-width: 0; }
.sim__bar i { display: block; width: 100%; max-width: 46px; border-radius: 9px 9px 4px 4px; background: linear-gradient(180deg, var(--accent), color-mix(in srgb, var(--accent) 45%, transparent)); }
.sim__bar small { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.camp-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.camp-bar { height: 6px; border-radius: 9999px; background: var(--surface-3); overflow: hidden; }
.camp-bar i { display: block; height: 100%; background: var(--accent); }

/* ───────────── Fase 2 · Confirmaciones y avisos compatibles con CSP (tvci-actions.js) ───────────── */
.modal--dlg { align-items: center; padding-top: 16px; z-index: 950; }
.modal__box--dlg { max-width: 440px; padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.dlg__title { margin: 0; font-size: 16px; font-weight: 600; color: var(--text); }
.dlg__msg { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; white-space: pre-line; }
.dlg__input { width: 100%; height: 40px; padding: 0 12px; background: var(--bg-2); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font: inherit; }
.dlg__input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.dlg__err { min-height: 16px; margin-top: -8px; color: var(--bad); font-size: 12.5px; }
.dlg__acts { display: flex; justify-content: flex-end; gap: 8px; }
.dlg__toast { margin: 0; color: var(--text); font-size: 13.5px; }
.dlg__clip { position: fixed; opacity: 0; pointer-events: none; }

/* ───────────── Fase 52A · cabecera, tablas, filtros y acuerdos ───────────── */
/* En portátiles (1366 px) el buscador se reduce a icono para que el título entre completo. */
@media (max-width: 1500px) {
    .tb__search { width: 40px; justify-content: center; padding: 0; flex: none; }
    .tb__search span, .tb__search kbd { display: none; }
}
.mt-12 { margin-top: 12px; }
.tbl--stack th, .tbl--stack td { white-space: normal; }
.tbl--stack td.num, .tbl--stack .badge, .tbl--stack .btn, .tbl--stack .health-state { white-space: nowrap; }
.tbl--stack td.mono { overflow-wrap: anywhere; min-width: 130px; }
.tbl--stack td.tbl__actions form { margin: 0; }
.tbl__btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
@media (min-width: 761px) and (max-width: 1500px) {
    .tbl.tbl--stack th, .tbl.tbl--stack td { padding-left: 10px; padding-right: 10px; }
    .tbl.tbl--stack th { letter-spacing: .03em; }
}
.filters.filters--grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; }
.filters--grid .field { min-width: 0; margin: 0; }
.filters--grid .field input, .filters--grid .field select { width: 100%; min-width: 0; height: 40px; }
.terms { display: contents; }
@supports selector(:has(*)) {
    .terms:not(:has(option[value="split"]:checked)) .terms__split { display: none; }
    .terms:not(:has(option[value="flat_fee"]:checked)) .terms__flat { display: none; }
}
.row-actions.row-actions--tight { margin-top: 10px; }
.cell-input.cell-input--full { width: 100%; max-width: none; }
.live-tabs { display: none; }
@media (max-width: 1024px) {
    .auth .field input:not([type="checkbox"]) { font-size: 16px; min-height: 46px; }
    .auth .btn { min-height: 46px; }
    .auth .check { min-height: 44px; }
    .auth .check input { width: 20px; height: 20px; }
}

/* Fase 52E1 · Bases amigas: lo que pide respuesta va arriba y el acuerdo se revisa antes de aceptar */
.card--priority { border-color: var(--warn, var(--border-strong)); }
.net-kv { display: grid; grid-template-columns: minmax(120px, max-content) minmax(0, 1fr); gap: 8px 16px; margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); font-size: 14px; }
.net-kv dt { color: var(--muted); }
.net-kv dd { margin: 0; overflow-wrap: anywhere; }
.net-list { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 4px; }
@media (max-width: 560px) { .net-kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } .net-kv dd { margin-bottom: 8px; } }

/* Fase 52E1 · guía de roles en /equipo e inicio limpio para operadores */
.role-guide { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; margin: 0; }
.role-guide__item { padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); min-width: 0; }
.role-guide dt { font-weight: 700; margin-bottom: 4px; }
.role-guide dd { margin: 0; font-size: 13.5px; color: var(--muted); overflow-wrap: anywhere; }
.op-home__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.op-home__link { display: flex; align-items: center; gap: 10px; min-height: 52px; padding: 10px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); text-decoration: none; font-weight: 600; }
.op-home__link:hover, .op-home__link:focus-visible { border-color: var(--border-strong); }

/* Fase 52E2 · menú en acordeón y buscador del cajón móvil */
.sb__toggle { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 8px; background: transparent; border: 0; cursor: pointer; text-align: left; font-family: inherit; }
.sb__toggle:hover { color: var(--sb-text); }
.sb__toggle:focus-visible { outline: 2px solid var(--sb-active-bar); outline-offset: -2px; border-radius: 6px; }
.sb__chev { transition: transform .18s ease; flex: none; }
.sb__group.is-closed .sb__chev { transform: rotate(-90deg); }
.sb__search { display: none; }
.sb__empty { padding: 8px 12px; }
html:not([data-collapsed="1"]):not([data-dock="bottom"]):not(.nav-filtering) .sb__group.is-closed .sb__items { display: none; }
html[data-collapsed="1"] .sb__toggle, html[data-dock="bottom"] .sb__toggle { display: none; }
html[data-collapsed="1"] .sb__search, html[data-dock="bottom"] .sb__search { display: none; }
@media (prefers-reduced-motion: reduce) { .sb__chev { transition: none; } }
.sb [hidden] { display: none !important; }

/* ── Fase 55 · utilidades que reemplazan style="" (CSP: style-src sin 'unsafe-inline'). Valores idénticos a los que tenían las vistas. ── */
.w-56 { width: 56px; } .w-60 { width: 60px; } .w-64 { width: 64px; } .w-70 { width: 70px; } .w-76 { width: 76px; } .w-80 { width: 80px; } .w-90 { width: 90px; }
.w-96 { width: 96px; } .w-100 { width: 100px; } .w-110 { width: 110px; } .w-120 { width: 120px; } .w-full { width: 100%; }
.mxw-220 { max-width: 220px; } .mxw-240 { max-width: 240px; } .mxw-600 { max-width: 600px; } .mxw-620 { max-width: 620px; } .mxw-640 { max-width: 640px; }
.mxw-720 { max-width: 720px; } .mxw-820 { max-width: 820px; }
.mt-6 { margin-top: 6px; } .mt-10 { margin-top: 10px; } .mt-14 { margin-top: 14px; } .mt-16 { margin-top: 16px; } .mt-18 { margin-top: 18px; }
.mb-12 { margin-bottom: 12px; } .m-0-0-14 { margin: 0 0 14px; } .pad-20 { padding: 20px; }
.qr-200 { width: 200px; height: 200px; } .avatar--64 { width: 64px; height: 64px; } .logo-receipt { max-width: 180px; max-height: 80px; }
/* Barras cuyo ancho llega en data-w (tvci-ui.js lo vuelca a --w por CSSOM). */
.camp-bar i[data-w], .cv__bar i[data-w] { width: var(--w, 0%); transition: width .6s var(--ease); }
