:root {
    --brand: #e12b48;
    --brand-dark: #b51c35;
    --ink: #24262d;
    --muted: #747984;
    --line: #e4e6ea;
    --surface: #ffffff;
    --surface-soft: #f8f8fa;
    --background: #f2f3f5;
    --success: #15803d;
    --warning: #a16207;
    --danger: #b4233c;
    --sidebar: #202127;
    --radius: 18px;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
html { min-height: 100%; }
body { min-height: 100%; margin: 0; background: var(--background); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }

.topbar { height: 82px; padding: 0 26px; background: var(--surface); border-bottom: 1px solid var(--line); display: grid; grid-template-columns: auto minmax(240px, 1fr) auto auto; align-items: center; gap: 24px; position: sticky; top: 0; z-index: 40; }
.topbar-brand { display: flex; align-items: center; gap: 13px; min-width: 260px; }
.topbar-brand small, .topbar-company span { display: block; color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.topbar-brand strong { display: block; margin-top: 2px; font-size: 18px; letter-spacing: -.03em; }
.mini-mark { width: 38px; height: 32px; position: relative; flex: 0 0 auto; }
.mini-mark::before, .mini-mark::after, .mini-mark i { content: ""; position: absolute; left: 0; height: 6px; background: var(--brand); transform: skewX(-30deg); border-radius: 2px; }
.mini-mark::before { top: 1px; width: 30px; }.mini-mark i { top: 12px; width: 38px; }.mini-mark::after { top: 23px; width: 24px; }
.topbar-company { justify-self: end; padding-right: 4px; text-align: right; }
.topbar-company strong { display: block; margin-top: 3px; font-size: 14px; }
.user-box { min-width: 210px; text-align: right; font-size: 12px; }
.user-box > strong, .user-box > span { display: block; }.user-box > span { color: var(--muted); margin: 2px 0 5px; }
.user-box div { display: flex; justify-content: flex-end; gap: 12px; }.user-box a { color: var(--brand); font-weight: 800; }
.menu-button { display: none; border: 0; background: transparent; padding: 7px; }.menu-button span { display: block; width: 24px; height: 2px; background: var(--ink); margin: 5px 0; }

.app-shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 82px); }
.sidebar { position: sticky; top: 82px; height: calc(100vh - 82px); background: var(--sidebar); padding: 22px 15px 16px; display: flex; flex-direction: column; justify-content: space-between; overflow-y: auto; z-index: 35; }
.sidebar nav { display: grid; gap: 5px; }.nav-section { color: #7f838d; text-transform: uppercase; letter-spacing: .13em; font-size: 9px; font-weight: 900; padding: 13px 14px 6px; }
.sidebar a { color: #d1d3d8; padding: 12px 13px; border-radius: 12px; display: flex; align-items: center; gap: 11px; font-size: 13px; font-weight: 750; transition: .18s ease; }
.sidebar a b { width: 25px; height: 25px; display: grid; place-items: center; border-radius: 8px; background: rgba(255,255,255,.07); font-size: 9px; color: #aeb1b8; }
.sidebar a em { margin-left: auto; color: #858993; font-size: 8px; text-transform: uppercase; font-style: normal; letter-spacing: .08em; }
.sidebar a:hover:not(.disabled), .sidebar a.active { background: var(--brand); color: #fff; transform: translateX(2px); }.sidebar a.active b { color: var(--brand); background: #fff; }.sidebar a.disabled { opacity: .52; cursor: default; }
.sidebar-foot { color: #8f939b; border-top: 1px solid rgba(255,255,255,.08); padding: 17px 14px 4px; font-size: 10px; }.sidebar-foot strong { display: block; color: #d5d6d9; margin-top: 3px; }
.content { min-width: 0; padding: 30px; }

.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 24px; }.page-heading h1 { margin: 5px 0 0; font-size: clamp(28px, 3vw, 38px); letter-spacing: -.055em; }.page-heading p { max-width: 680px; color: var(--muted); margin: 8px 0 0; line-height: 1.55; }.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.eyebrow { color: var(--brand); text-transform: uppercase; letter-spacing: .14em; font-size: 10px; font-weight: 900; }
.primary-button, .secondary-button, .danger-button, .icon-button { border: 0; border-radius: 11px; min-height: 42px; padding: 0 17px; font-weight: 850; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.primary-button { color: #fff; background: var(--brand); }.primary-button:hover { filter: brightness(.92); }.secondary-button { background: #fff; border: 1px solid var(--line); color: var(--ink); }.secondary-button:hover { border-color: #bfc2c9; }.danger-button { background: #fff0f2; color: var(--danger); }.icon-button { min-height: 34px; padding: 0 11px; background: #f2f3f5; font-size: 11px; }.full { width: 100%; }
.cards { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 15px; }.metric-card, .panel, .module-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 9px 28px rgba(25,27,33,.035); }.metric-card { padding: 20px; position: relative; overflow: hidden; }.metric-card::after { content: ""; position: absolute; right: -20px; bottom: -34px; width: 95px; height: 95px; border-radius: 50%; background: color-mix(in srgb, var(--brand) 9%, transparent); }.metric-card span { color: var(--muted); font-size: 12px; font-weight: 750; }.metric-card strong { display: block; font-size: 36px; letter-spacing: -.05em; margin: 9px 0 2px; }.metric-card small { color: var(--muted); }
.panel-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 15px; margin-top: 15px; }.panel { padding: 21px; }.panel-title { display: flex; justify-content: space-between; align-items: center; gap: 15px; margin-bottom: 18px; }.panel-title h2, .panel-title h3 { margin: 0; font-size: 17px; }.panel-title span { color: var(--muted); font-size: 11px; }
.empty-state { min-height: 180px; display: grid; place-items: center; text-align: center; color: var(--muted); border: 1px dashed #d8dae0; background: var(--surface-soft); border-radius: 14px; padding: 24px; }
.module-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 15px; }.module-card { padding: 22px; transition: .18s ease; }.module-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); box-shadow: 0 15px 38px rgba(25,27,33,.07); }.module-card .module-code { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: color-mix(in srgb, var(--brand) 10%, white); color: var(--brand); font-weight: 900; }.module-card h3 { margin: 17px 0 7px; }.module-card p { margin: 0 0 18px; color: var(--muted); line-height: 1.5; font-size: 13px; }.module-card span { color: var(--brand); font-size: 12px; font-weight: 850; }

.data-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }.data-toolbar { padding: 16px 18px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; background: #fbfbfc; }.data-toolbar strong { font-size: 14px; }.data-toolbar span { color: var(--muted); font-size: 12px; }
.table-wrap { width: 100%; overflow-x: auto; }.data-table { width: 100%; border-collapse: collapse; min-width: 760px; }.data-table th { padding: 12px 15px; background: #f7f7f9; color: #6e737e; text-align: left; text-transform: uppercase; letter-spacing: .07em; font-size: 9px; }.data-table td { padding: 14px 15px; border-top: 1px solid #eceef1; font-size: 12px; vertical-align: middle; }.data-table tr:hover td { background: #fdfdfe; }.table-title { font-weight: 850; font-size: 13px; }.table-subtitle { color: var(--muted); font-size: 11px; margin-top: 3px; }.table-actions { display: flex; gap: 7px; justify-content: flex-end; }.status { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 6px 9px; font-size: 9px; text-transform: uppercase; letter-spacing: .06em; font-weight: 900; white-space: nowrap; }.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }.status.active, .status.available { color: var(--success); background: #ecf9f0; }.status.inactive, .status.out_of_service, .status.incident { color: var(--danger); background: #fff0f2; }.status.workshop, .status.in_workshop, .status.vacation, .status.medical_leave { color: var(--warning); background: #fff8e8; }.status.assigned, .status.in_route, .status.in_terminal, .status.fueling { color: #2563eb; background: #eef4ff; }

.form-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 17px; }.form-grid .span-2 { grid-column: span 2; }.field { display: grid; gap: 7px; }.field label, .check-label { font-size: 11px; font-weight: 850; color: #444852; }.field input, .field select, .field textarea { width: 100%; min-height: 43px; border: 1px solid #dfe1e5; border-radius: 11px; padding: 10px 12px; background: #fff; color: var(--ink); outline: none; }.field textarea { min-height: 94px; resize: vertical; }.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }.field small { color: var(--muted); font-size: 10px; line-height: 1.4; }.check-row { display: flex; align-items: center; gap: 10px; min-height: 43px; }.check-row input { width: 17px; height: 17px; accent-color: var(--brand); }.form-actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.split-view { display: grid; grid-template-columns: minmax(320px,.82fr) minmax(0,1.7fr); gap: 16px; align-items: start; }.sticky-form { position: sticky; top: 104px; }
.color-preview { width: 30px; height: 30px; border-radius: 9px; border: 1px solid rgba(0,0,0,.1); display: inline-block; vertical-align: middle; margin-right: 8px; }.company-logo { width: 45px; height: 34px; object-fit: contain; border-radius: 7px; border: 1px solid var(--line); background: #fff; padding: 3px; }
.toast { position: fixed; top: 96px; right: 24px; max-width: 390px; z-index: 80; padding: 14px 16px; border-radius: 13px; box-shadow: 0 16px 45px rgba(0,0,0,.17); background: #fff; font-size: 12px; font-weight: 800; transition: .25s ease; }.toast.success { border-left: 4px solid var(--success); }.toast.error { border-left: 4px solid var(--danger); }.toast.hide { opacity: 0; transform: translateY(-8px); pointer-events: none; }
.note { padding: 13px 15px; border-radius: 12px; background: #fff8e8; color: #795812; border: 1px solid #f3dfaf; font-size: 12px; line-height: 1.5; margin-bottom: 17px; }

.auth-page { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(circle at top right, rgba(225,43,72,.17), transparent 36%), #202127; }.auth-card { width: min(440px,100%); background: #fff; border-radius: 24px; padding: 34px; box-shadow: 0 30px 80px rgba(0,0,0,.25); }.auth-card.wide { width: min(680px,100%); }.auth-card h1 { margin: 5px 0 0; letter-spacing: -.045em; }.auth-card p { color: var(--muted); line-height: 1.5; }.auth-card form:not(.company-list) { display: grid; gap: 16px; margin-top: 24px; }.auth-card label { display: grid; gap: 7px; font-size: 12px; font-weight: 850; }.auth-card input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 13px 14px; outline: none; }.auth-card input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(225,43,72,.12); }.brand-mark { width: 64px; height: 42px; position: relative; margin-bottom: 20px; }.brand-mark::before, .brand-mark::after, .brand-mark span { content: ""; position: absolute; left: 0; height: 8px; background: var(--brand); transform: skewX(-30deg); }.brand-mark::before { top: 2px; width: 52px; }.brand-mark span { top: 16px; width: 64px; }.brand-mark::after { top: 30px; width: 42px; }.alert, .success { padding: 12px 14px; border-radius: 12px; margin-top: 18px; font-size: 12px; font-weight: 750; }.alert { background: #fff0f2; color: #a7132d; }.success { background: #eaf9ef; color: #166534; }.company-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 24px; }.company-option { text-align: left; border: 1px solid var(--line); background: #fff; padding: 18px; border-radius: 14px; cursor: pointer; }.company-option:hover { border-color: var(--brand); box-shadow: 0 8px 25px rgba(225,43,72,.1); }.company-option strong, .company-option span { display: block; }.company-option span { color: var(--muted); margin-top: 5px; font-size: 11px; }
.menu-overlay { display: none; }

@media (max-width: 1120px) { .cards { grid-template-columns: repeat(2,minmax(0,1fr)); }.module-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }.split-view { grid-template-columns: 1fr; }.sticky-form { position: static; }.topbar-company { display: none; } }
@media (max-width: 780px) {
    .topbar { height: 70px; padding: 0 15px; grid-template-columns: auto 1fr auto; gap: 12px; }.menu-button { display: block; }.topbar-brand { min-width: 0; }.topbar-brand small { display: none; }.topbar-brand strong { font-size: 15px; }.mini-mark { width: 31px; transform: scale(.82); transform-origin: left center; }.user-box { min-width: 0; }.user-box > strong, .user-box > span { display: none; }.user-box div a:first-child { display: none; }.user-box div { gap: 0; }.app-shell { display: block; min-height: calc(100vh - 70px); }.sidebar { position: fixed; top: 0; left: 0; height: 100vh; width: min(286px,84vw); transform: translateX(-105%); transition: .24s ease; z-index: 70; padding-top: 25px; }.sidebar.open { transform: translateX(0); }.menu-overlay { position: fixed; inset: 0; background: rgba(12,14,18,.58); z-index: 65; }.menu-overlay.show { display: block; }.menu-open { overflow: hidden; }.content { padding: 22px 16px; }.page-heading { align-items: stretch; flex-direction: column; }.page-actions > * { flex: 1; }.panel-grid, .module-grid { grid-template-columns: 1fr; }.form-grid { grid-template-columns: 1fr; }.form-grid .span-2 { grid-column: auto; }.toast { top: 82px; left: 16px; right: 16px; }.company-list { grid-template-columns: 1fr; }
}
@media (max-width: 520px) { .cards { grid-template-columns: 1fr 1fr; gap: 10px; }.metric-card { padding: 16px; }.metric-card strong { font-size: 30px; }.form-panel { padding: 18px; }.table-actions { flex-direction: column; }.page-heading h1 { font-size: 29px; } }

/* Version 0.3: rutas, corridas, papeleta y QR */
.page-alert { margin: 0 0 16px; }
.compact-cards { margin-bottom: 15px; }
.compact-cards .metric-card strong { font-size: 30px; }
.filter-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 15px; }
.filter-grid { display: grid; grid-template-columns: 155px 155px 190px minmax(220px,1fr) auto; gap: 12px; align-items: end; }
.filter-actions { display: flex; gap: 8px; align-items: center; min-height: 43px; }
.ghost-button { color: var(--muted); font-size: 11px; font-weight: 850; padding: 10px 4px; }
.trip-time { margin-top: 4px; color: var(--brand); font-size: 22px; font-weight: 950; letter-spacing: -.04em; }
.status.draft { color: #60646f; background: #f0f1f3; }
.status.scheduled { color: #7357b5; background: #f3efff; }
.status.ready { color: #137a3c; background: #eaf9ef; }
.status.in_progress { color: #1769d2; background: #eaf3ff; }
.status.delayed { color: #a76400; background: #fff4dc; }
.status.diverted { color: #8b4a00; background: #fff0de; }
.status.completed { color: #137a3c; background: #eaf9ef; }
.status.cancelled { color: #b3263d; background: #fff0f2; }
.trip-form { display: grid; gap: 16px; padding-bottom: 88px; }
.form-section { padding: 0; overflow: hidden; }
.section-heading { display: flex; align-items: center; gap: 14px; padding: 19px 22px; border-bottom: 1px solid var(--line); background: #fbfbfc; }
.section-heading > span { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 11px; background: color-mix(in srgb, var(--brand) 10%, white); color: var(--brand); font-weight: 950; }
.section-heading h2 { margin: 0; font-size: 17px; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11px; }
.form-section > .form-grid { padding: 22px; }
.form-grid-3 { grid-template-columns: repeat(3,minmax(0,1fr)); }
.form-grid .span-3 { grid-column: span 3; }
.trip-save-bar { position: fixed; left: 250px; right: 0; bottom: 0; z-index: 45; min-height: 72px; padding: 13px 32px; display: flex; justify-content: space-between; align-items: center; gap: 18px; background: rgba(255,255,255,.94); border-top: 1px solid var(--line); box-shadow: 0 -12px 35px rgba(25,27,33,.08); backdrop-filter: blur(14px); }
.trip-save-bar > div:last-child { display: flex; gap: 10px; }
.trip-save-bar strong, .trip-save-bar span { display: block; }
.trip-save-bar strong { font-size: 13px; }
.trip-save-bar span { color: var(--muted); font-size: 10px; margin-top: 3px; }
.trip-hero { display: grid; grid-template-columns: 1fr auto 1.25fr; align-items: center; gap: 24px; background: linear-gradient(135deg,#25272d,#18191d); color: #fff; border-radius: 19px; padding: 26px; margin-bottom: 16px; overflow: hidden; position: relative; }
.trip-hero::after { content:""; position:absolute; width:220px; height:220px; border-radius:50%; right:-80px; top:-110px; background:color-mix(in srgb,var(--brand) 35%,transparent); }
.trip-hero h2 { margin: 6px 0 10px; font-size: 28px; }
.trip-hero-time { text-align: center; padding: 0 28px; border-left: 1px solid rgba(255,255,255,.14); border-right: 1px solid rgba(255,255,255,.14); }
.trip-hero-time span,.trip-hero-time small,.trip-hero-route span { display:block; color:rgba(255,255,255,.62); font-size:10px; }
.trip-hero-time strong { display:block; font-size:42px; letter-spacing:-.06em; }
.trip-hero-route { position:relative; z-index:1; }
.trip-hero-route strong { display:inline-block; margin-top:7px; font-size:16px; }
.trip-hero-route i { color:var(--brand); font-style:normal; font-weight:900; margin:0 9px; }
.detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:15px; margin-bottom:15px; }
.detail-list { margin:0; display:grid; }
.detail-list > div { display:grid; grid-template-columns:145px 1fr; gap:14px; padding:10px 0; border-top:1px solid #eef0f2; }
.detail-list > div:first-child { border-top:0; }
.detail-list dt { color:var(--muted); font-size:10px; font-weight:800; }
.detail-list dd { margin:0; font-size:12px; font-weight:800; text-align:right; }
.qr-preview { display:grid; grid-template-columns:132px 1fr; gap:20px; align-items:center; }
.qr-preview p { color:var(--muted); line-height:1.5; font-size:11px; }
.qr-preview small { color:#8b8e96; font-size:9px; }
.notes-box { min-height:105px; padding:15px; border-radius:12px; background:var(--surface-soft); color:#555a64; line-height:1.6; font-size:12px; }
.timeline { display:grid; gap:13px; }
.timeline > div:not(.empty-state) { position:relative; padding-left:20px; display:grid; gap:3px; }
.timeline i { position:absolute; left:0; top:4px; width:9px; height:9px; border-radius:50%; background:var(--brand); box-shadow:0 0 0 4px color-mix(in srgb,var(--brand) 12%,transparent); }
.timeline strong { font-size:11px; }
.timeline span { color:var(--muted); font-size:9px; }
.empty-state.compact { min-height:90px; }
.operation-queue { display:grid; }
.operation-queue > a { display:grid; grid-template-columns:28px minmax(190px,1.4fr) minmax(130px,.7fr) auto; gap:13px; align-items:center; padding:12px 0; border-top:1px solid #eceef1; color:var(--ink); }
.operation-queue > a:first-child { border-top:0; }
.operation-queue > a > b { width:26px; height:26px; display:grid; place-items:center; border-radius:8px; background:#f1f2f4; color:#777b84; font-size:10px; }
.operation-queue strong,.operation-queue span,.queue-unit small { display:block; }
.operation-queue strong { font-size:11px; }
.operation-queue span:not(.status),.queue-unit small { color:var(--muted); font-size:9px; margin-top:3px; }
.queue-unit { font-size:11px; font-weight:850; }
.quick-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.quick-actions a { padding:15px; border:1px solid var(--line); border-radius:13px; color:var(--ink); }
.quick-actions a:hover { border-color:var(--brand); }
.quick-actions b { width:30px; height:30px; display:grid; place-items:center; border-radius:9px; background:color-mix(in srgb,var(--brand) 10%,white); color:var(--brand); }
.quick-actions span { display:block; font-size:10px; font-weight:850; margin-top:9px; }
.scan-result { width:min(580px,100%); margin:30px auto; text-align:center; background:#fff; border:1px solid var(--line); border-radius:22px; padding:36px; box-shadow:0 20px 55px rgba(25,27,33,.08); }
.scan-check { width:64px; height:64px; display:grid; place-items:center; margin:0 auto 16px; border-radius:50%; background:#eaf9ef; color:#178544; font-size:30px; font-weight:950; }
.scan-result > span { color:var(--muted); font-size:11px; font-weight:850; }
.scan-result h2 { margin:7px 0; font-size:34px; }
.scan-result p { color:var(--muted); }
.scan-result dl { margin:24px 0; display:grid; grid-template-columns:repeat(3,1fr); border:1px solid var(--line); border-radius:14px; overflow:hidden; }
.scan-result dl div { padding:14px; border-left:1px solid var(--line); }
.scan-result dl div:first-child { border-left:0; }
.scan-result dt { color:var(--muted); font-size:9px; }
.scan-result dd { margin:5px 0 0; font-size:11px; font-weight:850; }

/* Papeleta imprimible */
.print-body { margin:0; background:#e9eaed; color:#22242a; font-family:Arial,Helvetica,sans-serif; }
.print-toolbar { width:min(960px,calc(100% - 30px)); margin:18px auto; display:flex; justify-content:space-between; align-items:center; }
.print-toolbar a,.print-toolbar button { border:0; border-radius:10px; padding:11px 15px; background:#fff; color:#25272d; font-size:12px; font-weight:800; cursor:pointer; box-shadow:0 5px 18px rgba(0,0,0,.07); }
.print-toolbar button { background:var(--brand); color:#fff; }
.travel-sheet { width:210mm; min-height:277mm; margin:0 auto 35px; background:#fff; padding:14mm; box-shadow:0 16px 50px rgba(0,0,0,.15); }
.sheet-header { display:flex; justify-content:space-between; align-items:center; padding-bottom:20px; border-bottom:4px solid var(--brand); }
.sheet-brand { display:flex; align-items:center; gap:16px; }
.sheet-arrow { width:58px; height:38px; position:relative; display:block; }
.sheet-arrow::before,.sheet-arrow::after { content:""; position:absolute; left:0; height:9px; background:var(--brand); transform:skewX(-30deg); }
.sheet-arrow::before { top:4px; width:46px; box-shadow:8px 13px 0 var(--brand); }
.sheet-arrow::after { top:30px; width:35px; }
.sheet-brand small,.sheet-brand p,.sheet-number span,.sheet-number small { display:block; color:#737781; font-size:9px; text-transform:uppercase; letter-spacing:.09em; font-weight:800; }
.sheet-brand h1 { margin:3px 0; font-size:24px; }
.sheet-brand p { margin:0; text-transform:none; letter-spacing:0; }
.sheet-number { text-align:right; }
.sheet-number strong { display:block; color:var(--brand); font-size:32px; margin:4px 0; }
.sheet-route { display:grid; grid-template-columns:1fr auto 1fr; align-items:center; gap:24px; padding:23px; margin:22px 0; border-radius:16px; background:#25272d; color:#fff; }
.sheet-route div:last-child { text-align:right; }
.sheet-route span,.sheet-grid span,.sheet-note span,.sheet-observations > span { display:block; color:#8a8e98; font-size:8px; text-transform:uppercase; letter-spacing:.08em; font-weight:850; }
.sheet-route strong { display:block; margin-top:5px; font-size:19px; }
.sheet-route i { color:var(--brand); font-style:normal; font-size:28px; font-weight:900; }
.sheet-grid { display:grid; grid-template-columns:repeat(4,1fr); border:1px solid #dfe1e5; border-radius:13px; overflow:hidden; margin-bottom:13px; }
.sheet-grid > div { min-height:66px; padding:13px; border-left:1px solid #e4e5e8; }
.sheet-grid > div:first-child { border-left:0; }
.sheet-grid strong { display:block; margin-top:7px; font-size:12px; }
.sheet-grid small { display:block; color:#858993; margin-top:4px; font-size:8px; }
.sheet-grid-main strong { font-size:14px; }
.sheet-note { padding:14px 16px; border-left:4px solid var(--brand); background:#f7f7f9; border-radius:0 10px 10px 0; margin-bottom:13px; }
.sheet-note p { margin:6px 0 0; font-size:10px; }
.sheet-bottom { display:grid; grid-template-columns:190px 1fr; gap:22px; padding-top:18px; }
.sheet-qr { text-align:center; border:1px solid #dfe1e5; border-radius:14px; padding:14px; }
.sheet-qr #sheet-qr { display:grid; place-items:center; }
.sheet-qr span { display:block; margin-top:8px; color:#6f737d; font-size:8px; line-height:1.35; }
.sheet-observations { padding:15px; background:#f8f8fa; border-radius:14px; }
.sheet-observations p { min-height:65px; margin:8px 0; font-size:9px; line-height:1.5; }
.signature-lines { display:grid; grid-template-columns:1fr 1fr; gap:25px; padding-top:28px; }
.signature-lines div { border-top:1px solid #aeb1b8; padding-top:6px; text-align:center; color:#777b84; font-size:8px; }
.travel-sheet footer { display:flex; justify-content:space-between; gap:10px; padding-top:16px; margin-top:18px; border-top:1px solid #dfe1e5; color:#858993; font-size:8px; }
@media print { @page{size:A4;margin:0} .print-toolbar{display:none!important}.print-body{background:#fff}.travel-sheet{width:auto;min-height:0;margin:0;box-shadow:none;padding:12mm} }

@media (max-width:1120px){ .filter-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.filter-actions{grid-column:span 2}.form-grid-3{grid-template-columns:repeat(2,minmax(0,1fr))}.form-grid .span-3{grid-column:span 2}.trip-save-bar{left:250px}.trip-hero{grid-template-columns:1fr auto}.trip-hero-route{grid-column:span 2}.operation-queue>a{grid-template-columns:28px 1fr auto}.queue-unit{display:none} }
@media (max-width:780px){ .filter-grid,.form-grid-3{grid-template-columns:1fr}.filter-actions,.form-grid .span-3{grid-column:auto}.trip-save-bar{left:0;padding:10px 16px}.trip-save-bar>div:first-child{display:none}.trip-save-bar>div:last-child{width:100%}.trip-save-bar a,.trip-save-bar button{flex:1}.trip-hero{grid-template-columns:1fr;padding:21px}.trip-hero-time{border:0;border-top:1px solid rgba(255,255,255,.14);border-bottom:1px solid rgba(255,255,255,.14);padding:15px 0}.trip-hero-route{grid-column:auto}.detail-grid{grid-template-columns:1fr}.qr-preview{grid-template-columns:110px 1fr}.operation-queue>a{grid-template-columns:26px 1fr}.operation-queue>a>.status{grid-column:2}.scan-result{padding:24px}.scan-result dl{grid-template-columns:1fr}.scan-result dl div{border-left:0;border-top:1px solid var(--line)}.scan-result dl div:first-child{border-top:0}.travel-sheet{width:auto;min-height:auto;margin:0;padding:18px}.sheet-grid{grid-template-columns:1fr 1fr}.sheet-grid>div:nth-child(odd){border-left:0}.sheet-grid>div:nth-child(n+3){border-top:1px solid #e4e5e8}.sheet-bottom{grid-template-columns:1fr}.print-toolbar{width:calc(100% - 30px)} }

/* Version 0.3.1: identidad visual Flecha Roja */
:root {
    --brand: #E33049;
    --brand-dark: #B82139;
    --brand-secondary: #31565B;
    --brand-secondary-deep: #18363A;
    --brand-teal: #137680;
    --brand-gold: #E1AF68;
    --ink: #1C292B;
    --muted: #6D7779;
    --line: #DDE4E3;
    --surface-soft: #F5F8F7;
    --background: #EEF3F2;
    --sidebar: #18363A;
}

body {
    background: linear-gradient(180deg, #F5F8F7 0, var(--background) 280px);
}

.topbar {
    background: linear-gradient(105deg, var(--brand-secondary) 0%, #294953 100%);
    border-bottom: 4px solid var(--brand);
    color: #fff;
    box-shadow: 0 5px 18px rgba(17, 45, 49, .16);
}
.topbar-brand { min-width: 330px; gap: 16px; }
.topbar-logo { display: block; width: 148px; max-height: 48px; object-fit: contain; object-position: left center; }
.topbar-brand-copy { border-left: 1px solid rgba(255,255,255,.24); padding-left: 15px; }
.topbar-brand small,
.topbar-company span { color: rgba(255,255,255,.68); }
.topbar-brand strong,
.topbar-company strong,
.user-box > strong { color: #fff; }
.user-box > span { color: rgba(255,255,255,.68); }
.user-box a { color: #fff; }
.user-box a:hover { color: #F8CED5; }
.menu-button span { background: #fff; }
.mini-mark::before,
.mini-mark::after,
.mini-mark i { background: var(--brand); }

.sidebar {
    background:
        linear-gradient(180deg, rgba(255,255,255,.025), transparent 34%),
        var(--brand-secondary-deep);
    border-right: 1px solid rgba(255,255,255,.06);
}
.nav-section { color: #78999B; }
.sidebar a { color: #D4E1E1; }
.sidebar a b { background: rgba(255,255,255,.08); color: #A9C0C1; }
.sidebar a em { color: #78999B; }
.sidebar a:hover:not(.disabled) { background: rgba(255,255,255,.08); transform: translateX(2px); }
.sidebar a.active { background: var(--brand); color: #fff; box-shadow: 0 8px 22px rgba(227,48,73,.24); }
.sidebar a.active b { color: var(--brand); background: #fff; }
.sidebar-foot { color: #78999B; border-top-color: rgba(255,255,255,.1); }
.sidebar-foot strong { color: #D7E3E3; }

.eyebrow { color: var(--brand); }
.primary-button { background: var(--brand); box-shadow: 0 7px 18px rgba(227,48,73,.16); }
.primary-button:hover { background: var(--brand-dark); filter: none; }
.secondary-button:hover { border-color: var(--brand-secondary); color: var(--brand-secondary); }

.metric-card,
.panel,
.module-card,
.data-panel,
.form-panel,
.filter-panel {
    border-color: #DCE5E3;
    box-shadow: 0 10px 28px rgba(24,54,58,.045);
}
.metric-card::after {
    width: 108px;
    height: 108px;
    right: -30px;
    bottom: -44px;
    background: rgba(49,86,91,.095);
}
.metric-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 20px;
    width: 42px;
    height: 4px;
    background: var(--brand);
    border-radius: 0 0 5px 5px;
}
.metric-card strong { color: var(--brand-secondary-deep); }
.module-card:hover {
    border-color: rgba(49,86,91,.42);
    box-shadow: 0 16px 38px rgba(24,54,58,.09);
}
.module-card .module-code {
    background: rgba(49,86,91,.1);
    color: var(--brand-secondary);
    border: 1px solid rgba(49,86,91,.08);
}
.module-card span { color: var(--brand); }

.data-toolbar,
.data-table th { background: #F1F6F5; }
.data-table th { color: #53686A; }
.data-table tr:hover td { background: #F8FBFA; }
.field input:focus,
.field select:focus,
.field textarea:focus {
    border-color: var(--brand-teal);
    box-shadow: 0 0 0 3px rgba(19,118,128,.12);
}
.check-row input { accent-color: var(--brand); }
.icon-button:hover { color: var(--brand-secondary); background: #EAF1F0; }

.status.assigned,
.status.in_route,
.status.in_terminal,
.status.fueling,
.status.in_progress {
    color: #0C6C75;
    background: #E7F4F4;
}

.auth-page {
    background:
        radial-gradient(circle at 90% 0%, rgba(227,48,73,.24), transparent 34%),
        linear-gradient(135deg, #18363A, #31565B);
}
.auth-card { border-top: 5px solid var(--brand); }
.auth-card input:focus { border-color: var(--brand-teal); box-shadow: 0 0 0 3px rgba(19,118,128,.12); }
.company-option:hover { border-color: var(--brand-secondary); box-shadow: 0 8px 25px rgba(24,54,58,.12); }

.trip-hero,
.sheet-route { background: linear-gradient(110deg, #18363A, #31565B); }
.trip-hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0 auto;
    width: 170px;
    height: 18px;
    background: var(--brand);
    clip-path: polygon(0 0, 100% 0, 86% 100%, 0 100%);
    opacity: .95;
}
.sheet-route i,
.trip-time { color: var(--brand); }

@media (max-width: 780px) {
    .topbar-brand { min-width: 0; }
    .topbar-logo { width: 112px; max-height: 38px; }
    .topbar-brand-copy { display: none; }
}

/* Version 0.3.3: cargador limpio de logotipo */
.file-dropzone {
    position: relative;
    width: 100%;
    min-height: 112px;
    padding: 18px 20px;
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    border: 2px dashed #B9CBC8;
    border-radius: 14px;
    background: #F7FAF9;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}
.file-dropzone:hover,
.file-dropzone:focus-visible {
    border-color: var(--brand-teal);
    background: #F1F8F7;
    box-shadow: 0 0 0 4px rgba(19,118,128,.10);
    outline: none;
}
.file-dropzone.is-dragover {
    border-color: var(--brand);
    background: #FFF4F6;
    box-shadow: 0 0 0 5px rgba(227,48,73,.12);
    transform: translateY(-1px);
}
.file-dropzone.has-error {
    border-color: #C53242;
    background: #FFF4F5;
}
.file-dropzone-preview {
    width: 72px;
    height: 72px;
    display: grid;
    place-items: center;
    border: 1px solid #D7E2E0;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
}
.file-dropzone-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}
.file-dropzone-icon {
    width: 30px;
    height: 30px;
    color: var(--brand-secondary);
}
.file-dropzone-copy {
    min-width: 0;
}
.file-dropzone-copy strong,
.file-dropzone-copy span {
    display: block;
}
.file-dropzone-copy strong {
    color: var(--ink);
    font-size: 14px;
    font-weight: 850;
}
.file-dropzone-copy span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.45;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.file-dropzone-button {
    border: 1px solid #D3DFDD;
    border-radius: 10px;
    padding: 10px 14px;
    background: #fff;
    color: var(--brand-secondary-deep);
    font: inherit;
    font-size: 11px;
    font-weight: 850;
    cursor: pointer;
    white-space: nowrap;
}
.file-dropzone-button:hover {
    border-color: var(--brand-teal);
    color: var(--brand-teal);
}
.file-dropzone + small.is-error {
    color: #B82336;
}
@media (max-width: 680px) {
    .file-dropzone {
        grid-template-columns: 58px minmax(0,1fr);
        min-height: 104px;
        padding: 14px;
        gap: 12px;
    }
    .file-dropzone-preview {
        width: 58px;
        height: 58px;
        grid-row: 1 / span 2;
    }
    .file-dropzone-button {
        justify-self: start;
        padding: 8px 11px;
    }
}

/* Version 0.3.5: accesos independientes por empresa */
.company-auth-page {
    min-height: 100vh;
    position: relative;
    isolation: isolate;
    background-color: var(--brand-secondary);
    background-image:
        linear-gradient(135deg,
            color-mix(in srgb, var(--brand-secondary) 90%, #061013),
            color-mix(in srgb, var(--brand-secondary) 68%, transparent)),
        var(--company-login-background);
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}
.company-auth-page::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 85% 8%, color-mix(in srgb, var(--brand) 28%, transparent), transparent 32%),
        linear-gradient(90deg, rgba(5,18,21,.22), transparent 58%);
}
.company-auth-card {
    border-top: 5px solid var(--brand);
    box-shadow: 0 32px 90px rgba(3,14,17,.34);
}
.auth-company-brand {
    display: grid;
    justify-items: start;
    gap: 17px;
    margin-bottom: 11px;
}
.auth-company-logo {
    display: block;
    width: auto;
    max-width: min(245px, 100%);
    max-height: 92px;
    object-fit: contain;
    object-position: left center;
}
.auth-access-foot {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 22px;
    padding-top: 17px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 10px;
}
.auth-access-foot a {
    color: var(--brand);
    font-weight: 850;
}
.company-settings-view {
    grid-template-columns: minmax(390px, .95fr) minmax(0, 1.55fr);
}
.company-access-box {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    margin: 0 0 22px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--brand-secondary) 24%, var(--line));
    border-radius: 13px;
    background: color-mix(in srgb, var(--brand-secondary) 5%, white);
}
.company-access-box > div:first-child {
    min-width: 0;
}
.company-access-box span,
.company-access-box strong {
    display: block;
}
.company-access-box span {
    margin-bottom: 4px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.company-access-box strong {
    max-width: 330px;
    overflow: hidden;
    color: var(--brand-secondary-deep, var(--brand-secondary));
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.company-access-box > div:last-child {
    display: grid;
    grid-template-columns: repeat(2, minmax(92px, auto));
    align-items: stretch;
    gap: 8px;
}
.company-access-box > div:last-child > * {
    width: 100%;
    min-width: 92px;
    white-space: nowrap;
}
.compact-button {
    min-height: 42px;
    padding: 0 14px;
    font-size: 10px;
    line-height: 1;
}
.slug-input {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    min-height: 43px;
    overflow: hidden;
    border: 1px solid #dfe1e5;
    border-radius: 11px;
    background: #fff;
}
.slug-input:focus-within {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent);
}
.slug-input span {
    align-self: stretch;
    display: flex;
    align-items: center;
    padding: 0 10px;
    border-right: 1px solid #e5e7ea;
    background: #f5f7f7;
    color: #687175;
    font-size: 10px;
    font-weight: 800;
}
.slug-input input {
    min-height: 41px;
    border: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}
.company-form-section-title {
    gap: 3px;
    margin-top: 4px;
    padding: 14px 0 2px;
    border-top: 1px solid var(--line);
}
.company-form-section-title strong {
    color: var(--ink);
    font-size: 13px;
}
.company-form-section-title span {
    color: var(--muted);
    font-size: 10px;
}
.background-dropzone .file-dropzone-preview {
    width: 104px;
}
.background-dropzone .file-dropzone-preview img {
    padding: 0;
    object-fit: cover;
}
.company-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}
.company-access-link {
    color: var(--brand-secondary);
    font-size: 11px;
    font-weight: 850;
}
.company-access-link:hover {
    color: var(--brand);
}
.company-table {
    min-width: 850px;
}

@media (max-width: 1120px) {
    .company-settings-view { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
    .auth-access-foot {
        align-items: stretch;
        flex-direction: column;
    }
    .company-access-box {
        grid-template-columns: 1fr;
        align-items: stretch;
    }
    .company-access-box > div:last-child {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
    }
    .company-access-box > div:last-child > * {
        min-width: 0;
    }
    .background-dropzone .file-dropzone-preview { width: 74px; }
}

/* v0.3.7 - Tabla de empresas: mantener visibles todas las acciones */
.company-table {
    width: 100%;
    min-width: 780px;
    table-layout: fixed;
}
.company-table th:nth-child(1),
.company-table td:nth-child(1) { width: 28%; }
.company-table th:nth-child(2),
.company-table td:nth-child(2) { width: 24%; }
.company-table th:nth-child(3),
.company-table td:nth-child(3) { width: 15%; }
.company-table th:nth-child(4),
.company-table td:nth-child(4) { width: 13%; }
.company-table th:last-child,
.company-table td:last-child {
    width: 200px;
    padding-left: 8px;
    padding-right: 14px;
}
.company-table .company-cell,
.company-table .company-cell > div {
    min-width: 0;
}
.company-table .table-title,
.company-table .table-subtitle,
.company-table .company-access-link {
    overflow: hidden;
    text-overflow: ellipsis;
}
.company-table .company-access-link {
    display: block;
    white-space: nowrap;
}
.company-table .table-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    width: 100%;
    justify-content: stretch;
}
.company-table .table-actions form {
    min-width: 0;
    margin: 0;
}
.company-table .table-actions .icon-button {
    width: 100%;
    min-width: 0;
    padding: 0 9px;
    white-space: nowrap;
}

@media (max-width: 760px) {
    .company-table {
        min-width: 740px;
    }
}

/* v0.4 - Recepción QR */
.reception-station-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(270px, 390px);
    align-items: end;
    gap: 24px;
    margin-bottom: 15px;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(135deg, color-mix(in srgb, var(--brand-secondary) 8%, white), #fff 66%);
    box-shadow: var(--shadow);
}
.reception-station-copy h2 { margin: 4px 0 6px; font-size: 22px; }
.reception-station-copy p { max-width: 680px; margin: 0; color: var(--muted); line-height: 1.5; }
.reception-station-form { display: grid; gap: 7px; }
.reception-station-form label { color: var(--ink); font-size: 11px; font-weight: 850; }
.reception-station-form select {
    width: 100%;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid color-mix(in srgb, var(--brand-secondary) 24%, var(--line));
    border-radius: 11px;
    background: #fff;
    color: var(--ink);
    font-weight: 750;
}
.reception-metrics { margin-bottom: 15px; }
.reception-workspace {
    display: grid;
    grid-template-columns: minmax(430px, .95fr) minmax(420px, 1.05fr);
    gap: 15px;
    align-items: start;
}
.reception-scanner-card,
.terminal-queue-card,
.reception-confirm-card,
.reception-side-summary,
.reception-error-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}
.reception-scanner-card,
.terminal-queue-card { padding: 22px; }
.scanner-secure-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--brand-secondary) 8%, white);
    color: var(--brand-secondary) !important;
    font-size: 9px !important;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .05em;
}
.scanner-stage {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 350px;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--brand-secondary) 25%, var(--line));
    border-radius: 18px;
    background:
        radial-gradient(circle at center, color-mix(in srgb, var(--brand-secondary) 18%, transparent), transparent 58%),
        #102c31;
}
.scanner-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity .2s ease;
}
.scanner-stage.camera-active .scanner-video { opacity: 1; }
.scanner-placeholder {
    position: relative;
    z-index: 3;
    display: grid;
    justify-items: center;
    max-width: 340px;
    padding: 28px;
    color: #fff;
    text-align: center;
}
.scanner-placeholder strong { margin-top: 17px; font-size: 18px; }
.scanner-placeholder p { margin: 8px 0 0; color: rgba(255,255,255,.68); line-height: 1.5; }
.scanner-icon {
    position: relative;
    width: 84px;
    height: 84px;
}
.scanner-icon i,
.scanner-frame span {
    position: absolute;
    width: 27px;
    height: 27px;
    border-color: var(--brand);
    border-style: solid;
}
.scanner-icon i:nth-child(1), .scanner-frame span:nth-child(1) { top: 0; left: 0; border-width: 4px 0 0 4px; }
.scanner-icon i:nth-child(2), .scanner-frame span:nth-child(2) { top: 0; right: 0; border-width: 4px 4px 0 0; }
.scanner-icon i:nth-child(3), .scanner-frame span:nth-child(3) { bottom: 0; left: 0; border-width: 0 0 4px 4px; }
.scanner-icon i:nth-child(4), .scanner-frame span:nth-child(4) { right: 0; bottom: 0; border-width: 0 4px 4px 0; }
.scanner-frame {
    position: absolute;
    z-index: 4;
    width: min(250px, 64%);
    aspect-ratio: 1;
    opacity: 0;
    pointer-events: none;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,.4));
}
.scanner-stage.camera-active .scanner-frame { opacity: 1; }
.scanner-stage.camera-active .scanner-frame::after {
    content: "";
    position: absolute;
    left: 8%;
    right: 8%;
    top: 12%;
    height: 2px;
    background: var(--brand);
    box-shadow: 0 0 10px var(--brand);
    animation: qr-scan-line 2.2s ease-in-out infinite;
}
@keyframes qr-scan-line { 0%,100% { top: 12%; } 50% { top: 86%; } }
.scanner-status {
    position: absolute;
    z-index: 6;
    left: 16px;
    right: 16px;
    bottom: 14px;
    min-height: 34px;
    padding: 9px 12px;
    border-radius: 10px;
    background: rgba(4,20,23,.72);
    color: rgba(255,255,255,.78);
    font-size: 10px;
    font-weight: 750;
    text-align: center;
    backdrop-filter: blur(8px);
}
.scanner-status.active { color: #fff; }
.scanner-status.success { background: rgba(18,115,61,.88); color: #fff; }
.scanner-status.error { background: rgba(167,19,45,.9); color: #fff; }
.scanner-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.scanner-actions > * { flex: 1; }
.scanner-file-button { cursor: pointer; }
.manual-scan-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 15px;
    color: var(--muted);
    font-size: 9px;
    font-weight: 850;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.manual-scan-divider::before,
.manual-scan-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.manual-scan-form { display: grid; gap: 8px; }
.manual-scan-form label { font-size: 11px; font-weight: 850; }
.manual-scan-form > div { display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 8px; }
.manual-scan-form input {
    min-width: 0;
    min-height: 44px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: none;
}
.manual-scan-form input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 12%, transparent); }
.scanner-help { margin: 10px 0 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.terminal-queue { display: grid; gap: 9px; }
.queue-item {
    display: grid;
    grid-template-columns: 42px minmax(125px,.8fr) minmax(150px,1.25fr) 72px auto;
    align-items: center;
    gap: 11px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
}
.queue-position {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: color-mix(in srgb, var(--brand) 10%, white);
    color: var(--brand);
    font-size: 11px;
    font-weight: 900;
}
.queue-unit,
.queue-route,
.queue-time { min-width: 0; }
.queue-unit strong,
.queue-unit span,
.queue-route strong,
.queue-route span,
.queue-time strong,
.queue-time span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.queue-unit strong,
.queue-route strong,
.queue-time strong { color: var(--ink); font-size: 11px; }
.queue-unit span,
.queue-route span,
.queue-time span { margin-top: 3px; color: var(--muted); font-size: 9px; }
.queue-time { text-align: right; }
.reception-history-panel { margin-top: 15px; }
.movement-badge {
    display: inline-flex;
    align-items: center;
    min-height: 27px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.movement-badge.arrival { background: #e7f7ef; color: #13733d; }
.movement-badge.departure { background: color-mix(in srgb, var(--brand-secondary) 11%, white); color: var(--brand-secondary); }
.reception-confirm-layout {
    display: grid;
    grid-template-columns: minmax(0,1fr) 320px;
    gap: 15px;
    align-items: start;
}
.reception-confirm-card { overflow: hidden; }
.movement-heading { padding: 25px 28px; color: #fff; }
.movement-heading.arrival { background: linear-gradient(135deg, #13733d, #1a8f54); }
.movement-heading.departure { background: linear-gradient(135deg, var(--brand-secondary), color-mix(in srgb, var(--brand-secondary) 72%, #0a1d20)); }
.movement-heading span { font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .1em; opacity: .76; }
.movement-heading h2 { margin: 5px 0; font-size: 26px; }
.movement-heading p { margin: 0; color: rgba(255,255,255,.76); }
.vehicle-identity { padding: 24px 28px 18px; border-bottom: 1px solid var(--line); }
.vehicle-identity span,
.vehicle-identity strong,
.vehicle-identity small { display: block; }
.vehicle-identity span { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.vehicle-identity strong { margin: 4px 0; color: var(--ink); font-size: 38px; line-height: 1; }
.vehicle-identity small { color: var(--brand); font-weight: 850; }
.confirmation-details {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
    margin: 0;
    padding: 8px 28px 20px;
}
.confirmation-details div { padding: 15px 0; border-bottom: 1px solid var(--line); }
.confirmation-details div:nth-child(odd) { padding-right: 18px; }
.confirmation-details div:nth-child(even) { padding-left: 18px; border-left: 1px solid var(--line); }
.confirmation-details dt { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .05em; }
.confirmation-details dd { margin: 5px 0 0; color: var(--ink); font-size: 11px; font-weight: 800; line-height: 1.45; }
.confirmation-form { padding: 0 28px 28px; }
.confirm-warning { margin: 17px 0; padding: 12px 14px; border-radius: 11px; background: #f4f7f7; color: var(--muted); font-size: 10px; line-height: 1.5; }
.reception-confirm-button { width: 100%; min-height: 52px; font-size: 14px; }
.reception-side-summary { padding: 24px; }
.reception-side-summary h3 { margin: 5px 0 20px; font-size: 20px; }
.reception-side-summary ul { display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.reception-side-summary li { display: grid; gap: 4px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.reception-side-summary li:last-child { border-bottom: 0; }
.reception-side-summary li strong { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .05em; }
.reception-side-summary li span { color: var(--ink); font-size: 11px; font-weight: 800; }
.reception-error-card { display: grid; justify-items: center; max-width: 620px; margin: 30px auto; padding: 42px; text-align: center; }
.scan-error-mark { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #fff0f2; color: var(--brand); font-size: 28px; font-weight: 900; }
.reception-error-card h2 { margin: 18px 0 8px; }
.reception-error-card p { max-width: 460px; margin: 0 0 22px; color: var(--muted); line-height: 1.6; }

@media (max-width: 1180px) {
    .reception-workspace { grid-template-columns: 1fr; }
    .terminal-queue-card { order: 2; }
}
@media (max-width: 900px) {
    .reception-station-panel,
    .reception-confirm-layout { grid-template-columns: 1fr; }
    .queue-item { grid-template-columns: 38px minmax(0,1fr) 68px auto; }
    .queue-route { display: none; }
    .reception-side-summary { order: -1; }
}
@media (max-width: 680px) {
    .reception-scanner-card,
    .terminal-queue-card { padding: 16px; }
    .scanner-stage { min-height: 300px; }
    .scanner-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .scanner-actions > :first-child { grid-column: span 2; }
    .manual-scan-form > div { grid-template-columns: 1fr; }
    .queue-item { grid-template-columns: 36px minmax(0,1fr) auto; }
    .queue-time { display: none; }
    .queue-item .icon-button { min-height: 38px; }
    .confirmation-details { grid-template-columns: 1fr; }
    .confirmation-details div:nth-child(odd),
    .confirmation-details div:nth-child(even) { padding-left: 0; padding-right: 0; border-left: 0; }
    .movement-heading,
    .vehicle-identity,
    .confirmation-form { padding-left: 20px; padding-right: 20px; }
    .confirmation-details { padding-left: 20px; padding-right: 20px; }
}

/* v0.4.1 - Fotografias de operadores */
.visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.driver-photo-dropzone {
    grid-template-columns: 92px minmax(0, 1fr) auto;
    min-height: 132px;
}
.driver-photo-preview {
    width: 92px;
    height: 92px;
    border-radius: 50%;
    background: linear-gradient(145deg, #eef5f4, #fff);
}
.driver-photo-preview img {
    padding: 0;
    object-fit: cover;
}
.remove-photo-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 750;
}
.remove-photo-option input {
    width: 16px;
    height: 16px;
    accent-color: var(--brand);
}
.driver-cell,
.trip-assignment-cell,
.trip-driver-profile,
.reception-driver-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}
.driver-cell > div:last-child,
.trip-assignment-cell > div:last-child,
.trip-driver-profile > div:last-child,
.reception-driver-card > div:last-child {
    min-width: 0;
}
.driver-avatar {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 2px solid #fff;
    border-radius: 50%;
    background: linear-gradient(145deg, var(--brand-secondary), var(--brand-secondary-deep));
    box-shadow: 0 0 0 1px #d6e2e0, 0 5px 16px rgba(24, 54, 58, .12);
    color: #fff;
    font-size: 16px;
    font-weight: 900;
}
.driver-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.driver-avatar-small {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 12px;
}
.driver-avatar-large {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
    font-size: 24px;
}
.trip-driver-profile,
.reception-driver-card {
    margin: 4px 0 18px;
    padding: 14px;
    border: 1px solid #dbe6e4;
    border-radius: 14px;
    background: #f7faf9;
}
.trip-driver-profile span,
.trip-driver-profile strong,
.trip-driver-profile small,
.reception-driver-card span,
.reception-driver-card strong,
.reception-driver-card small {
    display: block;
}
.trip-driver-profile span,
.reception-driver-card span {
    color: var(--brand);
    font-size: 9px;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.trip-driver-profile strong,
.reception-driver-card strong {
    margin-top: 3px;
    color: var(--ink);
    font-size: 15px;
}
.trip-driver-profile small,
.reception-driver-card small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 10px;
}
.driver-table th:first-child,
.driver-table td:first-child {
    min-width: 270px;
}
@media (max-width: 680px) {
    .driver-photo-dropzone {
        grid-template-columns: 72px minmax(0, 1fr);
        min-height: 112px;
    }
    .driver-photo-preview {
        width: 72px;
        height: 72px;
    }
    .driver-avatar-large {
        width: 58px;
        height: 58px;
        flex-basis: 58px;
    }
}

/* v0.5 - Portal personal de operadores */
.portal-access-heading {
    display: grid;
    gap: 4px;
    margin-top: 4px;
    padding: 15px 0 2px;
    border-top: 1px solid var(--line);
}
.portal-access-heading strong { font-size: 13px; }
.portal-access-heading span { color: var(--muted); font-size: 10px; line-height: 1.4; }
.driver-access-tools {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-top: 18px;
    padding: 14px;
    border: 1px solid color-mix(in srgb, var(--brand-secondary) 22%, var(--line));
    border-radius: 13px;
    background: color-mix(in srgb, var(--brand-secondary) 5%, white);
}
.driver-access-tools span,
.driver-access-tools strong { display: block; }
.driver-access-tools span { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.driver-access-tools strong { margin-top: 4px; font-size: 12px; }
.driver-actions { min-width: 240px; }
.driver-actions form { margin: 0; }
.driver-actions .icon-button { white-space: nowrap; }
.status.pending { color: #a16207; background: #fff8e8; }
.status.approved { color: var(--success); background: #ecf9f0; }
.status.rejected, .status.cancelled { color: var(--danger); background: #fff0f2; }
.status.scheduled, .status.ready { color: #2563eb; background: #eef4ff; }
.status.in_progress, .status.delayed, .status.diverted { color: #0f766e; background: #eaf8f7; }
.status.completed { color: var(--success); background: #ecf9f0; }

.driver-dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(280px, .45fr);
    gap: 15px;
    margin-bottom: 15px;
}
.driver-license-summary,
.driver-mini-qr,
.driver-current-trip {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    box-shadow: var(--shadow);
}
.driver-license-summary {
    display: grid;
    grid-template-columns: 108px minmax(0,1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 22px;
    background: linear-gradient(135deg, #fff, color-mix(in srgb, var(--brand-secondary) 7%, white));
}
.license-photo,
.credential-photo {
    overflow: hidden;
    border: 4px solid #fff;
    border-radius: 15px;
    background: color-mix(in srgb, var(--brand-secondary) 12%, white);
    box-shadow: 0 8px 25px rgba(16,44,49,.14);
}
.license-photo { width: 108px; height: 132px; }
.license-photo img,
.credential-photo img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.license-photo > span,
.credential-photo > span { width: 100%; height: 100%; display: grid; place-items: center; color: var(--brand-secondary); font-size: 38px; font-weight: 900; }
.license-data > span { color: var(--brand); font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.license-data h2 { margin: 6px 0 5px; font-size: 25px; letter-spacing: -.04em; }
.license-data p { margin: 0; color: var(--muted); font-size: 12px; }
.license-data > div { display: grid; gap: 2px; margin-top: 16px; }
.license-data > div strong { color: var(--brand-secondary); font-size: 16px; }
.license-data > div small { color: var(--muted); font-size: 10px; }
.driver-mini-qr { display: flex; align-items: center; gap: 17px; padding: 20px; }
.driver-mini-qr > div:first-child { flex: 0 0 auto; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.driver-mini-qr span,
.driver-mini-qr strong { display: block; }
.driver-mini-qr span { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.driver-mini-qr strong { margin: 5px 0; font-size: 17px; }
.driver-mini-qr p { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.driver-metrics { margin-bottom: 15px; }
.metric-card .metric-text { max-width: 100%; overflow: hidden; font-size: 23px; text-overflow: ellipsis; white-space: nowrap; }
.driver-current-trip {
    display: grid;
    grid-template-columns: auto minmax(0,1fr) auto;
    align-items: center;
    gap: 22px;
    margin-bottom: 15px;
    padding: 22px;
    border-left: 5px solid var(--brand);
}
.driver-trip-status { min-width: 135px; }
.driver-trip-status span,
.driver-trip-status strong { display: block; }
.driver-trip-status span { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.driver-trip-status strong { margin-top: 6px; color: var(--brand-secondary); font-size: 17px; }
.driver-trip-main span { color: var(--brand); font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .08em; }
.driver-trip-main h2 { margin: 6px 0; font-size: 23px; letter-spacing: -.035em; }
.driver-trip-main h2 i { color: var(--brand); font-style: normal; }
.driver-trip-main p { margin: 0; color: var(--muted); font-size: 12px; }
.driver-trip-actions { display: flex; gap: 8px; }
.driver-upcoming-panel { margin-top: 0; }
.driver-empty { margin-bottom: 15px; }
.driver-trip-table { min-width: 940px; }
.km-authorization { display: grid; gap: 10px; }
.km-authorization > div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.km-authorization > div:last-child { border: 0; }
.km-authorization span { color: var(--muted); font-size: 11px; }
.km-authorization strong { font-size: 17px; }
.km-authorization .total { padding: 14px; border: 0; border-radius: 12px; background: color-mix(in srgb, var(--brand) 7%, white); }
.km-authorization .total strong { color: var(--brand); font-size: 20px; }
.request-list { display: grid; gap: 10px; }
.request-list article { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: #fff; }
.request-list article > div:first-child { display: flex; justify-content: space-between; gap: 14px; }
.request-list article strong,
.request-list article span { display: block; }
.request-list article span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.request-list article p { margin: 10px 0; color: #4f565a; font-size: 12px; line-height: 1.5; }
.request-list article small { color: var(--brand-secondary); font-size: 10px; }
.driver-request-layout { grid-template-columns: minmax(340px, .75fr) minmax(500px, 1.25fr); }
.request-list-large { padding: 15px; }
.request-head { align-items: center; }
.request-km { display: flex; align-items: center; justify-content: space-between; margin: 12px 0 0; padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--brand-secondary) 6%, white); }
.request-km b { color: var(--brand); font-size: 18px; }
.request-km span { margin: 0 !important; color: var(--brand-secondary) !important; font-weight: 800; }

.credential-page-wrap { display: grid; place-items: start center; }
.driver-credential-card {
    width: min(100%, 620px);
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--brand-secondary) 28%, var(--line));
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 25px 65px rgba(16,44,49,.14);
}
.credential-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 94px;
    padding: 20px 26px;
    border-bottom: 5px solid var(--brand);
    background: var(--brand-secondary);
    color: #fff;
}
.credential-brand img { max-width: 175px; max-height: 56px; object-fit: contain; }
.credential-brand span { font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .12em; }
.credential-main { display: grid; grid-template-columns: 155px minmax(0,1fr); gap: 25px; padding: 27px; }
.credential-photo { width: 155px; height: 196px; border-radius: 14px; }
.credential-copy > span { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .09em; }
.credential-copy h2 { margin: 6px 0 18px; font-size: 25px; line-height: 1.12; }
.credential-copy dl { display: grid; gap: 9px; margin: 0; }
.credential-copy dl div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.credential-copy dt { color: var(--muted); font-size: 10px; }
.credential-copy dd { margin: 0; font-size: 11px; font-weight: 850; text-align: right; }
.credential-trip { margin: 0 27px; padding: 18px; border-radius: 15px; background: color-mix(in srgb, var(--brand) 7%, white); }
.credential-trip span { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.credential-trip strong { display: block; margin-top: 5px; color: var(--brand); font-size: 20px; }
.credential-trip p { margin: 7px 0 0; color: #4f565a; font-size: 11px; line-height: 1.5; }
.credential-qr { display: flex; align-items: center; gap: 20px; padding: 24px 27px; }
.credential-qr > div:first-child { padding: 8px; border: 1px solid var(--line); border-radius: 13px; }
.credential-qr strong,
.credential-qr span { display: block; }
.credential-qr strong { font-size: 15px; }
.credential-qr span { max-width: 220px; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.credential-foot { display: flex; justify-content: space-between; gap: 15px; padding: 14px 27px; border-top: 1px solid var(--line); background: #f7f9f9; }
.credential-foot span { font-size: 11px; font-weight: 850; }
.credential-foot small { color: var(--muted); }

.public-driver-id-page { min-height: 100vh; padding: 22px; background: linear-gradient(135deg, #17373b, color-mix(in srgb, var(--brand-secondary) 75%, #000)); }
.public-id-wrap { min-height: calc(100vh - 44px); display: grid; place-items: center; }
.public-id-card { width: min(100%, 580px); overflow: hidden; border-radius: 24px; background: #fff; box-shadow: 0 35px 90px rgba(0,0,0,.25); }
.public-id-brand { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 90px; padding: 20px 24px; border-bottom: 5px solid var(--brand); background: var(--brand-secondary); color: #fff; }
.public-id-brand img { max-width: 175px; max-height: 55px; object-fit: contain; }
.public-id-brand span { font-size: 9px; font-weight: 900; text-transform: uppercase; letter-spacing: .11em; }
.public-id-person { display: grid; grid-template-columns: 125px minmax(0,1fr); align-items: center; gap: 22px; padding: 25px; }
.public-id-person .credential-photo { width: 125px; height: 158px; }
.public-id-person > div:last-child > span { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.public-id-person h1 { margin: 6px 0; font-size: 25px; line-height: 1.1; }
.public-id-person p { margin: 0; color: var(--muted); font-size: 11px; }
.public-status { margin: 0 25px; padding: 17px; border-radius: 14px; background: color-mix(in srgb, var(--brand) 8%, white); }
.public-status span { display: block; color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; letter-spacing: .08em; }
.public-status strong { display: block; margin-top: 5px; color: var(--brand); font-size: 21px; }
.public-trip { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 20px 25px; }
.public-trip > div { padding: 12px; border: 1px solid var(--line); border-radius: 11px; }
.public-trip .wide { grid-column: span 2; }
.public-trip span,
.public-trip strong { display: block; }
.public-trip span { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .07em; }
.public-trip strong { margin-top: 4px; font-size: 12px; }
.public-no-trip { margin: 20px 25px; padding: 20px; border: 1px dashed var(--line); border-radius: 13px; color: var(--muted); text-align: center; }
.public-id-foot { display: grid; gap: 3px; padding: 15px 25px; border-top: 1px solid var(--line); background: #f7f9f9; }
.public-id-foot span { font-size: 10px; font-weight: 800; }
.public-id-foot small { color: var(--muted); font-size: 9px; }

.filter-tabs { display: flex; gap: 8px; margin-bottom: 15px; overflow-x: auto; }
.filter-tabs a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 11px; font-weight: 850; white-space: nowrap; }
.filter-tabs a b { min-width: 22px; height: 22px; display: grid; place-items: center; border-radius: 999px; background: #f0f2f3; color: var(--ink); font-size: 9px; }
.filter-tabs a.active { border-color: var(--brand); background: var(--brand); color: #fff; }
.filter-tabs a.active b { background: #fff; color: var(--brand); }
.approval-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.approval-card { padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.approval-driver { display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 12px; }
.approval-driver strong,
.approval-driver span { display: block; }
.approval-driver > div:nth-child(2) span { margin-top: 3px; color: var(--muted); font-size: 10px; }
.approval-trip { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 16px; }
.approval-trip > div { padding: 10px; border-radius: 10px; background: #f7f9f9; }
.approval-trip .wide { grid-column: span 2; }
.approval-trip span,
.approval-trip strong { display: block; }
.approval-trip span { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; letter-spacing: .06em; }
.approval-trip strong { margin-top: 4px; font-size: 11px; }
.approval-distance { display: flex; align-items: center; justify-content: space-between; margin: 14px 0; padding: 14px; border-radius: 12px; background: color-mix(in srgb, var(--brand) 7%, white); }
.approval-distance span { color: var(--muted); font-size: 10px; font-weight: 800; }
.approval-distance strong { color: var(--brand); font-size: 22px; }
.approval-reason { margin: 0 0 8px; color: #4d5558; font-size: 12px; line-height: 1.55; }
.approval-card > small { display: block; margin-top: 5px; color: var(--muted); font-size: 9px; }
.approval-form { display: grid; grid-template-columns: 150px minmax(0,1fr); gap: 10px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.approval-form textarea { min-height: 70px; }
.approval-actions { grid-column: span 2; display: flex; justify-content: flex-end; gap: 8px; }
.approval-resolution { margin-top: 16px; padding: 14px; border-radius: 12px; background: #f7f9f9; }
.approval-resolution strong,
.approval-resolution span { display: block; }
.approval-resolution span { margin-top: 4px; color: var(--muted); font-size: 9px; }
.approval-resolution p { margin: 8px 0 0; font-size: 11px; }
.approval-empty { grid-column: 1 / -1; }

@media (max-width: 1120px) {
    .driver-dashboard-hero { grid-template-columns: 1fr; }
    .driver-mini-qr { justify-content: center; }
    .driver-request-layout { grid-template-columns: 1fr; }
    .approval-grid { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
    .driver-license-summary { grid-template-columns: 86px minmax(0,1fr); gap: 14px; padding: 17px; }
    .driver-license-summary > .secondary-button { grid-column: span 2; width: 100%; }
    .license-photo { width: 86px; height: 108px; }
    .license-data h2 { font-size: 19px; }
    .driver-current-trip { grid-template-columns: 1fr; gap: 13px; }
    .driver-trip-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .driver-trip-actions > * { width: 100%; }
    .driver-mini-qr { align-items: flex-start; }
    .credential-main { grid-template-columns: 105px minmax(0,1fr); gap: 16px; padding: 20px; }
    .credential-photo { width: 105px; height: 135px; }
    .credential-copy h2 { font-size: 19px; }
    .credential-trip { margin: 0 20px; }
    .credential-qr { padding: 20px; }
    .credential-qr > div:first-child canvas,
    .credential-qr > div:first-child img { width: 118px !important; height: 118px !important; }
    .credential-foot { align-items: flex-start; flex-direction: column; padding: 13px 20px; }
    .public-driver-id-page { padding: 10px; }
    .public-id-wrap { min-height: calc(100vh - 20px); }
    .public-id-person { grid-template-columns: 95px minmax(0,1fr); gap: 14px; padding: 18px; }
    .public-id-person .credential-photo { width: 95px; height: 120px; }
    .public-id-person h1 { font-size: 20px; }
    .public-status { margin: 0 18px; }
    .public-trip { padding: 16px 18px; }
    .approval-form { grid-template-columns: 1fr; }
    .approval-actions { grid-column: auto; }
}
@media print {
    .driver-portal-body .topbar,
    .driver-portal-body .sidebar,
    .driver-portal-body .menu-overlay,
    .driver-portal-body .page-heading,
    .driver-portal-body .toast { display: none !important; }
    .driver-portal-body .app-shell { display: block; }
    .driver-portal-body .content { padding: 0; }
    .driver-credential-card { box-shadow: none; }
}

/* Flecha Operaciones v0.6 - Pre-salidas */
.predeparture-metrics { margin-bottom: 18px; }
.predeparture-search-panel { display: grid; grid-template-columns: minmax(0,1.4fr) minmax(320px,.8fr); gap: 18px; margin-bottom: 18px; }
.predeparture-search-form,
.predeparture-qr-form { display: grid; grid-template-columns: minmax(0,1fr) minmax(190px,.55fr) auto; align-items: end; gap: 12px; }
.predeparture-qr-form { grid-template-columns: minmax(0,1fr) auto; padding-left: 18px; border-left: 1px solid var(--line); }
.predeparture-search-form .field,
.predeparture-qr-form .field { margin: 0; }
.predeparture-layout { grid-template-columns: minmax(0,1.55fr) minmax(310px,.65fr); align-items: start; }
.predeparture-table .status { white-space: nowrap; }
.recent-inspection-list { display: grid; }
.recent-inspection-list > a { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--ink); }
.recent-inspection-list > a:last-child { border-bottom: 0; }
.recent-inspection-list strong,
.recent-inspection-list span { display: block; }
.recent-inspection-list > a > div span { margin-top: 4px; color: var(--muted); font-size: 10px; }
.predeparture-select-unit { max-width: 720px; }
.predeparture-select-unit > p { color: var(--muted); }
.vehicle-inspection-hero,
.inspection-report-hero { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 1px; overflow: hidden; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); box-shadow: var(--shadow); }
.vehicle-inspection-hero > div,
.inspection-report-hero > div { min-height: 115px; padding: 21px; background: #fff; }
.vehicle-inspection-hero span,
.vehicle-inspection-hero strong,
.vehicle-inspection-hero small,
.inspection-report-hero span,
.inspection-report-hero strong,
.inspection-report-hero small { display: block; }
.vehicle-inspection-hero span,
.inspection-report-hero span { color: var(--muted); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.vehicle-inspection-hero strong,
.inspection-report-hero strong { margin-top: 8px; font-size: 19px; line-height: 1.15; }
.vehicle-inspection-hero small,
.inspection-report-hero small { margin-top: 6px; color: var(--muted); line-height: 1.4; }
.inspection-report-hero.active { border-top: 5px solid #1f9d55; }
.inspection-report-hero.warning { border-top: 5px solid #d69413; }
.inspection-report-hero.cancelled { border-top: 5px solid #d83a4e; }
.inspection-checklist { display: grid; gap: 10px; }
.checklist-row { display: grid; grid-template-columns: minmax(190px,.85fr) minmax(440px,1.4fr) minmax(220px,.8fr); align-items: center; gap: 16px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.checklist-row.critical-item { border-left: 4px solid var(--brand); }
.checklist-label strong,
.checklist-label span { display: block; }
.checklist-label strong { font-size: 12px; line-height: 1.35; }
.checklist-label span { margin-top: 4px; color: var(--muted); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.checklist-options { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; }
.checklist-options label { position: relative; cursor: pointer; }
.checklist-options input { position: absolute; opacity: 0; pointer-events: none; }
.checklist-options span { display: grid; place-items: center; min-height: 38px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 10px; background: #f7f9f9; color: var(--muted); font-size: 9px; font-weight: 850; text-align: center; transition: .18s ease; }
.checklist-options input:checked + span { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, white); color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.checklist-options label:nth-child(3) input:checked + span { border-color: #d83a4e; background: #fff0f2; color: #b61d35; box-shadow: inset 0 0 0 1px #d83a4e; }
.checklist-notes { margin: 0; }
.checklist-notes input { min-height: 42px; }
.inspection-report-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; margin-bottom: 16px; }
.inspection-report-items { display: grid; gap: 8px; }
.report-item { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; }
.report-item > div strong,
.report-item > div span { display: block; }
.report-item > div strong { font-size: 11px; }
.report-item > div span { margin-top: 3px; color: var(--muted); font-size: 8px; text-transform: uppercase; }
.report-item > p { grid-column: 1 / -1; margin: 0; padding-top: 8px; border-top: 1px dashed var(--line); color: #4f565a; font-size: 10px; line-height: 1.5; }
.report-item.status-fail { border-left: 4px solid #d83a4e; }
.report-item.status-observation { border-left: 4px solid #d69413; }
.workshop-order-banner { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 16px; border-left: 5px solid #d83a4e; }
.workshop-order-banner span,
.workshop-order-banner strong,
.workshop-order-banner small { display: block; }
.workshop-order-banner > div:first-child > span { color: var(--muted); font-size: 9px; font-weight: 850; text-transform: uppercase; }
.workshop-order-banner > div:first-child > strong { margin-top: 4px; font-size: 19px; }
.workshop-order-banner > div:first-child > small { margin-top: 4px; color: var(--muted); }
.inspection-notes { margin-bottom: 16px; }
.inspection-notes p { margin: 0; color: #4f565a; line-height: 1.65; }
.inspection-evidence-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.inspection-evidence-grid a { overflow: hidden; border: 1px solid var(--line); border-radius: 13px; background: #fff; color: var(--ink); }
.inspection-evidence-grid img { width: 100%; aspect-ratio: 4 / 3; display: block; object-fit: cover; }
.inspection-evidence-grid span { display: block; padding: 9px; overflow: hidden; font-size: 9px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.vehicle-readiness-table .table-actions { min-width: 245px; }

@media (max-width: 1180px) {
    .predeparture-search-panel { grid-template-columns: 1fr; }
    .predeparture-qr-form { padding-left: 0; padding-top: 16px; border-left: 0; border-top: 1px solid var(--line); }
    .predeparture-layout { grid-template-columns: 1fr; }
    .checklist-row { grid-template-columns: 1fr; }
    .checklist-options { max-width: 680px; }
}
@media (max-width: 760px) {
    .predeparture-search-form,
    .predeparture-qr-form { grid-template-columns: 1fr; }
    .vehicle-inspection-hero,
    .inspection-report-hero { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .checklist-options { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .inspection-report-grid { grid-template-columns: 1fr; }
    .inspection-evidence-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .workshop-order-banner { align-items: flex-start; flex-direction: column; }
}
@media print {
    .inspection-report-hero,
    .inspection-report-grid,
    .inspection-notes { break-inside: avoid; }
    .inspection-evidence-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
}
.work-order-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px; }
.work-order-card { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: var(--shadow); }
.work-order-card.priority-critical { border-top: 5px solid #d83a4e; }
.work-order-card.priority-high { border-top: 5px solid #d69413; }
.work-order-card.priority-normal { border-top: 5px solid var(--brand-secondary); }
.work-order-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; padding: 20px; border-bottom: 1px solid var(--line); }
.work-order-card > header span,
.work-order-card > header h2,
.work-order-card > header small { display: block; }
.work-order-card > header > div > span { color: var(--brand); font-size: 9px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.work-order-card > header h2 { margin: 5px 0 3px; font-size: 22px; }
.work-order-card > header small { color: var(--muted); }
.work-order-meta { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; background: var(--line); }
.work-order-meta > div { padding: 13px 15px; background: #f8fafa; }
.work-order-meta span,
.work-order-meta strong { display: block; }
.work-order-meta span { color: var(--muted); font-size: 8px; font-weight: 850; text-transform: uppercase; }
.work-order-meta strong { margin-top: 4px; font-size: 10px; line-height: 1.4; }
.work-order-faults { padding: 17px 20px; }
.work-order-faults strong { font-size: 11px; }
.work-order-faults p { margin: 8px 0 0; color: #4f565a; font-size: 11px; line-height: 1.55; }
.work-order-form { display: grid; gap: 12px; padding: 18px 20px 20px; border-top: 1px solid var(--line); background: #fbfcfc; }
.work-order-form .field { margin: 0; }
.work-order-form textarea { min-height: 82px; }
.work-order-form .primary-button { justify-self: end; }
@media (max-width: 980px) { .work-order-grid { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .work-order-meta { grid-template-columns: 1fr; } .work-order-card > header { flex-direction: column; } }
.sheet-safety-cert { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); margin: 0 0 16px; border: 2px solid #1f9d55; border-radius: 12px; overflow: hidden; }
.sheet-safety-cert > div { padding: 13px 16px; background: #f1fbf5; }
.sheet-safety-cert > div + div { border-left: 1px solid #bfe6cd; }
.sheet-safety-cert span,
.sheet-safety-cert strong { display: block; }
.sheet-safety-cert span { color: #267446; font-size: 8px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.sheet-safety-cert strong { margin-top: 4px; font-size: 12px; }
