/**
 * Estilos Específicos para Módulos de Operaciones y Formatos SEC
 */

/* Formulario de Filtros */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-end;
  background-color: var(--surface);
  padding: 20px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 200px;
}

.form-group label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
}

.form-control {
  padding: 10px 14px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease;
}

.form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(39, 91, 136, 0.15);
}

/* Grid de Tarjetas de Vuelos */
.operations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 20px;
}

.operation-card {
  background-color: var(--surface);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.operation-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand);
}

.op-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-2);
  padding-bottom: 10px;
}

.op-airline {
  font-size: 15px;
  font-weight: 800;
  color: var(--brand-deep);
}

.op-flight-no {
  font-size: 13px;
  font-weight: 700;
  color: var(--brand);
}

.op-route {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0;
  padding: 12px 16px;
  background-color: var(--bg);
  border-radius: var(--radius-sm);
}

.route-city {
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
}

.op-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 11px;
  margin-bottom: 14px;
}

.time-box {
  background-color: var(--surface);
  border: 1px solid var(--border-2);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}

.time-box.real {
  border-color: #FECACA;
  background-color: #FEF2F2;
  color: var(--danger);
  font-weight: 600;
}

/* Banner de Operación Seleccionada */
.flight-context-banner {
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand) 100%);
  color: #FFFFFF;
  padding: 20px 28px;
  border-radius: var(--radius-md);
  border-bottom: 3px solid var(--gold);
  margin-bottom: 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-md);
}

.flight-context-info h3 {
  color: #FFFFFF;
  font-size: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.flight-context-tags {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

.flight-tag {
  background-color: rgba(255, 255, 255, 0.15);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

/* Grid de Formatos de Seguridad */
.formats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.format-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: all 0.2s ease;
  cursor: pointer;
}

.format-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.format-card h4 {
  font-size: 15px;
  color: var(--brand-deep);
  margin-bottom: 8px;
}

.format-card p {
  color: var(--text-3);
  font-size: 12px;
  margin-bottom: 16px;
}

/* Modal y Popups (Reanudar Formato) */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background-color: var(--surface);
  width: 90%;
  max-width: 600px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalFadeIn 0.25s ease;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

.modal-header {
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand) 100%);
  color: #FFFFFF;
  padding: 20px 24px;
  border-bottom: 3px solid var(--gold);
}

.modal-header h3 {
  color: #FFFFFF;
  font-size: 18px;
}

.modal-body {
  padding: 24px;
  max-height: 480px;
  overflow-y: auto;
}

.modal-footer {
  padding: 16px 24px;
  background-color: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Canvas de Firma Digital */
.signature-box {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background-color: #FFFFFF;
  position: relative;
  margin: 12px 0;
}

.signature-box canvas {
  width: 100%;
  height: 180px;
  display: block;
  cursor: crosshair;
}

.signature-tools {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: var(--bg);
  border-top: 1px solid var(--border-2);
}

/* Cuadro Combinado con Búsqueda (Searchable Combobox) */
.sio-combo {
  position: relative;
  width: 100%;
}

.sio-combo-native {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 0 !important;
  height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
}

.sio-combo-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  min-height: 41px;
  cursor: pointer;
  text-align: left;
}

.sio-combo-trigger.is-placeholder .sio-combo-value {
  color: var(--text-3);
}

.sio-combo-trigger.is-invalid {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16);
}

.sio-combo-value {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sio-combo-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  color: var(--text-3);
}

.sio-combo-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  color: var(--text-3);
  transition: background-color 0.15s ease, color 0.15s ease;
}

.sio-combo-clear:hover {
  background-color: var(--danger-light);
  color: var(--danger);
}

.sio-combo-chevron {
  font-size: 11px;
  transition: transform 0.18s ease;
}

.sio-combo.open .sio-combo-chevron {
  transform: rotate(180deg);
}

.sio-combo-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  z-index: 250;
  display: none;
  overflow: hidden;
}

.sio-combo.open .sio-combo-dropdown {
  display: block;
}

.sio-combo-search-wrap {
  position: relative;
  padding: 8px;
  background-color: var(--bg);
  border-bottom: 1px solid var(--border-2);
}

.sio-combo-search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: var(--text-3);
  pointer-events: none;
}

.sio-combo-search {
  width: 100%;
  padding: 8px 12px 8px 30px;
  font-size: 13px;
  font-family: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--surface);
  color: var(--text);
  outline: none;
}

.sio-combo-search:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(39, 91, 136, 0.14);
}

.sio-combo-list {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  max-height: 240px;
  overflow-y: auto;
}

.sio-combo-option {
  padding: 9px 14px;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: background-color 0.12s ease, color 0.12s ease;
}

.sio-combo-option:hover,
.sio-combo-option.is-highlighted {
  background-color: rgba(39, 91, 136, 0.1);
  color: var(--brand);
}

.sio-combo-option.is-selected {
  background-color: rgba(39, 91, 136, 0.14);
  font-weight: 700;
  color: var(--brand-deep);
}

body.dark-mode .sio-combo-option.is-selected {
  color: var(--gold);
}

.sio-combo-empty {
  padding: 14px;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}

/* ============================================================================
   Módulo Control de Perimétrica (CP) - Tarjetas y Controles
   ============================================================================ */
.cp-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--brand-deep);
  display: flex;
  align-items: center;
  gap: 8px;
}

body.dark-mode .cp-section-title {
  color: var(--gold);
}

.cp-time-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.cp-time-row .form-control {
  flex: 1;
}

.cp-clock-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background-color: var(--bg);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.cp-clock-btn:hover {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
}

.cp-registros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-top: 14px;
}

.cp-reg-card {
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cp-reg-topbar {
  height: 6px;
  width: 100%;
}

.cp-reg-topbar.is-pending {
  background-color: #DC2626;
}

.cp-reg-topbar.is-done {
  background-color: #16A34A;
}

.cp-reg-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cp-reg-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.cp-reg-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.cp-reg-num {
  min-width: 52px;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  background-color: var(--bg);
  border: 1px solid var(--border-2);
  text-align: center;
}

.cp-reg-num small {
  display: block;
  font-size: 9px;
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.5px;
}

.cp-reg-num strong {
  display: block;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.cp-reg-num.is-pending strong {
  color: #DC2626;
}

.cp-reg-num.is-done strong {
  color: #16A34A;
}

.cp-reg-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.cp-icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background-color: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.15s ease;
}

.cp-icon-btn.clock {
  color: var(--brand);
}

.cp-icon-btn.clock:hover:not(:disabled) {
  background-color: var(--brand);
  border-color: var(--brand);
  color: #FFFFFF;
}

.cp-icon-btn.clock:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cp-icon-btn.trash {
  color: var(--danger);
}

.cp-icon-btn.trash:hover {
  background-color: var(--danger);
  border-color: var(--danger);
  color: #FFFFFF;
}

.cp-reg-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cp-tag-pill {
  background-color: var(--bg);
  border: 1px solid var(--border-2);
  color: var(--text-2);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cp-reg-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background-color: var(--bg);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

.cp-reg-time-col small {
  display: block;
  font-size: 10px;
  font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase;
}

.cp-reg-time-val {
  margin-top: 4px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cp-badge-pending {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 4px;
  background-color: #FEF2F2;
  border: 1px solid #FECACA;
  color: #B91C1C;
  font-size: 12px;
  font-weight: 700;
}

.cp-reg-motivo {
  background-color: var(--bg);
  border-left: 4px solid var(--brand);
  padding: 8px 12px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12px;
  color: var(--text-2);
  font-style: italic;
}

.cp-aleros-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.cp-alero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background-color: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--brand);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
}

.cp-empty-dashed {
  border: 2px dashed var(--border);
  border-radius: var(--radius-md);
  background-color: var(--bg);
  padding: 22px;
  text-align: center;
  color: var(--text-3);
  font-size: 13px;
  font-weight: 700;
}

/* ============================================================================
   Módulo Control de Equipaje en Revisión AVSEC/SGDAIA (ER) — Cuadrícula Fluida
   y Estándar Transversal de Validación Estricto (--danger #DC2626)
   ============================================================================ */
.er-fluid-grid-wrapper {
  width: 100%;
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background-color: var(--surface);
  box-shadow: var(--shadow-sm);
}

.er-fluid-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 1120px;
}

.er-fluid-table thead th {
  position: sticky;
  top: 0;
  z-index: 15;
  background-color: var(--brand-deep);
  color: #FFFFFF;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 12px 10px;
  border-bottom: 3px solid var(--gold);
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  white-space: nowrap;
}

.er-fluid-table thead th:last-child {
  border-right: none;
}

.er-req-star {
  color: #FCA5A5;
  font-weight: 800;
  margin-left: 2px;
}

.er-fluid-table tbody td {
  padding: 8px 8px;
  border-bottom: 1px solid var(--border-2);
  border-right: 1px solid var(--border-2);
  background-color: var(--surface);
  vertical-align: middle;
  transition: background-color 0.15s ease;
}

.er-fluid-table tbody td:last-child {
  border-right: none;
}

.er-fluid-table tbody tr.er-grid-row:nth-child(even) td {
  background-color: rgba(244, 247, 251, 0.65);
}

body.dark-mode .er-fluid-table tbody tr.er-grid-row:nth-child(even) td {
  background-color: rgba(30, 41, 59, 0.55);
}

.er-fluid-table tbody tr.er-grid-row:hover td {
  background-color: rgba(39, 91, 136, 0.06);
}

.er-cell-input {
  padding: 7px 10px;
  font-size: 12.5px;
  width: 100%;
  min-height: 36px;
}

.er-cell-center {
  text-align: center;
}

.er-cell-readonly {
  background-color: var(--bg) !important;
  font-weight: 700;
  color: var(--brand-deep) !important;
  cursor: default;
}

body.dark-mode .er-cell-readonly {
  color: var(--gold) !important;
}

.er-cell-time-group {
  display: flex;
  align-items: center;
  gap: 5px;
}

.er-cell-time-group .er-cell-input {
  flex: 1;
  min-width: 96px;
}

.er-total-counter-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--brand-deep) 0%, var(--brand) 100%);
  color: #FFFFFF;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  border-bottom: 2px solid var(--gold);
}

.er-total-counter-badge strong {
  background-color: var(--gold);
  color: var(--brand-deep);
  font-size: 13px;
  font-weight: 800;
  padding: 2px 9px;
  border-radius: 999px;
}

.er-persisted-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--success);
  display: inline-block;
  flex-shrink: 0;
}

/* Estados de Alerta Visual Transversal (--danger #DC2626) */
.form-control.is-invalid,
.form-control.sio-field-invalid,
.signature-box.is-invalid,
.signature-box.sio-field-invalid {
  border: 2px solid var(--danger) !important;
  background-color: #FFF5F5 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.18) !important;
}

body.dark-mode .form-control.is-invalid,
body.dark-mode .form-control.sio-field-invalid {
  background-color: rgba(220, 38, 38, 0.14) !important;
}

.sio-cell-invalid {
  background-color: #FEF2F2 !important;
  box-shadow: inset 0 0 0 1px var(--danger);
}

.er-fluid-table tbody tr.sio-row-invalid td,
.er-fluid-table tbody tr.er-row-invalid td {
  background-color: #FEF2F2 !important;
  border-top: 1px solid #FCA5A5;
  border-bottom: 1px solid #FCA5A5;
}

.er-fluid-table tbody tr.sio-row-invalid td:first-child,
.er-fluid-table tbody tr.er-row-invalid td:first-child {
  border-left: 4px solid var(--danger) !important;
}

.sio-grid-invalid {
  border: 2px solid var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.16) !important;
}


