:root {
  --azul: #1a3560;
  --azul2: #253f73;
  --azul3: #4ea6e8;
  --verde: #28a745;
  --rojo: #c0392b;
  --naranja: #e67e22;
  --morado: #6f42c1;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background: #f0f4f8;
  min-height: 100vh;
}

#header {
  background: var(--azul);
  color: white;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.logo-box {
  width: 44px;
  height: 44px;
  background: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

#header-count {
  margin-left: auto;
  font-size: 13px;
  opacity: 0.8;
}

#nav {
  background: var(--azul2);
  display: flex;
  flex-wrap: wrap;
}

.nav-btn {
  background: transparent;
  color: white;
  border: none;
  padding: 11px 18px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 3px solid transparent;
  white-space: nowrap;
}

.nav-btn.active {
  background: var(--azul);
  border-bottom: 3px solid var(--azul3);
  font-weight: bold;
}

.nav-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
}

#main {
  max-width: 1250px;
  margin: 0 auto;
  padding: 24px 16px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin-bottom: 16px;
}

.card-titulo {
  background: #e8ede8;
  border-bottom: 2px solid #bbb;
  padding: 14px 24px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: #222;
  letter-spacing: 1px;
}

.card-body {
  padding: 24px;
}

.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.field label {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: bold;
  color: #444;
}

.field input,
.field select {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
}

.field input:focus,
.field select:focus {
  outline: 2px solid var(--azul3);
}

.field input:disabled {
  background: #f0f0f0;
  color: #888;
  cursor: not-allowed;
}

.box {
  background: #f8f9fb;
  border: 1px solid #dde;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 20px;
}

.box.azul {
  background: #f0f4f9;
  border-color: #c8d8ec;
}

.box.verde {
  background: #f0f9f4;
  border-color: #a8dfc0;
}

.box-title {
  font-size: 13px;
  font-weight: bold;
  color: #333;
  margin-bottom: 12px;
}

.ln-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.ln-opt {
  position: relative;
}

.ln-opt input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.ln-card {
  border: 2px solid #ddd;
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: white;
}

.ln-card:hover {
  border-color: var(--azul3);
  background: #f0f7ff;
}

.ln-opt input:checked+.ln-card {
  border-color: var(--azul);
  background: var(--azul);
  color: white;
}

.ln-icon {
  font-size: 26px;
  display: block;
  margin-bottom: 6px;
}

.ln-label {
  font-size: 13px;
  font-weight: bold;
}

.rubros-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.rubro-opt {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  font-size: 14px;
}

.rubro-opt input {
  width: 16px;
  height: 16px;
}

.concept-row {
  display: grid;
  grid-template-columns: auto 1fr 130px;
  gap: 8px;
  margin-bottom: 8px;
  align-items: center;
}

.concept-num {
  width: 24px;
  height: 24px;
  background: var(--azul);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: bold;
  flex-shrink: 0;
}

.concept-row input {
  padding: 9px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 14px;
  width: 100%;
}

.concept-sep {
  height: 1px;
  background: #eee;
  margin: 4px 0 8px 32px;
}

.btn {
  padding: 9px 18px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: bold;
  transition: opacity 0.15s;
}

.btn:hover {
  opacity: 0.88;
}

.btn-primary {
  background: var(--azul);
  color: white;
  width: 100%;
  padding: 14px;
  font-size: 16px;
  letter-spacing: 1px;
}

.btn-gray {
  background: #666;
  color: white;
}

.btn-blue {
  background: var(--azul2);
  color: white;
}

.btn-green {
  background: var(--verde);
  color: white;
}

.btn-red {
  background: var(--rojo);
  color: white;
  padding: 5px 12px;
  font-size: 12px;
}

.btn-orange {
  background: var(--naranja);
  color: white;
  padding: 5px 12px;
  font-size: 12px;
}

.btn-sm {
  padding: 5px 12px;
  font-size: 12px;
}

.alerta {
  padding: 12px 20px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-weight: bold;
  font-size: 15px;
  display: none;
}

.alerta-ok {
  background: #d4edda;
  border: 1px solid var(--verde);
  color: #155724;
}

.alerta-err {
  background: #f8d7da;
  border: 1px solid var(--rojo);
  color: #721c24;
}

/* ═══ TARJETA SOLICITUD CON EVIDENCIA ═══ */
.sol-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: 1fr 160px auto;
  overflow: hidden;
  border: 1px solid #eaecef;
}

.sol-info {
  padding: 18px 20px;
}

.sol-nombre {
  font-weight: bold;
  font-size: 16px;
  color: var(--azul);
  margin-bottom: 4px;
}

.sol-meta {
  color: #666;
  font-size: 13px;
  margin-bottom: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.badge {
  display: inline-block;
  color: white;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
}

.badge-ln {
  display: inline-block;
  border: 2px solid var(--azul);
  color: var(--azul);
  padding: 1px 9px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: bold;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  background: #eef2ff;
  color: #3a4faa;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
}

/* EVIDENCIA COLUMNA */
.sol-evidencia {
  border-left: 1px solid #eee;
  border-right: 1px solid #eee;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: #fafafa;
  min-height: 140px;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
}

.sol-evidencia:hover {
  background: #f0f4ff;
}

.ev-empty {
  text-align: center;
  color: #aaa;
}

.ev-empty-icon {
  font-size: 32px;
  margin-bottom: 6px;
}

.ev-empty-text {
  font-size: 11px;
  line-height: 1.4;
  color: #888;
}

.ev-empty-btn {
  margin-top: 8px;
  background: var(--azul);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  width: 100%;
}

.ev-thumb {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 6px;
  display: block;
}

.ev-status {
  margin-top: 6px;
  text-align: center;
}

.ev-pagado {
  display: inline-block;
  background: #d4edda;
  color: #155724;
  border: 1px solid #28a745;
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 11px;
  font-weight: bold;
}

.ev-btns {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  justify-content: center;
}

.ev-btn {
  border: none;
  border-radius: 5px;
  padding: 3px 8px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
}

.ev-btn-ver {
  background: #e8f0ff;
  color: var(--azul);
}

.ev-btn-cam {
  background: #fff3e0;
  color: var(--naranja);
}

.ev-btn-del {
  background: #fde;
  color: var(--rojo);
}

/* ACCIONES COLUMNA */
.sol-acciones {
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 130px;
}

.sol-total {
  font-size: 22px;
  font-weight: bold;
  color: var(--azul);
  text-align: center;
}

.sol-total-label {
  font-size: 10px;
  color: #888;
  text-align: center;
  margin-top: 2px;
}

.sol-btns-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
}

.sol-btns-col button {
  width: 100%;
  padding: 6px 0;
  font-size: 12px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.sbtn-editar {
  background: #fff3e0;
  color: var(--naranja);
}

.sbtn-formato {
  background: #e8f0ff;
  color: var(--azul2);
}

.sbtn-eliminar {
  background: #fde;
  color: var(--rojo);
}

.busqueda {
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  width: 100%;
  margin-bottom: 16px;
}

.empty {
  background: white;
  padding: 48px;
  border-radius: 10px;
  text-align: center;
  color: #888;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* REPORTE */
.filtros {
  display: flex;
  gap: 12px;
  margin: 20px 0 24px;
  align-items: center;
  flex-wrap: wrap;
}

.filtros select {
  padding: 9px 16px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 14px;
  background: white;
}

.banner {
  background: linear-gradient(135deg, #1a3560, #253f73);
  color: white;
  padding: 20px 28px;
  border-radius: 10px;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.banner-monto {
  font-size: 36px;
  font-weight: bold;
}

.rubros-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.rubro-card {
  background: white;
  padding: 18px;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.rubro-monto {
  font-size: 24px;
  font-weight: bold;
  color: var(--azul);
}

.barra {
  margin-top: 10px;
  height: 5px;
  background: #eee;
  border-radius: 3px;
}

.barra-fill {
  height: 5px;
  border-radius: 3px;
}

.tabla-wrap {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  overflow: hidden;
}

.tabla-bar {
  padding: 14px 20px;
  background: #f5f7fb;
  border-bottom: 1px solid #e0e0e0;
  font-weight: bold;
  color: #333;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  padding: 10px 16px;
  text-align: left;
  font-size: 12px;
  color: #555;
  border-bottom: 1px solid #e0e0e0;
  background: #f9fafc;
}

td {
  padding: 10px 16px;
  font-size: 13px;
  border-bottom: 1px solid #f0f0f0;
}

tr:nth-child(even) td {
  background: #fafbfc;
}

tfoot td {
  background: #eef2ff;
  font-weight: bold;
}

/* LÍNEA DE NEGOCIO */
.ln-resumen-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}

.ln-resumen-card {
  border-radius: 12px;
  padding: 22px;
  color: white;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.ln-resumen-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

.ln-resumen-nombre {
  font-size: 16px;
  font-weight: bold;
  margin-bottom: 8px;
  opacity: 0.9;
}

.ln-resumen-monto {
  font-size: 32px;
  font-weight: bold;
}

.ln-resumen-count {
  font-size: 13px;
  opacity: 0.75;
  margin-top: 4px;
}

/* CATÁLOGO */
.cat-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  padding: 16px 20px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.cat-nombre {
  font-weight: bold;
  font-size: 15px;
  color: var(--azul);
}

.cat-dato {
  font-size: 12px;
  color: #666;
  margin-top: 3px;
}

.cat-btns {
  display: flex;
  gap: 6px;
}

.worker-box {
  background: linear-gradient(135deg, #eef4ff, #e8f0fe);
  border: 2px solid var(--azul3);
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 20px;
}

.worker-box label {
  font-size: 13px;
  font-weight: bold;
  color: var(--azul);
  display: block;
  margin-bottom: 8px;
}

.worker-box select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #aac4e8;
  border-radius: 6px;
  font-size: 14px;
  background: white;
}

/* MODALES */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1000;
  overflow-y: auto;
  padding: 20px;
  z-index: 99999 !important;
}

.modal-overlay.open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.modal {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 740px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  margin: auto;
  z-index: 10000;
}

.modal-header {
  background: var(--azul);
  color: white;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 17px;
}

.modal-close {
  background: none;
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
}

.modal-body {
  padding: 24px;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  background: #f5f7fb;
  border-top: 1px solid #e0e0e0;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.campo-bloqueado {
  font-size: 11px;
  color: var(--rojo);
  font-weight: normal;
}

/* EVIDENCIA MULTI-FOTO */
.ev-fotos-grid {
  display: grid;
  gap: 4px;
  width: 100%;
}

.ev-fotos-grid.n1 {
  grid-template-columns: 1fr;
}

.ev-fotos-grid.n2 {
  grid-template-columns: 1fr 1fr;
}

.ev-fotos-grid.n3 {
  grid-template-columns: 1fr 1fr;
}

.ev-foto-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 5px;
  cursor: pointer;
}

.ev-foto-wrap img {
  width: 100%;
  height: 68px;
  object-fit: cover;
  display: block;
  transition: opacity 0.15s;
}

.ev-fotos-grid.n1 .ev-foto-wrap img {
  height: 100px;
}

.ev-foto-wrap:hover img {
  opacity: 0.85;
}

.ev-foto-del {
  position: absolute;
  top: 2px;
  right: 2px;
  background: rgba(192, 57, 43, 0.85);
  color: white;
  border: none;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 10px;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.ev-foto-wrap:hover .ev-foto-del {
  display: flex;
}

.ev-foto-num {
  position: absolute;
  bottom: 2px;
  left: 3px;
  background: rgba(0, 0, 0, 0.55);
  color: white;
  font-size: 9px;
  border-radius: 3px;
  padding: 1px 4px;
}

.ev-add-btn {
  width: 100%;
  margin-top: 5px;
  background: rgba(26, 53, 96, 0.08);
  color: var(--azul);
  border: 1px dashed var(--azul3);
  border-radius: 5px;
  padding: 4px 0;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
}

.ev-add-btn:hover {
  background: rgba(26, 53, 96, 0.15);
}

.ev-contador {
  font-size: 10px;
  text-align: center;
  color: #888;
  margin-top: 3px;
}

/* VISOR DE EVIDENCIA */
#visor-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.93);
  z-index: 2000;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

#visor-overlay.open {
  display: flex;
}

#visor-img {
  max-width: 88vw;
  max-height: 78vh;
  border-radius: 8px;
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.6);
}

#visor-titulo {
  color: white;
  font-size: 14px;
  margin-bottom: 12px;
  opacity: 0.85;
}

#visor-close {
  position: fixed;
  top: 18px;
  right: 24px;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 26px;
  cursor: pointer;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#visor-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

#visor-nav {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  align-items: center;
}

.visor-nav-btn {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  font-size: 22px;
  cursor: pointer;
  border-radius: 50%;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.visor-nav-btn:hover {
  background: rgba(255, 255, 255, 0.28);
}

.visor-nav-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

#visor-counter {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  min-width: 50px;
  text-align: center;
}

/* FORMATO */
.fmt-header-btns {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
}

.fmt-doc {
  background: white;
  border: 2px solid #333;
  max-width: 700px;
  margin: 0 auto;
  font-size: 13px;
}

.fmt-top {
  display: grid;
  grid-template-columns: 140px 1fr;
  border-bottom: 2px solid #333;
}

.fmt-logo {
  padding: 14px;
  border-right: 2px solid #333;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.fmt-logo-box {
  width: 48px;
  height: 36px;
  background: #1a3560;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
}

.fmt-titulo {
  padding: 16px 20px;
  text-align: center;
  background: #e8ede8;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fmt-row {
  display: grid;
  grid-template-columns: 185px 1fr;
  border-bottom: 1px solid #ccc;
}

.fmt-lbl {
  padding: 7px 14px;
  font-size: 13px;
  border-right: 1px solid #ccc;
  background: #fafafa;
}

.fmt-val {
  padding: 7px 14px;
  font-size: 13px;
}

.fmt-sec {
  padding: 6px 14px;
  background: #f0f0f0;
  border-bottom: 1px solid #ccc;
  font-weight: bold;
  font-size: 12px;
}

.fmt-rubro-row {
  display: grid;
  grid-template-columns: 185px 50px 1fr;
  border-bottom: 1px solid #ddd;
}

.fmt-rubro-lbl {
  padding: 6px 14px;
  font-size: 13px;
  border-right: 1px solid #ddd;
}

.fmt-rubro-x {
  padding: 6px;
  text-align: center;
  font-size: 15px;
  font-weight: bold;
  border-right: 1px solid #ddd;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fmt-rubro-desc {
  padding: 6px 14px;
  font-size: 12px;
}

.fmt-sep {
  height: 14px;
  background: #888;
  border-top: 1px solid #555;
  border-bottom: 1px solid #555;
}

/* ═══ NÓMINA ═══ */
.nom-tabla-wrap {
  overflow-x: auto;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
}

.nom-tabla {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.nom-tabla th {
  padding: 7px 8px;
  font-size: 11px;
  color: #444;
  border-bottom: 2px solid #ddd;
  background: #f5f7fb;
  text-align: center;
  white-space: nowrap;
}

.nom-tabla td {
  padding: 5px 7px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.nom-tabla tbody tr:hover td {
  background: #fafcff;
}

.nom-tabla input[type="number"] {
  width: 100%;
  padding: 5px 6px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font-size: 12px;
  text-align: right;
  background: #fff;
}

.nom-tabla input[type="number"]:focus {
  outline: 2px solid var(--azul3);
  border-color: transparent;
}

.nom-tabla .td-nombre {
  text-align: left;
  font-weight: bold;
  color: var(--azul);
  min-width: 160px;
  font-size: 13px;
}

.nom-tabla .td-meta {
  text-align: left;
  color: #666;
  font-size: 11px;
  min-width: 130px;
}

.nom-tabla tfoot td {
  background: #eef2ff;
  font-weight: bold;
  font-size: 12px;
  padding: 8px 8px;
}

.nom-comp {
  font-weight: bold;
  color: var(--azul);
  text-align: right !important;
  white-space: nowrap;
  min-width: 90px;
}

.nom-hist-card {
  background: white;
  border-radius: 10px;
  padding: 14px 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.nom-hist-semana {
  font-weight: bold;
  font-size: 15px;
  color: var(--azul);
}

.nom-hist-meta {
  font-size: 13px;
  color: #555;
  margin-top: 4px;
}

.th-e1 {
  background: #dce8f5 !important;
}

.th-e2 {
  background: #d4edda !important;
}

.th-desc {
  background: #ffe8e8 !important;
}

.th-tot {
  background: #cce5ff !important;
}

/* MODAL NÓMINA VER */
#nom-modal {
  display: none;
  position: fixed;
  top: 0;
  z-index: 1;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.65);
  z-index: 1500;
  overflow-y: auto;
  padding: 20px;
}

#nom-modal.open {
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

#nom-modal-box {
  background: white;
  border-radius: 12px;
  width: 100%;
  max-width: 960px;
  margin: auto;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

#nom-modal-header {
  background: var(--azul);
  color: white;
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#nom-modal-body {
  padding: 0;
  overflow-x: auto;
  max-height: 80vh;
  overflow-y: auto;
}

/* TOAST RESPALDO */
#backup-toast {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a3560;
  color: white;
  padding: 12px 22px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  min-width: 300px;
  max-width: 90vw;
}

#backup-toast.show {
  display: flex;
}

#backup-toast .bt-icon {
  font-size: 22px;
}

#backup-toast .bt-texto {
  flex: 1;
  line-height: 1.4;
}

#backup-toast .bt-fecha {
  font-size: 11px;
  opacity: 0.7;
}

#backup-toast button {
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: white;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

#backup-toast button:hover {
  background: rgba(255, 255, 255, 0.25);
}

.backup-badge {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  margin-left: 8px;
}

.carpeta-badge {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 5px;
  white-space: nowrap;
}

.carpeta-badge.ok {
  background: rgba(40, 167, 69, 0.25);
  color: #90ee90;
  border: 1px solid rgba(40, 167, 69, 0.4);
}

.carpeta-badge.sin {
  background: rgba(192, 57, 43, 0.2);
  color: #ffaaaa;
  border: 1px solid rgba(192, 57, 43, 0.35);
}

/* SUB NAV (Barra azul marino) */
#sub-nav {
  background: #0f2244;
  padding: 0 24px;
  display: flex;
  align-items: center;
  min-height: 46px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sub-menu-group {
  display: flex;
  gap: 8px;
  width: 100%;
}

.sub-nav-btn {
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  border: none;
  padding: 14px 16px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 3px solid transparent;
  transition: color 0.2s;
}

.sub-nav-btn.active {
  color: white;
  border-bottom: 3px solid var(--azul3);
  font-weight: bold;
}

.sub-nav-btn:hover:not(.active) {
  color: white;
  background: rgba(255, 255, 255, 0.05);
}

@media print {

  #header,
  #nav,
  #sync-bar,
  .fmt-header-btns,
  .no-print {
    display: none !important;
  }

  #main {
    padding: 0;
    max-width: 100%;
  }

  body {
    background: white;
  }
}

@media (max-width: 680px) {
  .sol-card {
    grid-template-columns: 1fr;
  }

  .sol-evidencia {
    border-left: none;
    border-top: 1px solid #eee;
  }

  .sol-acciones {
    border-top: 1px solid #eee;
    flex-direction: row;
  }

  .ln-resumen-grid,
  .ln-grid {
    grid-template-columns: 1fr;
  }

  .grid2 {
    grid-template-columns: 1fr;
  }
}

/* PESTAÑAS (TABS) INTERNAS */
.tabs-container {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  border-bottom: 2px solid #dde;
  padding-bottom: 12px;
  flex-wrap: wrap;
}

.tab-btn {
  background: white;
  border: 1px solid #ccc;
  padding: 10px 22px;
  font-size: 14px;
  font-weight: bold;
  color: #666;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.tab-btn.active {
  background: var(--azul);
  border-color: var(--azul);
  color: white;
  box-shadow: 0 4px 10px rgba(26, 53, 96, 0.3);
}

.tab-btn:hover:not(.active) {
  background: #f0f4ff;
  color: var(--azul);
  border-color: var(--azul3);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

#modal-staging-nomina {
  z-index: 999999 !important;
}