/* Consola gestionTaller. Bootstrap 5 + esta capa. Identidad: azul petroleo
   #1b4965, ambar #f2a541 para alertas, verde #2e9e5b para operativo,
   rojo #d64545 para parado. Tipografia Inter. Base heredada del vcard. */
:root {
  --you: #1b4965;
  --you-deep: #0f2e42;
  --you-soft: #e6eef5;
  --ink: #233247;
  --muted: #64748b;
  --line: #e2e8f0;
  --bg: #f3f6fa;
  --ok: #2e9e5b; --alerta: #f2a541; --peligro: #d64545;
  --sidebar-w: 256px;
  --bs-primary: #1b4965;
  --bs-primary-rgb: 27, 73, 101;
  --bs-link-color: #1b4965;
  --bs-body-font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  --bs-body-color: #1d1d1b;
  --bs-body-bg: #f4f5f9;
  --bs-border-color: #e6e8ee;
}
body { font-family: var(--bs-body-font-family); font-size: .9rem; line-height: 1.55; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; }
.btn-primary { --bs-btn-bg: var(--you); --bs-btn-border-color: var(--you); --bs-btn-hover-bg: var(--you-deep); --bs-btn-hover-border-color: var(--you-deep); --bs-btn-active-bg: var(--you-deep); }
.btn-outline-primary { --bs-btn-color: var(--you); --bs-btn-border-color: var(--you); --bs-btn-hover-bg: var(--you); --bs-btn-hover-border-color: var(--you); }
.btn { --bs-btn-border-radius: 10px; --bs-btn-font-weight: 500; }
.form-control, .form-select { --bs-border-radius: 10px; border-color: var(--line); }
.form-control:focus, .form-select:focus { border-color: var(--you); box-shadow: 0 0 0 .25rem rgba(27, 73, 101, .14); }
.text-primary { color: var(--you) !important; }
.badge.bg-primary { background: var(--you) !important; }

/* Layout: sidebar fijo en escritorio, offcanvas en movil */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: linear-gradient(180deg, var(--you) 0%, var(--you-deep) 100%); color: #fff;
  position: sticky; top: 0; height: 100vh; height: 100dvh; display: flex; flex-direction: column; padding: 1.1rem .85rem .9rem;
}
.sidebar > .nav { flex: 1 1 0; min-height: 0; flex-wrap: nowrap; overflow-y: auto; overflow-x: hidden; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: #6c8b9e transparent; padding: 0 .25rem .8rem; }
.sidebar > .nav::-webkit-scrollbar { width: 5px; }
.sidebar > .nav::-webkit-scrollbar-thumb { background: #6c8b9e; border-radius: 8px; }
.sidebar > .marca { flex-shrink: 0; }
.sidebar .marca { display: flex; align-items: center; gap: .7rem; padding: .3rem .5rem .65rem; color: #fff; text-decoration: none; }
.sidebar .marca img { height: 34px; width: auto; }
.sidebar .marca span { font-size: .7rem; letter-spacing: .18em; text-transform: uppercase; opacity: .75; }
.sidebar .grupo { font-size: .63rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #a9c1d0; padding: .55rem .75rem .15rem; }
.sidebar .nav-link { color: #dce7ef; border-radius: 8px; padding: .3rem .75rem; margin-bottom: 1px; display: flex; align-items: center; gap: .7rem; font-size: .85rem; font-weight: 500; flex-shrink: 0; transition: background .15s, color .15s; }
.sidebar .nav-link i { font-size: 1.1rem; width: 22px; text-align: center; opacity: .9; }
.sidebar .nav-link:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.sidebar .nav-link.active { background: #fff; color: var(--you); }

.principal { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { min-height: 72px; background: #fff; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 1rem; padding: .85rem 2rem; position: sticky; top: 0; z-index: 20; }
.titulo-modulo { font-size: 1.4rem; font-weight: 600; margin: 0 0 1.1rem; line-height: 1.3; overflow-wrap: anywhere; }
.topbar .empresa { min-width: 0; font-size: .85rem; color: var(--muted); display: flex; align-items: center; gap: .5rem; }
/* Visita guiada (driver.js) con la identidad YOU */
.driver-popover { font-family: Inter, system-ui, sans-serif; border-radius: 14px; padding: 18px 18px 14px; max-width: 340px; }
.driver-popover-title { font-size: 1rem; font-weight: 600; color: var(--you); }
.driver-popover-description { font-size: .9rem; color: var(--ink); line-height: 1.45; }
.driver-popover-footer button { font-family: inherit; border-radius: 8px; text-shadow: none; }
.driver-popover-next-btn, .driver-popover-prev-btn { background: var(--you); color: #fff; border: 0; padding: .4rem .8rem; }
.driver-popover-prev-btn { background: #fff; color: var(--you); border: 1px solid var(--line); }
.driver-popover-progress-text { color: var(--muted); font-size: .78rem; }
.driver-popover-close-btn { color: var(--muted); }
.topbar .empresa .pill { background: var(--you-soft); color: var(--you); border-radius: 999px; padding: .2rem .7rem; font-weight: 500; font-size: .78rem; }
.contenido { padding: 1.75rem 2rem 3rem; max-width: 1600px; width: 100%; margin-inline: auto; }
.hamb { display: none; border: 0; background: none; font-size: 1.5rem; color: var(--ink); padding: 0; }

/* Tarjetas de contenido */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 24px -18px rgba(29, 29, 27, .25); }
.panel-head { display: flex; align-items: center; gap: .8rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.panel-head h2 { font-size: 1.05rem; font-weight: 600; margin: 0; }
.panel-head .der { margin-left: auto; display: flex; gap: .5rem; align-items: center; }
.panel-body { padding: 1.2rem; }
.buscador { position: relative; min-width: 240px; }
.buscador input { padding-left: 2.3rem; height: 42px; }
.buscador i { position: absolute; left: .85rem; top: 50%; translate: 0 -50%; color: var(--muted); }

/* Tabla */
.tabla { width: 100%; border-collapse: separate; border-spacing: 0; }
.tabla th { font-size: .68rem; letter-spacing: .065em; text-transform: uppercase; color: #52647b; background: #f7f9fc; font-weight: 600; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tabla td { font-size: .85rem; line-height: 1.5; padding: .95rem 1.1rem; border-bottom: 1px solid #edf1f6; vertical-align: middle; }
.tabla tr:last-child td { border-bottom: 0; }
.tabla tbody tr:nth-child(even) { background: #fcfdff; }
.tabla tbody tr:hover td { background: #f0f5fa; }
.persona { display: flex; align-items: center; gap: .75rem; min-width: 0; }
.persona img, .persona .ini { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; background: var(--you-soft); color: var(--you); display: grid; place-items: center; font-weight: 600; }
.persona b { display: block; font-weight: 600; line-height: 1.15; }
.persona small { color: var(--muted); }
.estado { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; }
.estado::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #25d366; }
.estado.off::before { background: #c9ccd3; }
.acc { display: flex; gap: .25rem; justify-content: flex-end; }
.acc .btn { --bs-btn-padding-x: .55rem; --bs-btn-padding-y: .35rem; border-color: var(--line); color: var(--ink); }
.acc .btn:hover { background: var(--you-soft); color: var(--you); border-color: var(--you-soft); }
.paginacion { display: flex; justify-content: flex-end; padding: .8rem 1rem; gap: .25rem; }
.paginacion .pagination { margin: 0; --bs-pagination-color: var(--ink); --bs-pagination-active-bg: var(--you); --bs-pagination-active-border-color: var(--you); --bs-pagination-border-radius: 8px; }
.paginacion li a, .paginacion li span { display: block; }
.vacio { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.vacio i { font-size: 2.4rem; color: var(--you-soft); display: block; margin-bottom: .5rem; }
.pie-lista { padding: .7rem 1.2rem; border-top: 1px solid var(--line); text-align: right; font-size: .85rem; color: var(--muted); font-weight: 600; }
.tabla-items td { padding: .4rem; vertical-align: middle; }
.tabla-items input, .tabla-items select { font-size: .85rem; }
.tabla-items .num-cell { text-align: right; white-space: nowrap; }
.tabla-items tfoot td { border-top: 2px solid var(--line); font-weight: 600; }

/* Modal. Los modales llevan un <form> que envuelve header/body/footer; sin
   esta regla el form corta la cadena flex y el cuerpo no puede hacer scroll. */
.modal-content { border: 0; border-radius: 18px; }
.modal-content > form { display: flex; flex-direction: column; min-height: 0; max-height: 100%; }
.modal-dialog-scrollable .modal-content > form .modal-body { overflow-y: auto; }
.modal-header { border-bottom: 1px solid var(--line); }
.modal-title { font-weight: 600; }
.form-label { font-size: .8rem; color: var(--muted); margin-bottom: .25rem; }
.form-text { font-size: .75rem; }
.color-inp { display: flex; gap: .4rem; }
.color-inp input[type=color] { width: 46px; padding: 3px; border-radius: 10px; }

/* Login */
.login { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.login .lado { background: linear-gradient(160deg, var(--you) 0%, var(--you-deep) 100%); color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 3rem; position: relative; overflow: hidden; }
.login .lado img { height: 56px; width: auto; align-self: flex-start; margin-bottom: 2rem; }
.login .lado h2 { font-weight: 500; font-size: 2rem; line-height: 1.15; max-width: 22ch; }
.login .lado p { opacity: .85; max-width: 42ch; }
.login .lado .prod { display: flex; gap: .6rem; margin-top: 1.5rem; }
.login .lado .prod span { border: 1px solid rgba(255, 255, 255, .4); border-radius: 999px; padding: .3rem .9rem; font-size: .8rem; }
.login .lado .binario { position: absolute; right: -2%; bottom: -4%; font-size: 6rem; font-weight: 600; line-height: .9; opacity: .06; letter-spacing: .1em; pointer-events: none; }
.login .form { display: flex; align-items: center; justify-content: center; padding: 2rem; background: #fff; }
.login .form form { width: 100%; max-width: 380px; }
.login .form h1 { font-size: 1.5rem; font-weight: 600; }

/* Sidebar plegado (escritorio): solo iconos, 72px. Se recuerda en localStorage. */
.plegar { position: absolute; right: -13px; top: 22px; width: 26px; height: 26px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--you); display: none; place-items: center; font-size: .8rem; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.12); z-index: 41; }
.plegar:hover { background: var(--you-soft); }
@media (min-width: 992px) {
  .plegar { display: grid; }
  .sidebar { transition: width .2s ease; z-index: 30; }
  body.rail .sidebar { width: 72px; padding-left: .55rem; padding-right: .55rem; }
  body.rail .sidebar .marca { justify-content: center; padding-left: 0; padding-right: 0; }
  body.rail .sidebar .marca img { height: auto; width: 100%; max-width: 46px; }
  body.rail .sidebar .marca .txt, body.rail .sidebar .grupo, body.rail .sidebar .nav-link span { display: none; }
  body.rail .sidebar .nav-link { justify-content: center; padding: .3rem 0; position: relative; }
  body.rail .sidebar .nav-link i { width: auto; font-size: 1.25rem; }
  body.rail .sidebar .grupo + .nav-link { margin-top: .25rem; }
  body.rail .plegar i { rotate: 180deg; }
}

@media (max-width: 991px) {
  .sidebar { position: fixed; left: 0; top: 0; z-index: 40; transform: translateX(-100%); transition: transform .25s ease; }
  body.menu .sidebar { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .4); z-index: 39; display: none; }
  body.menu .scrim { display: block; }
  body.menu { overflow: hidden; }
  body:not(.menu) .sidebar { visibility: hidden; }
  body.rail .sidebar .marca .txt { display: inline; }
  .hamb { display: block; }
  .topbar .empresa .nombre { display: none; }
  .contenido { padding: 1rem .9rem 3rem; }
  .login { grid-template-columns: 1fr; }
  .login .lado { padding: 2rem 1.5rem; min-height: 200px; }
  .login .lado h2 { font-size: 1.4rem; }
  .login .lado p, .login .lado .prod { display: none; }
  /* tabla -> tarjetas */
  .tabla thead { display: none; }
  .tabla tbody { display: block; padding: .75rem; }
  .tabla tr { display: block; border: 1px solid var(--line); border-radius: 10px; padding: .6rem 0; margin-bottom: .65rem; background: #fff; }
  .tabla td { display: block; border: 0; padding: .3rem 1rem; overflow-wrap: anywhere; }
  .tabla td[data-l]::before { content: attr(data-l) ": "; color: var(--muted); font-size: .75rem; }
  .acc { justify-content: flex-start; padding-top: .4rem; }
}

/* Marca en el sidebar (sin imagen) */
.sidebar .marca .logo { width: 36px; height: 36px; border-radius: 10px; background: #fff; color: var(--you); display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.sidebar .marca .txt { font-size: 1.05rem; letter-spacing: 0; text-transform: none; opacity: 1; font-weight: 400; }
.sidebar .marca .txt b { font-weight: 700; }
@media (min-width: 992px) { body.rail .sidebar .marca .txt { display: none; } }
.topbar .sel-empresa { border: 1px solid var(--line); border-radius: 999px; font-weight: 500; }

/* Estados de vehiculo y semaforos */
.estado.ok::before { background: var(--ok); }
.estado.alerta::before { background: var(--alerta); }
.estado.peligro::before { background: var(--peligro); }
.badge.est-operativo { background: var(--ok); }
.badge.est-en_reparacion, .badge.est-esperando_repuesto { background: var(--alerta); color: var(--ink); }
.badge.est-parado, .badge.est-baja { background: var(--peligro); }

/* Numeros y montos */
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tabla th.num { text-align: right; }

/* Tablero: tarjetas de indicadores */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; display: flex; gap: .9rem; align-items: center; text-decoration: none; color: var(--ink); }
.kpi:hover { border-color: var(--you); color: var(--ink); }
.kpi i { font-size: 1.5rem; color: var(--you); width: 40px; height: 40px; border-radius: 10px; background: var(--you-soft); display: grid; place-items: center; }
.kpi b { display: block; font-size: 1.4rem; line-height: 1.1; }
.kpi small { color: var(--muted); }

/* Adjuntos (js/adjuntos.js) */
.adj-drop { border: 2px dashed var(--line); border-radius: 12px; padding: 1rem; text-align: center; color: var(--muted); cursor: pointer; display: flex; gap: .6rem; align-items: center; justify-content: center; }
.adj-drop:hover, .adj-drop.sobre { border-color: var(--you); background: var(--you-soft); color: var(--you); }
.adj-drop i { font-size: 1.4rem; }
.adj-lista { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .6rem; margin-top: .6rem; }
.adj-item { border: 1px solid var(--line); border-radius: 10px; padding: .4rem; position: relative; background: #fff; }
.adj-item a { height: 90px; display: grid; place-items: center; background: var(--bg); border-radius: 8px; overflow: hidden; color: var(--peligro); font-size: 2rem; }
.adj-item img { width: 100%; height: 100%; object-fit: cover; }
.adj-meta { font-size: .75rem; margin-top: .3rem; display: flex; justify-content: space-between; gap: .3rem; }
.adj-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adj-meta small { color: var(--muted); flex-shrink: 0; }
.adj-del { position: absolute; top: 0; right: 0; padding: .2rem .4rem; }

/* Acabado compartido: controles, superficies y lectura de datos. */
h1, h2, h3, .modal-title { letter-spacing: -.025em; }
.btn { font-size: .85rem; min-height: 38px; padding: .5rem .85rem; }
.btn-sm { font-size: .78rem; min-height: 34px; padding: .35rem .65rem; }
.form-control, .form-select { font-size: .85rem; min-height: 40px; border-radius: 8px; }
.form-control::placeholder { color: #7a8799; }
.form-label { font-size: .8rem; font-weight: 500; color: #526078; }
.form-check-input:checked { background-color: var(--you); border-color: var(--you); }
.panel { border-radius: 12px; box-shadow: 0 3px 14px rgba(28, 49, 77, .035); }
.panel-head { padding: 1.1rem 1.25rem; gap: .65rem; }
.panel-head .der { flex-wrap: wrap; }
.panel-head .buscador { flex: 1 1 260px; max-width: 420px; min-width: 0; }
.panel-head > .form-control, .panel-head > .form-select { max-width: 100%; }
.panel > .outer_div { border-radius: 0 0 12px 12px; overflow-x: auto; }
.tabla small { font-size: .75rem; }
.tabla .num { font-variant-numeric: tabular-nums; }
.estado { font-size: .75rem; font-weight: 500; padding: .2rem .55rem; border-radius: 6px; background: #eef6f1; color: #236943; white-space: nowrap; }
.estado.off { background: #f0f2f6; color: #667085; }
.estado.alerta { background: #fff6e6; color: #855813; }
.estado.peligro { background: #fff0f0; color: #a93232; }
.acc { gap: .4rem; }
.acc .btn { min-width: 34px; min-height: 34px; border-radius: 7px; background: #fff; }
.paginacion { padding: 1rem 1.25rem; flex-wrap: wrap; }
.paginacion .pagination { flex-wrap: wrap; gap: .2rem; }
.pie-lista { background: #f7f9fc; font-size: .8rem; }
.kpi { padding: 1.25rem; border-radius: 12px; box-shadow: 0 3px 14px rgba(28, 49, 77, .035); }
.kpi i { width: 46px; height: 46px; flex-shrink: 0; }
.kpi b { font-size: 1.7rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi small { display: block; margin-top: .3rem; font-size: .78rem; }
.modal-content { border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 80px rgba(15, 46, 66, .18); }
.modal-header, .modal-footer { padding: 1rem 1.25rem; }
.modal-body { padding: 1.25rem; }
.modal-footer { background: #f8fafc; border-top: 1px solid var(--line); border-radius: 0 0 14px 14px; }
.dropdown-menu { font-size: .85rem; padding: .4rem; border-color: var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(15, 46, 66, .12); max-width: calc(100vw - 24px); }
.dropdown-item { border-radius: 6px; padding: .5rem .75rem; white-space: normal; }
.dropdown-item.active { background: var(--you); }
.dropdown-item.active small { color: #fff !important; }
.topbar .sel-empresa { display: flex; align-items: center; gap: .25rem; border-radius: 8px; background: #f8fafc; }
.topbar .sel-empresa span { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .cuenta { flex-shrink: 0; margin-left: auto; }
.avatar-usuario { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; border: 1px solid #cbdce7; background: var(--you-soft); color: var(--you); font-size: 1.25rem; cursor: pointer; }
.avatar-usuario:hover, .avatar-usuario[aria-expanded="true"] { background: var(--you); border-color: var(--you); color: #fff; }
.cuenta .dropdown-menu { width: 250px; }
.cuenta-datos { padding: .55rem .75rem; overflow-wrap: anywhere; }
.cuenta-datos strong, .cuenta-datos small { display: block; }
.cuenta-datos strong { font-size: .85rem; color: var(--ink); font-weight: 600; }
.cuenta-datos small { margin-top: .15rem; color: var(--muted); }
.perfil-datos dt { color: var(--muted); font-size: .78rem; font-weight: 500; }
.perfil-datos dd { margin: .2rem 0 1rem; overflow-wrap: anywhere; }
.perfil-datos dd:last-child { margin-bottom: 0; }
:where(a, button, input, select, textarea):focus-visible { outline: 3px solid #4c9abb; outline-offset: 3px; }
.sidebar :where(a, button):focus-visible { outline-color: #9bd7ef; outline-offset: -3px; }
@media (max-width: 991px) {
  .topbar { min-height: 64px; padding: .75rem 1rem; gap: .65rem; }
  .titulo-modulo { font-size: 1.2rem; margin-bottom: .9rem; }
  .topbar .empresa { min-width: 0; }
  .topbar .empresa > .dropdown { min-width: 0; max-width: 100%; }
  .topbar .sel-empresa { max-width: 100%; }
  .topbar .sel-empresa span { min-width: 0; max-width: 260px; }
  .topbar .empresa .pill { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .hamb { min-width: 36px; min-height: 40px; }
  .tabla td.num { text-align: left; white-space: normal; }
  .tabla tbody tr:last-child { margin-bottom: 0; }
  .tabla tbody tr:hover td { background: transparent; }
  .tabla .acc .btn { min-width: 40px; min-height: 40px; }
}
@media (max-width: 575px) {
  .topbar { display: grid; grid-template-columns: 36px minmax(0, 1fr) 38px; }
  .topbar .hamb { grid-column: 1; grid-row: 1; }
  .topbar .cuenta { grid-column: 3; grid-row: 1; }
  .topbar .empresa { grid-column: 2; grid-row: 1; max-width: 100%; }
  .panel-head { padding: 1rem; }
  .panel-head .buscador { flex-basis: 100%; max-width: none; }
  .panel-head .der { width: 100%; margin-left: 0; }
  .panel-head .der > .btn { flex: 1; }
  .panel-body { padding: 1rem; }
  .kpis { grid-template-columns: 1fr; gap: .75rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .sidebar .nav-link { transition: none; }
}

/* --- Fase 3: deposito, firmas, entregas y consumo (agregado, no tocar lo de arriba) --- */
.firma-lienzo { border: 1px dashed var(--line); border-radius: 10px; background: #fff; touch-action: none; }
.firma-lienzo canvas { display: block; width: 100%; touch-action: none; cursor: crosshair; }
.firma-resumen { background: #f7f9fc; border-radius: 10px; padding: .75rem 1rem; font-size: .85rem; }
.firma-resumen table { width: 100%; margin-bottom: 0; }
.firma-render { background: #fff; border: 1px solid var(--line); border-radius: 8px; max-width: 320px; }
.firma-render svg { width: 100%; height: auto; display: block; }
.badge-sin-articulo { display: inline-block; }

/* Tarjetas de "pendientes de firma" (entregas.php): botones grandes, una mano. */
.tarjetas-pendientes { display: grid; gap: .75rem; }
.tarjeta-pendiente { border: 1px solid var(--line); border-radius: 12px; padding: 1rem; background: #fff; box-shadow: 0 3px 14px rgba(28, 49, 77, .035); }
.tarjeta-pendiente .tp-cab { display: flex; justify-content: space-between; align-items: baseline; gap: .5rem; margin-bottom: .4rem; }
.tarjeta-pendiente .tp-cab b { font-size: 1.05rem; }
.tarjeta-pendiente .tp-items { font-size: .85rem; color: var(--muted); margin-bottom: .75rem; }
.tarjeta-pendiente .btn-firmar-grande { width: 100%; padding: .85rem; font-size: 1.05rem; border-radius: 10px; }

/* Kardex y grilla de consumos: numeros alineados, encabezado fijo en scroll horizontal. */
.grilla-consumo { font-size: .82rem; }
.grilla-consumo th, .grilla-consumo td { text-align: center; white-space: nowrap; }
.grilla-consumo td.gc-celda { cursor: pointer; }
.grilla-consumo td.gc-celda:hover { background: var(--you-soft); }
.grilla-consumo td.gc-cero { color: var(--muted); }

@media (max-width: 575px) {
  .firma-modal .modal-body { padding: 1rem; }
  .tarjeta-pendiente .tp-cab { flex-direction: column; align-items: flex-start; }
}

/* --- Fase 5: cubiertas (esquema de ejes y posiciones) --- */
.esquema-ejes { display: grid; gap: 1.5rem; }

.eje {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  background: #fff;
}

.eje-numero {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.eje-posiciones {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
}

.pos-card {
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #fff;
  min-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.pos-card.ocupada {
  border-color: #0d6efd;
  background: rgba(13, 110, 253, 0.04);
  font-weight: 500;
}

.pos-card.ocupada:hover {
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
  border-color: #0d6efd;
}

.pos-card.ocupada.alerta {
  border-color: #ffc107;
  background: rgba(255, 193, 7, 0.04);
}

.pos-card.vacia {
  border-style: dashed;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.01);
}

.pos-card.vacia:hover {
  border-color: #0d6efd;
  color: #0d6efd;
  background: rgba(13, 110, 253, 0.04);
}

.pos-card .nro-fuego {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
  word-break: break-word;
}

.pos-card .detalles {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.75rem;
}

.pos-card .detalles small {
  color: var(--muted);
}

.pos-card .alerta {
  color: #ffc107;
}

.pos-card .placeholder {
  font-size: 0.95rem;
  font-weight: 500;
}

.aux-seccion {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem;
  background: #fff;
}

.aux-posiciones {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
}

.aux-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: #f8f9fa;
  font-size: 0.85rem;
  font-weight: 500;
}

.aux-card:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  border-color: #0d6efd;
  background: rgba(13, 110, 253, 0.04);
}

.aux-card small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  margin-top: 0.3rem;
  font-weight: 400;
}

/* Estados de cubierta (badges) */
.est-cub-deposito { --bs-bg-opacity: 1; background-color: rgba(108, 117, 125, 0.8) !important; }
.est-cub-montada { --bs-bg-opacity: 1; background-color: rgba(25, 135, 84, 0.8) !important; }
.est-cub-auxilio { --bs-bg-opacity: 1; background-color: rgba(0, 123, 255, 0.8) !important; }
.est-cub-en_recapado { --bs-bg-opacity: 1; background-color: rgba(255, 193, 7, 0.9) !important; color: #000 !important; }
.est-cub-baja { --bs-bg-opacity: 1; background-color: rgba(220, 53, 69, 0.8) !important; }

@media (max-width: 767px) {
  .eje-posiciones {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  }

  .pos-card {
    min-height: 100px;
    padding: 0.75rem;
    font-size: 0.9rem;
  }

  .pos-card .nro-fuego {
    font-size: 0.95rem;
  }

  .pos-card .detalles {
    font-size: 0.7rem;
  }

  .aux-posiciones {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  }

  .aux-card {
    padding: 0.6rem;
    font-size: 0.8rem;
  }
}

/* Fase 6: checklist diario y preventivo ------------------------------------ */
.grilla-buses { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: .75rem; }
.btn-bus { position: relative; border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 1.1rem .5rem; font-size: 1.3rem; font-weight: 700; color: var(--ink); box-shadow: 0 3px 14px rgba(28, 49, 77, .035); }
.btn-bus:hover, .btn-bus:focus { border-color: var(--you); color: var(--you); }
.btn-bus.hecho { border-color: var(--ok); background: #f0faf4; }
.btn-bus .bb-check { position: absolute; top: 6px; right: 8px; color: var(--ok); font-size: 1rem; }
.chk-items { display: grid; gap: .6rem; }
.chk-item { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 10px; padding: .75rem 1rem; background: #fff; }
.chk-item.critico { border-left: 4px solid var(--peligro); }
.chk-item .ci-texto { font-weight: 600; flex: 1 1 auto; min-width: 140px; }
.chk-item .ci-control { display: flex; flex-direction: column; align-items: flex-end; gap: .25rem; min-width: 160px; }
.chk-item .ci-okno .btn { min-width: 74px; }
.chk-item .ci-okno .btn.active.ci-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.chk-item .ci-okno .btn.active.ci-no { background: var(--peligro); border-color: var(--peligro); color: #fff; }
.chk-item .ci-detalle { max-width: 220px; }
.preventivo-tabla td.pv-celda { cursor: pointer; text-align: center; font-size: .78rem; white-space: nowrap; }
.pv-ok { background: #f0faf4; color: var(--ok); }
.pv-proximo { background: #fff7ea; color: #9a6400; }
.pv-vencido { background: #fdeeee; color: var(--peligro); font-weight: 600; }
.pv-sin_registro { background: #f1f3f5; color: var(--muted); }
@media (max-width: 576px) {
  .grilla-buses { grid-template-columns: repeat(auto-fill, minmax(88px, 1fr)); }
  .chk-item { flex-direction: column; align-items: stretch; }
  .chk-item .ci-control { align-items: stretch; min-width: 0; }
  .chk-item .ci-detalle { max-width: none; }
}

/* --- Fase 7: campana de notificaciones, tablero con graficos, reportes extra --- */
.topbar .campana { flex-shrink: 0; }
.campana .avatar-usuario { position: relative; }
.campana-badge { position: absolute; top: -2px; right: -2px; background: var(--peligro); color: #fff; border-radius: 999px; font-size: .62rem; line-height: 1; padding: .28rem .38rem; font-weight: 700; min-width: 17px; text-align: center; }
.campana-menu { width: 340px; max-width: calc(100vw - 24px); padding: 0; overflow: hidden; }
.campana-cab { display: flex; align-items: center; justify-content: space-between; padding: .7rem .9rem; border-bottom: 1px solid var(--line); font-weight: 600; font-size: .85rem; }
.campana-lista { max-height: 360px; overflow-y: auto; }
.campana-item { display: block; padding: .65rem .9rem; border-bottom: 1px solid #f1f4f8; text-decoration: none; color: var(--ink); }
.campana-item:hover { background: var(--you-soft); }
.campana-item.no-leida { background: #f6fafd; }
.campana-item.no-leida .ci-titulo::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--you); margin-right: .4rem; }
.campana-item .ci-titulo { font-weight: 600; font-size: .84rem; }
.campana-item .ci-detalle { font-size: .78rem; color: var(--muted); margin-top: .1rem; }
.campana-item .ci-fecha { font-size: .7rem; color: var(--muted); margin-top: .15rem; }

.tablero-graficos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; margin-bottom: 1.4rem; }
.tablero-graficos .panel-body { height: 300px; }
.tablero-atencion { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; margin-bottom: 1.4rem; }
.at-lista { list-style: none; margin: 0; padding: 0; }
.at-lista li { display: flex; justify-content: space-between; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid #f1f4f8; font-size: .84rem; }
.at-lista li:last-child { border-bottom: 0; }
.at-lista a { color: var(--ink); text-decoration: none; font-weight: 500; }
.at-lista a:hover { color: var(--you); }
.at-lista .at-dato { color: var(--muted); white-space: nowrap; }
.at-vertodos { display: block; text-align: center; font-size: .78rem; padding-top: .5rem; }
@media (max-width: 860px) {
  .tablero-graficos { grid-template-columns: 1fr; }
}

.rep-fila-exp { cursor: pointer; }
.rep-fila-exp:hover td { background: var(--you-soft) !important; }
.rep-detalle-fila td { background: #f7f9fc; padding: 0 !important; }
.rep-detalle-fila .tabla { margin: .5rem; width: calc(100% - 1rem); }
