/* ── Fuentes Google ────────────────────────────── */
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap");

/* ── Variables globales ────────────────────────────── */
:root {
  --color-primary: #000060;
  --color-secondary: #001ba0;
  --color-accent: #00aaff;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-bg: #e8eaf6; /* Neutro municipal */
  --color-surface: #ffffff;
  --color-border: #d1d5db;
  --sidebar-width: 280px;
  --topbar-height: 70px;
}

/* ── Layout base ───────────────────────────────────── */
html,
body {
  height: 100%;
  overflow: hidden;
}
#app {
  height: 100vh;
  font-family: "Poppins", sans-serif;
}

.layout-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  grid-template-rows: var(--topbar-height) 1fr;
  height: 100vh;
  background: var(--color-bg);
}

.sidebar {
  grid-row: 1 / -1;
  grid-column: 1;
  background: linear-gradient(180deg, #000060 0%, #001ba0 100%);
  color: white;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden; /* ← Se quita el scroll de aquí */
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  z-index: 40;
  position: relative;
}

.sidebar nav {
  flex: 1;
  overflow-y: auto; /* ← El scroll se pasa a la navegación */
  padding: 1rem 0;
}

/* Scrollbar personalizado para el sidebar */
.sidebar nav::-webkit-scrollbar {
  width: 4px;
}
.sidebar nav::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
}
.sidebar nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}
.sidebar nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

.sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
  opacity: 0.5;
}

.topbar {
  grid-column: 2;
  grid-row: 1;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 2rem;
  gap: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  position: sticky;
  top: 0;
  z-index: 30;
}

.main-content {
  grid-column: 2;
  grid-row: 2;
  padding: 2rem;
  overflow-y: auto; /* ← único scroll de la app */
  overflow-x: hidden;
  background: transparent;
  height: 100%; /* ← llena la fila disponible */
}

/* ── Responsive ────────────────────────────────────── */
@media (max-width: 1280px) {
  .main-content {
    padding: 1.5rem;
  }
  .metric-card {
    padding: 1rem;
  }
}

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 260px;
  }
  .layout-shell {
    grid-template-columns: 1fr;
    grid-template-rows: var(--topbar-height) 1fr;
  }
  .sidebar {
    position: fixed;
    left: -100%;
    top: 0;
    bottom: 0;
    height: 100vh;
    width: var(--sidebar-width);
    z-index: 50;
    transition: left 0.3s ease;
  }
  .sidebar.open {
    left: 0;
  }
  .sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .sidebar-overlay.show {
    opacity: 1;
    pointer-events: auto;
  }

  .topbar {
    grid-column: 1;
    padding: 0 1rem;
  }
  .main-content {
    grid-column: 1;
    padding: 1rem;
  }
}

@media (max-width: 640px) {
  :root {
    --topbar-height: 60px;
    --sidebar-width: 100%;
  }
  .topbar {
    padding: 0 0.75rem;
    gap: 0.5rem;
  }
  .main-content {
    padding: 0.75rem;
  }
  .card {
    padding: 1rem;
    border-radius: 0.75rem;
  }
  .metric-card {
    padding: 0.875rem;
  }
  .metric-card .icon-circle {
    width: 40px;
    height: 40px;
  }
  .metric-card .text-3xl {
    font-size: 1.5rem;
  }
  .user-info {
    display: none;
  }
  .status-indicator span:last-child {
    display: none;
  }
  .table-wrapper {
    margin: 0 -1rem;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .srrh-table {
    font-size: 0.75rem;
  }
  .srrh-table th,
  .srrh-table td {
    padding: 0.5rem 0.75rem;
  }
  .btn {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
  }
  .btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
  }
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 45;
}
@media (max-width: 1024px) {
  .sidebar-overlay.show {
    display: block;
  }
  .sidebar-close {
    display: flex !important;
  }
}

.sidebar-close {
  display: none;
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  z-index: 50;
  transition: all 0.2s ease;
}

.sidebar-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.05);
}

.sidebar-close:active {
  transform: scale(0.95);
}


/* Fix definitivo para backdrop de modales (v2.8.6)
   El div.global-modal-backdrop es hijo directo de .layout-shell
   (que ocupa 100vw x 100vh). Su position:absolute lo posiciona
   sobre TODO el layout, incluyendo el sidebar. Sin restricciones
   de stacking context. Los eventos Vue siguen intactos en .modal-overlay-premium. */
/* Se elimina el hack de body.modal-open ya que los modales 
   fixed escaparán naturalmente del main-content ahora que
   .layout-shell no tiene overflow restrictivos ni animaciones
   con transform en vuelo. */

.fade-enter-active,
.fade-leave-active {
  transition: opacity 0.2s ease;
}
.fade-enter-from,
.fade-leave-to {
  opacity: 0;
}

/* ── Estilos mejorados ─────────────────────────────── */
.card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.1),
    0 1px 2px -1px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
}
.card:hover {
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  transform: translateY(-1px);
}

.metric-card {
  background: white;
  border-radius: 1rem;
  padding: 1.25rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.metric-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
}

.icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.icon-circle-blue {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
  color: #2563eb;
}
.icon-circle-amber {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  color: #d97706;
}
.icon-circle-green {
  background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
  color: #059669;
}
.icon-circle-red {
  background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
  color: #dc2626;
}
.icon-circle-purple {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  color: #7c3aed;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}
.badge-pendiente {
  background: #fef3c7;
  color: #92400e;
}
.badge-en_revision {
  background: #dbeafe;
  color: #1e40af;
}
.badge-aprobado {
  background: #d1fae5;
  color: #065f46;
}
.badge-rechazado {
  background: #fee2e2;
  color: #991b1b;
}
.badge-correccion {
  background: #fce7f3;
  color: #9d174d;
}
.badge-borrador {
  background: #f1f5f9;
  color: #475569;
}
.badge-success {
  background: #d1fae5;
  color: #065f46;
}
.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}
.badge-primary {
  background: #dbeafe;
  color: #1e40af;
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  background: white;
  transition: all 0.15s ease;
  outline: none;
}
.form-input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #374151;
  margin-bottom: 0.5rem;
}
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  background: white;
  transition: all 0.15s ease;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
}
.form-select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Fix for clipped text in fixed-height inputs */
.form-input.h-10,
.form-select.h-10 {
  padding-top: 0.4rem;
  padding-bottom: 0.4rem;
}

.form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  background: white;
  transition: all 0.15s ease;
  outline: none;
  resize: vertical;
  min-height: 80px;
}
.form-textarea:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.form-checkbox {
  width: 1.125rem;
  height: 1.125rem;
  border: 1px solid #d1d5db;
  border-radius: 0.25rem;
  cursor: pointer;
  accent-color: #001ba0;
}
.form-secondary {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
}
.form-secondary:hover {
  box-shadow: 0 4px 12px rgba(75, 85, 99, 0.3);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s ease;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: scale(0.98);
}
.btn-primary {
  background: linear-gradient(135deg, #001ba0 0%, #000060 100%);
  color: white;
}
.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(0, 27, 160, 0.3);
}
.btn-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
}
.btn-success:hover {
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}
.btn-warning {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
}
.btn-outline {
  background: white;
  border: 1px solid #d1d5db;
  color: #374151;
}
.btn-outline:hover {
  background: #f9fafb;
  border-color: #9ca3af;
}
.btn-secondary {
  background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
  color: white;
}
.btn-secondary:hover {
  box-shadow: 0 4px 12px rgba(75, 85, 99, 0.3);
}
.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8rem;
}

.table-wrapper {
  overflow-x: auto;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: white;
}
table.srrh-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.srrh-table thead th {
  background: #f9fafb;
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  color: #6b7280;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid #e5e7eb;
}
.srrh-table tbody tr {
  transition: background 0.15s;
}
.srrh-table tbody tr:hover {
  background: #f9fafb;
}
.srrh-table tbody td {
  padding: 1rem;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.75rem 1rem;
  border-radius: 0.625rem;
  color: rgba(255, 255, 255, 0.7);
  transition: all 0.2s ease;
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
}
.nav-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}
.nav-link-active {
  background: linear-gradient(
    135deg,
    rgba(0, 170, 255, 0.3) 0%,
    rgba(0, 27, 160, 0.3) 100%
  );
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}
.nav-link-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 24px;
  background: #00aaff;
  border-radius: 0 4px 4px 0;
}
.nav-link i {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}
.badge-count {
  margin-left: auto;
  background: #ef4444;
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  min-width: 20px;
  text-align: center;
}

.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.toast {
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: white;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  animation: slideIn 0.3s ease;
  min-width: 280px;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.toast-success {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}
.toast-error {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}
.toast-info {
  background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}
@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  border-radius: 0.625rem;
  transition: background 0.15s;
}
.user-menu:hover {
  background: #f3f4f6;
}
.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, #001ba0 0%, #00aaff 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(0, 27, 160, 0.3);
}
.user-info {
  display: flex;
  flex-direction: column;
}
.user-name {
  font-weight: 600;
  color: #111827;
  font-size: 0.875rem;
}
.user-role {
  font-size: 0.75rem;
  color: #6b7280;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}
.status-online {
  background: #d1fae5;
  color: #065f46;
}
.status-offline {
  background: #fee2e2;
  color: #991b1b;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.status-dot-online {
  background: #10b981;
  animation: pulseSoft 2s infinite;
}
.status-dot-offline {
  background: #ef4444;
}

.section-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: #111827;
  margin-bottom: 1rem;
}
.section-subtitle {
  font-size: 0.875rem;
  color: #6b7280;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
}

.sidebar-logo {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}
.sidebar-logo img {
  height: 48px;
  width: auto;
  object-fit: contain;
  filter: brightness(1.1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}
.sidebar-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.menu-section-title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.4);
  padding: 1rem 1rem 0.5rem;
  margin-top: 0.5rem;
}

/* ── MODALES Y OVERLAYS PREMIUM (v3.0.1) ───────────────── */
.modal-overlay-premium {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(12px) saturate(180%);
  -webkit-backdrop-filter: blur(12px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 1rem;
}

.modal-card-premium {
  background: white;
  border-radius: 2rem;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow:
    0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04),
    0 0 0 1px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.5);
  overflow: hidden;
  animation: modalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-header-premium {
  padding: 1.5rem 2rem;
  background: linear-gradient(to right, #f8fafc, #ffffff);
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-body-premium {
  padding: 2rem;
  overflow-y: auto;
  flex: 1;
}

.modal-footer-premium {
  padding: 1.25rem 2rem;
  background: #f8fafc;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
}

@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-enter-active,
.modal-leave-active {
  transition: opacity 0.3s ease;
}
.modal-enter-from,
.modal-leave-to {
  opacity: 0;
}

/* ── STEPPER (v3.1.0) ────────────────────────────────── */
.stepper-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 3rem;
  position: relative;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.stepper-container::before {
  content: "";
  position: absolute;
  top: 18px;
  left: 0;
  right: 0;
  height: 2px;
  background: #e2e8f0;
  z-index: 1;
}

.step-item {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
}

.step-indicator {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: white;
  border: 2px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.875rem;
  color: #64748b;
  transition: all 0.3s ease;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.step-item.active .step-indicator {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: white;
  transform: scale(1.1);
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.step-item.completed .step-indicator {
  background: var(--color-success);
  border-color: var(--color-success);
  color: white;
}

.step-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
  transition: all 0.3s ease;
}

.step-item.active .step-label {
  color: var(--color-primary);
}

.step-item.completed .step-label {
  color: var(--color-success);
}

/* Transición de pasos */
.fade-slide-enter-active,
.fade-slide-leave-active {
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-slide-enter-from {
  opacity: 0;
  transform: translateX(20px);
}

.fade-slide-leave-to {
  opacity: 0;
  transform: translateX(-20px);
}

.form-group-premium {
  background: white;
  border-radius: 1.5rem;
  padding: 2rem;
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05);
}

/* ── CAMPOS DE FORMULARIO AVANZADOS ───────────────────────── */
.form-input[readonly] {
  background-color: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
  border-color: #e2e8f0;
}
.form-input:disabled {
  background-color: #f8fafc;
  opacity: 0.6;
  cursor: not-allowed;
}
.form-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
  transform: translateY(-1px);
  transition: all 0.2s ease;
}

/* ── TABLAS Y DATAGRIDS ───────────────────────────────────── */
.status-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 100px;
}
.srrh-table tbody tr {
  transition:
    background-color 0.15s ease,
    transform 0.1s ease;
}
.srrh-table tbody tr:hover {
  background-color: #f8fafc;
  box-shadow: inset 4px 0 0 var(--color-accent);
}

/* ── BADGES DE ESTADO ─────────────────────────────────────── */
.badge {
  font-family: "Inter", sans-serif;
  text-transform: uppercase;
  font-size: 0.65rem !important;
  padding: 0.25rem 0.6rem !important;
  border: 1px solid transparent;
}
.badge-pendiente {
  background: #fef3c7;
  color: #92400e;
  border-color: #fde68a;
}
.badge-en_revision {
  background: #dbeafe;
  color: #1e40af;
  border-color: #bfdbfe;
}
.badge-aprobado {
  background: #dcfce7;
  color: #166534;
  border-color: #bbf7d0;
}
.badge-rechazado {
  background: #fee2e2;
  color: #991b1b;
  border-color: #fecaca;
}
.badge-correccion {
  background: #fce7f3;
  color: #9d174d;
  border-color: #fbcfe8;
}
.badge-borrador {
  background: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

/* ── BOTONES Y ESTADOS DE CARGA ───────────────────────────── */
.btn-loading {
  pointer-events: none;
  opacity: 0.7;
  position: relative;
  color: transparent !important;
}
.btn-loading::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  top: calc(50% - 8px);
  left: calc(50% - 8px);
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ── SCROLLBAR CUSTOM ────────────────────────────────────── */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* ── PAGINACIÓN ──────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 1rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
  border-radius: 0 0 0.75rem 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.pagination.pagination-top {
  border-top: none;
  border-bottom: 1px solid #e5e7eb;
  border-radius: 0.75rem 0.75rem 0 0;
}
.pagination-info {
  font-size: 0.8rem;
  color: #6b7280;
}
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.page-btn {
  min-width: 32px;
  height: 32px;
  padding: 0 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e5e7eb;
  background: white;
  color: #374151;
  border-radius: 0.375rem;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
}
.page-btn:hover:not(:disabled) {
  background: #f3f4f6;
  border-color: #9ca3af;
}
.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.page-btn.active {
  background: #001ba0;
  color: white;
  border-color: #001ba0;
}

/* ── SEARCH BAR ─────────────────────────────────────────── */
.search-bar-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}
.search-bar-wrapper i,
.search-bar-wrapper svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: #9ca3af;
}
.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 0.625rem;
  font-size: 0.875rem;
  background: white;
  outline: none;
  transition: all 0.15s;
}
.search-input:focus {
  border-color: #001ba0;
  box-shadow: 0 0 0 3px rgba(0, 27, 160, 0.08);
}

/* ── UTILIDADES DE ANIMACIÓN ─────────────────────────────── */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
.animate-fade-in {
  animation: fadeIn 0.4s ease forwards;
}

/* ── Buzón Premium (v2.1.0) ────────────────────────── */
.stat-mini {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1.25rem;
  border-radius: 12px;
  border: 1px solid transparent;
  min-width: 120px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s;
}
.stat-mini:hover {
  transform: translateY(-2px);
}
.stat-mini .label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.8;
  margin-bottom: 2px;
}
.stat-mini .value {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1;
}

.bg-glass {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.buzon-grid-header {
  background: linear-gradient(90deg, #f8fafc 0%, #ffffff 100%);
  border-bottom: 2px solid #e2e8f0;
}

.filter-pattern {
  background-image: radial-gradient(#cbd5e1 0.5px, transparent 0.5px);
  background-size: 12px 12px;
  background-position: 0 0;
}

/* Fix para desbordamiento de modal */
.modal-content-safe {
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
  padding-right: 8px;
}

.modal-content-safe::-webkit-scrollbar {
  width: 6px;
}
.modal-content-safe::-webkit-scrollbar-thumb {
  background-color: #cbd5e1;
  border-radius: 10px;
}

input[type="date"].form-input::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
  filter: invert(0.5);
}

/* ── CARGA GLOBAL (GLASSMORPHISM) ────────────────────────── */
.global-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 96, 0.4);
  backdrop-filter: blur(8px) saturate(180%);
  -webkit-backdrop-filter: blur(8px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  animation: fadeInModal 0.3s ease-out;
}

.loading-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  padding: 3rem;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  max-width: 320px;
  width: 90%;
  text-align: center;
}

.loading-spinner-premium {
  width: 64px;
  height: 64px;
  position: relative;
}

.loading-spinner-premium::before,
.loading-spinner-premium::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 4px solid transparent;
}

.loading-spinner-premium::before {
  border-top-color: #001ba0;
  animation: spinPremium 1s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

.loading-spinner-premium::after {
  border-bottom-color: #00aaff;
  animation: spinPremium 1.5s cubic-bezier(0.5, 0, 0.5, 1) infinite reverse;
  opacity: 0.5;
}

@keyframes spinPremium {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@keyframes fadeInModal {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.loading-text {
  font-weight: 600;
  color: #000060;
  letter-spacing: -0.01em;
  animation: pulseOpacity 2s ease-in-out infinite;
}

@keyframes pulseOpacity {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.6;
  }
}

/* --- ASISTENTE AI (CHATBOT) v3.2.0 --- */
.slide-up-enter-active,
.slide-up-leave-active {
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
.slide-up-enter,
.slide-up-leave-to {
  transform: translateY(20px);
  opacity: 0;
}

@media (max-width: 640px) {
  .chatbot-container {
    bottom: 1rem !important;
    right: 1rem !important;
  }
  .chatbot-window {
    width: calc(100vw - 2rem) !important;
    height: 60vh !important;
  }
}

/* Glassmorphism for Chat */
.chat-glass {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

