/* ===== Base ===== */
:root {
  --brand: #1A6FB5;
  --brand-hover: #155A94;
  --brand-ink: #164E82;
  --brand-soft: #E8F1F8;
  --accent: #E39B1C;
  --ink: #152033;
  --muted: #5B6B7C;
  --sidebar: #0E1A2B;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.34s;
}
html { scroll-behavior: smooth; }
body { color: var(--ink); background: #F3F5F7; }
.logo-wordmark { height: 1.75rem; width: auto; max-width: 11rem; object-fit: contain; object-position: left center; }
.logo-mark { height: 2.15rem; width: 2.15rem; object-fit: contain; }
.logo-login { height: 3.1rem; width: auto; max-width: 16rem; object-fit: contain; }
.logo-portal { height: 1.65rem; width: auto; max-width: 10rem; object-fit: contain; }
.logo-report { height: 2.4rem; width: auto; max-width: 14rem; object-fit: contain; }
.logo-foot { height: 1.15rem; width: auto; object-fit: contain; opacity: 0.85; }
main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
main select,
main textarea {
  border: 1px solid #c5d0db;
  border-radius: 0.55rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  background: #fff;
}
@media (max-width: 767px) {
  main input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  main select,
  main textarea {
    max-width: 100%;
    font-size: 16px !important;
  }
  main button { min-height: 2.5rem; touch-action: manipulation; }
}
main input[type="file"] { max-width: 100%; font-size: 0.82rem; color: #64748b; }
main input[type="file"]::file-selector-button {
  margin-right: 0.6rem;
  padding: 0.45rem 0.85rem;
  border: 1px solid #d7dee6;
  border-radius: 0.6rem;
  background: #fff;
  color: #334155;
  font-weight: 600;
  cursor: pointer;
}
main input[type="file"]::file-selector-button:hover { background: #f4f6f8; }
main input:focus, main select:focus, main textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 111, 181, 0.14);
}

/* ===== Botones ===== */
button.btn-pri, button.btn-sec { cursor: pointer; border: 1px solid transparent; }
.btn-pri, .btn-sec, button.btn-pri, button.btn-sec {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border-radius: 0.7rem;
  padding: 0.5rem 0.95rem;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}
.btn-pri, .btn-sec, button.btn-pri, button.btn-sec, a.btn-pri, a.btn-sec {
  transition: background var(--dur) var(--ease), color 0.2s ease, border-color 0.2s ease, transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}
.btn-pri { background: var(--brand); color: #fff; }
.btn-pri:hover { background: var(--brand-hover); transform: translateY(-1px); }
.btn-sec { background: #fff; color: #334155; border: 1px solid #d7dee6; }
.btn-sec:hover { background: #f4f6f8; transform: translateY(-1px); }
.btn-pri svg, .btn-sec svg, .btn-icon svg, .nav-link svg, header button svg {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.05rem;
  height: 2.05rem;
  border-radius: 0.6rem;
  margin: 0 0.12rem;
  transition: transform 0.12s ease, background 0.12s ease;
}
.btn-icon:hover { transform: translateY(-1px); }
.btn-editar { background: var(--brand-soft); color: var(--brand-ink); }
.btn-editar:hover { background: #d6e7f5; }
.btn-ver { background: #f1f5f9; color: #334155; }
.btn-ver:hover { background: #e2e8f0; }
.btn-equipos { background: #f0f9ff; color: #0369a1; }
.btn-equipos:hover { background: #e0f2fe; }

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.15rem 0.6rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.badge-amber { background: #fef3c7; color: #92400e; }
.badge-cyan { background: var(--brand-soft); color: var(--brand-ink); }
.badge-emerald { background: #d1fae5; color: #065f46; }
.badge-slate { background: #f1f5f9; color: #475569; }
.badge-rose { background: #ffe4e6; color: #9f1239; }
.badge-violet { background: #ede9fe; color: #5b21b6; }

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border-radius: 0.7rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  transition: background var(--dur) var(--ease), color 0.2s ease, box-shadow 0.2s ease;
}
.nav-link svg { opacity: 0.9; }

/* ===== Sidebar (móvil overlay + escritorio plegable) ===== */
#sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 40;
  display: flex;
  width: 16.75rem;
  transform: translateX(-100%);
  flex-direction: column;
  overflow: hidden;
  background: var(--sidebar);
  color: #d7dee8;
  transition: transform var(--dur) var(--ease), width var(--dur) var(--ease);
}
#sidebar nav {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
#sidebar nav::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}
body.sidebar-open #sidebar { transform: translateX(0); }
.sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 35;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--dur) var(--ease), visibility var(--dur);
}
body.sidebar-open .sidebar-backdrop {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
body.sidebar-open { overflow: hidden; }
.app-shell {
  display: flex;
  min-height: 100vh;
  min-width: 0;
  flex: 1;
  flex-direction: column;
}
@media (min-width: 768px) {
  #sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    transform: none;
  }
  .sidebar-backdrop { display: none !important; }
  body.sidebar-open { overflow: visible; }
  body.sidebar-collapsed #sidebar { width: 4.25rem; }
  body.sidebar-collapsed .sidebar-label,
  body.sidebar-collapsed .sidebar-user,
  body.sidebar-collapsed .sidebar-group,
  body.sidebar-collapsed .nav-link span { display: none; }
  body.sidebar-collapsed #sidebar nav .nav-link {
    justify-content: center;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
  body.sidebar-collapsed .logo-mark { display: block; }
  body.sidebar-collapsed .logo-wordmark { display: none; }
  body.sidebar-collapsed #sidebar > .flex.h-16 {
    flex-direction: column;
    height: auto;
    justify-content: center;
    padding: 0.7rem 0.35rem 0.5rem;
    gap: 0.15rem;
  }
  body.sidebar-collapsed .sidebar-rail { margin-left: 0; }
  body.sidebar-collapsed .sidebar-rail svg { transform: rotate(180deg); }
}

/* ===== DataTables: toolbar arriba, paginación abajo ===== */
.dataTables_wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  font-size: 0.875rem;
  clear: both;
}
.dataTables_wrapper:after { content: none; }
.dt-head, .dt-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.dt-head-left, .dt-head-right, .dt-foot-left, .dt-foot-right,
.dataTables_length, .dataTables_filter, .dataTables_info, .dataTables_paginate {
  float: none !important;
  text-align: left;
  width: auto;
  margin: 0 !important;
}
.dt-head-right, .dt-foot-right { margin-left: auto; }
.dataTables_length label, .dataTables_filter label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #64748b;
  font-weight: 500;
  margin: 0;
}
.dataTables_filter input,
.dataTables_length select {
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
  padding: 0.45rem 0.75rem;
  margin: 0;
  background: #fff;
}
.dataTables_filter input {
  min-width: 220px;
  background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2394a3b8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='M21 21l-4.35-4.35M17 11A6 6 0 1 1 5 11a6 6 0 0 1 12 0z'/%3E%3C/svg%3E") no-repeat 0.7rem center / 1rem;
  padding-left: 2.1rem;
}
.dataTables_filter input:focus {
  background-color: #fff;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(26, 111, 181, 0.12);
}
.dataTables_info { color: #64748b; font-size: 0.8rem; }
.dataTables_paginate {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}
.dataTables_paginate .paginate_button {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.55rem !important;
  margin: 0 !important;
  border-radius: 0.5rem !important;
  border: 1px solid #e2e8f0 !important;
  background: #fff !important;
  color: #334155 !important;
  cursor: pointer;
  box-shadow: none !important;
}
.dataTables_paginate .paginate_button:hover {
  background: var(--brand-soft) !important;
  color: var(--brand-ink) !important;
  border-color: #b7cfe4 !important;
}
.dataTables_paginate .paginate_button.current,
.dataTables_paginate .paginate_button.current:hover {
  background: var(--brand) !important;
  color: #fff !important;
  border-color: var(--brand) !important;
}
.dataTables_paginate .paginate_button.disabled,
.dataTables_paginate .paginate_button.disabled:hover {
  opacity: 0.4;
  cursor: default;
  background: #fff !important;
  color: #94a3b8 !important;
}
.dataTables_processing {
  position: absolute !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%);
  background: #fff !important;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 0.6rem 1rem;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  z-index: 5;
}

table.dataTable {
  width: 100% !important;
  border-collapse: separate;
  border-spacing: 0;
}
table.dataTable thead th {
  background: #f8fafc;
  font-size: 0.72rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
  padding: 0.8rem 0.9rem;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  white-space: nowrap;
}
table.dataTable tbody td {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.875rem;
  vertical-align: middle;
}
table.dataTable tbody tr:hover { background: #f4f8fb; }
table.dataTable tbody tr:last-child td { border-bottom: 0; }
.dt-acciones { white-space: nowrap; text-align: right; width: 1%; }
.dt-scroll { position: relative; overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ===== DataTables en móvil: cada fila es una tarjeta ===== */
@media (max-width: 767px) {
  .dataTables_wrapper { gap: 0.75rem; }
  .dt-head, .dt-foot { flex-direction: column; align-items: stretch; gap: 0.6rem; }
  .dt-head-right, .dt-foot-right { margin-left: 0; }
  .dt-head-right { order: -1; }
  .dataTables_filter label { width: 100%; }
  .dataTables_filter input { flex: 1; width: 100%; min-width: 0; }
  .dataTables_length label { font-size: 0.8rem; }
  .dataTables_info { text-align: center; }
  .dataTables_paginate { justify-content: center; }
  .dataTables_paginate .paginate_button { min-width: 2.25rem; height: 2.25rem; }
  .dt-scroll { overflow-x: visible; }
  .card-soft:has(> .dataTables_wrapper) {
    padding: 0 !important;
    border: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
  }

  table.dt-cards tbody td.dt-acciones {
    width: auto;
    padding-top: 0.55rem;
  }
  table.dt-cards tbody td.dataTables_empty {
    display: block;
    padding: 1.2rem 0 !important;
    text-align: center;
    color: #64748b;
  }
  table.dt-cards tbody tr:has(td.dataTables_empty) { border-style: dashed; }
}

/* ===== Agenda (FullCalendar) ===== */
.fc .fc-toolbar-title { font-size: 1.15rem; font-weight: 650; letter-spacing: -0.01em; }
.fc .fc-button { font-size: 0.82rem; text-transform: none; }
.fc .fc-button-primary { background: #fff; border-color: #d7dee6; color: #334155; }
.fc .fc-button-primary:hover { background: #f4f6f8; border-color: #cbd5e1; color: #1e293b; }
.fc .fc-button-primary:not(:disabled).fc-button-active,
.fc .fc-button-primary:not(:disabled):active { background: var(--brand); border-color: var(--brand); color: #fff; }
.fc .fc-button-primary:disabled { background: #f8fafc; border-color: #e2e8f0; color: #94a3b8; }
.fc .fc-list-event { cursor: pointer; }
@media (max-width: 767px) {
  .fc .fc-header-toolbar { flex-wrap: wrap; gap: 0.6rem; }
  .fc .fc-header-toolbar .fc-toolbar-chunk:nth-child(2) { order: -1; flex-basis: 100%; text-align: center; }
  .fc .fc-toolbar-title { font-size: 1.05rem; }
  .fc .fc-list-event-title { white-space: normal; }
  .fc .fc-list-table td { padding: 0.55rem 0.6rem; }
}

/* ===== Tablas normales en móvil (.tbl-movil) y DataTables: filas como tarjetas ===== */
@media (max-width: 767px) {
  table.dt-cards, table.dt-cards tbody,
  table.tbl-movil, table.tbl-movil tbody { display: block; width: 100% !important; min-width: 0; }
  table.dt-cards thead, table.tbl-movil thead { display: none; }
  table.dt-cards tbody tr, table.tbl-movil tbody tr {
    display: block;
    margin-bottom: 0.65rem;
    padding: 0.3rem 0.85rem;
    border: 1px solid #e4e9ef;
    border-radius: 0.8rem;
    background: #fff;
  }
  table.dt-cards tbody tr:last-child, table.tbl-movil tbody tr:last-child { margin-bottom: 0; }
  table.dt-cards tbody tr:hover, table.tbl-movil tbody tr:hover { background: #fff; }
  table.dt-cards tbody td, table.dt-cards tbody tr:last-child td,
  table.tbl-movil tbody td {
    display: block;
    min-height: 2.2rem;
    padding: 0.45rem 0 !important;
    border: 0;
    border-bottom: 1px solid #f1f5f9;
    text-align: right;
    line-height: 1.35rem;
    overflow-wrap: anywhere;
  }
  table.dt-cards tbody td::after, table.tbl-movil tbody td::after { content: ''; display: block; clear: both; }
  table.dt-cards tbody td:last-child, table.tbl-movil tbody td:last-child { border-bottom: 0; }
  table.dt-cards tbody td:empty, table.tbl-movil tbody td:empty { display: none; }
  table.dt-cards tbody td[data-label]::before,
  table.tbl-movil tbody td[data-label]::before {
    content: attr(data-label);
    float: left;
    max-width: 45%;
    margin-right: 0.9rem;
    font-size: 0.68rem;
    font-weight: 650;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
    color: #64748b;
  }
  table.tbl-movil tbody td[colspan] { text-align: center; }
  table.tbl-movil tbody tr {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 0.7rem;
  }
  table.tbl-movil tbody td { grid-column: span 2; }
  table.tbl-movil tbody td.movil-mitad,
  table.tbl-movil tbody td:has(> input[type="number"]:only-child),
  table.tbl-movil tbody td:has(> input.js-dinero:only-child),
  table.tbl-movil tbody td[data-label]:has(> input[type="checkbox"]:only-child) { grid-column: span 1; }
  table.tbl-movil tbody td:has(input:not([type="checkbox"]):not([type="radio"]), select, textarea) {
    display: block;
    text-align: left;
  }
  table.tbl-movil tbody td:has(input:not([type="checkbox"]):not([type="radio"]), select, textarea)::before {
    display: block;
    float: none;
    max-width: none;
    margin-bottom: 0.25rem;
  }
  table.tbl-movil td input:not([type="checkbox"]):not([type="radio"]),
  table.tbl-movil td select,
  table.tbl-movil td textarea {
    width: 100% !important;
    max-width: 100%;
  }
  table.tbl-movil td > input:not([type="checkbox"]):not([type="radio"]) + input:not([type="checkbox"]):not([type="radio"]),
  table.tbl-movil td > select + input { margin-top: 0.35rem; }

  table.tbl-fila, table.tbl-fila tbody { display: block; width: 100%; min-width: 0; }
  table.tbl-fila tbody tr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #eef2f6;
  }
  table.tbl-fila tbody td { display: block; padding: 0 !important; }
  table.tbl-fila tbody td:first-child { flex: 1 1 100%; }
  table.tbl-fila tbody td:first-child input { width: 100% !important; }
}

.card-soft {
  background: #fff;
  border-radius: 0.85rem;
  box-shadow: 0 1px 2px rgba(15, 32, 51, 0.04);
  border: 1px solid #e4e9ef;
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color 0.2s ease;
}
.card-soft:hover {
  box-shadow: 0 8px 24px rgba(15, 32, 51, 0.06);
}
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 1.1rem; }
.page-head h2 { font-size: 1.35rem; font-weight: 700; letter-spacing: -0.02em; }

.ui-autocomplete {
  z-index: 60;
  max-height: 240px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12);
}
.select2-container .select2-selection--single {
  height: 38px;
  border: 1px solid #cbd5e1;
  border-radius: 0.65rem;
}
.select2-container--default .select2-selection--single .select2-selection__rendered { line-height: 38px; }
.select2-container--default .select2-selection--single .select2-selection__arrow { height: 36px; }

/* ===== Opciones de campo (reporte técnico) ===== */
.opt-seg {
  display: inline-flex;
  width: 100%;
  background: #f1f5f9;
  border-radius: 0.85rem;
  padding: 0.22rem;
  gap: 0.22rem;
}
.opt-seg label {
  position: relative;
  flex: 1;
  margin: 0;
  cursor: pointer;
}
.opt-seg input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.opt-seg span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.5rem;
  padding: 0.4rem 0.7rem;
  border-radius: 0.7rem;
  font-size: 0.82rem;
  font-weight: 650;
  color: #64748b;
  transition: background 0.12s ease, color 0.12s ease, box-shadow 0.12s ease;
}
.opt-seg input:checked + span.opt-ok {
  background: #d1fae5;
  color: #065f46;
  box-shadow: 0 0 0 1px #6ee7b7;
}
.opt-seg input:checked + span.opt-bad {
  background: #ffe4e6;
  color: #9f1239;
  box-shadow: 0 0 0 1px #fda4af;
}
.opt-seg input:checked + span.opt-na {
  background: #e2e8f0;
  color: #334155;
  box-shadow: 0 0 0 1px #cbd5e1;
}
.opt-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}
.opt-cards label {
  position: relative;
  margin: 0;
  cursor: pointer;
}
.opt-cards input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.opt-cards span {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 4.1rem;
  padding: 0.7rem 0.9rem;
  border-radius: 0.9rem;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 650;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}
.opt-cards span small {
  margin-top: 0.15rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: #64748b;
}
.opt-cards input:checked + span.opt-yes {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-ink);
  box-shadow: 0 0 0 3px rgba(26, 111, 181, 0.12);
}
.opt-cards input:checked + span.opt-no {
  border-color: #94a3b8;
  background: #f8fafc;
  color: #334155;
}

/* ===== Guía ===== */
.guia-pasos {
  display: grid;
  gap: 0.65rem;
}
.guia-pasos li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.8rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.guia-pasos li span { color: #64748b; font-size: 0.82rem; }
.guia-pasos li small {
  display: block;
  margin-top: 0.22rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: #94a3b8;
}
.guia-flujos { display: grid; gap: 1.15rem; }
.guia-flujo-card header {
  margin: -1.25rem -1.25rem 1rem;
  padding: 1rem 1.2rem 0.9rem;
  border-bottom: 1px solid #eef2f6;
  border-radius: 0.85rem 0.85rem 0 0;
  background: #f8fafc;
}
.guia-flujo-card.is-ot header { box-shadow: inset 4px 0 0 var(--brand); }
.guia-flujo-card.is-rep header { box-shadow: inset 4px 0 0 #b45309; }
.guia-flujo-card.is-ins header { box-shadow: inset 4px 0 0 #475569; }
.guia-flujo-card header h4 { font-size: 1.02rem; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.guia-flujo-card header p { margin-top: 0.28rem; font-size: 0.82rem; color: var(--muted); }
.guia-pipe {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.2rem;
  margin: 0 0 1rem;
}
.guia-pipe b {
  font-size: 0.7rem;
  font-weight: 650;
  padding: 0.28rem 0.58rem;
  border-radius: 999px;
  background: #eef2f6;
  color: #334155;
  letter-spacing: 0.01em;
}
.guia-pipe i { font-style: normal; color: #94a3b8; font-size: 0.68rem; padding: 0 0.1rem; }
.guia-alt {
  margin-top: 0.85rem;
  padding: 0.7rem 0.85rem;
  border-radius: 0.7rem;
  background: #f8fafc;
  border: 1px dashed #d7dee6;
  font-size: 0.8rem;
  color: #5B6B7C;
}
.guia-alt strong { color: var(--ink); font-weight: 650; }
.guia-sub {
  margin: 1.15rem 0 0.55rem;
  font-size: 0.92rem;
  font-weight: 650;
  color: var(--brand-ink);
}
.guia-elige {
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 768px) {
  .guia-elige { grid-template-columns: repeat(3, 1fr); }
}
.guia-elige article {
  padding: 0.85rem 0.95rem;
  border-radius: 0.8rem;
  border: 1px solid #e4e9ef;
  background: #f8fafc;
  transition: transform var(--dur) var(--ease), border-color 0.2s ease, box-shadow var(--dur) var(--ease);
}
.guia-elige article:hover {
  transform: translateY(-2px);
  border-color: #c5dbeb;
  box-shadow: 0 8px 20px rgba(15, 32, 51, 0.05);
}
.guia-elige h4 { font-size: 0.92rem; font-weight: 650; margin-bottom: 0.35rem; }
.guia-elige p { font-size: 0.82rem; color: #5B6B7C; }
.guia-tips { display: grid; gap: 0.45rem; font-size: 0.875rem; color: #475569; }
.guia-tips li { padding-left: 0.2rem; }
.guia-item {
  border-bottom: 1px solid #e2e8f0;
  padding: 0.35rem 0;
}
.guia-item summary {
  cursor: pointer;
  font-weight: 650;
  padding: 0.55rem 0;
  list-style: none;
  transition: color 0.2s ease;
}
.guia-item summary::-webkit-details-marker { display: none; }
.guia-item summary::after {
  content: '';
  float: right;
  width: 0.45rem;
  height: 0.45rem;
  margin-top: 0.35rem;
  border-right: 1.6px solid #94a3b8;
  border-bottom: 1.6px solid #94a3b8;
  transform: rotate(45deg);
  transition: transform 0.28s var(--ease);
}
.guia-item[open] summary::after { transform: rotate(-135deg); }
.guia-item summary:hover { color: var(--brand-ink); }
.guia-item div {
  padding: 0 0 0.7rem;
  color: #475569;
  font-size: 0.875rem;
  animation: ts-enter 0.32s var(--ease);
}
.guia-item div p, .guia-item div li { margin-bottom: 0.4rem; }
.guia-item code {
  font-size: 0.8rem;
  background: #f1f5f9;
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
}

.driver-popover {
  max-width: 26rem;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}
.driver-popover-title { font-size: 1rem; color: #0f172a; }
.driver-popover-description { font-size: 0.85rem; color: #475569; line-height: 1.45; }
.driver-popover-next-btn {
  background: var(--brand) !important;
  color: #fff !important;
  border: 0 !important;
  text-shadow: none !important;
}

.nav-link-active {
  background: rgba(26, 111, 181, 0.2);
  color: #fff;
  box-shadow: inset 3px 0 0 var(--accent);
}
.logo-mark { display: none; }

button.bg-cyan-600,
a.bg-cyan-600 {
  background-color: var(--brand) !important;
}
button.bg-cyan-600:hover,
a.bg-cyan-600:hover,
button.hover\:bg-cyan-700:hover {
  background-color: var(--brand-hover) !important;
}
.text-cyan-700 { color: var(--brand-ink) !important; }
.text-cyan-600 { color: var(--brand) !important; }
.hover\:text-cyan-700:hover { color: var(--brand-hover) !important; }
.border-cyan-200 { border-color: #c5dbeb !important; }
.bg-cyan-50 { background-color: var(--brand-soft) !important; }
.text-cyan-900 { color: var(--brand-ink) !important; }
.hover\:ring-cyan-400:hover { --tw-ring-color: rgba(26, 111, 181, 0.45); }
.hover\:border-cyan-300:hover { border-color: #9fc0dc !important; }

/* ===== Firmas: recuadro fijo, sin overlay ===== */
.firma-box,
.firma-view {
  height: 9rem;
  max-height: 9rem;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: #f8fafc;
}
.firma-view {
  display: flex;
  align-items: center;
  justify-content: center;
}
.firma-box canvas {
  display: block;
  width: 100% !important;
  height: 9rem !important;
  max-height: 9rem;
}
.firma-box.locked canvas { display: none; }
.firma-box .firma-prev,
.firma-view img {
  display: block;
  width: 100%;
  height: 9rem;
  max-width: 100%;
  max-height: 9rem;
  object-fit: contain;
  object-position: center;
  background: #f8fafc;
}
.firma-box:not(.locked) .firma-prev,
.firma-box .firma-prev.hidden { display: none; }
canvas.touch-none { touch-action: none; }

/* ===== Movimiento ===== */
@keyframes ts-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
main > section {
  animation: ts-enter 0.42s var(--ease);
}
#tour-bienvenida {
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
#tour-bienvenida.is-on {
  opacity: 1;
  transform: none;
}
.ts-toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 50;
  max-width: 20rem;
  border-radius: 0.85rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: #fff;
  box-shadow: 0 12px 32px rgba(15, 32, 51, 0.18);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.28s var(--ease), transform 0.28s var(--ease);
  pointer-events: none;
}
.ts-toast.is-on { opacity: 1; transform: none; }
.ts-toast-ok { background: #059669; }
.ts-toast-bad { background: #dc2626; }
header {
  transition: box-shadow 0.25s ease;
}
.logo-wordmark, .logo-mark {
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.dataTables_paginate .paginate_button {
  transition: background 0.2s var(--ease), color 0.2s ease, border-color 0.2s ease !important;
}
.driver-popover {
  animation: ts-enter 0.28s var(--ease);
}

/* ===== Dashboard ===== */
.dash { display: flex; flex-direction: column; gap: 1.15rem; }
.dash-hello {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.85rem;
}
.dash-hello h2 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
}
.dash-hello p { margin-top: 0.28rem; font-size: 0.875rem; color: var(--muted); }
.dash-hello p span { color: #94a3b8; }
.dash-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.dash-welcome {
  border-radius: 0.9rem;
  border: 1px solid #e4e9ef;
  background: linear-gradient(180deg, #fff, #f7fafc);
  padding: 0.95rem 1.1rem;
  font-size: 0.875rem;
  color: #3d4f63;
}
.dash-strip {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.dash-chip {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1.05rem;
  text-decoration: none;
  color: inherit;
}
.dash-chip:hover { border-color: #c5d4e2; }
.dash-chip-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 0.7rem;
  background: var(--brand-soft);
  color: var(--brand-ink);
  flex-shrink: 0;
}
.dash-chip-ico svg { width: 1.2rem; height: 1.2rem; }
.dash-chip-ico.is-warn { background: #f8eee8; color: #9a4b1c; }
.dash-chip-ico.is-cash { background: #f4f1ea; color: #8a6414; }
.dash-chip-num {
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--ink);
}
.dash-chip-lbl { margin-top: 0.18rem; font-size: 0.78rem; color: var(--muted); font-weight: 500; }
.dash-mods {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 1fr;
}
@media (min-width: 900px) {
  .dash-mods { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
}
.dash-mod { display: flex; flex-direction: column; padding: 1.1rem 1.15rem 0.7rem; min-height: 100%; }
.dash-mod-head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid #eef2f6;
}
.dash-mod-ico {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 0.7rem;
  background: var(--brand-soft);
  color: var(--brand-ink);
  flex-shrink: 0;
}
.dash-mod-ico svg { width: 1.15rem; height: 1.15rem; }
.dash-mod-ico.is-rep { background: #f8eee8; color: #9a4b1c; }
.dash-mod-ico.is-ins { background: #eef1f6; color: #3d4f63; }
.dash-mod-head h3 { font-size: 0.95rem; font-weight: 650; letter-spacing: -0.01em; }
.dash-mod-head p { margin-top: 0.12rem; font-size: 0.75rem; color: var(--muted); }
.dash-stat {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.48rem 0.35rem;
  margin: 0 -0.35rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: inherit;
  transition: background 0.18s var(--ease);
}
.dash-stat:hover { background: #f5f8fb; }
.dash-stat-label { font-size: 0.82rem; color: var(--muted); }
.dash-stat-val {
  font-size: 1.12rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.dash-stat.is-warn .dash-stat-val { color: #b45309; }
.dash-stat.is-alert .dash-stat-val { color: #9f1239; }
.dash-mod-foot {
  margin-top: auto;
  padding: 0.65rem 0.1rem 0.35rem;
  border-top: 1px solid #eef2f6;
}
.dash-mod-foot a {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
}
.dash-mod-foot a:hover { color: var(--brand-hover); }
.dash-body {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
  .dash-body { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
}
.dash-panel { padding: 1.05rem 1.15rem 0.85rem; }
.dash-panel h3 { font-size: 0.92rem; font-weight: 650; letter-spacing: -0.01em; }
.dash-panel-sub { margin-top: 0.15rem; font-size: 0.75rem; color: var(--muted); }
.dash-hoy { display: flex; flex-direction: column; margin-top: 0.7rem; }
.dash-hoy-item {
  display: grid;
  grid-template-columns: 4.1rem minmax(0, 1fr) auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.62rem 0.2rem;
  border-top: 1px solid #f1f5f9;
  text-decoration: none;
  color: inherit;
  border-radius: 0.45rem;
  transition: background 0.18s var(--ease);
}
.dash-hoy-item:first-child { border-top: 0; }
.dash-hoy-item:hover { background: #f5f8fb; }
.dash-hoy-hora {
  font-size: 0.78rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--brand-ink);
}
.dash-hoy-cli { font-size: 0.86rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-hoy-meta { margin-top: 0.1rem; font-size: 0.72rem; color: var(--muted); }
.dash-empty {
  padding: 1.4rem 0.4rem 0.8rem;
  text-align: center;
  font-size: 0.84rem;
  color: var(--muted);
}
.dash-charts { display: flex; flex-direction: column; gap: 0.9rem; }
.dash-chart-box { position: relative; height: 12.5rem; }
.dash-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.1rem;
  font-size: 0.8rem;
}
.dash-links a { color: var(--muted); text-decoration: none; font-weight: 500; }
.dash-links a:hover { color: var(--brand); }

/* ===== Menú: contadores, pestañas de sección, búsqueda, + Nuevo, barra inferior ===== */
.nav-link { position: relative; }
.nav-link > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-count {
  min-width: 1.35rem;
  padding: 0.05rem 0.4rem;
  border-radius: 999px;
  background: var(--accent);
  color: #1f1300;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.2rem;
  text-align: center;
}
@media (min-width: 768px) {
  body.sidebar-collapsed .nav-count {
    position: absolute;
    top: 0.2rem;
    right: 0.35rem;
    min-width: 1rem;
    padding: 0 0.25rem;
    font-size: 0.6rem;
    line-height: 1rem;
  }
}

.sec-tabs {
  position: relative;
  display: flex;
  gap: 0.15rem;
  margin: -0.25rem 0 1.1rem;
  overflow-x: auto;
  border-bottom: 1px solid #e2e8f0;
  scrollbar-width: none;
}
.sec-tabs::-webkit-scrollbar { display: none; }
.sec-tab {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: -1px;
  padding: 0.6rem 0.8rem;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.sec-tab:hover { color: var(--ink); }
.sec-tab.is-on { color: var(--brand-ink); border-bottom-color: var(--brand); }
.sec-count {
  min-width: 1.3rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #eef2f6;
  color: #475569;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1.15rem;
  text-align: center;
}
.sec-count.is-alert { background: #fef3c7; color: #92400e; }
.sec-tab.is-on .sec-count { background: var(--brand-soft); color: var(--brand-ink); }
.sec-tab.is-on .sec-count.is-alert { background: #fde68a; color: #78350f; }

.ts-buscar { position: relative; flex: 1; min-width: 0; max-width: 34rem; }
.ts-buscar > svg {
  position: absolute;
  top: 50%;
  left: 0.7rem;
  width: 1.05rem;
  height: 1.05rem;
  color: #94a3b8;
  transform: translateY(-50%);
  pointer-events: none;
}
.ts-buscar input {
  width: 100%;
  height: 2.4rem;
  padding: 0 0.75rem 0 2.2rem;
  border: 1px solid #d7dee6;
  border-radius: 0.7rem;
  background: #f6f8fa;
  font-size: 0.875rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.ts-buscar input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26, 111, 181, 0.14);
}
@media (max-width: 767px) {
  .ts-buscar input { font-size: 16px; }
}
.ts-buscar-res {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 50;
  width: min(34rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 32rem);
  overflow-y: auto;
  padding: 0.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.8rem;
  background: #fff;
  box-shadow: 0 18px 40px -12px rgba(15, 23, 42, 0.28);
}
.ts-buscar-grupo {
  padding: 0.55rem 0.6rem 0.25rem;
  color: #94a3b8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.ts-buscar-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  border-radius: 0.55rem;
  color: inherit;
  text-decoration: none;
}
.ts-buscar-item:hover, .ts-buscar-item.is-sel { background: #f1f5f9; }
.ts-buscar-item b { display: block; overflow: hidden; font-size: 0.86rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.ts-buscar-item small { display: block; overflow: hidden; color: var(--muted); font-size: 0.74rem; text-overflow: ellipsis; white-space: nowrap; }
.ts-buscar-item > div { flex: 1; min-width: 0; }
.ts-buscar-vacio { padding: 1rem 0.75rem; color: var(--muted); font-size: 0.84rem; text-align: center; }

.ts-nuevo { position: relative; }
.ts-nuevo-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  z-index: 50;
  min-width: 14rem;
  padding: 0.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 0.8rem;
  background: #fff;
  box-shadow: 0 18px 40px -12px rgba(15, 23, 42, 0.28);
}
.ts-nuevo-menu a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.7rem;
  border-radius: 0.55rem;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
}
.ts-nuevo-menu a:hover { background: #f1f5f9; color: var(--ink); }
.ts-nuevo-menu svg { width: 1.05rem; height: 1.05rem; color: var(--brand); }

@media (max-width: 639px) {
  .ts-oculto-movil { display: none !important; }
}
.ts-bottom { display: none; }
@media (max-width: 767px) {
  .ts-bottom {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 30;
    display: flex;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid #e2e8f0;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 -6px 18px -10px rgba(15, 23, 42, 0.25);
  }
  .ts-bottom a {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    padding: 0.5rem 0.25rem 0.45rem;
    color: #64748b;
    font-size: 0.68rem;
    font-weight: 600;
    text-decoration: none;
  }
  .ts-bottom a svg { width: 1.35rem; height: 1.35rem; }
  .ts-bottom a.is-on { color: var(--brand); }
  body.has-bottom-nav .app-shell { padding-bottom: calc(3.6rem + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
