/* =========================================================================
   Sistema de diseño · tema claro (predeterminado) y oscuro
   -------------------------------------------------------------------------
   Toda la interfaz usa estas variables. La marca de cada empresa llega en
   --brand, --brand-2 y --brand-accent (cevar/branding.py) y el tema se elige
   con <html data-theme="light|dark"> (app-shell.js recuerda la preferencia).
   ========================================================================= */

:root {
    /* Marca (valores por defecto; el servidor inyecta los de la empresa) */
    --brand: #1E4E8C;
    --brand-ink: #FFFFFF;
    --brand-2: #0D1B33;
    --brand-2-ink: #FFFFFF;
    --brand-accent: #3A9BDC;
    --brand-accent-ink: #0B1220;

    --font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-mono: ui-monospace, "SF Mono", Consolas, "Liberation Mono", monospace;

    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 32px;
    --space-7: 48px;
    --shell-height: 66px;
    --content-max: 1320px;
    --focus: 0 0 0 3px color-mix(in srgb, var(--brand) 28%, transparent);
    --ease: cubic-bezier(.22, .78, .24, 1);
}

/* ---------- Tema claro ---------- */
:root,
:root[data-theme="light"] {
    color-scheme: light;
    --bg: #F5F6F8;
    --surface: #FFFFFF;
    --surface-2: #F8F9FB;
    --surface-3: #EEF1F5;
    --border: #E4E7EC;
    --border-strong: #CDD3DD;
    --text: #0F172A;
    --text-2: #475569;
    --text-3: #64748B;
    --ov: #0F172A;          /* velos sobre superficies (hover, separadores) */
    --shade: #0F172A;       /* sombras */
    --scrim: #0F172A;       /* fondo de ventanas modales */
    --inverse: #0F172A;
    --inverse-ink: #FFFFFF;
    --link: var(--brand);
    --brand-soft: color-mix(in srgb, var(--brand) 9%, var(--surface));
    --brand-fg: var(--brand);

    --green: #12B76A;  --green-solid: #12B76A;  --green-fg: #067647;
    --red: #E5484D;    --red-solid: #E5484D;    --red-fg: #B42318;
    --amber: #F59E0B;  --amber-solid: #F5B027;  --amber-fg: #A15C07;
    --blue: var(--brand); --blue-solid: color-mix(in srgb, var(--brand) 70%, white); --blue-fg: var(--brand);
    --cyan: #0891B2;   --cyan-solid: #22B8CF;   --cyan-fg: #0E7490;
    --purple: #7C3AED; --purple-solid: #9F7AEA; --purple-fg: #6D28D9;

    --shadow-sm: 0 1px 2px rgb(15 23 42 / .06);
    --shadow: 0 1px 3px rgb(15 23 42 / .08), 0 1px 2px rgb(15 23 42 / .04);
    --shadow-lg: 0 12px 32px rgb(15 23 42 / .12), 0 2px 6px rgb(15 23 42 / .06);
}

/* ---------- Tema oscuro ---------- */
:root[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0B1120;
    --surface: #111827;
    --surface-2: #151F31;
    --surface-3: #1B263B;
    --border: #232E42;
    --border-strong: #33405A;
    --text: #F1F5F9;
    --text-2: #A9B4C4;
    --text-3: #7D899C;
    --ov: #FFFFFF;
    --shade: #000000;
    --scrim: #02060D;
    --inverse: #F1F5F9;
    --inverse-ink: #0F172A;
    --brand-fg: color-mix(in srgb, var(--brand) 55%, white);
    --link: var(--brand-fg);
    --brand-soft: color-mix(in srgb, var(--brand) 22%, var(--surface));

    --green: #22C55E;  --green-solid: #4ADE80;  --green-fg: #6EE7A8;
    --red: #EF4444;    --red-solid: #F87171;    --red-fg: #FCA5A5;
    --amber: #F59E0B;  --amber-solid: #FBBF24;  --amber-fg: #FCD34D;
    --blue: var(--brand-fg); --blue-solid: var(--brand-fg); --blue-fg: var(--brand-fg);
    --cyan: #06B6D4;   --cyan-solid: #22D3EE;   --cyan-fg: #67E8F9;
    --purple: #8B5CF6; --purple-solid: #A78BFA; --purple-fg: #C4B5FD;

    --shadow-sm: 0 1px 2px rgb(0 0 0 / .3);
    --shadow: 0 1px 3px rgb(0 0 0 / .35);
    --shadow-lg: 0 16px 40px rgb(0 0 0 / .45);
}

/* Variables antiguas de las hojas previas, apuntando al sistema nuevo. */
:root {
    --navy-950: var(--bg);
    --navy-900: var(--surface);
    --navy-850: var(--surface-2);
    --navy-800: var(--surface-3);
    --navy-700: var(--border-strong);
    --white: var(--text);
    --silver: var(--text-2);
    --muted: var(--text-3);
    --muted-2: var(--text-3);
    --border-hover: var(--border-strong);
    --card: var(--surface);
    --card-hover: var(--surface-2);
}

/* ---------- Base ---------- */
html { -webkit-text-size-adjust: 100%; }
html, body {
    background: var(--bg) !important;
    background-image: none !important;
    color: var(--text);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    margin: 0;
    font-family: var(--font) !important;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}
a { color: var(--link); }
::selection { background: color-mix(in srgb, var(--brand) 22%, transparent); }
:focus-visible { outline: none; box-shadow: var(--focus); }
.num, time, .tabular { font-variant-numeric: tabular-nums; }

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

/* ---------- Encabezado único (app shell) ---------- */
.app-shell {
    position: sticky;
    top: 0;
    z-index: 900;
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.app-shell-inner {
    max-width: var(--content-max);
    margin: 0 auto;
    height: var(--shell-height);
    padding: 0 var(--space-5);
    display: flex;
    align-items: center;
    gap: var(--space-5);
}
.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: none;
    text-decoration: none;
    color: var(--text);
    min-width: 0;
}
.app-brand img { height: 46px; width: auto; max-width: 220px; object-fit: contain; display: block; }
.app-brand .logo-on-dark { display: none; }
:root[data-theme="dark"] .app-brand .logo-on-light { display: none; }
:root[data-theme="dark"] .app-brand .logo-on-dark { display: block; }
.app-brand-name {
    font-weight: 700;
    font-size: 15px;
    letter-spacing: -.01em;
    color: var(--brand-2);
    white-space: nowrap;
}
:root[data-theme="dark"] .app-brand-name { color: var(--text); }
.app-brand.has-logo .app-brand-name { display: none; }

.app-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    flex: 1;
}
.app-nav::-webkit-scrollbar { display: none; }
.app-nav a {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 12px;
    border-radius: var(--radius-sm);
    color: var(--text-2);
    font-weight: 500;
    font-size: 13.5px;
    text-decoration: none;
    white-space: nowrap;
    transition: background .15s, color .15s;
}
.app-nav a:hover { background: var(--surface-3); color: var(--text); }
.app-nav a[aria-current="page"] {
    color: var(--brand-fg);
    background: var(--brand-soft);
    font-weight: 600;
}

.app-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; flex: none; }
.ui-icon-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-2);
    cursor: pointer;
    transition: background .15s, color .15s;
}
.ui-icon-btn:hover, .ui-icon-btn[aria-expanded="true"] { background: var(--surface-3); color: var(--text); }
.ui-icon-btn svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ui-icon-btn .ui-count {
    position: absolute;
    top: -1px;
    right: -3px;
    min-width: 12px;
    height: 16px;
    padding: 0 3px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    border: 2px solid var(--surface);
    box-sizing: content-box;
}
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }

.ui-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    color: var(--text-2);
    font-size: 12px;
    font-weight: 500;
    background: transparent;
    border: 1px solid var(--border);
    cursor: pointer;
}
.ui-status:hover { background: var(--surface-3); }
.ui-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.ui-dot.good { background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 18%, transparent); }
.ui-dot.warning { background: var(--amber); }
.ui-dot.bad { background: var(--red); }

.ui-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 36px;
    padding: 0 8px 0 4px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    cursor: pointer;
}
.ui-user:hover, .ui-user[aria-expanded="true"] { background: var(--surface-3); }
.ui-avatar {
    display: inline-grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--brand);
    color: var(--brand-ink);
    font-size: 12px;
    font-weight: 700;
}
.ui-user .user-name { font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-user svg { width: 14px; height: 14px; stroke: var(--text-3); fill: none; stroke-width: 2; }

.ui-menu-wrap { position: relative; }
.ui-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 240px;
    padding: 6px;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    z-index: 950;
    animation: menu-in .14s var(--ease);
}
.ui-menu[hidden] { display: none; }
@keyframes menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.ui-menu-head { padding: 10px 10px 8px; }
.ui-menu-head strong { display: block; font-size: 14px; }
.ui-menu-head span { color: var(--text-3); font-size: 12px; }
.ui-menu-sep { height: 1px; margin: 6px 0; background: var(--border); }
.ui-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px 10px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.ui-menu-item:hover { background: var(--surface-3); }
.ui-menu-item.danger { color: var(--red-fg); }
.ui-menu-item small { margin-left: auto; color: var(--text-3); font-size: 12px; }
.ui-menu-label { padding: 8px 10px 4px; color: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.ui-menu-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 10px; font-size: 13px; color: var(--text-2); }
.ui-menu-row strong { display: inline-flex; align-items: center; gap: 6px; color: var(--text); font-weight: 500; }

/* Segmentado de tema dentro del menú de usuario */
.ui-segmented { display: grid; grid-template-columns: repeat(2, 1fr); gap: 4px; padding: 4px; margin: 4px 6px 6px; border-radius: var(--radius-sm); background: var(--surface-3); }
.ui-segmented button { height: 30px; border: 0; border-radius: 6px; background: transparent; color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 500; cursor: pointer; }
.ui-segmented button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm); }

/* Notificaciones */
.notif-menu { width: min(380px, calc(100vw - 24px)); padding: 0; }
.notif-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; border-bottom: 1px solid var(--border); }
.notif-head strong { font-size: 14px; }
.notif-list { max-height: min(460px, 70vh); overflow-y: auto; padding: 6px; }
.notif-group { padding: 8px 8px 4px; color: var(--text-3); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.notif-item { display: flex; gap: 10px; align-items: flex-start; padding: 10px; border-radius: var(--radius-sm); cursor: pointer; }
.notif-item:hover { background: var(--surface-3); }
.notif-item .ui-dot { margin-top: 6px; }
.notif-item.read { opacity: .65; }
.notif-item.read .ui-dot { background: var(--border-strong); }
.notif-copy { display: grid; gap: 2px; min-width: 0; flex: 1; }
.notif-copy strong { font-size: 13px; font-weight: 600; }
.notif-copy span { color: var(--text-2); font-size: 12.5px; }
.notif-copy time { color: var(--text-3); font-size: 11.5px; }
.notif-del { border: 0; background: transparent; color: var(--text-3); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px 4px; border-radius: 6px; }
.notif-del:hover { color: var(--text); background: var(--surface); }
.notif-empty { padding: 28px 16px; text-align: center; color: var(--text-3); font-size: 13px; }

.app-shell-toggle { display: none; }
@media (max-width: 1240px) {
    .app-shell-inner { gap: var(--space-3); padding: 0 var(--space-4); }
    .ui-status .status-text { display: none; }
    .ui-user .user-name { display: none; }
}
@media (max-width: 1100px) {
    .app-shell-toggle { display: inline-grid; }
    .app-nav {
        position: fixed;
        inset: var(--shell-height) 0 auto 0;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 8px 12px 14px;
        background: var(--surface);
        border-bottom: 1px solid var(--border);
        box-shadow: var(--shadow-lg);
        display: none;
    }
    .app-shell.nav-open .app-nav { display: flex; }
    .app-nav a { height: 42px; font-size: 15px; }
    .ui-status { display: none; }
}

/* ---------- Página ---------- */
.app-page {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: var(--space-6) var(--space-5) var(--space-7);
}
.ui-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-4);
    flex-wrap: wrap;
    margin-bottom: var(--space-5);
}
.ui-page-head h1 { margin: 0; font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; color: var(--text); }
.ui-page-head p { margin: 4px 0 0; color: var(--text-3); font-size: 14px; }
.ui-page-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.ui-section { margin-top: var(--space-6); }
.ui-section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.ui-section-head h2 { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.ui-section-head a { font-size: 13px; font-weight: 500; text-decoration: none; }
.ui-section-head a:hover { text-decoration: underline; }
@media (max-width: 640px) {
    .app-page { padding: var(--space-5) var(--space-4) var(--space-6); }
    .app-brand img { height: 40px; max-width: 170px; }
    .ui-page-head h1 { font-size: 21px; }
}

/* ---------- Componentes ---------- */
.ui-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 38px;
    padding: 0 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s, border-color .15s, box-shadow .15s;
}
.ui-btn:hover { background: var(--surface-3); }
.ui-btn:disabled { opacity: .55; cursor: not-allowed; }
.ui-btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.ui-btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, black); }
.ui-btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.ui-btn.ghost:hover { background: var(--surface-3); color: var(--text); }
.ui-btn.danger { color: var(--red-fg); }
.ui-btn.sm { height: 32px; padding: 0 12px; font-size: 12.5px; }
.ui-btn.lg { height: 46px; padding: 0 20px; font-size: 15px; }
.ui-btn.block { width: 100%; }
.ui-btn svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.ui-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.ui-pad { padding: var(--space-5); }

.ui-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.ui-kpi { display: block; padding: 18px 20px; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.ui-kpi:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.ui-kpi-label { display: flex; align-items: center; justify-content: space-between; color: var(--text-2); font-size: 13px; font-weight: 500; }
.ui-kpi-label svg { width: 18px; height: 18px; stroke: var(--text-3); fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ui-kpi-value { margin-top: 10px; font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; color: var(--text); font-variant-numeric: tabular-nums; }
.ui-kpi-caption { margin-top: 4px; color: var(--text-3); font-size: 12.5px; }
@media (max-width: 960px) { .ui-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 420px) { .ui-kpi { padding: 14px; } .ui-kpi-value { font-size: 24px; } }

.ui-field { display: grid; gap: 6px; }
.ui-field > span, .ui-field > label { color: var(--text-2); font-size: 13px; font-weight: 500; }
.ui-input, .ui-field input, .ui-field select, .ui-field textarea {
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}
.ui-input:focus, .ui-field input:focus, .ui-field select:focus, .ui-field textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: var(--focus);
}
.ui-field small { color: var(--text-3); font-size: 12px; }

.ui-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 24px;
    padding: 0 9px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--surface-3);
    color: var(--text-2);
}
.ui-badge.green { background: color-mix(in srgb, var(--green-fg) 12%, transparent); color: var(--green-fg); }
.ui-badge.red { background: color-mix(in srgb, var(--red-fg) 12%, transparent); color: var(--red-fg); }
.ui-badge.amber { background: color-mix(in srgb, var(--amber-fg) 14%, transparent); color: var(--amber-fg); }
.ui-badge.blue { background: var(--brand-soft); color: var(--brand-fg); }

.ui-empty {
    padding: var(--space-6) var(--space-5);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    text-align: center;
    color: var(--text-3);
    background: var(--surface);
}

.app-footer {
    max-width: var(--content-max);
    margin: 0 auto;
    padding: var(--space-5);
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    color: var(--text-3);
    font-size: 12px;
    border-top: 1px solid var(--border);
}

.ui-skeleton {
    display: inline-block;
    border-radius: 6px;
    background: linear-gradient(90deg, var(--surface-3), var(--surface-2), var(--surface-3));
    background-size: 200% 100%;
    animation: ui-skeleton 1.2s ease-in-out infinite;
}
@keyframes ui-skeleton { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- Pestañas de página y filtros tipo chip ---------- */
.ui-tabs {
    display: flex;
    gap: 4px;
    margin: 0 0 var(--space-5);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    scrollbar-width: none;
}
.ui-tabs::-webkit-scrollbar { display: none; }
.ui-tabs button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: none;
    height: 42px;
    padding: 0 12px;
    border: 0;
    background: transparent;
    color: var(--text-2);
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.ui-tabs button:hover { color: var(--text); }
.ui-tabs button strong {
    min-width: 22px;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--surface-3);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.ui-tabs button[aria-selected="true"] { color: var(--brand-fg); font-weight: 600; }
.ui-tabs button[aria-selected="true"] strong { background: var(--brand-soft); color: var(--brand-fg); }
.ui-tabs button[aria-selected="true"]::after {
    content: "";
    position: absolute;
    left: 8px;
    right: 8px;
    bottom: -1px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand-fg);
}
.ui-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.ui-chips > button {
    height: 34px;
    min-height: 0;
    padding: 0 14px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    background: var(--surface);
    color: var(--text-2);
    font: inherit;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0;
    text-transform: none;
    cursor: pointer;
    transform: none;
}
.ui-chips > button:hover { background: var(--surface-3); color: var(--text); }
.ui-chips > button.active { background: var(--inverse); border-color: var(--inverse); color: var(--inverse-ink); }

/* ---------- Hora escrita a mano (24 h), reutilizable ---------- */
.time24-control {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    background: var(--surface);
    overflow: hidden;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.time24-control:focus-within { border-color: var(--brand); box-shadow: var(--focus); }
.time24-control.is-invalid { border-color: var(--red); }
.time24-control input {
    flex: 1;
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding: 0 12px;
    border: 0 !important;
    outline: 0;
    background: transparent !important;
    box-shadow: none !important;
    color: var(--text);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .06em;
    font-variant-numeric: tabular-nums;
}
.time24-control input::placeholder { color: var(--text-3); font-weight: 500; }
.time24-hint { padding: 0 12px; color: var(--text-3); font-size: 12px; font-weight: 500; user-select: none; }
.time24-error { display: block; margin-top: 6px; color: var(--red-fg); font-size: 12px; }
.time24-error[hidden] { display: none; }


/* Sección «Inactivos» (Unidades, Operadores, Clientes) */
.catalog-inactive { margin-top: 28px; padding: 16px; border: 1px dashed var(--border-strong); border-radius: var(--radius, 12px); background: var(--surface-2); }
.catalog-inactive[hidden] { display: none !important; }
.catalog-inactive-head { display: flex; align-items: center; gap: 8px; }
.catalog-inactive-head h3 { margin: 0; font-size: 15px; font-weight: 650; color: var(--text); }
.catalog-inactive-count { min-width: 22px; height: 22px; padding: 0 7px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font-size: 12px; font-weight: 650; }
.catalog-inactive-note { margin: 6px 0 12px; color: var(--text-3); font-size: 12.5px; }
.catalog-inactive-list { display: grid; gap: 8px; }
.catalog-inactive-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm, 8px); background: var(--surface); }
.catalog-inactive-copy { min-width: 0; display: grid; gap: 2px; }
.catalog-inactive-copy strong { color: var(--text-2); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.catalog-inactive-copy small { color: var(--text-3); font-size: 12px; overflow-wrap: anywhere; }
.catalog-inactive-actions { display: flex; gap: 8px; flex-shrink: 0; }
.catalog-inactive-actions button { height: 32px; padding: 0 12px; border-radius: var(--radius-sm, 8px); border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.catalog-inactive-actions button:hover { background: var(--surface-3); }
.catalog-inactive-actions button.danger { border-color: color-mix(in srgb, var(--red-fg) 45%, transparent); color: var(--red-fg); }
.catalog-inactive-actions button.danger:hover { background: color-mix(in srgb, var(--red-fg) 10%, var(--surface)); }
.catalog-inactive-actions button:disabled { opacity: .6; cursor: wait; }
@media (max-width: 640px) {
    .catalog-inactive-row { flex-direction: column; align-items: stretch; }
    .catalog-inactive-actions button { flex: 1; }
}


/* Menú de acciones «⋯» */
.ui-kebab { position: relative; display: inline-flex; flex: none; }
.ui-kebab-trigger {
    width: 34px; height: 34px; padding: 0; display: inline-grid; place-items: center;
    border: 1px solid transparent; border-radius: var(--radius-sm, 8px); background: transparent;
    color: var(--text-2); cursor: pointer;
}
.ui-kebab-trigger:hover, .ui-kebab.is-open .ui-kebab-trigger { background: var(--surface-3); border-color: var(--border); color: var(--text); }
.ui-kebab-trigger:focus-visible { outline: none; box-shadow: var(--focus); }
.ui-kebab-trigger svg { width: 18px; height: 18px; fill: currentColor; }
.ui-kebab-menu {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 2000; min-width: 190px; padding: 6px;
    border: 1px solid var(--border); border-radius: var(--radius, 12px); background: var(--surface);
    box-shadow: 0 12px 32px color-mix(in srgb, var(--shade, #000) 18%, transparent);
}
.ui-kebab-menu[hidden] { display: none !important; }
.ui-kebab-menu button {
    width: 100%; min-height: 36px; padding: 0 10px; display: flex; align-items: center; gap: 8px;
    border: 0; border-radius: var(--radius-sm, 8px); background: transparent; color: var(--text);
    font: inherit; font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer;
}
.ui-kebab-menu button:hover, .ui-kebab-menu button:focus-visible { outline: none; background: var(--surface-3); }
.ui-kebab-menu button.danger { color: var(--red-fg); }
.ui-kebab-menu button.danger:hover { background: color-mix(in srgb, var(--red-fg) 10%, var(--surface)); }
.ui-kebab-menu hr { margin: 4px 2px; border: 0; border-top: 1px solid var(--border); }

.catalog-inactive-date { color: var(--red-fg) !important; opacity: .85; }
