/* =====================================================================
   TM Gestión · estilos
   Base: Bootstrap 4. Un único color de acento (el de cada empresa, --deca);
   los colores de estado solo se usan para estados. Superficies blancas con
   borde fino, sin sombras decorativas.
   ===================================================================== */

@font-face {
  font-family: 'Archivo';
  src: url('fonts/archivo.woff2') format('woff2');
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
}

:root {
  --deca: #063a86; --deca-dark: #042a63; --deca-light: #e7eefa; --tm-vivo: #0071ec;
  --ink: #17212b; --ink-2: #3e4b59; --muted: #6b7785; --muted-2: #94a0ad;
  --line: #e2e6eb; --line-2: #eef1f4; --canvas: #f4f6f8; --surface: #fff;
  --ok: #157a48; --ok-bg: #e5f3eb; --warn: #9a5b00; --warn-bg: #fcf0d9; --bad: #b42318; --bad-bg: #fdeceb;
  --run: #0a6b76; --run-bg: #def1f2; --info: #384a9c; --info-bg: #eceefa; --neutral-bg: #eef1f4;
  --r-lg: 12px; --r: 8px; --r-sm: 6px;
  --side-w: 236px;
  --font: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* ---------- Base ---------- */
b, strong { font-weight: 650; }
.font-weight-bold { font-weight: 650 !important; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--ink); background: var(--canvas); font-size: .9375rem; line-height: 1.5; font-feature-settings: 'tnum' 0; -webkit-font-smoothing: antialiased; }
.layout-conductor, .layout-simple { font-size: 1rem; }
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 { font-family: var(--font); font-weight: 650; font-stretch: 108%; letter-spacing: -.01em; color: var(--ink); }
.h4, h4 { font-size: 1.35rem; }
.h5, h5 { font-size: 1.1rem; }
.h6, h6 { font-size: .95rem; }
a { color: var(--deca); }
a:hover { color: var(--deca-dark); }
.text-muted { color: var(--muted) !important; }
.small, small { font-size: 85%; }
.tnum, .kpi-num, .hora-col, .ag-card strong, td.text-right, .table .text-right { font-variant-numeric: tabular-nums; }
hr { border-top-color: var(--line); }
::selection { background: var(--deca-light); }
:focus-visible { outline: 2px solid var(--deca); outline-offset: 2px; }
.min-w-0 { min-width: 0; }
.opacity-50 { opacity: .5; }

/* ---------- Color de marca ---------- */
.bg-deca { background-color: var(--deca) !important; }
.text-deca { color: var(--deca) !important; }
.border-deca { border-color: var(--deca) !important; }
.border-left-deca { border-left: 3px solid var(--deca) !important; }
.text-warning-dark { color: var(--warn) !important; }
.text-success { color: var(--ok) !important; }
.text-danger { color: var(--bad) !important; }
.text-warning { color: #c27c0e !important; }

/* ---------- Botones ---------- */
.btn { font-weight: 550; border-radius: var(--r); letter-spacing: .005em; transition: background-color .12s, border-color .12s, color .12s; }
.btn-lg { border-radius: 10px; font-size: 1.05rem; padding: .6rem 1.1rem; }
.btn-sm { border-radius: var(--r-sm); }
.btn-xs { padding: .12rem .5rem; font-size: .78rem; line-height: 1.4; border-radius: var(--r-sm); }
.btn-deca { background: var(--deca); border-color: var(--deca); color: #fff; }
.btn-deca:hover, .btn-deca:focus { background: var(--deca-dark); border-color: var(--deca-dark); color: #fff; }
.btn-deca:disabled { background: var(--deca); color: #fff; opacity: .6; }
.btn-outline-deca { color: var(--deca); border-color: var(--line); background: #fff; }
.btn-outline-deca:hover, .btn-outline-deca.active { background: var(--deca-light) !important; color: var(--deca) !important; border-color: var(--deca) !important; }
.btn-light { background: #fff; border-color: var(--line); color: var(--ink-2); }
.btn-light:hover, .btn-light:focus { background: var(--canvas); border-color: #d3d9df; color: var(--ink); }
.btn-outline-secondary { color: var(--ink-2); border-color: var(--line); background: #fff; }
.btn-outline-secondary:hover { background: var(--canvas); color: var(--ink); border-color: #d3d9df; }
.btn-outline-primary { color: var(--deca); border-color: var(--line); background: #fff; }
.btn-outline-primary:hover { background: var(--deca-light); color: var(--deca); border-color: var(--deca); }
.btn-outline-success { color: var(--ok); border-color: var(--line); background: #fff; }
.btn-outline-success:hover { background: var(--ok-bg); color: var(--ok); border-color: var(--ok); }
.btn-outline-danger { color: var(--bad); border-color: var(--line); background: #fff; }
.btn-outline-danger:hover { background: var(--bad-bg); color: var(--bad); border-color: var(--bad); }
.btn-outline-warning { color: var(--warn); border-color: var(--line); background: #fff; }
.btn-outline-warning:hover { background: var(--warn-bg); color: var(--warn); border-color: #e3b25f; }
.btn-info { background: var(--deca); border-color: var(--deca); color: #fff; }
.btn-info:hover, .btn-info:focus { background: var(--deca-dark); border-color: var(--deca-dark); color: #fff; }
.btn-outline-info { color: var(--deca); border-color: var(--line); background: #fff; }
.btn-outline-info:hover { background: var(--deca-light); color: var(--deca); border-color: var(--deca); }
.btn-success { background: var(--ok); border-color: var(--ok); }
.btn-success:hover, .btn-success:focus { background: #0f6339; border-color: #0f6339; }
.btn-warning { background: #f2b53a; border-color: #f2b53a; color: #3d2600; }
.btn-warning:hover { background: #e3a527; border-color: #e3a527; color: #3d2600; }
.btn-danger { background: var(--bad); border-color: var(--bad); }
.btn-link { color: var(--deca); font-weight: 500; }
.btn.shadow, .btn.shadow-sm { box-shadow: none !important; }
.btn-group .btn { border-radius: var(--r); }
.btn-group > .btn:not(:last-child) { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.btn-group > .btn:not(:first-child) { border-top-left-radius: 0; border-bottom-left-radius: 0; }
.btn-deca.active-seg, .btn-group .btn-deca { z-index: 1; }

/* ---------- Tarjetas ---------- */
.card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.card.shadow-sm, .card.shadow { box-shadow: none !important; }
.card-header { background: transparent; border-bottom: 1px solid var(--line-2); border-radius: var(--r-lg) var(--r-lg) 0 0 !important; padding: .85rem 1.15rem; font-weight: 600; }
.card-body { padding: 1.15rem; }
.card-footer { background: transparent; border-top: 1px solid var(--line-2); border-radius: 0 0 var(--r-lg) var(--r-lg) !important; }
.card > .list-group:first-child .list-group-item:first-child { border-top-left-radius: var(--r-lg); border-top-right-radius: var(--r-lg); }
.card > .list-group:last-child .list-group-item:last-child { border-bottom-left-radius: var(--r-lg); border-bottom-right-radius: var(--r-lg); }
.list-group-item { border-color: var(--line-2); }
.list-group-item-action:hover { background: #f8fafb; }
.border-success { border-color: #9fd3b5 !important; }
.border-warning { border-color: #ecc98a !important; }
.border-danger { border-color: #f0b1ab !important; }

/* ---------- Formularios ---------- */
label { font-weight: 550; font-size: .875rem; color: var(--ink-2); margin-bottom: .3rem; }
.form-control, .custom-select { border-color: #d5dbe1; border-radius: var(--r); color: var(--ink); font-family: var(--font); }
.form-control::placeholder { color: var(--muted-2); }
.text-uppercase::placeholder { text-transform: none; }
.form-control:focus, .custom-select:focus { border-color: var(--deca); box-shadow: 0 0 0 3px var(--deca-light); }
.form-control-lg { border-radius: 10px; font-size: 1.05rem; }
.form-control-sm { border-radius: var(--r-sm); }
.input-group-text { background: var(--canvas); border-color: #d5dbe1; color: var(--muted); border-radius: var(--r); }
.form-control[readonly] { background: var(--canvas); }
.custom-control-label { font-weight: 450; color: var(--ink); }
.custom-control-input:checked ~ .custom-control-label::before { background-color: var(--deca); border-color: var(--deca); }
.custom-control-input:focus ~ .custom-control-label::before { box-shadow: 0 0 0 3px var(--deca-light); }
.custom-switch .custom-control-label::before { border-radius: 1rem; }
.form-text { color: var(--muted); }
.is-invalid { border-color: var(--bad) !important; }

/* ---------- Tablas ---------- */
.table { color: var(--ink); margin-bottom: 0; }
.table th, .table td { border-top: 1px solid var(--line-2); padding: .7rem .9rem; vertical-align: middle; }
.table thead th { border-bottom: 1px solid var(--line); border-top: 0; font-size: .8rem; font-weight: 550; color: var(--muted); background: transparent; white-space: nowrap; }
.table .thead-light th { background: transparent; color: var(--muted); border-color: var(--line); }
.table-sm th, .table-sm td { padding: .45rem .7rem; }
.table-hover tbody tr:hover, tr[data-href]:hover { background: #f8fafb; }
.table-responsive { border-radius: var(--r-lg); }
.card .table:first-child thead th:first-child, .card .table th:first-child, .card .table td:first-child { padding-left: 1.15rem; }
.card .table th:last-child, .card .table td:last-child { padding-right: 1.15rem; }
.tabla-srv tr[data-href], tr[data-href] { cursor: pointer; }
.tachado td:not(:last-child) { text-decoration: line-through; color: var(--muted); }

/* ---------- Avisos ---------- */
.alert { border: 0; border-radius: 10px; padding: .8rem 1rem; color: var(--ink); }
.alert.shadow-sm { box-shadow: none !important; }
.alert-success { background: var(--ok-bg); }
.alert-success .fas, .alert-success .alert-link { color: var(--ok); }
.alert-warning { background: var(--warn-bg); }
.alert-warning .fas, .alert-warning .alert-link { color: var(--warn); }
.alert-danger { background: var(--bad-bg); }
.alert-danger .fas, .alert-danger .alert-link { color: var(--bad); }
.alert-info { background: var(--info-bg); }
.alert-info .fas, .alert-info .alert-link { color: var(--info); }
.alert-light { background: #fff; border: 1px solid var(--line) !important; }
.alert-secondary { background: var(--neutral-bg); }
.alert-dark { background: var(--ink); color: #fff; }
.alert .close { opacity: .4; text-shadow: none; }

/* ---------- Etiquetas de estado ---------- */
.badge { font-weight: 600; font-size: .75rem; border-radius: 999px; padding: .28em .65em; letter-spacing: .01em; }
.badge .fas { font-size: .9em; margin-right: .15em; }
.badge-primary { background: var(--info-bg); color: var(--info); }
.badge-secondary { background: var(--neutral-bg); color: var(--ink-2); }
.badge-success { background: var(--ok-bg); color: var(--ok); }
.badge-warning { background: var(--warn-bg); color: var(--warn); }
.badge-info { background: var(--info-bg); color: var(--info); }
.badge-danger { background: var(--bad-bg); color: var(--bad); }
.badge-dark { background: var(--neutral-bg); color: var(--ink-2); }
.badge-light { background: #fff; color: var(--ink-2); }
.badge-light.border { border-color: var(--line) !important; }
.st-en_curso, .badge.st-run { background: var(--run-bg); color: var(--run); }
/* Estado operativo: punto + texto */
.st { display: inline-flex; align-items: center; gap: .4em; font-size: .8rem; font-weight: 600; white-space: nowrap; border-radius: 999px; padding: .2em .65em .2em .55em; }
.st::before { content: ''; width: .5em; height: .5em; border-radius: 50%; background: currentColor; }
.st-solicitud, .st-presupuesto { background: var(--info-bg); color: var(--info); }
.st-pendiente { background: var(--warn-bg); color: var(--warn); }
.st-asignado { background: var(--neutral-bg); color: var(--ink-2); }
.st-completado { background: var(--ok-bg); color: var(--ok); }
.st-cancelado, .st-rechazado { background: var(--neutral-bg); color: var(--muted); }
/* DeCA: sello */
.deca { display: inline-flex; align-items: center; gap: .35em; font-size: .8rem; font-weight: 600; white-space: nowrap; }
.deca-emitido { color: var(--ok); }
.deca-borrador { color: var(--warn); }
.deca-anulado { color: var(--bad); }
.badge-rol-admin { background: var(--deca-light); color: var(--deca); }
.badge-rol-administrativo { background: var(--info-bg); color: var(--info); }
.badge-rol-conductor { background: var(--neutral-bg); color: var(--ink-2); }
.badge-rol-cliente { background: var(--ok-bg); color: var(--ok); }
.badge-rol-superadmin { background: var(--ink); color: #fff; }

/* ---------- Matrícula (placa española) ---------- */
.matricula { display: inline-flex; align-items: stretch; font-family: var(--font); font-stretch: 82%; font-weight: 700; font-size: .85rem; letter-spacing: .06em; line-height: 1.55; color: #111; background: #fff; border: 1px solid #1d2733; border-radius: 4px; overflow: hidden; white-space: nowrap; vertical-align: middle; font-variant-numeric: tabular-nums; }
.matricula::before { content: 'E'; display: flex; align-items: flex-end; justify-content: center; width: 1.05em; background: #1f4bb4; color: #fff; font-size: .62em; font-stretch: 100%; letter-spacing: 0; padding-bottom: .15em; }
.matricula { padding-right: .45em; }
.matricula::before { margin-right: .45em; }
.matricula-sm { font-size: .72rem; }
.matricula-lg { font-size: 1.15rem; }

/* ---------- Ruta (carga → descarga) ---------- */
.ruta-v { position: relative; padding-left: 26px; }
.ruta-v::before { content: ''; position: absolute; left: 8px; top: .7em; bottom: .9em; width: 2px; background: repeating-linear-gradient(to bottom, var(--muted-2) 0 4px, transparent 4px 8px); }
.rv-p { position: relative; }
.rv-p + .rv-p { margin-top: .85rem; }
.rv-p::before { content: ''; position: absolute; left: -24px; top: .38em; width: 14px; height: 14px; border-radius: 50%; background: #fff; border: 3px solid var(--ink); }
.rv-p.rv-d::before { background: var(--ink); }
.rv-lbl { display: block; font-size: .78rem; color: var(--muted); font-weight: 500; line-height: 1.2; }
.rv-txt { font-weight: 600; line-height: 1.3; }
.ruta-h { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ruta-h .flecha { color: var(--muted-2); margin: 0 .3em; font-weight: 400; }
/* compatibilidad */
.ruta { border-left: 2px solid var(--line); padding-left: .6rem; font-weight: 500; }
.ruta-linea { height: 6px; }

/* ---------- Datos (ficha) ---------- */
.dato-lbl { color: var(--muted); font-size: .78rem; font-weight: 500; margin-bottom: .1rem; }
.dato { font-size: .95rem; }
.hist-deca { border-left: 3px solid var(--deca); }
.num-paso { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: .72rem; font-weight: 700; margin-right: .45rem; vertical-align: 1px; }

/* ---------- Cabecera de página ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .75rem; margin-bottom: 1.25rem; }
.page-head h1 { font-size: 1.55rem; margin: 0; }
.page-head .sub { color: var(--muted); font-size: .9rem; margin-top: .15rem; }

/* Títulos de página: sin icono decorativo */
.shell-main main > h1 > i.fas:first-child, .shell-main main .d-flex > h1 > i.fas:first-child, .shell-main main div > h1 > i.fas:first-child, .layout-portal main h1 > i.fas:first-child { display: none; }
.shell-main main h1.h4, .layout-portal main h1.h4 { font-size: 1.55rem; }
@media (max-width: 991.98px) { .shell-main main h1.h4 { font-size: 1.3rem; } }

/* ---------- KPIs ---------- */
.kpi { position: relative; display: block; color: inherit; transition: border-color .12s; }
a.kpi:hover { border-color: #c7cfd7; text-decoration: none; color: inherit; }
.kpi .card-body { padding: 1rem 1.15rem; }
.kpi-icon { display: none; }
.kpi-num { font-size: 1.75rem; font-weight: 650; font-stretch: 110%; line-height: 1.1; letter-spacing: -.02em; }
.kpi-lbl { color: var(--muted); font-size: .85rem; margin-top: .2rem; }
.kpi-alerta .kpi-num { color: var(--warn); }
.hora-col { min-width: 52px; font-weight: 650; font-stretch: 105%; }

/* ---------- Mini gráfico ---------- */
.barras { height: 110px; gap: 4px; }
.barra-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; }
.barra { width: 100%; max-width: 20px; background: #c9d3dd; border-radius: 3px 3px 0 0; }
.barra-hoy { background: var(--deca); }
.barra-num { font-size: .68rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.barra-lbl { font-size: .68rem; color: var(--muted); margin-top: 3px; }
.barras-lg { height: 170px; gap: 2px; }

/* ---------- QR y acciones del DeCA ---------- */
.qr-box { background: #fff; padding: 8px; border-radius: 10px; border: 1px solid var(--line); display: inline-block; line-height: 0; }
.qr-box svg { width: 100%; height: auto; max-width: 200px; }
.qr-box-lg svg { max-width: 340px; width: 78vw; }
.acciones-deca .btn { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: .55rem .25rem; font-size: .8rem; gap: 3px; }
.acciones-deca .btn i { font-size: 1.15rem; }
.acciones-deca .btn-lg { padding: .8rem .25rem; font-size: .95rem; }
.acciones-deca .btn-lg i { font-size: 1.5rem; }
.btn-outline-deca.btn-deca-soft { background: var(--deca-light); border-color: transparent; }

/* ---------- Chips y selectores táctiles ---------- */
.chips .btn { border-radius: 999px; }
.chips-scroll { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.chips-scroll .btn { flex: 0 0 auto; text-align: left; line-height: 1.25; border-radius: 10px; padding: .55rem .8rem; max-width: 230px; white-space: normal; font-weight: 450; }
.chips-scroll .btn strong { font-weight: 650; }
.opciones { display: flex; flex-wrap: wrap; gap: 8px; }
.opcion { position: relative; display: inline-flex; align-items: center; gap: .5rem; min-height: 46px; padding: .5rem .85rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer; font-weight: 550; line-height: 1.2; text-align: left; user-select: none; }
.opcion:hover { border-color: #c4ccd5; }
.opcion small { display: block; color: var(--muted); font-weight: 450; }
.opcion.activa, .opcion[aria-pressed="true"] { border-color: var(--deca); background: var(--deca-light); box-shadow: inset 0 0 0 1px var(--deca); }
.opcion .fa-check-circle { color: var(--deca); display: none; }
.opcion.activa .fa-check-circle { display: inline-block; }
.opcion-otra { border-style: dashed; color: var(--ink-2); }
#op-veh, #op-rem { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
#op-veh .opcion, #op-rem .opcion { justify-content: flex-start; }

/* ---------- Autocompletado ---------- */
.ac-wrap { position: relative; }
.ac-menu { position: absolute; z-index: 1050; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 10px; max-height: 300px; overflow-y: auto; box-shadow: 0 10px 28px rgba(23, 33, 43, .12); padding: 4px 0; }
.ac-menu.shadow { box-shadow: 0 10px 28px rgba(23, 33, 43, .12) !important; }
.ac-item { display: flex; align-items: baseline; gap: .55rem; padding: .5rem .8rem; color: var(--ink); line-height: 1.3; }
.ac-item:hover, .ac-item.active { background: var(--deca-light); text-decoration: none; color: var(--ink); }
.ac-item .ac-ico { width: 16px; flex: 0 0 16px; text-align: center; color: var(--muted-2); font-size: .85rem; }
.ac-item .ac-main { min-width: 0; }
.ac-item .ac-main b { font-weight: 650; }
.ac-item .ac-sub { display: block; color: var(--muted); font-size: .82rem; }
.ac-grupo { padding: .45rem .8rem .2rem; font-size: .75rem; font-weight: 600; color: var(--muted); }
.ac-pie { padding: .35rem .8rem; font-size: .72rem; color: var(--muted-2); text-align: right; }
.lugar-acc { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.lugar-acc .btn { font-size: .8rem; padding: .2rem .6rem; border-radius: 999px; }

/* ---------- Formulario de servicio ---------- */
#check-card { border-left: 3px solid var(--line); }
#check-card.border-success { border-left-color: var(--ok) !important; }
#check-card.border-warning { border-left-color: #e0a640 !important; }
@media (min-width: 1200px) { .sticky-xl-top { position: sticky; top: 20px; } }
.modulo-item:last-child { border-bottom: 0 !important; }
.form-seccion { font-weight: 650; font-size: 1rem; font-stretch: 106%; margin-bottom: .75rem; display: flex; align-items: center; }

/* ---------- Agenda ---------- */
.agenda-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-lg); background: #fff; }
.agenda { table-layout: fixed; min-width: 980px; background: #fff; margin: 0; }
.agenda.table-bordered, .agenda.table-bordered th, .agenda.table-bordered td { border-color: var(--line-2); }
.agenda.table-bordered { border: 0; }
.agenda th, .agenda td { vertical-align: top; padding: 5px; }
.agenda thead th { background: #fff; font-size: .82rem; font-weight: 600; color: var(--ink-2); position: sticky; top: 0; z-index: 2; border-bottom: 1px solid var(--line) !important; }
.ag-recurso-col { width: 160px; background: #fbfcfd; font-size: .85rem; position: sticky; left: 0; z-index: 1; }
.agenda thead .ag-recurso-col { z-index: 3; }
.ag-cell { min-height: 70px; height: 74px; position: relative; padding-bottom: 22px !important; transition: background .1s; }
.ag-hoy { background: #f6f9fd; }
.agenda thead th.ag-hoy { color: var(--deca); box-shadow: inset 0 -2px 0 var(--deca); }
.ag-finde { background: #fafbfc; }
.ag-over { background: var(--deca-light) !important; outline: 2px dashed var(--deca); outline-offset: -3px; }
.ag-fila-sin td, .ag-fila-sin th { background: #fffaf0; }
.ag-fila-ext td, .ag-fila-ext th { background: #f7f8f9; }
.ag-add { position: absolute; bottom: 3px; right: 5px; font-size: .75rem; color: var(--muted-2); opacity: 0; }
.ag-cell:hover .ag-add { opacity: 1; }
.ag-card { background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--muted-2); border-radius: 6px; padding: 4px 7px; margin-bottom: 4px; font-size: .76rem; line-height: 1.3; cursor: grab; user-select: none; }
.ag-card:hover { border-color: #c4ccd5; }
.ag-card.ag-emitido { border-left-color: var(--ok); }
.ag-card.ag-borrador { border-left-color: #e0a640; background: #fffcf5; }
.ag-card.ag-anulado { border-left-color: var(--bad); }
.ag-card.ag-st-completado { opacity: .6; }
.ag-card.ag-st-en_curso { background: var(--run-bg); }
.ag-ruta { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ag-sub { color: var(--muted); }
.ag-mat { font-stretch: 82%; font-weight: 700; color: var(--ink); letter-spacing: .04em; }
.ag-dragging { opacity: .4; }
.ag-saving { opacity: .6; }
.ag-flash { animation: agflash 1.2s ease; }
@keyframes agflash { 0% { box-shadow: 0 0 0 3px rgba(21, 122, 72, .45); } 100% { box-shadow: none; } }
.ag-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; vertical-align: middle; }
.ag-dot.ag-emitido { background: var(--ok); }
.ag-dot.ag-borrador { background: #e0a640; }
.agenda .ag-recurso-col .matricula { font-size: .72rem; }

/* ---------- Aviso flotante ---------- */
.app-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 16px); opacity: 0; z-index: 2000; transition: transform .2s, opacity .2s; max-width: 92vw; box-shadow: 0 8px 24px rgba(23, 33, 43, .18) !important; }
.app-toast.show { transform: translate(-50%, 0); opacity: 1; }
.layout-conductor .app-toast { bottom: calc(84px + env(safe-area-inset-bottom)); }

/* =====================================================================
   Estructura: panel de empresa y administración (barra lateral)
   ===================================================================== */
.shell { display: flex; min-height: 100vh; }
.side { width: var(--side-w); flex: 0 0 var(--side-w); background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; z-index: 1040; }
.side-brand { display: flex; align-items: center; gap: .6rem; padding: 1.1rem 1.1rem .9rem; color: var(--ink); text-decoration: none !important; min-height: 64px; }
.side-brand:hover { color: var(--ink); }
.side-brand img { max-height: 34px; max-width: 150px; }
.side-brand .marca-ini { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 9px; background: var(--deca); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-stretch: 112%; }
.side-brand .marca-txt { font-weight: 650; font-stretch: 106%; line-height: 1.2; font-size: .95rem; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.side-new { margin: .2rem 1rem 1rem; }
.side-nav { padding: 0 .6rem; flex: 1; }
.side-grupo { font-size: .75rem; font-weight: 600; color: var(--muted-2); padding: 1rem .6rem .35rem; }
.side-link { display: flex; align-items: center; gap: .7rem; padding: .5rem .6rem; margin-bottom: 1px; border-radius: 8px; color: var(--ink-2); font-weight: 500; text-decoration: none !important; }
.side-link .fas { width: 18px; text-align: center; color: var(--muted-2); font-size: .95rem; }
.side-link:hover { background: var(--canvas); color: var(--ink); }
.side-link.active { background: var(--deca-light); color: var(--deca); font-weight: 600; }
.side-link.active .fas { color: var(--deca); }
.side-link .cuenta { margin-left: auto; background: #f2b53a; color: #3d2600; font-size: .72rem; font-weight: 700; border-radius: 999px; padding: 0 .45rem; line-height: 1.5; }
.side-user { border-top: 1px solid var(--line-2); padding: .8rem 1rem; display: flex; align-items: center; gap: .6rem; }
.side-user .avatar { width: 32px; height: 32px; flex: 0 0 32px; border-radius: 50%; background: var(--neutral-bg); color: var(--ink-2); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; }
.side-user .quien { min-width: 0; line-height: 1.2; flex: 1; }
.side-user .quien b { display: block; font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .quien span { font-size: .78rem; color: var(--muted); }
.side-user a.icono { color: var(--muted); padding: .3rem; border-radius: 6px; }
.side-user a.icono:hover { background: var(--canvas); color: var(--ink); }
.shell-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.shell-main > main { flex: 1; width: 100%; max-width: 1480px; padding: 1.6rem 2rem 2rem; }
.shell-foot { color: var(--muted-2); font-size: .78rem; padding: 0 2rem 1.5rem; }
.topbar { display: none; }
.aviso-sa { background: #fff6dd; border-bottom: 1px solid #f1dfa8; font-size: .85rem; padding: .45rem 2rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.aviso-sa a { color: var(--ink); font-weight: 600; }
.area-admin .side-brand .marca-ini { background: var(--ink); }
.area-admin .side-link.active { background: var(--neutral-bg); color: var(--ink); }
.area-admin .side-link.active .fas { color: var(--ink); }
.side-velo { display: none; }

@media (max-width: 991.98px) {
  .side { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: none; }
  body.side-abierta .side { transform: none; box-shadow: 0 0 40px rgba(23, 33, 43, .25); }
  body.side-abierta .side-velo { display: block; position: fixed; inset: 0; background: rgba(23, 33, 43, .35); z-index: 1035; }
  .topbar { display: flex; align-items: center; gap: .5rem; position: sticky; top: 0; z-index: 1030; background: #fff; border-bottom: 1px solid var(--line); padding: .55rem .75rem; padding-top: calc(.55rem + env(safe-area-inset-top)); }
  .topbar .tb-marca { flex: 1; min-width: 0; font-weight: 650; font-stretch: 106%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
  .topbar .tb-marca img { max-height: 28px; max-width: 140px; }
  .topbar .btn { padding: .35rem .6rem; }
  .shell-main > main { padding: 1rem .9rem 1.5rem; }
  .shell-foot { padding: 0 1rem 1rem; }
  .aviso-sa { padding: .45rem 1rem; }
  .page-head h1 { font-size: 1.3rem; }
}
@media (prefers-reduced-motion: reduce) { .side, .app-toast { transition: none; } }

/* =====================================================================
   Conductor (móvil, estilo app)
   ===================================================================== */
.layout-conductor { padding-bottom: calc(72px + env(safe-area-inset-bottom)); background: var(--canvas); }
.layout-conductor main.container { max-width: 640px; padding-top: 1rem; }
.app-topbar { position: sticky; top: 0; z-index: 1030; display: flex; align-items: center; gap: .5rem; background: #fff; border-bottom: 1px solid var(--line); padding: .6rem .9rem; padding-top: calc(.6rem + env(safe-area-inset-top)); min-height: 56px; }
.app-topbar .tb-volver { color: var(--ink); width: 36px; height: 36px; margin-left: -6px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.app-topbar .tb-volver:hover { background: var(--canvas); }
.app-topbar .tb-titulo { flex: 1; min-width: 0; font-weight: 650; font-stretch: 106%; font-size: 1.08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.app-topbar .tb-emp { color: var(--muted); font-size: .8rem; max-width: 40%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.app-topbar .tb-emp img { max-height: 26px; max-width: 96px; }
.app-tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 1030; background: #fff; border-top: 1px solid var(--line); display: flex; padding-bottom: env(safe-area-inset-bottom); }
.app-tabbar a { flex: 1; text-align: center; padding: 9px 0 7px; color: var(--muted); font-size: .72rem; font-weight: 550; text-decoration: none; position: relative; }
.app-tabbar a i { display: block; font-size: 1.2rem; margin-bottom: 3px; }
.app-tabbar a.active { color: var(--deca); }
.app-tabbar a.active::before { content: ''; position: absolute; top: -1px; left: 30%; right: 30%; height: 3px; border-radius: 0 0 3px 3px; background: var(--deca); }
.app-tabbar a.tab-nuevo i { color: var(--deca); }
.dia-titulo { font-size: .85rem; color: var(--muted); margin: 1.25rem 0 .5rem; font-weight: 600; }
.layout-conductor .sticky-actions { bottom: calc(64px + env(safe-area-inset-bottom)); }
.qr-full { padding-top: .5rem; }
.lbl-paso { font-weight: 650; font-size: .95rem; margin-bottom: .45rem; display: flex; align-items: center; gap: .45rem; color: var(--ink); font-stretch: 104%; }
.lbl-paso .fas { color: var(--muted-2); width: 16px; text-align: center; }
.srv-card { display: block; color: inherit; text-decoration: none !important; }
.srv-card:hover { color: inherit; }
.srv-card .srv-hora { font-size: 1.35rem; font-weight: 650; font-stretch: 108%; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.srv-en-curso { border-color: #9cd0d5; box-shadow: inset 3px 0 0 var(--run); }
.ruta-sm .rv-p + .rv-p { margin-top: .45rem; }
.ruta-sm .rv-p::before { width: 12px; height: 12px; border-width: 2.5px; left: -23px; top: .32em; }
.ruta-sm::before { left: 7px; }
.srv-acciones { display: flex; gap: 8px; padding: .75rem 1rem; border-top: 1px solid var(--line-2); }
.srv-acciones .btn { flex: 1; white-space: nowrap; padding-left: .4rem; padding-right: .4rem; display: inline-flex; align-items: center; justify-content: center; }
.firma-pad { width: 100%; height: 200px; border: 1.5px dashed #b9c3ce; border-radius: 10px; background: #fff; touch-action: none; display: block; }
.firma-img { max-width: 100%; max-height: 90px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }

@media (max-width: 767.98px) {
  .sticky-actions { position: sticky; bottom: 0; padding: .75rem 0; background: linear-gradient(to top, var(--canvas) 72%, rgba(244, 246, 248, 0)); z-index: 10; }
  main.container, main.container-fluid { padding-left: 14px; padding-right: 14px; }
  .kpi-num { font-size: 1.45rem; }
  .card-body { padding: 1rem; }
}
@media print { nav, footer, .btn, .app-tabbar, .side, .topbar, .shell-foot { display: none !important; } .shell-main > main { padding: 0; } body { background: #fff; } }

/* =====================================================================
   Portal de clientes, logins y portada
   ===================================================================== */
.portal-nav { background: #fff; border-bottom: 1px solid var(--line); padding-top: .65rem; padding-bottom: .65rem; }
.portal-nav .nav-link { color: var(--ink-2); font-weight: 550; border-radius: 8px; padding: .45rem .8rem !important; }
.portal-nav .nav-item.active .nav-link, .portal-nav .nav-link:hover { color: var(--deca); background: var(--deca-light); }
.portal-logo { max-height: 36px; max-width: 170px; }
.layout-portal main.container { max-width: 1080px; padding-top: 1.75rem; }

.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; }
.login-box { width: 100%; max-width: 400px; }
.login-logo { width: 56px; height: 56px; border-radius: 14px; background: var(--deca); color: #fff; font-size: 24px; display: inline-flex; align-items: center; justify-content: center; }
.login-logo-img { max-height: 72px; max-width: 220px; }
.login-box h1 { font-size: 1.5rem; margin: 1rem 0 .2rem; }
.login-box .card-body { padding: 1.6rem; }
.login-otros a { color: var(--muted); }
.landing { min-height: 100vh; background: var(--canvas); }
.acceso-card { border: 1px solid var(--line) !important; transition: border-color .12s; }
.acceso-card:hover { border-color: var(--deca) !important; }
.acceso-icon { width: 52px; height: 52px; border-radius: 13px; background: var(--deca-light); color: var(--deca); font-size: 22px; display: inline-flex; align-items: center; justify-content: center; }
.display-5 { font-size: 2rem; font-weight: 650; font-stretch: 110%; }

/* ---------- Marca, ajustes ---------- */
.nav-logo { background: #fff; border-radius: 6px; padding: 2px 6px; display: inline-flex; align-items: center; height: 34px; }
.nav-logo img { max-height: 28px; max-width: 120px; }
.logo-preview { min-height: 70px; border: 1px dashed #c9d1d9; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 8px; background: repeating-conic-gradient(#f3f4f6 0% 25%, #fff 0% 50%) 50% / 16px 16px; }
.logo-preview img { max-height: 70px; max-width: 100%; }
.color-chip { width: 30px; height: 30px; border-radius: 50%; padding: 0; border: 2px solid #fff; box-shadow: 0 0 0 1px #c9d1d9; }
.list-group-item.active-deca { background: var(--deca-light); border-left: 3px solid var(--deca); }
.nav-pills .nav-link { color: var(--ink-2); font-weight: 550; border-radius: 8px; }
.nav-pills .nav-link.active, .nav-pills .nav-link.active.bg-deca { background: var(--deca-light) !important; color: var(--deca); }
.nav-tabs { border-bottom-color: var(--line); }
.nav-tabs .nav-link { color: var(--muted); font-weight: 550; border: 0; border-bottom: 2px solid transparent; }
.nav-tabs .nav-link.active { color: var(--ink); border-bottom-color: var(--deca); background: transparent; }
.modal-content { border: 0; border-radius: 14px; }
.modal-header, .modal-footer { border-color: var(--line-2); }
.dropdown-menu { border-color: var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(23, 33, 43, .12); padding: 4px; font-size: .92rem; }
.dropdown-item { border-radius: 6px; padding: .4rem .7rem; }
.dropdown-item:active { background: var(--deca-light); color: var(--ink); }
.page-link { color: var(--deca); border-color: var(--line); }
.page-item.active .page-link { background: var(--deca); border-color: var(--deca); }

/* Seguimiento del servicio en el portal */
.pasos { position: relative; }
.paso { position: relative; color: var(--muted-2); font-size: .85rem; }
.paso:not(:last-child)::after { content: ''; position: absolute; top: 13px; left: 50%; width: 100%; height: 2px; background: var(--line); z-index: 0; }
.paso.hecho:not(:last-child)::after { background: var(--deca); }
.paso-punto { position: relative; z-index: 1; width: 28px; height: 28px; line-height: 28px; border-radius: 50%; background: #fff; border: 2px solid var(--line); color: var(--muted-2); margin: 0 auto 5px; font-size: .75rem; }
.paso.hecho { color: var(--ink); font-weight: 550; }
.paso.hecho .paso-punto { background: var(--deca); border-color: var(--deca); color: #fff; }

/* ---------- Instalar como app ---------- */
.pwa-banner { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 1060; display: flex; align-items: center; gap: .7rem; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: .7rem .75rem; box-shadow: 0 12px 32px rgba(23, 33, 43, .18); max-width: 520px; margin: 0 auto; }
.pwa-banner img { width: 40px; height: 40px; border-radius: 10px; flex: 0 0 40px; }
.pwa-banner strong { display: block; font-size: .95rem; line-height: 1.2; }
.pwa-banner span { display: block; font-size: .8rem; color: var(--muted); line-height: 1.3; }
.layout-conductor .pwa-banner { bottom: calc(72px + env(safe-area-inset-bottom)); }
.side-instalar { margin: 0 1rem .5rem; }
[data-pwa-instalar] { cursor: pointer; }
.estado-deca { font-size: .85rem; line-height: 1.35; padding: .55rem .75rem; border-radius: 10px; }
.estado-deca:empty { display: none; }
.estado-deca.ok { background: var(--ok-bg); color: var(--ok); }
.estado-deca.falta { background: var(--warn-bg); color: #6b4300; }
.estado-deca .fas { margin-right: .25rem; }
.alert .btn .fas, .alert .btn .fab { color: inherit !important; }
.login-logo-tm { width: 234px; height: auto; max-width: 80%; }
