:root {
    --tho-black: #111111;
    --tho-black-soft: #1c1c1c;
    --tho-red: #d92735;
    --tho-red-dark: #b51f2b;
    --tho-white: #ffffff;
    --tho-gray-50: #f4f5f7;
    --tho-gray-100: #eceef1;
    --tho-gray-200: #dfe2e6;
    --tho-gray-500: #667085;
    --tho-gray-700: #344054;
    --tho-success: #18794e;
    --tho-warning: #8a5800;
    --tho-danger: #b42318;
    --tho-info: #175cd3;
    --tho-sidebar-width: 272px;
    --tho-topbar-height: 76px;
    --tho-radius-sm: .55rem;
    --tho-radius: .85rem;
    --tho-radius-lg: 1.15rem;
    --tho-shadow-sm: 0 1px 2px rgba(17, 17, 17, .04), 0 4px 14px rgba(17, 17, 17, .035);
    --tho-shadow: 0 16px 38px rgba(17, 17, 17, .09);
    --tho-space-1: .25rem;
    --tho-space-2: .5rem;
    --tho-space-3: .75rem;
    --tho-space-4: 1rem;
    --tho-space-5: 1.5rem;
    --tho-space-6: 2rem;
    --tho-surface: var(--tho-white);
    --tho-surface-glass: rgba(255, 255, 255, .94);
    --tho-border-soft: rgba(17, 17, 17, .10);
    --tho-border-light: rgba(255, 255, 255, .72);
    --tho-shadow-inset: inset 0 1px 0 rgba(255, 255, 255, .85);
    --tho-duration: 160ms;
    --tho-ease: cubic-bezier(.2, .65, .3, 1);
    --tho-field-border: #8a929e;
    --tho-table-heading: #f4f5f7;
    --tho-row-hover: #f9f2f3;
    --bs-primary: var(--tho-red);
    --bs-primary-rgb: 217, 39, 53;
    --bs-body-font-family: "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --bs-body-color: var(--tho-black);
    --bs-body-bg: var(--tho-gray-50);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--tho-gray-50); }
body { margin: 0; color: var(--tho-black); background: var(--tho-gray-50); font-size: .96rem; line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: var(--tho-red-dark); text-underline-offset: .2em; }
a:hover { color: var(--tho-black); }
h1, h2, h3, h4, h5, h6 { color: var(--tho-black); font-weight: 700; letter-spacing: -.025em; }
h1 { font-size: clamp(1.75rem, 3vw, 2.45rem); }
.text-secondary { color: #5d6673 !important; }

.skip-link { position: fixed; z-index: 2000; top: .75rem; left: .75rem; padding: .65rem 1rem; background: var(--tho-white); color: var(--tho-black); border: 3px solid var(--tho-red); border-radius: var(--tho-radius-sm); transform: translateY(-160%); }
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid var(--tho-red) !important; outline-offset: 3px; box-shadow: none !important; }

/* Estructura principal */
.app-shell { min-height: 100vh; --tho-shadow-sm: 0 2px 3px rgba(17, 17, 17, .025), 0 6px 20px rgba(17, 17, 17, .04); --tho-shadow: 0 8px 26px rgba(17, 17, 17, .08); background: var(--tho-gray-50); }
.app-sidebar { position: fixed; inset: 0 auto 0 0; z-index: 1040; display: flex; width: var(--tho-sidebar-width); flex-direction: column; overflow-y: auto; color: var(--tho-white); border-right: 1px solid rgba(255, 255, 255, .08); background: var(--tho-black); scrollbar-width: thin; scrollbar-color: #4b4b4b var(--tho-black); }
.sidebar-brand { padding: 1.5rem 1.2rem 1.25rem; }
.sidebar-brand a { display: block; padding: .7rem .9rem; background: var(--tho-white); border: 1px solid var(--tho-border-light); border-radius: var(--tho-radius); box-shadow: 0 3px 12px rgba(0, 0, 0, .12); }
.sidebar-brand img { display: block; width: 100%; height: 78px; object-fit: contain; }
.sidebar-nav { display: flex; flex: 1; flex-direction: column; gap: .35rem; padding: .35rem 1rem 1.25rem; }
.sidebar-label { margin: 1rem .8rem .35rem; padding-top: .5rem; color: #aeb2b8; border-top: 1px solid rgba(255, 255, 255, .09); font-size: .67rem; font-weight: 800; letter-spacing: .15em; }
.sidebar-link { display: flex; align-items: center; gap: .8rem; min-height: 46px; padding: .65rem .8rem; color: #d7d9dd; border-radius: .7rem; font-weight: 600; text-decoration: none; transition: background-color var(--tho-duration) var(--tho-ease), color var(--tho-duration) var(--tho-ease), box-shadow var(--tho-duration) var(--tho-ease); }
.sidebar-link:hover { color: var(--tho-white); background: rgba(255, 255, 255, .09); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.sidebar-link-active, .sidebar-link-active:hover { color: var(--tho-white); background: var(--tho-red); box-shadow: inset 3px 0 0 rgba(255, 255, 255, .65), inset 0 1px 0 rgba(255, 255, 255, .16); }
.sidebar-link:focus-visible, .sidebar-logout:focus-visible { outline-color: var(--tho-white) !important; outline-offset: 2px; }
.nav-mark, .stat-mark { display: inline-grid; place-items: center; flex: 0 0 auto; width: 32px; height: 32px; border-radius: .55rem; }
.nav-mark { color: #d7d9dd; background: rgba(255, 255, 255, .08); }
.nav-mark svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sidebar-icon-definitions { position: absolute; overflow: hidden; pointer-events: none; }
.sidebar-link:hover .nav-mark, .sidebar-link-active .nav-mark { color: var(--tho-white); background: rgba(255, 255, 255, .14); }
.sidebar-account { display: grid; grid-template-columns: 38px minmax(0, 1fr); gap: .7rem; margin: 0 1rem 1rem; padding: 1rem; border: 1px solid rgba(255, 255, 255, .13); border-radius: var(--tho-radius); background: var(--tho-black-soft); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04); }
.account-avatar { display: grid; place-items: center; width: 38px; height: 38px; color: var(--tho-white); background: var(--tho-red); border-radius: 50%; font-weight: 800; }
.account-copy { min-width: 0; }
.account-copy strong, .account-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { color: var(--tho-white); font-size: .83rem; }
.account-copy span { color: #aeb2b8; font-size: .7rem; letter-spacing: .06em; }
.sidebar-account form { grid-column: 1 / -1; }
.sidebar-logout { width: 100%; padding: .5rem .7rem; color: #e5e7eb; border: 1px solid #4b4b4b; border-radius: .55rem; background: transparent; font-size: .82rem; font-weight: 600; }
.sidebar-logout:hover { color: var(--tho-white); border-color: #737373; background: #272727; }
.app-main { display: flex; min-height: 100vh; margin-left: var(--tho-sidebar-width); flex-direction: column; }
.app-topbar { position: sticky; top: 0; z-index: 1020; display: flex; min-height: var(--tho-topbar-height); align-items: center; gap: 1rem; padding: .85rem clamp(1.25rem, 3vw, 2.5rem); border-bottom: 1px solid var(--tho-border-soft); background: var(--tho-surface); box-shadow: 0 2px 12px rgba(17, 17, 17, .025); }
/* One small sticky surface uses blur; content, tables and the driver portal stay solid. */
@supports ((backdrop-filter: blur(6px)) or (-webkit-backdrop-filter: blur(6px))) {
    .app-topbar { background: var(--tho-surface-glass); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
    .app-shell :is(.dashboard-context, .dashboard-kpi) { background: var(--tho-surface-glass); }
}
@media (max-width: 767.98px), (prefers-reduced-transparency: reduce), (forced-colors: active), print {
    .app-topbar { background: var(--tho-surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
    .app-shell :is(.dashboard-context, .dashboard-kpi) { background: var(--tho-surface); }
}
.app-topbar > div { display: flex; flex-direction: column; line-height: 1.25; }
.topbar-product { color: var(--tho-red-dark); font-size: .66rem; font-weight: 800; letter-spacing: .14em; }
.app-topbar strong { font-size: 1.05rem; }
.topbar-role { margin-left: auto; padding: .38rem .7rem; color: var(--tho-gray-700); border: 1px solid var(--tho-gray-200); border-radius: 999px; background: var(--tho-gray-50); box-shadow: var(--tho-shadow-inset); font-size: .72rem; font-weight: 700; letter-spacing: .04em; }
.menu-toggle { display: none; width: 42px; height: 42px; border: 1px solid var(--tho-gray-200); border-radius: .65rem; background: var(--tho-white); font-size: 1.2rem; }
.content-wrap { width: 100%; max-width: 1540px; flex: 1; align-self: center; padding: clamp(1.5rem, 3vw, 2.8rem); }
.app-footer { padding: 1rem clamp(1.5rem, 3vw, 2.8rem) 1.5rem; color: var(--tho-gray-500); font-size: .78rem; }
.sidebar-scrim { display: none; }

/* Identidad y encabezados */
.eyebrow { margin: 0 0 .5rem; color: var(--tho-red-dark); font-size: .7rem; font-weight: 800; letter-spacing: .15em; }
.page-heading { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.7rem; }
.page-heading h1 { margin-bottom: .3rem; }
.section-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 1rem; }
.section-title { margin: 0 0 1rem; font-size: 1.2rem; }
.section-heading .section-title { margin-bottom: 0; }
.dashboard-hero { position: relative; display: flex; min-height: 210px; align-items: center; justify-content: space-between; gap: 2rem; overflow: hidden; margin-bottom: 2rem; padding: clamp(1.6rem, 4vw, 3rem); color: var(--tho-white); border: 1px solid rgba(255, 255, 255, .10); border-radius: var(--tho-radius-lg); background: linear-gradient(125deg, #111 0%, #1b1b1b 68%, #311518 100%); box-shadow: var(--tho-shadow); }
.dashboard-hero::after { position: absolute; right: -40px; bottom: -90px; width: 260px; height: 260px; content: ""; border: 44px solid rgba(217, 39, 53, .14); border-radius: 50%; }
.dashboard-welcome { position: relative; z-index: 1; width: 100%; max-width: 860px; }
.dashboard-welcome h1 { margin: 0 0 .65rem; color: var(--tho-white); }
.dashboard-welcome .eyebrow { color: #f4c8cc; }
.dashboard-welcome p:last-child { max-width: 590px; margin: 0; color: #d6d7da; }

/* Superficies, tarjetas y accesos */
.card { border: 1px solid var(--tho-gray-200); border-radius: var(--tho-radius); background: var(--tho-white); box-shadow: var(--tho-shadow-sm); }
.card-body { padding: 1.25rem; }
.app-shell .card { border-color: var(--tho-border-soft); }
.app-shell .stat-card { background: var(--tho-surface); box-shadow: var(--tho-shadow-inset), var(--tho-shadow-sm); }
.form-card { max-width: 980px; }
.stat-card { display: flex; min-height: 168px; align-items: center; justify-content: center; gap: .55rem; padding: 1.2rem .85rem; flex-direction: column; text-align: center; }
.stat-card .stat-mark { width: 48px; height: 48px; color: var(--tho-red-dark); background: #fff0f1; border-radius: .8rem; }
.stat-mark svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.stat-card .stat-label { display: block; min-height: 2.35em; color: var(--tho-gray-500); font-size: .8rem; font-weight: 650; line-height: 1.18; }
.stat-card .stat-value { display: block; margin-top: .05rem; color: var(--tho-black); font-size: clamp(2.1rem, 3vw, 2.65rem); font-variant-numeric: tabular-nums; line-height: .95; }
.empty-state { margin-top: 1rem; padding: 3.4rem 1.5rem; color: var(--tho-gray-500); border: 1px dashed #ccd0d5; border-radius: var(--tho-radius); background: rgba(255, 255, 255, .45); text-align: center; }

/* Botones y estados */
.btn { min-height: 42px; padding: .55rem 1rem; border-radius: var(--tho-radius-sm); font-weight: 650; }
.btn-sm { min-height: 34px; padding: .35rem .7rem; font-size: .82rem; }
.app-shell .btn, .sidebar-logout, .menu-toggle { transition: color var(--tho-duration) var(--tho-ease), background-color var(--tho-duration) var(--tho-ease), border-color var(--tho-duration) var(--tho-ease), box-shadow var(--tho-duration) var(--tho-ease); }
.app-shell .btn-primary { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15), 0 2px 3px rgba(181, 31, 43, .12); }
.app-shell .btn-primary:disabled, .app-shell .btn.disabled { box-shadow: none; }
@media (hover: hover) and (pointer: fine) {
    .app-shell .btn-primary:hover:not(:disabled):not(.disabled) { box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12), 0 3px 8px rgba(181, 31, 43, .18); }
}
.btn-primary { --bs-btn-color: #fff; --bs-btn-bg: var(--tho-red); --bs-btn-border-color: var(--tho-red); --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--tho-red-dark); --bs-btn-hover-border-color: var(--tho-red-dark); --bs-btn-active-bg: #991b26; --bs-btn-active-border-color: #991b26; --bs-btn-disabled-bg: #bf6970; --bs-btn-disabled-border-color: #bf6970; }
.btn-outline-primary { --bs-btn-color: #b51f2b; --bs-btn-border-color: #d45a64; --bs-btn-hover-color: #fff; --bs-btn-hover-bg: var(--tho-red-dark); --bs-btn-hover-border-color: var(--tho-red-dark); --bs-btn-active-bg: #991b26; --bs-btn-active-border-color: #991b26; }
.btn-outline-secondary { --bs-btn-color: var(--tho-gray-700); --bs-btn-border-color: #aeb4bd; --bs-btn-hover-color: var(--tho-white); --bs-btn-hover-bg: var(--tho-black); --bs-btn-hover-border-color: var(--tho-black); }
.btn-link { color: var(--tho-red-dark); }
.badge { padding: .42em .7em; border-radius: 999px; font-size: .72rem; letter-spacing: .02em; }
.text-bg-success { color: #11633f !important; background: #dff4e9 !important; }
.text-bg-secondary { color: #49515d !important; background: #e8eaed !important; }
.text-bg-light { color: #4d5561 !important; background: #eef0f2 !important; }
.text-danger { color: var(--tho-danger) !important; }

/* Formularios */
.form-label { margin-bottom: .38rem; color: #24272c; font-size: .86rem; font-weight: 650; }
.form-control, .form-select, .input-group-text { min-height: 46px; border-color: #cfd3d8; border-radius: var(--tho-radius-sm); }
.form-control, .form-select { color: var(--tho-black); background-color: var(--tho-white); }
.form-control:hover, .form-select:hover { border-color: #aeb4bd; }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--tho-red); box-shadow: 0 0 0 .22rem rgba(217, 39, 53, .18); }
.form-control::placeholder { color: #7c8490; }
.form-text { color: #626c79; font-size: .78rem; }
.form-field { margin-bottom: 1.15rem; }
.form-check-input:checked { border-color: var(--tho-red); background-color: var(--tho-red); }
.company-access { margin-top: .5rem; padding: 1.2rem; border: 1px solid var(--tho-gray-200); border-radius: var(--tho-radius); background: var(--tho-gray-50); }
.company-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .65rem; }
.company-option { margin: 0; padding: .75rem .85rem; border: 1px solid var(--tho-gray-200); border-radius: .65rem; background: var(--tho-white); }
.search-bar { display: flex; max-width: 800px; gap: .75rem; margin-bottom: 1.3rem; }
.filter-bar { display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto; gap: 1rem; margin-bottom: 1.3rem; padding: 1rem; border: 1px solid var(--tho-gray-200); border-radius: var(--tho-radius); background: var(--tho-white); }
.filter-bar-four { grid-template-columns: repeat(3, minmax(160px, 1fr)) auto; }
.table-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; min-width: 12rem; }
.audit-list { display: grid; gap: .75rem; padding-left: 1.25rem; }
.audit-list li { padding-left: .25rem; }
.audit-list span { display: block; color: var(--tho-gray-500); font-size: .86rem; }
.company-check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.company-check { display: flex; align-items: flex-start; gap: .75rem; min-height: 72px; padding: .9rem; border: 1px solid var(--tho-gray-200); border-radius: var(--tho-radius-sm); background: var(--tho-white); cursor: pointer; }
.company-check:hover { border-color: var(--tho-red); }
.company-check .form-check-input { flex: 0 0 auto; margin-top: .2rem; }
.company-check span { display: grid; gap: .15rem; }
.company-check small { color: var(--tho-gray-500); }
.company-check.is-disabled { cursor: not-allowed; opacity: .7; }

/* Captura semanal de RH */
.form-card-wide { max-width: 1180px; }
.btn-back { display: inline-flex; align-items: center; gap: .4rem; }

/* Tablas y mensajes */
.table { --bs-table-bg: transparent; --bs-table-hover-bg: #fafafa; }
.table > :not(caption) > * > * { padding: 1rem 1.1rem; border-bottom-color: #e7e9ec; }
.table thead th { color: #5a6370; background: #fafafa; font-size: .72rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; white-space: nowrap; }
.table tbody tr:last-child > * { border-bottom: 0; }
.table caption { color: var(--tho-gray-500); }
.alert { border: 0; border-left: 4px solid currentColor; border-radius: var(--tho-radius-sm); }
.alert-danger { color: #842029; background: #fce8ea; }
.alert-success { color: #11633f; background: #e5f5ec; }
.alert-info { color: #174e91; background: #e8f1fd; }
.company-logo { width: 82px; height: 58px; object-fit: contain; border: 1px solid var(--tho-gray-200); border-radius: .7rem; background: var(--tho-white); }
.company-logo-lg { width: 180px; height: 90px; }

/* Acceso */
.auth-body { background: var(--tho-white); }
.login-page { display: grid; min-height: 100vh; grid-template-columns: minmax(360px, 1.05fr) minmax(420px, .95fr); }
.login-brand-panel { position: relative; display: flex; overflow: hidden; padding: clamp(2rem, 4vw, 4.5rem); align-items: flex-start; background: linear-gradient(165deg, #35252b, #886064 65%, #432d2a); }
.login-scene { position: absolute; inset: auto 0 0; aspect-ratio: 5 / 4; max-height: 100%; }
.login-scene img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: 56% bottom; mask-image: linear-gradient(transparent, #000 16%); }
.login-identity { position: relative; display: flex; align-items: center; gap: clamp(1rem, 2vw, 1.8rem); }
.login-brand-card { flex: 0 0 clamp(125px, 13vw, 200px); padding: .65rem; background: var(--tho-white); border-radius: var(--tho-radius); }
.login-brand-card img { display: block; width: 100%; height: auto; }
.login-slogan { margin: 0; font-weight: 700; }
.login-identity .login-slogan { max-width: 13em; padding-left: clamp(1rem, 2vw, 1.8rem); border-left: 2px solid var(--tho-red); color: var(--tho-white); font-size: clamp(1.35rem, 2.4vw, 2.25rem); line-height: 1.18; }
.login-form-panel { display: grid; padding: clamp(1.5rem, 5vw, 5rem); place-items: center; background: var(--tho-gray-50); }
.login-card { width: min(440px, 100%); padding: clamp(1.6rem, 4vw, 2.5rem); border: 1px solid var(--tho-gray-200); border-radius: var(--tho-radius-lg); background: var(--tho-white); box-shadow: var(--tho-shadow); }
.login-card h1 { margin-bottom: .45rem; font-size: clamp(1.8rem, 3vw, 2.35rem); }
.login-intro { margin-bottom: 1.8rem; color: var(--tho-gray-500); }
.login-help { margin: 1.5rem 0 0; color: var(--tho-gray-500); font-size: .8rem; text-align: center; }
.login-mobile-logo { display: none; }

@media (max-width: 991.98px) {
    .app-sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .app-main { margin-left: 0; }
    .menu-toggle { display: inline-grid; place-items: center; }
    .sidebar-open { overflow: hidden; }
    .sidebar-open .app-sidebar { transform: translateX(0); }
    .sidebar-open .sidebar-scrim { position: fixed; inset: 0; z-index: 1030; display: block; width: 100%; height: 100%; border: 0; background: rgba(17, 17, 17, .56); }
    .login-page { grid-template-columns: 1fr; }
    .login-brand-panel { display: none; }
    .login-form-panel { min-height: 100vh; }
    .login-mobile-logo { display: block; width: min(300px, 75vw); margin: 0 auto 1.5rem; padding: .7rem; border-radius: var(--tho-radius); background: var(--tho-white); }
    .login-mobile-logo img { display: block; width: 100%; height: 100px; object-fit: contain; }
    .login-mobile-logo span { display: block; margin: .5rem 0 .15rem; color: var(--tho-black); font-size: .82rem; font-weight: 750; letter-spacing: .16em; text-align: center; }
    .login-mobile-logo .login-slogan { color: var(--tho-gray-500); font-size: .78rem; line-height: 1.35; text-align: center; }
}

@media (max-width: 575.98px) and (max-height: 700px) {
    .login-mobile-logo { width: min(300px, 80vw); margin-bottom: .4rem; }
}

@media (max-width: 767.98px) {
    .app-topbar { min-height: 68px; padding: .7rem 1rem; }
    .topbar-role { display: none; }
    .content-wrap { padding: 1.25rem 1rem 2rem; }
    .app-footer { padding: .8rem 1rem 1.25rem; }
    .dashboard-hero { min-height: auto; padding: 1.5rem; }
    .dashboard-welcome p:last-child { font-size: .9rem; }
    .stat-card { min-height: 154px; align-items: center; justify-content: center; gap: .5rem; }
    .stat-card .stat-value { font-size: 2rem; }
    .search-bar { flex-direction: column; }
    .filter-bar { grid-template-columns: 1fr; }
    .filter-bar-four, .company-check-grid { grid-template-columns: 1fr; }
    .table-actions { min-width: 10rem; }
    .page-heading .btn, .page-heading > div:last-child { width: 100%; }
    .page-heading > div:last-child .btn { width: 100%; margin: .25rem 0; }
    .card-body { padding: 1rem; }
    .form-card .d-flex.gap-3 { flex-direction: column; }
    .form-card .d-flex.gap-3 .btn { width: 100%; }
    .company-card .d-flex { align-items: flex-start; }
    .table > :not(caption) > * > * { padding: .8rem; }
    .login-form-panel { padding: 1.25rem; }
    .login-card { padding: 1.5rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
.workday-clock { display: grid; justify-items: center; gap: .35rem; margin-bottom: 1rem; padding: 1.25rem; color: var(--tho-white); background: var(--tho-black); border-radius: var(--tho-radius); border-top: 3px solid var(--tho-red); }
.workday-clock__time { font-size: clamp(2rem, 6vw, 3.5rem); font-weight: 800; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.workday-clock small { color: #d6d7da; }
.workday-clock__facts { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; color: #d6d7da; text-align: center; }
.workday-clock__facts strong { color: var(--tho-white); font-variant-numeric: tabular-nums; }
.dashboard-workday { display: grid; gap: .15rem; margin-top: .65rem; padding: .65rem .75rem; color: var(--tho-black); background: var(--tho-gray-50); border-left: 3px solid var(--tho-red); border-radius: .5rem; }
.dashboard-workday strong, .dashboard-workday [data-workday-over] { font-variant-numeric: tabular-nums; }
.dashboard-workday__state { color: var(--tho-red-dark); font-size: .72rem; font-weight: 800; letter-spacing: .04em; }
.time-value { white-space: nowrap; font-variant-numeric: tabular-nums; }
.summary-table th, .summary-table td { min-width: 7.5rem; }
.summary-table th:first-child, .summary-table td:first-child { min-width: 13rem; }
.summary-table th:last-child, .summary-table td:last-child { min-width: 11rem; }
.overtime-facts span, .overtime-facts small { display: block; color: var(--tho-gray-500); }
.overtime-facts strong { display: block; margin-top: .15rem; }
.overtime-detected { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; background: #fff4d6; border-left: 4px solid #d89b00; border-radius: .5rem; }
.overtime-detected strong { font-size: 1.5rem; }
.overtime-preview { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .75rem; }
.overtime-preview div { display: grid; gap: .2rem; padding: .75rem; background: var(--tho-gray-50); border-radius: .5rem; }
.overtime-preview span { color: var(--tho-gray-500); font-size: .85rem; }
@media (max-width: 575.98px) { .overtime-preview { grid-template-columns: 1fr; } .workday-clock__facts { display: grid; } }


/* RH: panel diario compacto y selector reutilizable de empleados */
.rh-dashboard-grid > [class*="col-"] { display: flex; }
.rh-status-card { display: flex; width: 100%; height: 27rem; min-height: 0; overflow: hidden; flex-direction: column; }
.rh-status-card__header { display: flex; flex: 0 0 auto; align-items: center; justify-content: space-between; gap: .75rem; padding: 1rem 1rem .8rem; border-bottom: 1px solid var(--tho-gray-200); background: var(--tho-white); }
.rh-status-card__list { min-height: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #b8bdc5 transparent; scrollbar-width: thin; }
.rh-status-card__list:focus-visible { outline: 3px solid rgba(217,39,53,.24); outline-offset: -3px; }
.rh-status-card__empty { margin: 0; padding: 1.25rem 1rem; color: var(--tho-gray-500); }
.rh-employee-row { display: grid; min-height: 4.7rem; padding: .85rem 1rem; color: var(--tho-black); text-decoration: none; border-bottom: 1px solid var(--tho-gray-200); transition: background-color .15s ease, box-shadow .15s ease; }
.rh-employee-row:last-child { border-bottom: 0; }
.rh-employee-row:hover, .rh-employee-row:focus-visible { color: var(--tho-black); background: var(--tho-gray-50); box-shadow: inset 3px 0 var(--tho-red); }
.rh-employee-row__identity { display: grid; min-width: 0; gap: .18rem; }
.rh-employee-row__identity strong { overflow: hidden; font-size: .95rem; text-overflow: ellipsis; white-space: nowrap; }
.rh-employee-row__identity small { overflow: hidden; color: var(--tho-gray-500); text-overflow: ellipsis; white-space: nowrap; }
.rh-employee-row--active { grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: .75rem; }
.rh-row-timer.dashboard-workday { justify-items: end; min-width: 9.2rem; margin: 0; padding: 0; text-align: right; background: transparent; border: 0; border-radius: 0; }
.rh-row-timer > strong { font-family: var(--bs-font-monospace); font-size: .96rem; letter-spacing: .02em; white-space: nowrap; }
.rh-row-timer [data-workday-over] { color: var(--tho-red-dark); font-size: .74rem; white-space: nowrap; }
.rh-employee-row__badge { justify-self: start; margin-top: .4rem; padding: .22rem .5rem; color: var(--tho-red-dark); font-size: .72rem; font-weight: 800; letter-spacing: .035em; background: #fce8ea; border-radius: 999px; }
.rh-finalized-indicator { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .8rem 1rem; border: 1px solid var(--tho-gray-200); border-left: 4px solid var(--tho-black); border-radius: var(--tho-radius-sm); background: var(--tho-white); }
.rh-finalized-indicator span { color: var(--tho-gray-500); font-weight: 650; }
.rh-finalized-indicator strong { font-size: 1.45rem; font-variant-numeric: tabular-nums; }

.rh-filter-grid { display: grid; align-items: end; gap: .85rem; margin-bottom: 1.3rem; padding: 1rem; border: 1px solid var(--tho-gray-200); border-radius: var(--tho-radius); background: var(--tho-white); }
.rh-filter-grid--daily { grid-template-columns: minmax(150px,.8fr) minmax(190px,1fr) minmax(280px,1.6fr) auto; }
.rh-filter-grid--summary { grid-template-columns: minmax(145px,.8fr) minmax(145px,.8fr) minmax(190px,1fr) minmax(280px,1.7fr) auto; }
.rh-filter-grid__action { padding-bottom: 1.45rem; }
.employee-picker { position: relative; min-width: 0; }
.employee-picker__control { position: relative; }
.employee-picker__input { padding-right: 2.4rem; }
.employee-picker__clear { position: absolute; top: 50%; right: .7rem; z-index: 2; width: 1.65rem; height: 1.65rem; padding: 0; color: var(--tho-gray-500); font-size: 1.25rem; line-height: 1; border: 0; border-radius: 50%; background: transparent; transform: translateY(-50%); }
.employee-picker__clear:hover, .employee-picker__clear:focus-visible { color: var(--tho-red-dark); background: #fce8ea; }
.employee-picker__results { position: absolute; top: calc(100% + .35rem); right: 0; left: 0; z-index: 1080; max-height: 18rem; overflow-y: auto; border: 1px solid var(--tho-gray-200); border-radius: var(--tho-radius-sm); background: var(--tho-white); box-shadow: var(--tho-shadow); }
.employee-picker__option { display: grid; width: 100%; gap: .15rem; padding: .7rem .8rem; color: var(--tho-black); text-align: left; border: 0; border-bottom: 1px solid var(--tho-gray-200); background: var(--tho-white); }
.employee-picker__option:last-child { border-bottom: 0; }
.employee-picker__option:hover, .employee-picker__option:focus-visible, .employee-picker__option.is-active { outline: 0; background: var(--tho-gray-50); box-shadow: inset 3px 0 var(--tho-red); }
.employee-picker__option span { color: var(--tho-gray-500); font-size: .82rem; }
.employee-picker__empty { padding: .85rem; color: var(--tho-gray-500); }
.employee-picker__status { min-height: 1.15rem; margin-top: .3rem; }
.summary-table td:last-child { vertical-align: middle; }
.summary-table td:last-child .btn { margin-right: .35rem; white-space: nowrap; }
.summary-table .time-value { white-space: nowrap; }

@media (max-width: 1199.98px) {
    .rh-filter-grid--summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .rh-filter-grid--summary .employee-picker { grid-column: 1 / -1; }
    .rh-filter-grid__action { padding-bottom: 0; }
}

/* Tráfico · operación real de viajes */
.traffic-trip-actions{display:flex;gap:.75rem;flex-wrap:wrap;margin-bottom:1.25rem}.traffic-operation-list,.traffic-role-picker{display:grid;gap:.65rem}.traffic-operation-row,.traffic-role-option{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding:.8rem 1rem;border:1px solid #e1e3e7;border-radius:.7rem;color:inherit;text-decoration:none;background:#fff}.traffic-operation-row span,.traffic-role-option span,.traffic-role-option small{display:block;color:#666}.traffic-role-option__time{font:700 1.2rem ui-monospace,SFMono-Regular,Consolas,monospace;color:#b61622;min-width:4.5rem}
.traffic-trip-form{display:grid;gap:1rem}.traffic-trip-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem}.traffic-trip-grid label,.traffic-trip-form>label{display:grid;gap:.35rem}.traffic-trip-grid label>span,.traffic-trip-form>label>span,.traffic-trip-tariff>span{font-weight:700;font-size:.86rem}.traffic-trip-tariff{display:grid;align-content:center;gap:.35rem;padding:.55rem .75rem;background:#f4f5f7;border-radius:.55rem}.traffic-trip-tariff strong{font-size:1.15rem}
.trip-action-panel{display:grid;gap:.9rem;padding:1rem;border:1px solid #e1e3e7;border-radius:.7rem;background:#fafafa}.trip-action-panel__buttons,.trip-detail-actions__buttons{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.trip-action-panel .form-hint{margin:0;line-height:1.5;max-width:48rem}.trip-detail-actions{display:flex;align-items:center;justify-content:space-between;gap:1.5rem;margin-bottom:1rem}.trip-detail-actions h2,.trip-detail-actions p{margin-bottom:.35rem}.traffic-cancel-summary,.traffic-cancel-form{display:grid;gap:1rem;margin-bottom:1rem}.traffic-cancel-form>label{display:grid;gap:.4rem}.traffic-trip-live--cancelled{border-color:#e3b9bc;background:#fff8f8}.status-pill-cancelled{background:#eee;color:#5d2025}.traffic-trip-row--cancelled{color:#6b6b6b;background:#faf7f7}.trip-history{display:grid;gap:1rem;margin:0;padding:0;list-style:none}.trip-history>li{display:grid;grid-template-columns:9rem 1fr;gap:1rem;padding:1rem;border-left:3px solid #b61622;background:#f7f7f8;border-radius:0 .55rem .55rem 0}.trip-history time{font-weight:700}.trip-history span{display:block;color:#666}.trip-history ul{margin:.55rem 0;padding-left:1.15rem}.trip-history p{margin:.55rem 0 0}
.traffic-trip-live{display:flex;justify-content:space-between;align-items:center;gap:1.5rem;margin-bottom:1rem}.traffic-trip-clock{display:grid;text-align:right}.traffic-trip-clock span{font-size:.8rem;color:#666;text-transform:uppercase;letter-spacing:.04em}.traffic-trip-clock strong{font:800 2rem ui-monospace,SFMono-Regular,Consolas,monospace;color:#b61622}.traffic-trip-detail{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1rem;margin:0}.traffic-trip-detail div{padding:.75rem;background:#f7f7f8;border-radius:.55rem}.traffic-trip-detail dt{font-size:.78rem;color:#666;text-transform:uppercase}.traffic-trip-detail dd{margin:.25rem 0 0;font-weight:700;overflow-wrap:anywhere}.traffic-trip-detail__wide{grid-column:span 2}.day-navigation{display:flex;align-items:center;gap:.6rem;flex-wrap:wrap;margin-bottom:1rem}.filter-toolbar--wide{grid-template-columns:repeat(4,minmax(10rem,1fr));align-items:end}
@media(max-width:1100px){.traffic-trip-grid,.traffic-trip-detail{grid-template-columns:1fr 1fr}.filter-toolbar--wide{grid-template-columns:repeat(3,minmax(10rem,1fr))}}
@media(max-width:600px){.traffic-trip-grid,.traffic-trip-detail,.filter-toolbar--wide{grid-template-columns:1fr}.traffic-trip-live,.traffic-role-option,.trip-detail-actions{align-items:stretch;flex-direction:column}.traffic-trip-clock{text-align:left}.traffic-trip-detail__wide{grid-column:auto}.traffic-trip-actions .btn,.trip-action-panel__buttons .btn,.trip-detail-actions__buttons .btn{width:100%}.trip-action-panel__buttons,.trip-detail-actions__buttons{display:grid}.trip-history>li{grid-template-columns:1fr}.day-navigation .btn{flex:1 1 auto}}
@media (max-width: 991.98px) {
    .rh-filter-grid--daily { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .rh-filter-grid--daily .employee-picker { grid-column: 1 / -1; }
    .rh-status-card { height: 25rem; }
}
@media (max-width: 575.98px) {
    .rh-dashboard-filters, .rh-filter-grid--daily, .rh-filter-grid--summary { grid-template-columns: 1fr; }
    .rh-filter-grid--daily .employee-picker, .rh-filter-grid--summary .employee-picker { grid-column: auto; }
    .rh-filter-grid__action .btn { width: 100%; }
    .rh-status-card { height: min(24rem,68vh); }
    .rh-employee-row--active { grid-template-columns: 1fr; }
    .rh-row-timer.dashboard-workday { justify-items: start; min-width: 0; text-align: left; }
}

/* Rol de viajes: captura compacta y reutilizable para operación */
.traffic-role-filters { align-items: flex-end; }
.traffic-capture, .traffic-role-list { margin-bottom: 1.25rem; padding: 1.25rem; }
.traffic-capture__heading, .traffic-role-list__heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.traffic-capture__heading h2, .traffic-role-list__heading h2 { margin: .15rem 0 0; font-size: 1.25rem; }
/* Choose columns by the actual card width, including enlarged text. */
.traffic-capture { container-type: inline-size; }
.traffic-capture__grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1rem; align-items: start; }
.traffic-capture__grid > div { min-width: 0; }
@container (min-width: 71rem) {
    .traffic-capture__grid { grid-template-columns: minmax(10rem,.75fr) minmax(8rem,.45fr) repeat(4,minmax(12rem,1fr)); }
}
.traffic-capture__grid .form-select, .traffic-capture__grid .form-control { min-height: 46px; }
.traffic-capture__grid .form-text { display: block; margin-top: .35rem; }
.traffic-tariff { grid-column: span 3; display: grid; grid-template-columns: minmax(11rem,.8fr) minmax(12rem,1fr); gap: .35rem 1rem; min-height: 78px; padding: .8rem 1rem; border: 1px solid var(--tho-gray-200); border-radius: var(--tho-radius-sm); background: var(--tho-gray-50); }
.traffic-tariff span, .traffic-tariff small { display: block; }
.traffic-tariff strong { display: block; margin: .15rem 0; font-size: 1.15rem; }
.traffic-tariff > small { grid-column: 1 / -1; }
.traffic-tariff__applied .form-label { margin-bottom: .25rem; }
.traffic-tariff__adjusted, .traffic-adjusted-label { color: #8a6100 !important; font-weight: 700; }
.traffic-capture__action { grid-column: span 3; display: flex; justify-content: flex-end; align-self: end; }
.traffic-capture__action .btn { min-height: 46px; min-width: 10rem; }


.traffic-role-table { min-width: 68rem; margin-bottom: 0; }
.traffic-role-table th { white-space: nowrap; }

.traffic-role-table td > small { display: block; color: var(--tho-gray-500); }
.traffic-warning { display: block; width: max-content; margin-top: .3rem; padding: .15rem .45rem; border-radius: 999px; background: #fff2cc; color: #725500; font-size: .72rem; font-weight: 700; }
.traffic-delete { position: relative; }
.traffic-delete > summary { list-style: none; cursor: pointer; }
.traffic-delete > summary::-webkit-details-marker { display: none; }
.traffic-delete form { width: min(18rem,80vw); margin-top: .5rem; padding: 1rem; border: 1px solid var(--tho-gray-200); border-radius: var(--tho-radius-sm); background: var(--tho-white); box-shadow: var(--tho-shadow-sm); }
.traffic-delete form p { margin: 0 0 .75rem; color: var(--tho-gray-900); font-weight: 700; }
.traffic-delete__actions { display: flex; justify-content: flex-end; gap: .5rem; }
.rh-week-nav { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
.rh-week-nav__period { min-width: 15rem; padding: .55rem 1rem; text-align: center; border: 1px solid var(--tho-gray-200); border-radius: var(--tho-radius-sm); background: var(--tho-white); }
.rh-week-nav__period span, .rh-week-nav__period strong { display: block; }
.rh-week-nav__period span { color: var(--tho-gray-500); font-size: .72rem; font-weight: 800; letter-spacing: .08em; }
.rh-week-archive { gap: 1rem; }
.rh-week-archive__heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.rh-week-archive__metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: .75rem; }
.rh-week-archive__metrics span { padding: .7rem; border-radius: var(--tho-radius-sm); background: var(--tho-gray-50); text-align: center; }
.rh-week-archive__metrics strong { display: block; font-size: 1.25rem; }
.rh-week-archive--done { display: flex; flex-direction: row; align-items: center; justify-content: space-between; }
.rh-purge-confirm > summary { list-style: none; width: max-content; cursor: pointer; }
.rh-purge-confirm > summary::-webkit-details-marker { display: none; }
@media (max-width: 1199.98px) {
    .traffic-capture__grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
    .traffic-tariff, .traffic-capture__action { grid-column: span 3; }
}
@media (max-width: 767.98px) {
    .traffic-capture__heading, .traffic-role-list__heading { align-items: flex-start; flex-direction: column; }
    .traffic-capture__grid { grid-template-columns: minmax(0,1fr); }
    .traffic-tariff, .traffic-capture__action { grid-column: auto; }
    .traffic-capture__action .btn { width: 100%; }
    .traffic-role-filters .filter-action { width: 100%; }
    .traffic-tariff { grid-template-columns: minmax(0,1fr); }

    .rh-week-nav { display: grid; grid-template-columns: 1fr 1fr; }
    .rh-week-nav__period { grid-column: 1 / -1; grid-row: 1; min-width: 0; }
    .rh-week-nav .btn { width: 100%; }
    .rh-week-archive__metrics { grid-template-columns: 1fr 1fr; }
    .rh-week-archive--done { align-items: stretch; flex-direction: column; }
}

.rh-filter-grid > *, .rh-dashboard-filters > * { min-width: 0; }
.rh-filter-grid .form-control, .rh-filter-grid .form-select, .rh-dashboard-filters .form-control, .rh-dashboard-filters .form-select { width: 100%; min-width: 0; }

/* Barra de filtros reutilizable */
.filter-toolbar { display: flex; width: 100%; min-width: 0; align-items: flex-end; flex-wrap: wrap; gap: .75rem; margin-bottom: 1.3rem; }
.filter-toolbar--dashboard { width: fit-content; max-width: 100%; }
.filter-toolbar--surface { padding: 1rem; border: 1px solid var(--tho-gray-200); border-radius: var(--tho-radius); background: var(--tho-white); }
.filter-field { min-width: 0; flex: 0 1 auto; }
.filter-field--date { flex-basis: 10rem; width: 10rem; }
.filter-field--company { flex-basis: 15rem; width: 15rem; max-width: min(20rem, 100%); }
.filter-field--employee { flex: 1 1 18rem; min-width: 16rem; }
.filter-field .form-control, .filter-field .form-select { width: 100%; min-width: 0; height: 46px; }
.filter-field--company .form-select { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-action { flex: 0 0 auto; min-width: 7.75rem; }
.filter-action .btn { display: inline-flex; width: 100%; min-width: 7.75rem; min-height: 46px; align-items: center; justify-content: center; padding: .625rem 1.25rem; white-space: nowrap; }
.filter-toolbar--daily, .filter-toolbar--summary { align-items: flex-start; }
.filter-toolbar--daily .filter-action, .filter-toolbar--summary .filter-action { margin-top: 1.875rem; margin-bottom: 0; }

@media (max-width: 1199.98px) {
    .filter-toolbar--summary .filter-field--employee { flex-basis: 100%; order: 5; }
    .filter-toolbar--summary .filter-action { order: 6; }
}
@media (max-width: 991.98px) {
    .filter-toolbar--daily .filter-field--employee { flex-basis: 100%; order: 5; }
    .filter-toolbar--daily .filter-action { order: 6; }
}
@media (max-width: 575.98px) {
    .filter-toolbar { display: grid; grid-template-columns: minmax(0, 1fr); }
    .filter-toolbar--dashboard { width: 100%; }
    .filter-field, .filter-field--date, .filter-field--company, .filter-field--employee { width: 100%; max-width: none; min-width: 0; }
    .filter-action { width: 100%; min-width: 0; margin-top: 0 !important; margin-bottom: 0 !important; }
    .filter-action .btn { width: 100%; }
}

/* Horas de empleados: monitor semanal reutilizable */
.employee-hours-monitor{display:grid;gap:.8rem}.employee-hours-updated{color:var(--tho-gray-500);font-size:.82rem;font-variant-numeric:tabular-nums}.employee-hours-table{min-width:74rem;margin:0}.employee-hours-row--warning{background:#fffaf0}.employee-hours-row--critical,.employee-hours-row--completed{background:#fff5f5}.employee-hours-status{display:inline-flex;min-width:6.2rem;align-items:center;justify-content:center;padding:.25rem .55rem;border-radius:999px;font-size:.72rem;font-weight:800;letter-spacing:.035em}.employee-hours-status--normal{color:#31543a;background:#eaf4ec}.employee-hours-status--warning{color:#765600;background:#fff0bd}.employee-hours-status--critical,.employee-hours-status--completed{color:#8a1e27;background:#f9dfe2}.employee-hours-primary{font-size:1rem;font-weight:800;font-variant-numeric:tabular-nums}.employee-hours-archive{display:flex;align-items:center;gap:.75rem;flex-wrap:wrap}.employee-hours-archive span{flex:1 1 24rem}.employee-hours-message{min-height:1.2rem;margin:0;color:#8a1e27}@media(max-width:600px){.employee-hours-table{min-width:58rem}.employee-hours-table th:nth-child(3),.employee-hours-table td:nth-child(3),.employee-hours-table th:nth-child(4),.employee-hours-table td:nth-child(4),.employee-hours-table th:nth-child(5),.employee-hours-table td:nth-child(5),.employee-hours-table th:nth-child(8),.employee-hours-table td:nth-child(8){display:none}.employee-hours-table{min-width:38rem}.employee-hours-archive{align-items:stretch;flex-direction:column}.employee-hours-archive .btn{width:100%}}

.employee-hours-table{width:100%;min-width:60rem}.employee-hours-table thead th{white-space:normal;line-height:1.35}.employee-hours-table td:nth-child(2){min-width:9rem}.employee-hours-table td:nth-child(3){min-width:5rem}@media(max-width:600px){.employee-hours-table{min-width:38rem}.employee-hours-table td:nth-child(2){min-width:9rem}}

/* Shared operational viewport: natural height for short lists; scroll for long lists. */
:root { --tho-operational-list-max-height: 30rem; }
.operational-scroll-container {
    max-height: var(--tho-operational-list-max-height);
    min-width: 0;
    overflow: auto;
    overscroll-behavior: contain;
    overflow-anchor: none;
    scroll-padding-block: 4rem .5rem;
    border: 1px solid var(--tho-gray-200);
    border-radius: var(--tho-radius-sm);
}
.operational-scroll-container:focus-visible {
    outline: 3px solid var(--tho-red);
    outline-offset: 2px;
}
.operational-scroll-container > table { margin-bottom: 0; }
.operational-scroll-container > table > thead > tr > th {
    position: sticky;
    top: 0;
    z-index: 2;
    background: var(--tho-white);
    box-shadow: 0 1px 0 var(--tho-gray-200);
}
.operational-scroll-container--list {
    overflow-x: hidden;
    padding: .35rem;
    border: 0;
}
.operational-scroll-container--list > * { min-width: 0; padding: .65rem .85rem; line-height: 1.4; }
.operational-scroll-container--list .traffic-operation-row,
.operational-scroll-container--list .traffic-role-option { overflow-wrap: anywhere; }
.operational-scroll-container--list a:focus-visible {
    outline: 3px solid var(--tho-red);
    outline-offset: -3px;
}
@media (max-width: 600px) {
    .operational-scroll-container { max-height: min(var(--tho-operational-list-max-height), 65vh); }
}
.operational-scroll-container > table > tbody > tr > td { padding: .65rem; }
.operational-scroll-container > table > thead > tr > th { padding: .65rem; }

.operational-table--wide { min-width: 80rem; }
.operational-scroll-container .status-pill { white-space: nowrap; }

.operational-table--wide td { white-space: nowrap; }


/* Operational dashboard components. No overrides of existing module components. */
.dashboard-icon{width:1.25rem;height:1.25rem;flex:none;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.traffic-dashboard{--dashboard-gap:1rem;--dashboard-border:var(--tho-border-soft);--dashboard-muted:#636a75}
.dashboard-context{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:1.5rem;align-items:center;background:var(--tho-surface);border:1px solid var(--dashboard-border);border-top:3px solid var(--tho-red,#d92735);border-radius:var(--tho-radius-lg);padding:.85rem 1.25rem;box-shadow:var(--tho-shadow-inset),var(--tho-shadow-sm)}
.dashboard-context .eyebrow{font-size:.65rem;letter-spacing:.11em;margin:0;line-height:1.25}.dashboard-context h1{font-size:1.65rem;line-height:1.2;margin:.2rem 0 .35rem;letter-spacing:-.035em}
.dashboard-context__date{display:flex;align-items:center;gap:.45rem;font-size:.8rem;font-weight:750;letter-spacing:.035em}.dashboard-context__date svg{width:1rem;height:1rem;color:var(--tho-red,#d92735)}
.dashboard-context__copy p{font-size:.75rem;color:var(--dashboard-muted);margin:.25rem 0 0}.dashboard-context__controls{display:grid;gap:.75rem}
.dashboard-context__filter{margin:0;gap:.65rem;align-items:end}.dashboard-context__filter .filter-field--company{flex:0 1 15rem;min-width:0}.dashboard-context__filter .form-label{font-size:.72rem;margin-bottom:.3rem}
.dashboard-context__filter .form-select,.dashboard-context__filter .btn{min-height:2.65rem;font-size:.8rem}.dashboard-context__filter .btn{min-width:6.5rem}
.dashboard-live{display:flex;justify-content:flex-end;align-items:center;flex-wrap:wrap;gap:.65rem;color:var(--dashboard-muted);font-size:.68rem}
.dashboard-live__label{display:inline-flex;align-items:center;gap:.4rem;font-weight:750;letter-spacing:.06em;color:#365c47}.dashboard-live__label:before{content:"";width:.4rem;height:.4rem;border-radius:50%;background:#397153}
.dashboard-live--pending .dashboard-live__label{color:#766020}.dashboard-live--pending .dashboard-live__label:before{background:#9c7d2a}
.dashboard-kpis{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--dashboard-gap);margin:1rem 0}
.dashboard-kpi{display:flex;align-items:center;gap:.75rem;padding:.8rem 1rem;border:1px solid var(--dashboard-border);border-radius:var(--tho-radius);background:var(--tho-surface);color:#222;text-decoration:none;box-shadow:var(--tho-shadow-inset),var(--tho-shadow-sm);transition:border-color var(--tho-duration) var(--tho-ease),box-shadow var(--tho-duration) var(--tho-ease)}
.dashboard-kpi__icon{display:flex;align-items:center;justify-content:center;width:2.5rem;height:2.5rem;flex:none;border-radius:.65rem;background:#f5f6f8;color:#4a515b}
.dashboard-kpi:first-child .dashboard-kpi__icon{background:#fdf0f1;color:var(--tho-red,#d92735)}.dashboard-kpi__copy{min-width:0;flex:1}
.dashboard-kpi__title{display:block;font-size:.74rem;font-weight:750;line-height:1.35}.dashboard-kpi__description{display:block;font-size:.67rem;color:var(--dashboard-muted);margin-top:.25rem;line-height:1.4}
.dashboard-kpi strong{font-size:2rem;line-height:1;font-weight:750;letter-spacing:-.05em;font-variant-numeric:tabular-nums}
.dashboard-kpi:hover{border-color:#c7ccd4;color:#111;box-shadow:0 4px 16px rgba(18,24,35,.05)}
.dashboard-panel{min-width:0;background:var(--tho-surface);border:1px solid var(--dashboard-border);border-radius:var(--tho-radius-lg);box-shadow:var(--tho-shadow-sm)}
.dashboard-panel-header{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.75rem;padding:.8rem 1.1rem;border-bottom:1px solid #eceef2}
.dashboard-panel-header h2{font-size:.95rem;font-weight:750;margin:0;letter-spacing:-.015em}.dashboard-panel-header .eyebrow{font-size:.58rem;letter-spacing:.09em;margin:0 0 .2rem;line-height:1.25}
.dashboard-panel-header a{font-size:.7rem;color:#4a515b;white-space:nowrap;text-underline-offset:.2rem}
.dashboard-panel-header__title{display:flex;align-items:center;gap:.65rem;min-width:0}.dashboard-panel-header__title>.dashboard-icon{color:#535b66}
.dashboard-panel-header p{font-size:.65rem;color:var(--dashboard-muted);margin:.3rem 0 0}
.dashboard-operation__links{display:flex;align-items:center;flex-wrap:wrap;gap:1rem}.traffic-dashboard-secondary{font-size:.65rem;color:var(--dashboard-muted);margin:0}
.dashboard-operation__columns{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.75rem;padding:.75rem}
.dashboard-lane{min-width:0;align-self:start;border:1px solid #e9ecf0;border-radius:.6rem;background:#fff;overflow:hidden}
.dashboard-lane__header{display:flex;align-items:center;gap:.5rem;padding:.6rem .75rem;background:#f7f8fa;border-bottom:1px solid #e9ecf0}
.dashboard-lane__header>.dashboard-icon{width:1rem;height:1rem;color:#69717d}.dashboard-lane__header h3{font-size:.75rem;font-weight:750;margin:0}.dashboard-lane__header span{display:block;font-size:.6rem;color:var(--dashboard-muted);margin-top:.2rem}
.traffic-dashboard-list{--tho-operational-list-max-height:23rem;overflow-x:hidden;border:0;border-radius:0;scrollbar-width:thin}
.dashboard-support{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--dashboard-gap);margin-top:1rem;align-items:start}
.dashboard-support__panel{min-width:0;min-height:0}
.dashboard-support .traffic-dashboard-list{--tho-operational-list-max-height:22rem;max-height:min(var(--tho-operational-list-max-height),55vh);min-height:0;overflow-y:auto;overflow-x:hidden;border-radius:0 0 .875rem .875rem}
.operational-row{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:.7rem;min-height:3.65rem;padding:.65rem .8rem;border-bottom:1px solid #eceef2;color:#222;text-decoration:none}
.operational-row:last-child{border-bottom:0}.operational-row__copy{min-width:0}.operational-row__copy>strong{display:flex;align-items:center;gap:.5rem;line-height:1.3}
.operational-row__copy>span{display:block;font-size:.67rem;color:var(--dashboard-muted);line-height:1.45;margin-top:.2rem;overflow-wrap:anywhere}
.operational-row__name{font-size:.83rem;font-weight:700;overflow-wrap:anywhere}.operational-row__unit{flex:none;font-size:1rem;font-weight:800;letter-spacing:-.025em;border-right:1px solid #dfe3e9;padding-right:.5rem;font-variant-numeric:tabular-nums}
.operational-row__meta{display:flex;align-items:flex-end;flex-direction:column;gap:.2rem;min-width:0;text-align:right}
.operational-row__meta>strong{font-size:.78rem;font-weight:750;font-variant-numeric:tabular-nums}.operational-row__meta>span{font-size:.62rem;line-height:1.4}
.operational-row--trip{grid-template-columns:minmax(0,1fr);gap:.2rem;min-height:4.2rem;padding:.35rem .75rem;line-height:1.25}
.operational-row--trip .operational-row__meta{flex-direction:row;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:.25rem .4rem}
.traffic-dashboard-clock{font-family:ui-monospace,Consolas,monospace;white-space:nowrap;letter-spacing:.015em}.operational-row--trip .traffic-dashboard-clock{font-size:.86rem}
.operational-row__schedule{color:var(--dashboard-muted);margin-left:auto}
.operational-status{display:inline-flex;align-items:center;padding:.15rem .4rem;border-radius:.35rem;font-size:.62rem!important;font-weight:750;letter-spacing:.025em;background:#eff1f4;color:#4c5460;white-space:nowrap}
.operational-status--waiting{background:#fdf0f1;color:#a0212d}.operational-status--progress{background:#eceff3;color:#333e4b}
.operational-row--available .operational-row__copy>strong:before{content:"";width:.35rem;height:.35rem;border-radius:50%;background:#397153;flex:none}
.traffic-dashboard-available{color:#365c47;font-size:.65rem!important;font-weight:650!important}
.operational-row--available-trip{grid-template-columns:minmax(0,1fr);gap:.2rem}.operational-row--available-trip .operational-row__meta{align-items:flex-start;text-align:left}.operational-row--available-trip a{color:#365c47;text-decoration:underline;text-underline-offset:.15em}.operational-row--available-trip a:focus-visible{outline:3px solid var(--tho-red,#d92735);outline-offset:2px}
@media(min-width:701px) and (max-width:1200px){.dashboard-support{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-support__panel:nth-child(3){grid-column:1/-1}}
a.operational-row:hover{background:#fafbfc;color:#111}.operational-row:focus-visible,.dashboard-kpi:focus-visible{outline:3px solid var(--tho-red,#d92735);outline-offset:-3px}
.dashboard-empty{display:flex;align-items:center;gap:.5rem;min-height:3.65rem;padding:.8rem;color:#68717c}.dashboard-empty>.dashboard-icon{width:1rem;height:1rem;color:#8d96a2}.dashboard-empty p{font-size:.7rem;line-height:1.5;margin:0}
.dashboard-update-message{font-size:.72rem;color:#6c6149;line-height:1.5;margin:.6rem .1rem 0}.dashboard-update-message:empty{display:none}
@media(max-width:1200px){.dashboard-context{grid-template-columns:1fr;gap:.85rem}.dashboard-context__controls{grid-template-columns:minmax(0,1fr) auto;align-items:end}.dashboard-context__filter{grid-column:1;grid-row:1}.dashboard-live{grid-column:2;grid-row:1;flex-direction:column;align-items:flex-end;gap:.2rem}.dashboard-kpi{gap:.5rem;padding:.85rem}.dashboard-kpi__icon{width:2rem;height:2rem}.dashboard-kpi__description{font-size:.6rem}.dashboard-kpi strong{font-size:1.6rem}.dashboard-operation__columns{grid-template-columns:1fr 1fr}.dashboard-lane:last-child{grid-column:1/-1}.dashboard-lane:last-child [data-dashboard-list]{display:block}}
@media(max-width:700px){.dashboard-context{padding:1rem}.dashboard-context__controls{display:flex;flex-direction:column;align-items:stretch}.dashboard-live{flex-direction:row;justify-content:flex-start;align-items:center;gap:.5rem}.dashboard-context h1{font-size:1.5rem}.dashboard-context__filter{width:100%;margin:0}.dashboard-context__filter .filter-field--company{flex:1 1 auto;width:100%}.dashboard-kpis{gap:.5rem}.dashboard-kpi{flex-direction:column;align-items:flex-start;position:relative;padding:.65rem;gap:.4rem;min-height:7.1rem}.dashboard-kpi__icon{width:1.6rem;height:1.6rem;border-radius:.4rem}.dashboard-kpi__icon svg{width:1rem;height:1rem}.dashboard-kpi strong{position:absolute;top:.45rem;right:.65rem;font-size:1.55rem}.dashboard-kpi__title{font-size:.7rem}.dashboard-kpi__description{font-size:.62rem;line-height:1.35}.dashboard-operation__columns,.dashboard-support{grid-template-columns:1fr}.dashboard-lane:last-child{grid-column:auto}.dashboard-panel-header{padding:.85rem .9rem}.dashboard-operation__links{gap:.7rem}.traffic-dashboard-list,.dashboard-support .traffic-dashboard-list{max-height:min(var(--tho-operational-list-max-height),55vh)}.dashboard-support .dashboard-panel-header{align-items:flex-start}.operational-row__meta{max-width:45vw}}
@media(prefers-reduced-motion:reduce){.dashboard-kpi{transition:none}}


@media(min-width:1201px){.dashboard-context{padding:.7rem 1.25rem}.dashboard-context__controls{gap:.4rem}.dashboard-kpis{margin:.75rem 0}.dashboard-kpi{padding:.65rem 1rem}.dashboard-panel-header{padding:.65rem 1.1rem}.dashboard-operation__heading .eyebrow{display:none}}

/* Trip title must shrink inside the heading when text is enlarged. */
.trip-detail-heading > div { min-width: 0; max-width: 100%; }
.trip-detail-heading h1 { overflow-wrap: anywhere; }

/* GPS alert and trip detail scopes; existing Dashboard KPI styles stay intact. */
[data-gps-alerts] .gps-alert-freshness{display:flex;flex-wrap:wrap;gap:.4rem 1rem;margin:0;padding:.3rem 1rem .65rem;font-size:.78rem}
[data-gps-alerts] .gps-alert-freshness--stale{font-weight:700}
[data-gps-alerts] .gps-alert-table{table-layout:fixed;margin-bottom:0}
[data-gps-alerts] .gps-alert-table th,[data-gps-alerts] .gps-alert-table td{overflow-wrap:anywhere}
[data-gps-alerts] .gps-alert-table th:first-child{width:18%}[data-gps-alerts] .gps-alert-table th:nth-child(2){width:16%}[data-gps-alerts] .gps-alert-table th:nth-child(3){width:26%}[data-gps-alerts] .gps-alert-table th:nth-child(4){width:25%}[data-gps-alerts] .gps-alert-table th:last-child{width:15%}
[data-gps-alerts] .gps-alert-table .btn{white-space:nowrap}
.trip-detail-page .panel-card{margin-bottom:1rem;min-width:0}
.trip-detail-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;align-items:start}
.trip-detail-page .trip-detail-fields{grid-template-columns:repeat(2,minmax(0,1fr));gap:.65rem}
.trip-detail-page .trip-detail-fields>div,.trip-gps-panel .trip-gps-fields>div{padding:.65rem .75rem}
.trip-detail-page .trip-detail-notes{font-weight:400;line-height:1.55}
.trip-detail-page .trip-detail-security-times{margin-bottom:1.2rem}
.trip-gps-panel .trip-gps-group+.trip-gps-group{margin-top:1.1rem;padding-top:1rem;border-top:1px solid #e1e3e7}
.trip-gps-panel .trip-gps-group h3{font-size:.95rem;margin:0 0 .65rem}
.trip-gps-panel .trip-gps-fields{grid-template-columns:repeat(3,minmax(0,1fr));gap:.65rem}
.trip-gps-panel .trip-gps-fields dt{line-height:1.45}.trip-gps-panel .trip-gps-fields dd{font-size:.9rem;line-height:1.5}
.trip-gps-panel .trip-gps-history{padding:.7rem 0;border-top:1px solid #e1e3e7}.trip-gps-panel .trip-gps-history summary{font-weight:600;cursor:pointer}
.trip-gps-panel .trip-gps-history[open]>div,.trip-gps-panel .trip-gps-history[open]>p{margin-top:.75rem}
@media(max-width:1100px){.trip-detail-columns{grid-template-columns:1fr}.trip-gps-panel .trip-gps-fields{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:767px){[data-gps-alerts] .gps-alert-table th:first-child{width:28%}[data-gps-alerts] .gps-alert-table th:nth-child(3){width:44%}[data-gps-alerts] .gps-alert-table th:last-child{width:28%}}
@media(max-width:600px){.trip-detail-page .trip-detail-fields,.trip-gps-panel .trip-gps-fields{grid-template-columns:1fr}.trip-detail-page .traffic-trip-detail__wide{grid-column:auto}}

.trip-services{grid-column:1/-1;min-width:0;margin:1rem 0}.trip-service-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:1rem;border:1px solid var(--bs-border-color,#dce3ec);border-radius:12px;padding:1rem;margin-bottom:1rem;min-width:0}.trip-service-row legend{font-size:1rem;font-weight:700;float:none;width:auto;padding:0 .3rem}.trip-service-row label{min-width:0}.trip-service-row label>span{display:block;margin-bottom:.35rem}.trip-service-message{grid-column:1/-1}.trip-services-total{display:flex;gap:1rem;flex-wrap:wrap;justify-content:flex-end;padding:1rem 0;font-size:1.1rem}.trip-service-row .table-actions{align-items:center;flex-wrap:wrap}@media(max-width:600px){.trip-service-row{grid-template-columns:minmax(0,1fr)}.trip-services-total{display:block}.trip-services-total>span{display:block}}

/* Fase B: componentes administrativos. El Dashboard y el portal conservan su alcance. */
.admin-workspace { --tho-panel-padding: 1.25rem; }
.admin-workspace > .page-heading, .admin-workspace .trip-detail-heading {
    padding: var(--tho-panel-padding); border: 1px solid var(--tho-border-soft);
    border-radius: var(--tho-radius); background: var(--tho-surface);
    box-shadow: var(--tho-shadow-inset), var(--tho-shadow-sm);
}
@supports (backdrop-filter: blur(1px)) {
    .admin-workspace > .page-heading, .admin-workspace .trip-detail-heading { background: var(--tho-surface-glass); }
}
.admin-workspace .page-heading h1 { font-size: clamp(1.55rem, 2.5vw, 2rem); }
.admin-workspace .page-heading p:last-child { max-width: 65ch; }
.admin-workspace .panel-card { min-width: 0; padding: var(--tho-panel-padding); border: 1px solid var(--tho-border-soft); border-radius: var(--tho-radius); background: var(--tho-surface); box-shadow: var(--tho-shadow-sm); }
.admin-workspace .panel-card h2, .admin-workspace .trip-services h2 { margin-bottom: .5rem; font-size: 1.15rem; }
.admin-workspace .section-heading { margin-bottom: 1rem; }
.admin-workspace .panel-card > p:not(.live-message):not(.alert):not(.text-danger), .admin-workspace .trip-services > p { color: var(--tho-gray-700); font-size: .875rem; }
.admin-workspace .form-card { border-top: 3px solid var(--tho-red-dark); }
.admin-workspace .form-card .row { --bs-gutter-y: 1.25rem; }
.admin-workspace .form-control, .admin-workspace .form-select { border-color: var(--tho-field-border); transition: border-color var(--tho-duration) var(--tho-ease), box-shadow var(--tho-duration) var(--tho-ease); }
.admin-workspace .form-control::placeholder { color: #626c79; opacity: 1; }
.admin-workspace :is(.form-control, .form-select):hover:not(:disabled):not([readonly]) { border-color: var(--tho-gray-700); }
.admin-workspace :is(.form-control, .form-select):focus { border-color: var(--tho-red-dark); box-shadow: 0 0 0 .2rem rgba(181, 31, 43, .16); }
.admin-workspace :is(.form-control, .form-select):disabled, .admin-workspace .form-control[readonly] { color: #49515d; background-color: var(--tho-gray-100); }
.admin-workspace :is(.form-control, .form-select).is-invalid { border-color: var(--tho-danger); }
.admin-workspace :is(.form-control, .form-select).is-valid { border-color: var(--tho-success); }
.admin-workspace .form-text, .admin-workspace .form-hint { line-height: 1.5; }
.admin-workspace .form-card form > .d-flex:last-child { flex-wrap: wrap; margin-top: 1.5rem !important; padding-top: 1.15rem; border-top: 1px solid var(--tho-gray-200); }
.admin-workspace .company-access { padding: 1rem; }
.admin-workspace .company-option { display: flex; align-items: flex-start; gap: .5rem; padding-left: 2.25rem; }
.admin-workspace .company-option span { overflow-wrap: anywhere; }
.admin-workspace .company-check:focus-within, .admin-workspace .company-option:focus-within { outline: 2px solid var(--tho-red-dark); outline-offset: 2px; }
.admin-workspace :is(.filter-bar, .filter-toolbar--surface, .search-bar) { padding: 1rem; border: 1px solid var(--tho-border-soft); border-radius: var(--tho-radius); background: var(--tho-surface); box-shadow: var(--tho-shadow-sm); }
.admin-workspace .search-bar { max-width: none; align-items: center; }
.admin-workspace .search-bar .form-control { min-width: 0; }
.admin-workspace .filter-bar > * { min-width: 0; }
.admin-workspace .table { --bs-table-bg: var(--tho-surface); --bs-table-hover-bg: var(--tho-row-hover); color: var(--tho-black); margin-bottom: 0; font-size: .9rem; }
.admin-workspace .table > :not(caption) > * > * { padding: .85rem 1rem; border-bottom-color: var(--tho-gray-200); }
.admin-workspace .table thead th { color: var(--tho-gray-700); background: var(--tho-table-heading); letter-spacing: .035em; line-height: 1.45; }
.admin-workspace .table tbody tr:focus-within > * { box-shadow: inset 0 -2px 0 var(--tho-red-dark); }
.admin-workspace .table tfoot > tr > * { background: var(--tho-gray-50); border-top: 2px solid var(--tho-gray-200); font-weight: 650; font-variant-numeric: tabular-nums; }
.admin-workspace .table-responsive { border-radius: var(--tho-radius-sm); }
.admin-workspace .table-responsive:focus-visible { outline: 2px solid var(--tho-red-dark); outline-offset: 3px; }
.admin-workspace .table-actions .btn { white-space: nowrap; }
.admin-workspace .service-state { display: inline-block; padding: .25rem .65rem; border: 1px solid var(--tho-gray-200); border-radius: 999px; background: var(--tho-gray-50); color: var(--tho-gray-700); font-size: .78rem; font-weight: 650; white-space: nowrap; }
.admin-workspace .empty-state { padding: 2rem 1.25rem; background: var(--tho-surface); }
.admin-workspace .pagination { flex-wrap: wrap; gap: .25rem; }
.admin-workspace .page-link { border-radius: var(--tho-radius-sm); color: var(--tho-red-dark); }
.admin-workspace .page-item.active .page-link { background: var(--tho-red-dark); border-color: var(--tho-red-dark); color: var(--tho-white); }
.admin-workspace .ui-form-section { min-width: 0; margin: 0; padding: 0 0 1rem; border: 0; border-bottom: 1px solid var(--tho-gray-200); }
.admin-workspace .ui-form-section legend, .admin-workspace .ui-form-section-title { grid-column: 1 / -1; float: none; width: 100%; margin: 0 0 .4rem; color: var(--tho-gray-700); font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.admin-workspace .trip-services { margin: .5rem 0; }
.admin-workspace .trip-service-row { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .8rem 1rem; margin-bottom: .85rem; border-color: var(--tho-gray-200); border-radius: var(--tho-radius); background: var(--tho-gray-50); }
.admin-workspace .trip-service-row legend { width: auto; margin-bottom: .25rem; padding: .15rem .6rem; border: 1px solid var(--tho-gray-200); border-radius: var(--tho-radius-sm); background: var(--tho-surface); color: var(--tho-red-dark); font-size: .85rem; }
.admin-workspace .trip-service-row label > span, .admin-workspace .trip-service-row > div > span { color: var(--tho-gray-700); font-size: .82rem; font-weight: 650; }
.service-instructions-field{display:block;grid-column:1/-1;min-width:0}
.service-instructions-field>span{display:block;margin-bottom:.35rem}
.service-instructions-field textarea{width:100%;resize:vertical;min-height:4.5rem}
.service-instructions-field small{display:block;margin-top:.35rem;color:var(--tho-gray-700,#526176)}
.admin-workspace .trip-service-row .table-actions { grid-column: 1 / -1; padding-top: .35rem; }
.admin-workspace .trip-service-message:empty { display: none; }
.admin-workspace .trip-services-total { margin-top: .75rem; padding: .85rem 1rem; border: 1px solid var(--tho-gray-200); border-radius: var(--tho-radius-sm); background: var(--tho-gray-50); font-size: .9rem; font-variant-numeric: tabular-nums; }
.admin-workspace .trip-action-panel { border: 0; border-top: 1px solid var(--tho-gray-200); border-radius: 0; padding: 1rem 0 0; background: var(--tho-surface); }
.admin-workspace .trip-action-panel p { margin-bottom: 0; }
.admin-workspace .trip-detail-columns { align-items: stretch; }
.admin-workspace .trip-detail-columns > .panel-card { height: calc(100% - 1rem); }
.admin-workspace .traffic-trip-live { border-left: 3px solid var(--tho-red-dark); }
.admin-workspace .traffic-trip-live--cancelled { border-color: #e3b9bc; background: #fff8f8; }
.admin-workspace .traffic-trip-live h2 { font-size: 1.35rem; }
.admin-workspace .traffic-trip-live p { margin: .35rem 0 0; }
.admin-workspace .trip-detail-fields, .admin-workspace .trip-gps-fields { margin-bottom: 0; }
.admin-workspace .trip-detail-fields > div, .admin-workspace .trip-gps-fields > div { border: 1px solid var(--tho-gray-200); background: var(--tho-surface); }
.admin-workspace .trip-detail-fields dt, .admin-workspace .trip-gps-fields dt { color: #545e6b; font-size: .73rem; letter-spacing: .025em; }
.admin-workspace .trip-detail-fields dd { margin-top: .25rem; font-size: .9rem; }
.admin-workspace .trip-detail-page .trip-history > li { padding: .8rem 1rem; }
.admin-workspace .trip-detail-page .trip-history li li { display: list-item; padding: .3rem 0; border: 0; background: transparent; }
.admin-workspace .trip-detail-page .trip-history ul { margin: .5rem 0; padding-left: 1.2rem; }
.admin-workspace .trip-detail-page .trip-evidence { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.admin-workspace .trip-detail-page .trip-evidence > :is(.section-heading, dl) { grid-column: 1 / -1; margin-bottom: 0; }
.admin-workspace .trip-detail-page .trip-evidence-group { min-width: 0; margin: 0; padding: 0; border: 0; }
.admin-workspace .trip-detail-page .trip-evidence-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 8rem), 1fr)); }
@media (hover: hover) and (pointer: fine) {
    .admin-workspace .table tbody tr:hover > * { background-color: var(--tho-row-hover); }
    .admin-workspace .company-option:hover { border-color: var(--tho-field-border); }
}
@media (min-width: 1280px) {
    .admin-workspace .trip-service-row { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.25fr) minmax(0, .9fr) minmax(0, 1fr); align-items: start; }
    .admin-workspace .trip-gps-panel .trip-gps-fields { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .admin-workspace { --tho-panel-padding: 1rem; }
    .admin-workspace > .page-heading, .admin-workspace .trip-detail-heading { background: var(--tho-surface); }
    .admin-workspace .panel-card, .admin-workspace > .page-heading, .admin-workspace .trip-detail-heading { box-shadow: none; }
    .admin-workspace .search-bar { flex-wrap: wrap; }
    .admin-workspace .search-bar .form-control { flex-basis: 100%; }
    .admin-workspace .filter-bar { grid-template-columns: minmax(0, 1fr); }
    .admin-workspace .table-actions .btn, .admin-workspace .trip-service-row .btn { min-height: 44px; }
    .admin-workspace .form-card form > .d-flex:last-child > .btn { flex: 1 1 auto; }
    .admin-workspace .trip-detail-page .trip-evidence { grid-template-columns: minmax(0, 1fr); }
    .admin-workspace .trip-detail-page .trip-evidence-group + .trip-evidence-group { padding-top: 1rem; border-top: 1px solid var(--tho-gray-200); }
}
@media (max-width: 600px) {
    .admin-workspace .trip-service-row { grid-template-columns: minmax(0, 1fr); }
    .admin-workspace .trip-services-total > span + span { margin-top: .4rem; }
}
@media (prefers-reduced-motion: reduce) {
    .admin-workspace .form-control, .admin-workspace .form-select { transition: none; }
}
@media (prefers-reduced-transparency: reduce), (forced-colors: active), print {
    .admin-workspace > .page-heading, .admin-workspace .trip-detail-heading { background: var(--tho-surface); box-shadow: none; }
}

/* Selector de viajes desde Rol: espacio para el contenido, sin distribuir tres bloques con space-between. */
.traffic-role-picker .traffic-role-option { display: grid; grid-template-columns: max-content minmax(0, 1fr) auto; justify-content: normal; }
.traffic-role-picker .traffic-role-option__body { min-width: 0; }
.traffic-role-picker .traffic-role-option__body > strong { display: block; overflow-wrap: anywhere; }
.traffic-role-picker .traffic-role-option > .btn { justify-self: end; min-height: 44px; }
@media (max-width: 600px) {
    .traffic-role-picker .traffic-role-option { grid-template-columns: minmax(0, 1fr); gap: .55rem; }
    .traffic-role-picker .traffic-role-option > .btn { justify-self: stretch; }
}

/* Fase C: touch targets and compact, solid mobile surfaces; desktop remains unchanged. */
@media (max-width: 767.98px) {
    .app-shell .app-topbar { gap: .65rem; min-height: 64px; }
    .app-shell .app-topbar > div { min-width: 0; }
    .app-shell .app-topbar strong { overflow-wrap: anywhere; }
    .app-shell .menu-toggle { flex: 0 0 44px; width: 44px; height: 44px; }
    .app-shell .content-wrap { min-width: 0; padding: 1rem .875rem 2rem; }
    .app-shell .btn, .app-shell .sidebar-logout { min-width: 44px; min-height: 44px; white-space: normal; }
    .app-shell .form-control, .app-shell .form-select { min-height: 44px; font-size: 1rem; }
    .app-shell :is(.page-heading, .section-heading, .filter-toolbar, .filter-field) { min-width: 0; }
    .app-shell .section-heading { flex-wrap: wrap; gap: .5rem; }
    .app-shell :is(.panel-card, .dashboard-kpi, .card, .dashboard-context) { box-shadow: none; }
    .app-shell .dashboard-operation__links a { display: inline-flex; align-items: center; min-height: 44px; }
    .app-shell :is(.monitoring-detail, .traffic-delete) > summary { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
    .app-shell .rh-week-nav__period { min-width: 0; flex: 1 1 12rem; }
    .app-shell .table-responsive { overscroll-behavior-inline: contain; }
}

/* THO operation feedback; Bootstrap supplies the existing lightweight spinner. */
.tho-busy { cursor: progress; }
.tho-busy-spinner { flex: 0 0 auto; vertical-align: -.125em; }
.btn > .tho-busy-spinner { margin-inline-end: .45em; }
.nav-mark > .tho-busy-spinner { width: 1.1rem; height: 1.1rem; }
.sidebar-link > .nav-mark { position: relative; }
.sidebar-link > .nav-mark > .tho-busy-spinner { position: absolute; inset: 0; width: 100%; height: 100%; border-width: 2px; }
.tho-auth-pending { position: relative; cursor: progress; }
.tho-auth-pending::after { content: ""; position: absolute; inset-block-start: 50%; inset-inline-end: .75rem; margin-block-start: -.5rem; width: 1rem; height: 1rem; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: .75s linear infinite spinner-border; pointer-events: none; }
.driver-header .tho-auth-pending::after { inset-block-start: -.4rem; inset-inline-end: -.4rem; margin-block-start: 0; color: var(--tho-red); background-color: var(--tho-white); box-shadow: 0 0 0 2px var(--tho-white); }
@media (prefers-reduced-motion: reduce) {
    .tho-busy-spinner, .tho-auth-pending::after { animation: none; }
}
