/* ============================================================
   SISTEMA INTEGRAL DE CONTROL DE PRESTAMOS VEHICULARES
   Secretaria de Educacion del Estado de Campeche
   Estilos principales - style.css
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --azul-inst:    #1F3864;
  --azul-med:     #2E75B6;
  --azul-claro:   #4472C4;
  --azul-bg:      #EBF3FB;
  --azul-sidebar: #162B4D;
  --azul-hover:   #1a3668;
  --verde:        #1A7A4A;
  --verde-bg:     #E8F5EE;
  --rojo:         #C00000;
  --rojo-bg:      #FDECEA;
  --naranja:      #C55A11;
  --naranja-bg:   #FEF3EC;
  --gris-text:    #374151;
  --gris-sub:     #6B7280;
  --gris-borde:   #E5E7EB;
  --gris-fondo:   #F3F6FA;
  --blanco:       #FFFFFF;
  --sidebar-w:    260px;
  --header-h:     64px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,0.1);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.12);
  --shadow-lg:    0 8px 24px rgba(0,0,0,0.14);
  --radius:       10px;
  --radius-lg:    14px;
  --transition:   all 0.22s ease;
}

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

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--gris-fondo);
  color: var(--gris-text);
  display: flex;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ── Scrollbar ─────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gris-fondo); }
::-webkit-scrollbar-thumb { background: #B0BEC5; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--azul-med); }

/* ── SIDEBAR ───────────────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: linear-gradient(175deg, var(--azul-sidebar) 0%, #0d1f3c 100%);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: var(--transition);
  box-shadow: 3px 0 15px rgba(0,0,0,0.25);
}

.sidebar-header {
  padding: 20px 18px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.sidebar-logo svg {
  width: 36px; height: 36px;
  flex-shrink: 0;
}

.sidebar-title {
  color: var(--blanco);
  font-weight: 700;
  font-size: 0.78rem;
  line-height: 1.3;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.sidebar-subtitle {
  color: rgba(255,255,255,0.55);
  font-size: 0.68rem;
  font-weight: 400;
  line-height: 1.3;
  margin-top: 2px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.nav-group-label {
  color: rgba(255,255,255,0.38);
  font-size: 0.62rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 10px 18px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 18px;
  color: rgba(255,255,255,0.75);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: var(--transition);
  font-size: 0.83rem;
  font-weight: 500;
  user-select: none;
}

.nav-item:hover {
  color: var(--blanco);
  background: rgba(255,255,255,0.08);
  border-left-color: rgba(255,255,255,0.3);
}

.nav-item.active {
  color: var(--blanco);
  background: rgba(68,114,196,0.35);
  border-left-color: #5B9BD5;
}

.nav-item svg {
  width: 18px; height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.nav-item.active svg { opacity: 1; }

.badge-count {
  margin-left: auto;
  background: var(--rojo);
  color: white;
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.45);
  font-size: 0.68rem;
  text-align: center;
  flex-shrink: 0;
}

/* ── CONTENIDO PRINCIPAL ───────────────────────────────────── */
#main-wrapper {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── HEADER ────────────────────────────────────────────────── */
#topbar {
  position: sticky;
  top: 0;
  height: var(--header-h);
  background: var(--blanco);
  border-bottom: 1px solid var(--gris-borde);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}

#topbar-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--azul-inst);
  flex: 1;
}

.topbar-date {
  font-size: 0.78rem;
  color: var(--gris-sub);
  font-weight: 400;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ── PAGINAS ───────────────────────────────────────────────── */
.page { display: none; padding: 24px; animation: fadeIn 0.25s ease; }
.page.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── CARDS DE DASHBOARD ────────────────────────────────────── */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.card-stat {
  background: var(--blanco);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gris-borde);
  transition: var(--transition);
  cursor: default;
  position: relative;
  overflow: hidden;
}

.card-stat::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  height: 4px;
  width: 100%;
}

.card-stat.azul::before   { background: var(--azul-inst); }
.card-stat.verde::before  { background: var(--verde); }
.card-stat.rojo::before   { background: var(--rojo); }
.card-stat.naranja::before{ background: var(--naranja); }
.card-stat.cyan::before   { background: #0097A7; }
.card-stat.violeta::before{ background: #6A1B9A; }
.card-stat.ambar::before  { background: #E65100; }

.card-stat:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card-stat-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}

.card-stat.azul .card-stat-icon   { background: #E8EEF7; color: var(--azul-inst); }
.card-stat.verde .card-stat-icon  { background: var(--verde-bg); color: var(--verde); }
.card-stat.rojo .card-stat-icon   { background: var(--rojo-bg); color: var(--rojo); }
.card-stat.naranja .card-stat-icon{ background: var(--naranja-bg); color: var(--naranja); }
.card-stat.cyan .card-stat-icon   { background: #E0F7FA; color: #0097A7; }
.card-stat.violeta .card-stat-icon{ background: #F3E5F5; color: #6A1B9A; }
.card-stat.ambar .card-stat-icon  { background: #FFF3E0; color: #E65100; }

.card-stat-icon svg { width: 22px; height: 22px; }

.card-stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--azul-inst);
}

.card-stat.verde .card-stat-value  { color: var(--verde); }
.card-stat.rojo .card-stat-value   { color: var(--rojo); }
.card-stat.naranja .card-stat-value{ color: var(--naranja); }
.card-stat.cyan .card-stat-value   { color: #0097A7; }
.card-stat.violeta .card-stat-value{ color: #6A1B9A; }
.card-stat.ambar .card-stat-value  { color: #E65100; }

.card-stat-label {
  font-size: 0.75rem;
  color: var(--gris-sub);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

/* ── PANELES ───────────────────────────────────────────────── */
.panel {
  background: var(--blanco);
  border-radius: var(--radius-lg);
  border: 1px solid var(--gris-borde);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  margin-bottom: 20px;
}

.panel-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--gris-borde);
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(90deg, #F8FAFD 0%, var(--blanco) 100%);
}

.panel-header h3 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--azul-inst);
  flex: 1;
}

.panel-header svg {
  color: var(--azul-med);
  width: 20px; height: 20px;
}

.panel-body { padding: 16px 20px; }

/* ── BOTONES ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
}

.btn svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary   { background: var(--azul-inst); color: white; }
.btn-primary:hover { background: var(--azul-hover); box-shadow: 0 4px 12px rgba(31,56,100,0.3); }

.btn-success   { background: var(--verde); color: white; }
.btn-success:hover { background: #155E38; box-shadow: 0 4px 12px rgba(26,122,74,0.3); }

.btn-danger    { background: var(--rojo); color: white; }
.btn-danger:hover { background: #9A0000; box-shadow: 0 4px 12px rgba(192,0,0,0.3); }

.btn-warning   { background: var(--naranja); color: white; }
.btn-warning:hover { background: #9E4009; }

.btn-secondary { background: var(--gris-fondo); color: var(--gris-text); border: 1px solid var(--gris-borde); }
.btn-secondary:hover { background: #E9EDF3; }

.btn-outline   { background: transparent; color: var(--azul-inst); border: 1.5px solid var(--azul-inst); }
.btn-outline:hover { background: var(--azul-bg); }

.btn-sm { padding: 5px 11px; font-size: 0.75rem; }
.btn-lg { padding: 12px 24px; font-size: 0.92rem; }
.btn-icon { padding: 7px; border-radius: 8px; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── FORMULARIOS ───────────────────────────────────────────── */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}

.form-grid-2 { grid-template-columns: 1fr 1fr; }
.form-grid-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }

.form-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--azul-inst);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.form-label .req { color: var(--rojo); margin-left: 2px; }

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1.5px solid var(--gris-borde);
  border-radius: 8px;
  font-size: 0.87rem;
  font-family: inherit;
  color: var(--gris-text);
  background: var(--blanco);
  transition: var(--transition);
  outline: none;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--azul-med);
  box-shadow: 0 0 0 3px rgba(46,117,182,0.12);
}

.form-input.error, .form-select.error {
  border-color: var(--rojo);
  box-shadow: 0 0 0 3px rgba(192,0,0,0.1);
}

.form-textarea { resize: vertical; min-height: 72px; }
.form-hint { font-size: 0.72rem; color: var(--gris-sub); }
.form-error { font-size: 0.72rem; color: var(--rojo); font-weight: 500; }

/* ── TABLAS ────────────────────────────────────────────────── */
.table-wrapper {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius);
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

table.data-table thead th {
  background: var(--azul-inst);
  color: white;
  padding: 10px 12px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  position: sticky;
  top: 0;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

table.data-table thead th:hover { background: var(--azul-hover); }
table.data-table thead th.sorted-asc::after  { content: ' ↑'; opacity: 0.7; }
table.data-table thead th.sorted-desc::after { content: ' ↓'; opacity: 0.7; }

table.data-table tbody tr {
  border-bottom: 1px solid #F0F2F5;
  transition: background 0.12s;
}

table.data-table tbody tr:hover { background: var(--azul-bg); }
table.data-table tbody tr:nth-child(even) { background: #FAFBFC; }
table.data-table tbody tr:nth-child(even):hover { background: var(--azul-bg); }

table.data-table td {
  padding: 9px 12px;
  color: var(--gris-text);
  vertical-align: middle;
}

table.data-table td.editable-cell {
  cursor: text;
  position: relative;
}

table.data-table td.editable-cell:hover::after {
  content: '';
  position: absolute;
  inset: 2px;
  border: 1.5px dashed var(--azul-med);
  border-radius: 4px;
  pointer-events: none;
}

table.data-table td.editing input {
  width: 100%;
  border: 1.5px solid var(--azul-med);
  border-radius: 4px;
  padding: 3px 6px;
  font-size: inherit;
  font-family: inherit;
  outline: none;
  background: white;
}

.table-no-data {
  text-align: center;
  padding: 40px 20px;
  color: var(--gris-sub);
  font-size: 0.87rem;
}

/* ── BADGES / ESTADOS ──────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.badge-activo      { background: #E8F5EE; color: var(--verde); }
.badge-vencido     { background: var(--rojo-bg); color: var(--rojo); }
.badge-devuelto    { background: #E8EEF7; color: var(--azul-inst); }
.badge-cancelado   { background: #F3F4F6; color: #6B7280; }
.badge-programado  { background: #FEF3EC; color: var(--naranja); }
.badge-disponible  { background: var(--verde-bg); color: var(--verde); }
.badge-prestado    { background: var(--rojo-bg); color: var(--rojo); }
.badge-mantenimiento { background: #FFF3E0; color: #E65100; border: 1px solid #FFE0B2; }

/* ── BARRA DE BUSQUEDA ─────────────────────────────────────── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input-wrap svg {
  position: absolute;
  left: 11px; top: 50%;
  transform: translateY(-50%);
  color: var(--gris-sub);
  width: 16px; height: 16px;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1.5px solid var(--gris-borde);
  border-radius: 8px;
  font-size: 0.87rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.search-input:focus {
  border-color: var(--azul-med);
  box-shadow: 0 0 0 3px rgba(46,117,182,0.12);
}

/* ── MODALES ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--blanco);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 700px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  transform: scale(0.96) translateY(10px);
  transition: transform 0.22s ease;
  overflow: hidden;
}

.modal-overlay.open .modal { transform: scale(1) translateY(0); }

.modal-lg { max-width: 900px; }
.modal-sm { max-width: 480px; }

.modal-header {
  padding: 16px 22px;
  background: linear-gradient(90deg, var(--azul-inst) 0%, var(--azul-med) 100%);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.modal-header h4 {
  color: white;
  font-size: 1rem;
  font-weight: 700;
  flex: 1;
}

.modal-close {
  background: none;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: var(--transition);
  display: flex;
}

.modal-close:hover { background: rgba(255,255,255,0.15); color: white; }
.modal-close svg { width: 20px; height: 20px; }

.modal-body {
  padding: 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--gris-borde);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  background: #FAFBFC;
}

/* ── DATOS DEL VEHICULO EN PRESTAMO ───────────────────────── */
.vehiculo-card {
  background: linear-gradient(135deg, var(--azul-bg) 0%, #F0F8FF 100%);
  border: 1.5px solid #C5DCEF;
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 18px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.vehiculo-card-item { display: flex; flex-direction: column; gap: 2px; }
.vehiculo-card-item label { font-size: 0.68rem; font-weight: 600; color: var(--azul-med); text-transform: uppercase; }
.vehiculo-card-item span { font-size: 0.9rem; font-weight: 600; color: var(--azul-inst); }

/* ── ALERTAS / TOAST ───────────────────────────────────────── */
#toast-container {
  position: fixed;
  top: 80px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: white;
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 360px;
  pointer-events: all;
  animation: toastIn 0.3s ease;
  border-left: 4px solid;
}

.toast.success { border-left-color: var(--verde); }
.toast.error   { border-left-color: var(--rojo); }
.toast.warning { border-left-color: var(--naranja); }
.toast.info    { border-left-color: var(--azul-med); }

.toast svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.toast.success svg { color: var(--verde); }
.toast.error svg   { color: var(--rojo); }
.toast.warning svg { color: var(--naranja); }
.toast.info svg    { color: var(--azul-med); }

.toast-msg { font-size: 0.83rem; font-weight: 500; line-height: 1.4; flex: 1; }
.toast-close { cursor: pointer; opacity: 0.5; transition: opacity 0.15s; background: none; border: none; padding: 0; }
.toast-close:hover { opacity: 1; }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

.toast.removing {
  animation: toastOut 0.25s ease forwards;
}

@keyframes toastOut {
  to { opacity: 0; transform: translateX(20px); height: 0; padding: 0; margin: 0; }
}

/* ── SECCION TITULO ────────────────────────────────────────── */
.section-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--azul-inst);
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 0.82rem;
  color: var(--gris-sub);
  margin-bottom: 20px;
}

/* ── SEPARADOR ─────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--gris-borde);
  margin: 18px 0;
}

/* ── LOADING ───────────────────────────────────────────────── */
.loading-spinner {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--gris-sub);
  font-size: 0.83rem;
}

.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid var(--gris-borde);
  border-top-color: var(--azul-med);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── FILA DE HERRAMIENTAS ──────────────────────────────────── */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.toolbar-right { margin-left: auto; display: flex; gap: 8px; }

/* ── ALERTA VENCIDOS ───────────────────────────────────────── */
.alert-banner {
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  font-size: 0.87rem;
  font-weight: 500;
}

.alert-banner.danger {
  background: var(--rojo-bg);
  border: 1.5px solid #F5C6CB;
  color: var(--rojo);
}

.alert-banner.warning {
  background: var(--naranja-bg);
  border: 1.5px solid #F5D6C0;
  color: var(--naranja);
}

.alert-banner svg { width: 22px; height: 22px; flex-shrink: 0; }

/* ── DETALLE DE PRESTAMO ───────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  font-size: 0.85rem;
}

.detail-row { display: contents; }

.detail-label {
  padding: 7px 10px;
  background: #F3F6FA;
  font-weight: 600;
  color: var(--azul-inst);
  font-size: 0.78rem;
  border-bottom: 1px solid var(--gris-borde);
}

.detail-value {
  padding: 7px 10px;
  color: var(--gris-text);
  border-bottom: 1px solid var(--gris-borde);
}

/* ── BUSCADOR GLOBAL ───────────────────────────────────────── */
.global-search-box {
  background: var(--blanco);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
  margin-bottom: 20px;
  border: 1px solid var(--gris-borde);
}

.global-search-input {
  width: 100%;
  padding: 14px 18px 14px 48px;
  border: 2px solid var(--azul-med);
  border-radius: 10px;
  font-size: 1.05rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
  color: var(--gris-text);
}

.global-search-input:focus {
  border-color: var(--azul-inst);
  box-shadow: 0 0 0 4px rgba(31,56,100,0.1);
}

.global-search-wrap { position: relative; }
.global-search-wrap svg {
  position: absolute;
  left: 14px; top: 50%;
  transform: translateY(-50%);
  color: var(--azul-med);
  width: 22px; height: 22px;
  pointer-events: none;
}

/* ── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  #sidebar { transform: translateX(-260px); }
  #sidebar.mobile-open { transform: translateX(0); width: 260px; }
  #main-wrapper { margin-left: 0; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 500px) {
  .cards-grid { grid-template-columns: 1fr; }
  .modal { max-width: 100%; }
}

/* ── CONFIRMACION DIALOG ───────────────────────────────────── */
.confirm-dialog {
  text-align: center;
  padding: 10px 0;
}

.confirm-dialog .icon-big {
  width: 56px; height: 56px;
  margin: 0 auto 12px;
  background: var(--rojo-bg);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}

.confirm-dialog .icon-big svg { width: 28px; height: 28px; color: var(--rojo); }
.confirm-dialog h5 { font-size: 1.05rem; font-weight: 700; color: var(--gris-text); margin-bottom: 8px; }
.confirm-dialog p { font-size: 0.87rem; color: var(--gris-sub); line-height: 1.5; }

/* ── PESTANAS ──────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--gris-borde);
  margin-bottom: 18px;
  gap: 2px;
}

.tab-btn {
  padding: 9px 18px;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--gris-sub);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition);
  font-family: inherit;
}

.tab-btn:hover { color: var(--azul-inst); }
.tab-btn.active { color: var(--azul-inst); border-bottom-color: var(--azul-inst); }

.tab-content { display: none; }
.tab-content.active { display: block; animation: fadeIn 0.2s ease; }

/* ── FILTROS DE REPORTE ────────────────────────────────────── */
.filter-panel {
  background: var(--azul-bg);
  border: 1px solid #C5DCEF;
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

/* ── ESTADO DEL SISTEMA ────────────────────────────────────── */
.status-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--gris-sub);
}

.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  animation: pulse 2s ease-in-out infinite;
}

.status-dot.online { background: var(--verde); }
.status-dot.offline { background: var(--rojo); }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ── IMPORTAR EXCEL ────────────────────────────────────────── */
.upload-zone {
  border: 2.5px dashed var(--azul-med);
  border-radius: var(--radius-lg);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: var(--azul-bg);
}

.upload-zone:hover {
  border-color: var(--azul-inst);
  background: #DDE9F5;
}

.upload-zone svg { width: 48px; height: 48px; color: var(--azul-med); margin: 0 auto 12px; display: block; }
.upload-zone h5 { font-size: 0.95rem; font-weight: 700; color: var(--azul-inst); margin-bottom: 4px; }
.upload-zone p { font-size: 0.8rem; color: var(--gris-sub); }
