/* ==========================================================================
   TallerIN — componentes propios del taller
   Se carga después de app.css (sistema de diseño heredado de NeuroClinic) y
   usa sus mismos tokens. Aquí solo va lo específico del sector automotriz.
   ========================================================================== */

/* ---------- Utilidades ---------- */
.grid > .span-2 { grid-column: 1 / -1; }
.stat-hint { font-size: .72rem; color: var(--ink-500); margin-top: .1rem; }
.chart-box { position: relative; height: 260px; }
.avatar-icon { background: var(--primary-50); color: var(--primary-700); display: inline-grid; place-items: center; }
.avatar-icon .icon { width: 16px; height: 16px; }
.num { font-variant-numeric: tabular-nums; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- Placa vehicular (estilo matrícula) ---------- */
.plate {
    display: inline-flex; align-items: center; gap: .35rem;
    font-family: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
    font-weight: 800; letter-spacing: .08em; font-size: .82rem; line-height: 1;
    padding: .32rem .55rem; border-radius: 6px;
    background: #fff; color: var(--ink-900);
    border: 2px solid var(--ink-800);
    box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px var(--ink-300);
    white-space: nowrap;
}
.plate-lg { font-size: 1.15rem; padding: .45rem .8rem; border-width: 2.5px; }
.plate-none { border-style: dashed; color: var(--ink-400); font-weight: 600; letter-spacing: 0; }

/* ---------- Ficha de vehículo / cliente en listas ---------- */
.entity-card .top { display: flex; align-items: center; gap: .75rem; }
.entity-card .vehicle-ico {
    width: 44px; height: 44px; border-radius: 12px; flex: none;
    display: grid; place-items: center;
    background: var(--gradient-soft); color: var(--primary-700);
}
.entity-card .vehicle-ico img { width: 100%; height: 100%; object-fit: cover; border-radius: 12px; }

/* ---------- Odómetro ---------- */
.odo {
    display: inline-flex; align-items: baseline; gap: .25rem;
    font-family: ui-monospace, Menlo, Consolas, monospace; font-weight: 800;
    font-variant-numeric: tabular-nums;
}
.odo small { font-family: var(--font); font-weight: 600; color: var(--ink-500); font-size: .72em; }

/* ---------- Línea de tiempo del vehículo ---------- */
.timeline { position: relative; padding-left: 1.6rem; }
.timeline::before { content: ''; position: absolute; left: .55rem; top: .3rem; bottom: .3rem; width: 2px; background: var(--border); border-radius: 2px; }
.timeline-item { position: relative; padding-bottom: 1.1rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item .dot {
    position: absolute; left: -1.6rem; top: .1rem; width: 1.15rem; height: 1.15rem; border-radius: 50%;
    display: grid; place-items: center; background: var(--surface); border: 2px solid var(--primary-500); color: var(--primary-700);
}
.timeline-item .dot .icon { width: 10px; height: 10px; }
.timeline-item .when { font-size: .76rem; color: var(--ink-500); font-weight: 600; }
.timeline-item .what { font-weight: 700; color: var(--ink-900); }

/* ---------- Kanban / tablero de estados ---------- */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(260px, 1fr); gap: .9rem; overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x proximity; }
.board-col { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: .7rem; min-height: 120px; scroll-snap-align: start; }
.board-col h4 { margin: 0 0 .6rem; font-size: .82rem; display: flex; align-items: center; justify-content: space-between; color: var(--ink-700); }
.board-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .65rem .75rem; margin-bottom: .55rem; box-shadow: var(--shadow-xs); color: inherit; text-decoration: none; }
.board-card:hover { border-color: var(--primary-300); box-shadow: var(--shadow-sm); }

/* ---------- Estaciones (vista del taller) ---------- */
.bays { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem; }
.bay {
    position: relative; border-radius: var(--radius-lg); padding: .9rem; min-height: 150px;
    background: var(--surface); border: 2px dashed var(--border-strong);
    display: flex; flex-direction: column; gap: .5rem;
}
.bay.is-busy { border-style: solid; border-color: var(--primary-400); background: linear-gradient(180deg, var(--primary-50), var(--surface) 60%); }
.bay.is-reserved { border-style: solid; border-color: var(--amber); background: linear-gradient(180deg, var(--amber-bg), var(--surface) 60%); }
.bay.is-out { border-style: solid; border-color: var(--ink-300); background: repeating-linear-gradient(45deg, var(--ink-50), var(--ink-50) 10px, var(--surface) 10px, var(--surface) 20px); opacity: .85; }
.bay .bay-name { font-weight: 800; color: var(--ink-900); display: flex; align-items: center; gap: .4rem; }
.bay .bay-type { font-size: .74rem; color: var(--ink-500); }

/* ---------- Firma táctil ---------- */
.signature-pad { position: relative; border: 2px dashed var(--border-strong); border-radius: var(--radius); background: #fff; touch-action: none; }
.signature-pad canvas { display: block; width: 100%; height: 220px; border-radius: var(--radius); cursor: crosshair; }
.signature-pad .baseline { position: absolute; left: 8%; right: 8%; bottom: 46px; border-bottom: 1.5px solid var(--ink-300); pointer-events: none; }
.signature-pad .hint { position: absolute; left: 8%; bottom: 22px; font-size: .74rem; color: var(--ink-400); pointer-events: none; }

/* ---------- Inspección visual ---------- */
.inspection { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) 300px; }
@media (max-width: 1100px) { .inspection { grid-template-columns: 1fr; } }
.car-views { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: .6rem; }
.car-canvas { position: relative; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-lg); touch-action: manipulation; user-select: none; }
.car-canvas svg { display: block; width: 100%; height: auto; }
.damage-pin { cursor: pointer; }
.damage-legend { display: flex; flex-wrap: wrap; gap: .35rem; }
.damage-kind { display: inline-flex; align-items: center; gap: .35rem; padding: .35rem .6rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: .8rem; font-weight: 600; cursor: pointer; }
.damage-kind .sw { width: 12px; height: 12px; border-radius: 50%; }
.damage-kind.active { border-color: var(--primary-500); box-shadow: var(--ring); }

/* ---------- Fotos ---------- */
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: .6rem; }
.photo-tile { position: relative; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--ink-100); border: 1px solid var(--border); }
.photo-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-tile .cap { position: absolute; left: 0; right: 0; bottom: 0; padding: .3rem .45rem; font-size: .7rem; font-weight: 600; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.65)); }
.photo-add { display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: var(--radius); border: 2px dashed var(--border-strong); color: var(--ink-500); cursor: pointer; background: var(--surface); text-align: center; font-size: .78rem; font-weight: 600; }
.photo-add:hover { border-color: var(--primary-400); color: var(--primary-700); }

/* ---------- Combustible ---------- */
.fuel-gauge { display: grid; grid-template-columns: repeat(9, 1fr); gap: 3px; }
.fuel-gauge label { cursor: pointer; }
.fuel-gauge input { position: absolute; opacity: 0; pointer-events: none; }
.fuel-gauge span { display: block; height: 30px; border-radius: 4px; background: var(--ink-100); border: 1px solid var(--border); font-size: .62rem; font-weight: 700; color: var(--ink-500); display: grid; place-items: center; }
.fuel-gauge input:checked + span, .fuel-gauge label.fill span { background: var(--primary-500); border-color: var(--primary-600); color: #fff; }

/* ---------- Asistente por pasos (recepción en tablet) ---------- */
.wizard-steps { display: flex; gap: .4rem; overflow-x: auto; margin-bottom: 1rem; }
.wizard-steps .ws { flex: 1 0 auto; display: flex; align-items: center; gap: .45rem; padding: .55rem .8rem; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: .82rem; font-weight: 700; color: var(--ink-500); white-space: nowrap; }
.wizard-steps .ws .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--ink-100); font-size: .72rem; }
.wizard-steps .ws.current { border-color: var(--primary-500); color: var(--primary-700); background: var(--primary-50); }
.wizard-steps .ws.current .n, .wizard-steps .ws.done .n { background: var(--primary-600); color: #fff; }
.wizard-steps .ws.done { color: var(--ink-700); }

/* ---------- Totales de documentos ---------- */
.totals { margin-left: auto; min-width: 260px; }
.totals .row-t { display: flex; justify-content: space-between; gap: 1rem; padding: .3rem 0; font-variant-numeric: tabular-nums; }
.totals .grand { border-top: 2px solid var(--ink-800); margin-top: .3rem; padding-top: .5rem; font-weight: 800; font-size: 1.1rem; color: var(--ink-900); }

/* ---------- Tablas de líneas editables ---------- */
.lines { width: 100%; border-collapse: collapse; }
.lines th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-500); padding: .5rem; border-bottom: 1px solid var(--border); }
.lines td { padding: .45rem .5rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.lines tr:last-child td { border-bottom: 0; }

/* ---------- Margen / rentabilidad ---------- */
.margin-bar { height: 10px; border-radius: 999px; background: var(--ink-100); overflow: hidden; display: flex; }
.margin-bar span { display: block; height: 100%; }

/* ---------- Portal del cliente ---------- */
.portal { max-width: 720px; margin: 0 auto; padding: 1rem 1rem 3rem; }
.portal-head { display: flex; align-items: center; gap: .8rem; padding: 1.2rem 0; }
.portal-head .brand-mark { width: 48px; height: 48px; }

/* ---------- Impresión ---------- */
@media print {
    .sidebar, .topbar, .bottom-nav, .no-print, .hero-actions { display: none !important; }
    .main { margin: 0 !important; }
    body { background: #fff; }
}

/* ---------- Tablas compactas ---------- */
.table-compact th, .table-compact td { padding: .42rem .6rem; }
.timeline-item .dot.tone-slate { border-color: var(--ink-400); color: var(--ink-600); }
.timeline-item .dot.tone-blue { border-color: var(--blue); color: var(--blue-ink); }
.timeline-item .dot.tone-green { border-color: var(--green); color: var(--green-ink); }
.timeline-item .dot.tone-amber { border-color: var(--amber); color: var(--amber-ink); }
.timeline-item .dot.tone-red { border-color: var(--red); color: var(--red-ink); }
.timeline-item .dot.tone-violet { border-color: var(--violet); color: var(--violet-ink); }

/* ---------- Chips con casilla (accesorios) ---------- */
.chip-check { cursor: pointer; user-select: none; }
.chip-check input { margin: 0 .2rem 0 0; accent-color: var(--primary-600); }
.chip-check:has(input:checked) { background: var(--primary-50); border-color: var(--primary-300); color: var(--primary-800); }
.car-canvas svg { cursor: crosshair; }
.input-lg { height: 54px; font-size: 1.1rem; }

/* Reportes */
a.report-card { color: inherit; transition: transform var(--t), box-shadow var(--t); }
a.report-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); color: inherit; }
.table tfoot td { border-top: 2px solid var(--border); background: var(--surface-2, transparent); }

/* =============================================================================
   Operación guiada: botones grandes, proceso por etapas y cronómetro
   ============================================================================= */
.btn { min-height: 44px; height: auto; touch-action: manipulation; }
.btn-sm { min-height: 36px; }
.btn-xs { min-height: 30px; }
.btn-xl { min-height: 64px; padding: .6rem 1.75rem; font-size: 1.12rem; font-weight: 700; border-radius: 16px; gap: .65rem; white-space: normal; }
.btn-xl .icon { width: 24px; height: 24px; }
.btn-go { --btn-bg: #15803d; --btn-fg: #fff; --btn-bd: transparent; box-shadow: 0 8px 18px -8px rgba(21, 128, 61, .7); }
.btn-go:hover { --btn-bg: #166534; }
.btn-pause { --btn-bg: #fef3c7; --btn-fg: #92400e; --btn-bd: #fcd34d; }
.btn-pause:hover { --btn-bg: #fde68a; }

/* Etapas */
.process { list-style: none; margin: 0 0 1rem; padding: .9rem .6rem; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.process-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: .4rem; text-align: center; color: var(--ink-400); font-size: .8rem; font-weight: 600; }
.process-step::before { content: ''; position: absolute; top: 22px; left: calc(-50% + 26px); right: calc(50% + 26px); height: 3px; border-radius: 2px; background: var(--ink-100); }
.process-step:first-child::before { display: none; }
.process-dot { position: relative; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--ink-100); color: var(--ink-500); }
.process-dot .icon { width: 22px; height: 22px; }
.process-step.done { color: var(--ink-700); }
.process-step.done .process-dot { background: #15803d; color: #fff; }
.process-step.done::before, .process-step.current::before { background: #15803d; }
.process-step.current { color: var(--primary-700); font-weight: 800; }
.process-step.current .process-dot { background: var(--primary-600); color: #fff; box-shadow: 0 0 0 5px var(--primary-100); }

/* Siguiente paso */
.next-card { background: var(--surface); border: 2px solid var(--primary-200, var(--border)); border-radius: var(--radius-xl); padding: 1.35rem 1.5rem; box-shadow: var(--shadow-sm); }
.next-head { display: flex; align-items: center; gap: 1rem; }
.next-head h3, .next-work-side h3 { margin: 0; font-size: 1.35rem; font-weight: 800; color: var(--ink-900); }
.next-head p, .next-work-side p { margin: .2rem 0 0; color: var(--ink-600); font-size: 1rem; }
.next-icon { flex-shrink: 0; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary-700); }
.next-icon .icon { width: 32px; height: 32px; }
.next-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin-top: 1.1rem; }
.next-section-label { display: flex; align-items: center; gap: .4rem; margin: 1.1rem 0 .55rem; font-weight: 700; color: var(--ink-700); }
.next-section-label .icon { width: 18px; height: 18px; }
.next-work { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 1.5rem; align-items: center; }
.pick-row { display: flex; flex-wrap: wrap; gap: .5rem; }
.pick-chip input { position: absolute; opacity: 0; }
.pick-chip span { display: grid; place-items: center; min-width: 76px; min-height: 48px; padding: 0 1rem; border-radius: 12px; border: 2px solid var(--border-strong); background: var(--surface); font-weight: 700; cursor: pointer; }
.pick-chip input:checked + span { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.pick-chip input:focus-visible + span { box-shadow: var(--ring); }
.tech-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .75rem; }
.tech-card { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 1rem .75rem; border-radius: 16px; border: 2px solid var(--border); background: var(--surface); cursor: pointer; text-align: center; font: inherit; color: inherit; transition: border-color var(--t), box-shadow var(--t); }
.tech-card:hover, .tech-card:focus-visible { border-color: var(--primary-500); box-shadow: var(--ring); outline: none; }
.tech-card .avatar-lg { width: 60px; height: 60px; font-size: 1.15rem; }
.tech-name { font-weight: 800; font-size: 1.02rem; }
.tech-meta { font-size: .8rem; color: var(--ink-500); min-height: 1.1em; }
.tech-load { display: inline-flex; align-items: center; gap: .3rem; font-size: .82rem; font-weight: 700; margin-top: .2rem; }

/* Cronómetro */
.clock { padding: 1.1rem 1.25rem; border-radius: 18px; background: #0f172a; color: #fff; text-align: center; }
.clock-state { display: inline-flex; align-items: center; gap: .45rem; font-size: .85rem; font-weight: 600; color: #cbd5e1; }
.clock-state .dot { width: 10px; height: 10px; border-radius: 50%; background: #64748b; }
.clock.is-running .clock-state .dot { background: #4ade80; animation: clock-pulse 1.6s ease-in-out infinite; }
.clock-digits { font-family: ui-monospace, 'SF Mono', Consolas, monospace; font-variant-numeric: tabular-nums; font-size: clamp(2.6rem, 6vw, 3.6rem); font-weight: 700; line-height: 1.15; letter-spacing: .02em; }
.clock-goal { margin-top: .4rem; }
.clock-bar { height: 8px; border-radius: 4px; background: #334155; overflow: hidden; }
.clock-bar span { display: block; height: 100%; background: #4ade80; transition: width .4s linear; }
.clock-goal-text { margin-top: .35rem; font-size: .9rem; color: #e2e8f0; }
.clock.is-over .clock-bar span { background: #f87171; }
.clock.is-over .clock-goal-text { color: #fca5a5; font-weight: 700; }
.clock-sm { padding: .7rem .9rem; border-radius: 14px; }
.clock-sm .clock-digits { font-size: 2rem; }
@keyframes clock-pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .clock.is-running .clock-state .dot { animation: none; } }

/* Encabezado de la orden */
.wo-header { display: flex; flex-wrap: wrap; align-items: center; gap: 1.1rem; margin-bottom: 1rem; }
.wo-vehicle { flex-shrink: 0; color: var(--ink-800); }
.wo-sil { display: block; width: 168px; height: auto; }
.wo-who { flex: 1 1 280px; min-width: 0; }
.wo-who h2 { margin: .3rem 0 .25rem; font-size: 1.4rem; }
.wo-header .actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Tablero del técnico */
.job-list { display: grid; gap: .9rem; }
.job-card { display: grid; grid-template-columns: 170px minmax(0, 1fr) minmax(260px, 340px); gap: 1.1rem; align-items: center; padding: 1.1rem 1.25rem; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-xl); }
.job-card.is-urgente { border-color: #fca5a5; }
.job-card.is-alta { border-color: #fcd34d; }
.job-card.is-running { border-color: #16a34a; box-shadow: 0 0 0 4px rgba(22, 163, 74, .12); }
.job-vehicle { display: flex; flex-direction: column; align-items: center; gap: .5rem; color: var(--ink-800); }
.job-sil { width: 150px; height: auto; }
.job-title { display: block; font-size: 1.25rem; font-weight: 800; color: var(--ink-900); }
.job-reason { margin-top: .15rem; font-size: 1rem; color: var(--ink-600); }
.job-tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .5rem; }
.job-action { display: grid; gap: .55rem; }
.job-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.job-spent { display: flex; align-items: center; justify-content: center; gap: .35rem; font-weight: 700; color: var(--ink-600); }
.job-wait { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 64px; padding: .5rem 1rem; border-radius: 16px; background: var(--ink-100); color: var(--ink-600); font-weight: 700; text-align: center; }

/* Tablero por etapas */
.board-process { grid-auto-columns: minmax(220px, 1fr); }
.board-col { scroll-margin-top: 90px; }
.board-col:target { outline: 3px solid var(--primary-400); }
.board-card { color: inherit; padding: .8rem; }
.board-card.is-urgente { border-left: 4px solid #dc2626; }
.board-card.is-alta { border-left: 4px solid #f59e0b; }
.board-sil { display: block; width: 110px; height: auto; margin: 0 auto .4rem; color: var(--ink-700); }

/* Inicio */
.home-head { margin-bottom: 1rem; }
.home-head h2 { margin: 0; font-size: 1.6rem; font-weight: 800; }
.home-head p { margin: .1rem 0 0; color: var(--ink-500); }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: .9rem; margin-bottom: 1.25rem; }
.tile { position: relative; display: flex; flex-direction: column; justify-content: space-between; gap: .35rem; min-height: 148px; padding: 1.1rem 1.2rem; background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius-xl); color: var(--ink-900); transition: border-color var(--t), box-shadow var(--t); }
.tile:hover { border-color: var(--primary-400); box-shadow: var(--shadow); color: var(--ink-900); }
.tile:focus-visible { outline: none; box-shadow: var(--ring); }
.tile-icon { width: 54px; height: 54px; border-radius: 15px; display: grid; place-items: center; background: var(--ink-100); color: var(--ink-700); }
.tile-icon .icon { width: 28px; height: 28px; }
.tile-count { position: absolute; top: .95rem; right: 1.15rem; font-size: 2.3rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.tile-label { font-size: 1.08rem; font-weight: 800; line-height: 1.2; }
.tile-hint { font-size: .86rem; opacity: .85; }
.tile-amber .tile-icon { background: var(--amber-bg); color: var(--amber-ink); }
.tile-violet .tile-icon { background: var(--violet-bg); color: var(--violet-ink); }
.tile-blue .tile-icon { background: var(--blue-bg); color: var(--blue-ink); }
.tile-cyan .tile-icon { background: var(--cyan-bg); color: var(--cyan-ink); }
.tile-green .tile-icon { background: var(--green-bg); color: var(--green-ink); }
.tile-red .tile-icon { background: var(--red-bg); color: var(--red-ink); }
.tile-primary { background: var(--gradient); border-color: transparent; color: #fff; grid-column: span 2; }
.tile-primary:hover { color: #fff; border-color: transparent; }
.tile-primary .tile-icon { background: rgba(255, 255, 255, .2); color: #fff; }
.tile-primary .tile-label { font-size: 1.45rem; }

/* Menú */
.nav-link { min-height: 46px; }
.nav-more summary { list-style: none; cursor: pointer; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more-chev { margin-left: auto; transition: transform var(--t); }
.nav-more[open] .nav-more-chev { transform: rotate(180deg); }

/* Recepción */
.wizard-steps { gap: .5rem; }
.wizard-steps .ws { padding: .6rem .9rem; border-radius: 14px; min-height: 60px; font-weight: 700; }
.wizard-steps .ws .n { width: 40px; height: 40px; border-radius: 12px; flex-shrink: 0; }
.wizard-steps .ws .n .icon { width: 20px; height: 20px; }
.ws-text { display: flex; flex-direction: column; text-align: left; line-height: 1.2; }
.ws-text small { font-size: .7rem; font-weight: 600; opacity: .7; }
.body-picker { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .5rem; margin-bottom: 1rem; }
.body-option { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .6rem .4rem; border-radius: 14px; border: 2px solid var(--border); background: var(--surface); color: var(--ink-700); cursor: pointer; font: inherit; font-weight: 700; font-size: .85rem; }
.body-option:hover { border-color: var(--primary-300); }
.body-option.active { border-color: var(--primary-600); background: var(--primary-50); color: var(--primary-700); }
.body-sil { width: 100%; max-width: 120px; height: auto; }
.car-sil, .wo-sil, .job-sil, .board-sil, .body-sil { overflow: visible; }
.car-canvas svg.sil-off { display: none; }
.car-canvas { background: #fff; }
.car-views .chip, .damage-kind { min-height: 44px; }
.fuel-gauge span { height: 44px; display: grid; place-items: center; font-size: .78rem; }
.chips .chip-check { min-height: 44px; }

@media (max-width: 900px) {
    .job-card { grid-template-columns: 120px minmax(0, 1fr); }
    .job-sil { width: 110px; }
    .job-action { grid-column: 1 / -1; }
    .next-work { grid-template-columns: minmax(0, 1fr); }
    .body-picker { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .process { padding: .7rem .2rem; }
    .process-dot { width: 36px; height: 36px; }
    .process-dot .icon { width: 18px; height: 18px; }
    .process-step::before { top: 17px; left: calc(-50% + 20px); right: calc(50% + 20px); }
    .process-label { font-size: .62rem; line-height: 1.15; }
    .next-card { padding: 1rem; }
    .next-actions .btn { width: 100%; }
    .next-icon { width: 52px; height: 52px; }
    .next-head h3 { font-size: 1.15rem; }
    .wo-sil { width: 120px; }
    .tile-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .tile-primary { grid-column: 1 / -1; }
    .tile { min-height: 124px; padding: .9rem; }
    .tile-count { font-size: 1.8rem; }
    .tile-label { font-size: .95rem; }
    .job-card { padding: .9rem; }
}

.job-list { grid-template-columns: minmax(0, 1fr); }
.job-card > * { min-width: 0; }
.job-buttons .btn { white-space: normal; padding-inline: .6rem; }
.card-footer.row { flex-wrap: wrap; gap: .5rem; }
.inspection .card-footer .btn { white-space: normal; }

/* =============================================================================
   Plan del día, rastreador del cliente y aprobación en sitio
   ============================================================================= */
.gantt-legend { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-bottom: .75rem; font-size: .85rem; color: var(--ink-600); }
.gantt-key { display: inline-flex; align-items: center; gap: .3rem; }
.gantt-swatch { width: 22px; height: 12px; border-radius: 3px; border: 1.5px solid transparent; }
.gantt-wrap { overflow-x: auto; }
.gantt { min-width: 980px; }
.gantt-head, .gantt-row { display: grid; grid-template-columns: 180px minmax(0, 1fr); }
.gantt-head { border-bottom: 2px solid var(--border); font-size: .8rem; font-weight: 700; color: var(--ink-500); }
.gantt-row { border-bottom: 1px solid var(--border); }
.gantt-row:last-child { border-bottom: 0; }
.gantt-name { position: sticky; left: 0; z-index: 3; display: flex; align-items: center; gap: .5rem; padding: .6rem .75rem; background: var(--surface); border-right: 1px solid var(--border); font-size: .9rem; }
.gantt-head .gantt-track { height: 34px; }
.gantt-track { position: relative; }
.gantt-hour { position: absolute; top: 9px; transform: translateX(-50%); white-space: nowrap; }
.gantt-hour:first-child { transform: none; padding-left: 4px; }
.gantt-hour:last-child { transform: translateX(-100%); padding-right: 4px; }
.gantt-line { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--border); }
.gantt-now { position: absolute; top: 0; bottom: 0; width: 2px; background: #dc2626; z-index: 2; }
.gantt-now::before { content: ''; position: absolute; top: -1px; left: -4px; width: 10px; height: 10px; border-radius: 50%; background: #dc2626; }
.gantt-bar { position: absolute; height: 54px; border-radius: 9px; overflow: hidden; border: 1.5px solid #cbd5e1; background: #f1f5f9; color: #0f172a; z-index: 1; transition: box-shadow var(--t); }
.gantt-bar:hover, .gantt-bar:focus-visible { box-shadow: var(--shadow); color: #0f172a; z-index: 4; outline: none; }
.gantt-seg { position: absolute; top: 0; bottom: 0; background: #bbf7d0; }
.gantt-text { position: relative; display: flex; flex-direction: column; justify-content: center; height: 100%; padding: 0 .5rem; line-height: 1.2; white-space: nowrap; }
.gantt-text strong { font-size: .84rem; }
.gantt-text small { font-size: .72rem; opacity: .85; }
.gantt-bar.is-corriendo, .gantt-swatch.is-corriendo { border-color: #16a34a; background: #f0fdf4; }
.gantt-swatch.is-corriendo { background: #bbf7d0; }
.gantt-bar.is-pausado, .gantt-swatch.is-pausado { border-color: #f59e0b; background: #fffbeb; }
.gantt-bar.is-pausado .gantt-seg { background: #fde68a; }
.gantt-swatch.is-pausado { background: #fde68a; }
.gantt-bar.is-cola, .gantt-swatch.is-cola { border: 1.5px dashed #64748b; background: #f8fafc; }
.gantt-bar.is-cita, .gantt-swatch.is-cita { border-color: #2563eb; background: #eff6ff; }
.gantt-bar.is-terminado, .gantt-swatch.is-terminado { border-color: #94a3b8; background: #e2e8f0; }
.gantt-bar.is-terminado .gantt-seg { background: #cbd5e1; }
.gantt-bar.is-over, .gantt-swatch.is-over { border-color: #dc2626; }
.gantt-bar.is-over .gantt-seg { background: #fecaca; }
.gantt-swatch.is-over { background: #fecaca; }

.finding-alert, .portal-alert { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; padding: .9rem 1.1rem; border-radius: var(--radius-lg); background: #fef2f2; border: 2px solid #fca5a5; color: #7f1d1d; }
.finding-alert .next-icon, .portal-alert .next-icon { width: 52px; height: 52px; background: #fee2e2; color: #b91c1c; }
.portal-alert { margin-bottom: .75rem; color: #7f1d1d; }
.portal-alert:hover { color: #7f1d1d; box-shadow: var(--shadow); }
.portal-alert .block { display: block; font-size: .92rem; }
.onsite-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem 1rem; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); font-weight: 600; }
.onsite-bar span { display: inline-flex; align-items: center; gap: .45rem; }
.brings-check { display: inline-flex; align-items: center; gap: .4rem; min-height: 36px; font-size: .88rem; font-weight: 600; color: var(--primary-700); }
.brings-check input { width: 18px; height: 18px; accent-color: var(--primary-600); }

/* Portal: rastreador */
.portal-login { max-width: 460px; margin: 1rem auto; }
.portal-vehicle, .portal-appt { display: flex; align-items: center; gap: 1rem; }
.portal-sil { width: 150px; height: auto; flex-shrink: 0; color: var(--ink-800); overflow: visible; }
.maint-goals { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .75rem; margin-bottom: .9rem; }
.maint-goal { display: flex; gap: .7rem; align-items: flex-start; padding: .8rem; border: 1px solid var(--ink-200); border-radius: 12px; }
.maint-goal > .icon { width: 24px; height: 24px; flex-shrink: 0; color: var(--primary-600); }
.maint-goal div > * { display: block; }
.maint-goal strong { font-size: 1.2rem; font-weight: 800; line-height: 1.25; }
.maint-bar.maint-soon span { background: #d97706; }
.maint-bar.maint-due span { background: #dc2626; }
.maint-last { margin-top: 1rem; padding-top: .9rem; border-top: 1px solid var(--ink-100); }
.portal-detail { white-space: pre-line; }
.dev-credit { margin-top: 1.25rem; text-align: center; font-size: .78rem; color: var(--ink-500); }
.dev-credit a { color: var(--primary-700); font-weight: 700; }
.dev-credit-float { position: fixed; right: 1.5rem; bottom: .75rem; margin: 0; }
@media (max-width: 900px) { .dev-credit-float { left: 0; right: 0; } }
@media print { .dev-credit { display: none; } }
.portal-hero { position: relative; overflow: hidden; margin-bottom: .75rem; border-radius: 18px; background: linear-gradient(160deg, #1e293b, #0f172a); color: #fff; box-shadow: var(--shadow); }
.portal-hero .hero-photo { display: block; width: 100%; height: 280px; object-fit: cover; }
.portal-hero .hero-sil { display: grid; place-items: center; height: 230px; padding: 1rem 1rem 4.5rem; color: #f8fafc; }
.portal-hero .hero-sil .portal-sil path, .portal-hero .hero-sil .portal-sil circle, .portal-hero .hero-sil .portal-sil rect { stroke-width: 2.4; }
.portal-hero .hero-sil .portal-sil { width: 240px; max-width: 70%; }
.portal-hero .hero-cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.5rem 1.25rem 1rem; background: linear-gradient(transparent, rgba(2, 6, 23, .88)); }
.portal-hero .hero-plate { font-family: ui-monospace, Consolas, monospace; font-size: 2.1rem; font-weight: 800; letter-spacing: .12em; line-height: 1.1; text-shadow: 0 2px 8px rgba(0, 0, 0, .45); }
.portal-hero .hero-model { margin-top: .2rem; font-size: 1rem; font-weight: 600; opacity: .92; }
.portal-hero .hero-live { position: absolute; top: .75rem; right: .75rem; display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .65rem; border-radius: 99px; background: rgba(2, 6, 23, .6); font-size: .75rem; font-weight: 700; }
.portal-stats { padding: .4rem 1.1rem; }
.portal-stats .stat-owner { padding: .6rem 0; font-weight: 600; color: var(--ink-600); border-bottom: 1px solid var(--ink-100); }
.portal-stats .stat-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 54px; border-bottom: 1px solid var(--ink-100); }
.portal-stats .stat-row:last-child { border-bottom: 0; }
.portal-stats .stat-row span { display: inline-flex; align-items: center; gap: .5rem; color: var(--ink-600); }
.portal-stats .stat-row span .icon { width: 18px; height: 18px; color: var(--ink-400); }
.portal-stats .stat-row strong { display: inline-flex; align-items: center; gap: .35rem; font-size: 1.15rem; font-weight: 800; color: var(--ink-900); }
.portal-stats .stat-row strong .icon { width: 18px; height: 18px; }
.portal-stats .stat-green { color: #15803d !important; } .portal-stats .stat-amber { color: #b45309 !important; }
.portal-stats .stat-red { color: #b91c1c !important; } .portal-stats .stat-blue { color: #1d4ed8 !important; }
.portal-tabs { background: var(--surface); border-radius: 14px; padding: .3rem; box-shadow: var(--shadow-sm, none); }
.portal-tabs .tab { flex: 1; justify-content: center; min-height: 46px; font-size: 1rem; }
@media (max-width: 560px) { .portal-hero .hero-photo { height: 230px; } .portal-hero .hero-plate { font-size: 1.7rem; } }
.portal-live-tag { display: inline-flex; align-items: center; gap: .4rem; margin-top: .3rem; font-size: .78rem; font-weight: 600; color: var(--ink-500); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: #16a34a; animation: live-dot 2s ease-in-out infinite; }
@keyframes live-dot { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }
.maint-request summary { list-style: none; cursor: pointer; }
.maint-request summary::-webkit-details-marker { display: none; }
.maint-request[open] summary { display: none; }
.maint-periods { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .5rem; }
.maint-periods legend { padding: 0; margin-bottom: .35rem; }
.maint-period { display: block; cursor: pointer; }
.maint-period input { position: absolute; opacity: 0; }
.maint-period span { display: flex; align-items: center; justify-content: center; min-height: 52px; padding: .4rem .6rem; text-align: center; font-weight: 700; border: 2px solid var(--ink-200); border-radius: 12px; }
.maint-period input:checked + span { background: var(--primary-600); border-color: var(--primary-600); color: #fff; }
.maint-period input:focus-visible + span { outline: 3px solid var(--primary-300); outline-offset: 2px; }
.tracker-title { margin: 0; font-size: 1.45rem; font-weight: 800; }
.tracker-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.tracker-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; text-align: center; color: var(--ink-400); }
.tracker-step::before { content: ''; position: absolute; top: 23px; left: -50%; right: 50%; height: 8px; background: var(--ink-100); z-index: 0; }
.tracker-step:first-child::before { display: none; }
.tracker-dot { position: relative; z-index: 1; width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--ink-100); color: var(--ink-500); }
.tracker-dot .icon { width: 26px; height: 26px; }
.tracker-label { font-size: .78rem; font-weight: 700; line-height: 1.15; }
.tracker-step.done { color: var(--ink-700); }
.tracker-step.done::before, .tracker-step.current::before { background: #15803d; }
.tracker-step.done .tracker-dot { background: #15803d; color: #fff; }
.tracker-step.current { color: var(--primary-700); }
.tracker-step.current .tracker-dot { background: var(--primary-600); color: #fff; box-shadow: 0 0 0 6px var(--primary-100); animation: tracker-pulse 2s ease-in-out infinite; }
.tracker-step.waiting .tracker-dot { background: #d97706; box-shadow: 0 0 0 6px #fef3c7; }
.tracker-progress { margin-top: 1.1rem; display: grid; gap: .35rem; }
.tracker-bar { height: 14px; border-radius: 7px; background: var(--ink-100); overflow: hidden; }
.tracker-bar span { display: block; height: 100%; background: #15803d; }
@keyframes tracker-pulse { 50% { transform: scale(1.06); } }
@media (prefers-reduced-motion: reduce) { .tracker-step.current .tracker-dot { animation: none; } }
@media (max-width: 560px) {
    .tracker-dot { width: 40px; height: 40px; }
    .tracker-dot .icon { width: 20px; height: 20px; }
    .tracker-step::before { top: 16px; height: 6px; }
    .tracker-label { font-size: .62rem; }
    .portal-sil { width: 104px; }
    .portal-alert .btn { width: 100%; }
}

.approval-signature { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .4rem; }
.approval-signature img { height: 56px; width: auto; max-width: 100%; background: #fff; border: 1px solid var(--border); border-radius: 8px; }

.input-static { margin: 0; min-height: 44px; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .5rem .75rem; border-radius: 11px; background: var(--ink-100); font-weight: 600; }
.extension-alert { display: flex; flex-wrap: wrap; align-items: center; gap: .9rem; padding: .9rem 1.1rem; border-radius: var(--radius-lg); background: #fffbeb; border: 2px solid #fcd34d; color: #78350f; }
.extension-alert .next-icon { width: 52px; height: 52px; background: #fef3c7; color: #b45309; }

/* Cobro con varios medios de pago */
.pay-due { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .85rem 1.1rem; border-radius: 14px; background: #0f172a; color: #fff; }
.pay-due strong { font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.pay-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: .6rem; }
.pay-card { position: relative; display: flex; flex-direction: column; align-items: center; gap: .35rem; min-height: 96px; padding: .85rem .5rem; border: 2px solid var(--border); border-radius: 14px; background: var(--surface); color: var(--ink-800); font: inherit; font-weight: 700; font-size: .88rem; line-height: 1.2; text-align: center; cursor: pointer; touch-action: manipulation; transition: border-color var(--t), background var(--t); }
.pay-card:hover:not(:disabled) { border-color: #86efac; }
.pay-card:focus-visible { outline: none; box-shadow: var(--ring); }
.pay-card.selected { border-color: #16a34a; background: #f0fdf4; box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
.pay-card:disabled { opacity: .5; cursor: not-allowed; }
.pay-card-icon .icon { width: 30px; height: 30px; }
.pay-card-note { font-size: .72rem; font-weight: 600; color: var(--ink-500); }
.pay-card-check { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; display: none; place-items: center; background: #16a34a; color: #fff; }
.pay-card-check .icon { width: 14px; height: 14px; }
.pay-card.selected .pay-card-check { display: grid; }
.pay-rows { display: grid; gap: .5rem; margin-top: .85rem; }
.pay-row { display: grid; grid-template-columns: minmax(130px, 1.1fr) minmax(110px, 1fr) minmax(140px, 1.2fr); align-items: center; gap: .6rem; }
.pay-row-name { display: inline-flex; align-items: center; gap: .4rem; font-weight: 700; }
.pay-row-name .icon { width: 20px; height: 20px; }
.pay-amount { font-size: 1.1rem; font-weight: 700; text-align: right; }
.pay-cash { margin-top: .85rem; padding: .9rem 1rem; border-radius: 14px; background: #fffbeb; border: 1px solid #fde68a; }
.pay-cash[hidden] { display: none; }
.pay-cash-grid { display: grid; grid-template-columns: minmax(150px, 220px) minmax(0, 1fr); align-items: center; gap: .6rem; }
.pay-received { font-size: 1.25rem; font-weight: 700; text-align: right; }
.pay-quick { display: flex; flex-wrap: wrap; gap: .35rem; }
.pay-change { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: .7rem; padding: .7rem 1rem; border-radius: 12px; background: #dcfce7; color: #14532d; font-weight: 700; }
.pay-change strong { font-size: 1.7rem; font-variant-numeric: tabular-nums; }
.pay-change.is-short { background: #fee2e2; color: #7f1d1d; }
.pay-summary { margin: .85rem 0 0; font-size: .95rem; }
@media (max-width: 640px) {
    .pay-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
    .pay-ref { grid-column: 1 / -1; }
    .pay-cash-grid { grid-template-columns: minmax(0, 1fr); }
    .pay-due strong, .pay-change strong { font-size: 1.4rem; }
}

/* Recordatorios */
.today-card { border: 2px solid var(--primary-200, var(--border)); }
.reminder-row { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .85rem 1.1rem; border-top: 1px solid var(--border); }
.reminder-row:first-child { border-top: 0; }
.reminder-info { min-width: 220px; }
.reminder-info .title { font-weight: 700; }
.reminder-info .sub { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .25rem; font-size: .84rem; color: var(--ink-600); }
.reminder-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }

/* Campanita */
.bell-btn { position: relative; }
.bell-dot { position: absolute; top: 2px; right: 2px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; display: grid; place-items: center; background: #dc2626; color: #fff; font-size: .68rem; font-weight: 800; line-height: 1; box-shadow: 0 0 0 2px var(--surface); }
.bell-dot[hidden] { display: none; }
.bell-menu { width: min(380px, calc(100vw - 24px)); padding: 0; }
.bell-list { max-height: min(60vh, 460px); overflow-y: auto; }
.alert-item { display: flex; align-items: flex-start; gap: .65rem; padding: .7rem .9rem; border-top: 1px solid var(--border); color: var(--ink-800); }
.alert-item:hover, .alert-item:focus-visible { background: var(--surface-2, var(--ink-100)); color: var(--ink-900); outline: none; }
.alert-item-icon { flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.alert-item-icon .icon { width: 18px; height: 18px; }
.alert-item-text { display: flex; flex-direction: column; gap: .1rem; min-width: 0; font-size: .86rem; line-height: 1.3; overflow-wrap: anywhere; }
.alert-item-text strong { font-weight: 700; }
.alert-item-text small { font-size: .74rem; color: var(--ink-500); }
.alert-empty { display: flex; align-items: center; justify-content: center; gap: .4rem; padding: 1.4rem .9rem; color: var(--ink-500); font-size: .9rem; }
.attention-alerts .alert-item:first-child { border-top: 0; }
.attention-alerts { border-bottom: 1px solid var(--border); }

/* Importar datos */
.import-preview { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .75rem; }
.import-preview > div { display: flex; flex-direction: column; gap: .15rem; padding: .9rem 1rem; border: 1px solid var(--ink-100); border-radius: 12px; }
.import-preview strong { font-size: 1.6rem; font-weight: 800; color: var(--ink-900); line-height: 1.1; }
.import-preview span { font-weight: 600; color: var(--ink-700); }
.import-preview small { color: var(--ink-500); }
.import-rules { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: .55rem; }
.import-rules li { display: flex; gap: .55rem; align-items: flex-start; line-height: 1.4; }
.import-rules .icon { flex-shrink: 0; width: 18px; height: 18px; margin-top: .1rem; color: #15803d; }
.import-steps { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: .35rem; }
.import-steps li { display: flex; align-items: center; gap: .7rem; min-height: 44px; padding: .4rem .75rem; border-radius: 10px; background: var(--surface); border: 1px solid var(--ink-100); font-weight: 600; }
.import-steps .dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink-100); color: var(--ink-500); flex-shrink: 0; }
.import-steps .dot .icon { width: 15px; height: 15px; }
.import-steps li.done .dot { background: #15803d; color: #fff; }
.import-steps li.running { border-color: var(--primary-300); background: var(--primary-50); }
.import-steps li.running .dot { background: var(--primary-600); color: #fff; animation: tracker-pulse 1.4s ease-in-out infinite; }
.import-steps li.failed .dot { background: #dc2626; color: #fff; }
.import-steps li.failed [data-phase-result] { color: var(--red-ink); }
.import-note { display: flex; gap: .5rem; align-items: flex-start; padding: .35rem 0; font-size: .9rem; }
.import-note .icon { flex-shrink: 0; width: 16px; height: 16px; margin-top: .15rem; }
