/* ============================================================
   UFE-VIRTUAL Registro — Sistema de Solicitudes
   Politécnico Ulises Francisco Espaillat
   Design: Institucional + moderno, paleta azul-dorado
   ============================================================ */

:root {
  --pufe-blue:      #0d2d6e;
  --pufe-blue-mid:  #1a4799;
  --pufe-blue-lt:   #2563c7;
  --pufe-gold:      #c9920a;
  --pufe-gold-lt:   #f0b429;
  --pufe-bg:        #f0f4fb;
  --pufe-surface:   #ffffff;
  --pufe-border:    #dbe4f3;
  --pufe-text:      #1a2540;
  --pufe-muted:     #5f708a;
  --sidebar-w:      260px;
  --topbar-h:       64px;
  --radius:         12px;
  --shadow-sm:      0 1px 3px rgba(13,45,110,0.08);
  --shadow-md:      0 4px 16px rgba(13,45,110,0.12);
  --shadow-lg:      0 8px 32px rgba(13,45,110,0.16);

  /* Estado badges */
  --c-ingresada:  #3b82f6;
  --c-proceso:    #f59e0b;
  --c-digitada:   #8b5cf6;
  --c-validada:   #06b6d4;
  --c-concluida:  #10b981;
  --c-entregada:  #22c55e;
}

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

body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--pufe-bg);
  color: var(--pufe-text);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
  min-height: 100vh;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.app-wrapper {
  display: flex;
  min-height: 100vh;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar {
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--pufe-blue);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  z-index: 1000;
  transition: transform .3s ease, width .3s ease;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) rgba(255, 255, 255, 0.02);
}

/* Scrollbar moderno para el sidebar izquierdo */
.sidebar::-webkit-scrollbar {
  width: 5px;
}
.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.02);
}
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 10px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

.sidebar-collapsed { transform: translateX(calc(-1 * var(--sidebar-w))); }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.brand-logo {
  width: 42px; height: 42px;
  background: var(--pufe-gold);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: white;
  flex-shrink: 0;
}

.brand-name {
  font-family: 'Outfit', sans-serif;
  font-size: 18px; font-weight: 800;
  color: white; display: block; letter-spacing: .5px;
}

.brand-sub {
  font-size: 10px; color: rgba(255,255,255,0.55);
  display: block; letter-spacing: .3px;
}

.sidebar-user {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.user-avatar {
  width: 36px; height: 36px;
  background: var(--pufe-gold);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; font-size: 14px;
  flex-shrink: 0;
}

.user-name {
  display: block; color: white;
  font-size: 13px; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.user-role {
  display: block; color: rgba(255,255,255,0.5);
  font-size: 11px;
}

.sidebar-nav {
  list-style: none; margin: 0; padding: 12px 0; flex: 1;
}

.nav-section {
  font-size: 10px; font-weight: 600;
  color: rgba(255,255,255,0.35);
  letter-spacing: 1.2px; text-transform: uppercase;
  padding: 16px 20px 6px;
}

.sidebar-nav .nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  border-radius: 0;
  transition: all .2s;
  font-size: 13.5px;
  position: relative;
}

.sidebar-nav .nav-link i { font-size: 16px; flex-shrink: 0; }

.sidebar-nav .nav-link:hover {
  color: white;
  background: rgba(255,255,255,0.08);
}

.sidebar-nav .nav-link.active {
  color: white;
  background: rgba(201,146,10,0.2);
  border-left: 3px solid var(--pufe-gold);
}

.nav-badge {
  margin-left: auto;
  background: var(--pufe-gold);
  color: white; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 20px;
  min-width: 20px; text-align: center;
}

.sidebar-footer {
  padding: 12px 20px 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

.logout-btn {
  display: flex; align-items: center; gap: 10px;
  color: rgba(255,255,255,0.55);
  text-decoration: none; font-size: 13px;
  padding: 8px 0;
  transition: color .2s;
}
.logout-btn:hover { color: #ff6b6b; }

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
  display: flex; flex-direction: column;
  transition: margin-left .3s ease;
}

.main-content.expanded { margin-left: 0; }

/* TOPBAR */
.topbar {
  height: var(--topbar-h);
  background: var(--pufe-surface);
  border-bottom: 1px solid var(--pufe-border);
  display: flex; align-items: center;
  padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 500;
  box-shadow: var(--shadow-sm);
}

.sidebar-toggle {
  background: none; border: none;
  font-size: 22px; color: var(--pufe-muted);
  cursor: pointer; padding: 4px;
  transition: color .2s;
}
.sidebar-toggle:hover { color: var(--pufe-blue); }

.topbar-title {
  font-weight: 600; font-size: 16px;
  color: var(--pufe-text); flex: 1;
}

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

.topbar-user-btn {
  display: flex; align-items: center; gap: 8px;
  background: none; border: none;
  cursor: pointer; color: var(--pufe-text); font-size: 14px;
  padding: 4px 8px; border-radius: 8px;
  transition: background .2s;
}
.topbar-user-btn:hover { background: var(--pufe-bg); }

.topbar-avatar {
  width: 32px; height: 32px;
  background: var(--pufe-blue);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: white; font-size: 13px;
}

/* PAGE CONTENT */
.page-content {
  padding: 28px 28px;
  flex: 1;
}

/* ============================================================
   CARDS
   ============================================================ */
.card-pufe {
  background: var(--pufe-surface);
  border: 1px solid var(--pufe-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.card-pufe .card-header {
  background: white;
  border-bottom: 1px solid var(--pufe-border);
  padding: 16px 20px;
  display: flex; align-items: center; justify-content: space-between;
  font-weight: 600; font-size: 15px;
  color: var(--pufe-text);
}

.card-pufe .card-body { padding: 20px; }

/* STAT CARDS */
.stat-card {
  background: var(--pufe-surface);
  border: 1px solid var(--pufe-border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  transition: box-shadow .2s, transform .2s;
  text-decoration: none;
  color: var(--pufe-text);
  box-shadow: var(--shadow-sm);
}
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: var(--pufe-text);
}

.stat-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}

.stat-body { flex: 1; min-width: 0; }
.stat-number {
  font-size: 28px; font-weight: 700;
  font-family: 'Outfit', sans-serif;
  line-height: 1;
}
.stat-label {
  font-size: 12px; color: var(--pufe-muted);
  font-weight: 500; margin-top: 4px;
}

/* Color variants for stat cards */
.stat-ingresada .stat-icon { background: #eff6ff; color: var(--c-ingresada); }
.stat-proceso   .stat-icon { background: #fffbeb; color: var(--c-proceso); }
.stat-digitada  .stat-icon { background: #f5f3ff; color: var(--c-digitada); }
.stat-validada  .stat-icon { background: #ecfeff; color: var(--c-validada); }
.stat-concluida .stat-icon { background: #ecfdf5; color: var(--c-concluida); }
.stat-entregada .stat-icon { background: #f0fdf4; color: var(--c-entregada); }

/* Bordes izquierdos personalizados para tarjetas de estado */
.border-ingresada { border-left-color: var(--c-ingresada) !important; }
.border-proceso   { border-left-color: var(--c-proceso) !important; }
.border-digitada  { border-left-color: var(--c-digitada) !important; }
.border-validada  { border-left-color: var(--c-validada) !important; }
.border-concluida { border-left-color: var(--c-concluida) !important; }
.border-entregada { border-left-color: var(--c-entregada) !important; }

/* Interactividad y animación suave para tarjetas KPI del Dashboard */
.card-kpi-link {
  text-decoration: none;
  color: inherit;
  display: block;
  height: 100%;
}
.card-kpi-link .card-pufe {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.card-kpi-link:hover .card-pufe {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* ============================================================
   CARDS KPI CON EFECTO BURBUJA 3D (GLOSSY GEL BUBBLE)
   ============================================================ */
.card-kpi-bubble {
  position: relative;
  overflow: hidden;
  border-radius: 20px !important;
  border: 1px solid rgba(255, 255, 255, 0.45) !important;
  backdrop-filter: blur(10px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, background 0.3s ease !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-decoration: none;
}

/* Brillo superior en forma de elipse reflectiva (Efecto Burbuja de Gel) */
.card-kpi-bubble::before {
  content: '';
  position: absolute;
  top: 0;
  left: 4%;
  width: 92%;
  height: 38%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.05) 50%, rgba(255, 255, 255, 0) 100%);
  border-radius: 50% / 100% 100% 0% 0%;
  pointer-events: none;
  z-index: 2;
}

/* Sombreado y brillo de fondo radial en la parte inferior para profundidad 3D */
.card-kpi-bubble::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle at 50% 130%, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0) 65%);
  pointer-events: none;
  z-index: 1;
}

/* Elementos internos */
.card-kpi-bubble .card-body {
  position: relative;
  z-index: 3;
  width: 100%;
}

.card-kpi-bubble .card-kpi-icon {
  font-size: 28px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff !important;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
  margin-bottom: 6px;
  transition: transform 0.3s ease;
}

.card-kpi-bubble .card-kpi-number {
  font-family: 'Outfit', sans-serif;
  font-size: 24px;
  font-weight: 800;
  color: #ffffff !important;
  line-height: 1.1;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.card-kpi-bubble .card-kpi-label {
  font-size: 12.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9) !important;
  line-height: 1.1;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

/* Comportamiento al pasar el ratón (Hover) */
.card-kpi-link:hover .card-kpi-bubble {
  transform: translateY(-8px) scale(1.03) !important;
}
.card-kpi-link:hover .card-kpi-bubble .card-kpi-icon {
  transform: scale(1.15) translateY(-2px);
}

/* Colores 3D Jelly/Bubble específicos para cada estado */

/* 1. Ingresada (Azul) */
.card-kpi-ingresada {
  background: radial-gradient(circle at 50% 0%, #60a5fa 0%, #2563eb 60%, #1d4ed8 100%) !important;
  box-shadow: 
    inset 0 4px 6px rgba(255, 255, 255, 0.65), 
    inset 0 -5px 8px rgba(0, 0, 0, 0.35),
    0 8px 20px rgba(37, 99, 235, 0.25) !important;
}
.card-kpi-link:hover .card-kpi-ingresada {
  box-shadow: 
    inset 0 6px 10px rgba(255, 255, 255, 0.75), 
    inset 0 -6px 10px rgba(0, 0, 0, 0.4),
    0 15px 30px rgba(37, 99, 235, 0.45) !important;
}

/* 2. En Proceso (Naranja) */
.card-kpi-en_proceso {
  background: radial-gradient(circle at 50% 0%, #fbbf24 0%, #d97706 60%, #b45309 100%) !important;
  box-shadow: 
    inset 0 4px 6px rgba(255, 255, 255, 0.65), 
    inset 0 -5px 8px rgba(0, 0, 0, 0.35),
    0 8px 20px rgba(217, 119, 6, 0.25) !important;
}
.card-kpi-link:hover .card-kpi-en_proceso {
  box-shadow: 
    inset 0 6px 10px rgba(255, 255, 255, 0.75), 
    inset 0 -6px 10px rgba(0, 0, 0, 0.4),
    0 15px 30px rgba(217, 119, 6, 0.45) !important;
}

/* 3. Digitada (Morado) */
.card-kpi-digitada {
  background: radial-gradient(circle at 50% 0%, #c084fc 0%, #8b5cf6 60%, #6d28d9 100%) !important;
  box-shadow: 
    inset 0 4px 6px rgba(255, 255, 255, 0.65), 
    inset 0 -5px 8px rgba(0, 0, 0, 0.35),
    0 8px 20px rgba(139, 92, 246, 0.25) !important;
}
.card-kpi-link:hover .card-kpi-digitada {
  box-shadow: 
    inset 0 6px 10px rgba(255, 255, 255, 0.75), 
    inset 0 -6px 10px rgba(0, 0, 0, 0.4),
    0 15px 30px rgba(139, 92, 246, 0.45) !important;
}

/* 4. Validada (Cian) */
.card-kpi-validada {
  background: radial-gradient(circle at 50% 0%, #22d3ee 0%, #0891b2 60%, #0e7490 100%) !important;
  box-shadow: 
    inset 0 4px 6px rgba(255, 255, 255, 0.65), 
    inset 0 -5px 8px rgba(0, 0, 0, 0.35),
    0 8px 20px rgba(8, 145, 178, 0.25) !important;
}
.card-kpi-link:hover .card-kpi-validada {
  box-shadow: 
    inset 0 6px 10px rgba(255, 255, 255, 0.75), 
    inset 0 -6px 10px rgba(0, 0, 0, 0.4),
    0 15px 30px rgba(8, 145, 178, 0.45) !important;
}

/* 5. Concluida (Verde Esmeralda) */
.card-kpi-concluida {
  background: radial-gradient(circle at 50% 0%, #34d399 0%, #059669 60%, #047857 100%) !important;
  box-shadow: 
    inset 0 4px 6px rgba(255, 255, 255, 0.65), 
    inset 0 -5px 8px rgba(0, 0, 0, 0.35),
    0 8px 20px rgba(5, 150, 105, 0.25) !important;
}
.card-kpi-link:hover .card-kpi-concluida {
  box-shadow: 
    inset 0 6px 10px rgba(255, 255, 255, 0.75), 
    inset 0 -6px 10px rgba(0, 0, 0, 0.4),
    0 15px 30px rgba(5, 150, 105, 0.45) !important;
}

/* 6. Entregada (Verde) */
.card-kpi-entregada {
  background: radial-gradient(circle at 50% 0%, #4ade80 0%, #16a34a 60%, #15803d 100%) !important;
  box-shadow: 
    inset 0 4px 6px rgba(255, 255, 255, 0.65), 
    inset 0 -5px 8px rgba(0, 0, 0, 0.35),
    0 8px 20px rgba(22, 163, 74, 0.25) !important;
}
.card-kpi-link:hover .card-kpi-entregada {
  box-shadow: 
    inset 0 6px 10px rgba(255, 255, 255, 0.75), 
    inset 0 -6px 10px rgba(0, 0, 0, 0.4),
    0 15px 30px rgba(22, 163, 74, 0.45) !important;
}

/* Avatar compacto para tablas */
.table-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  font-size: 12.5px;
  flex-shrink: 0;
  user-select: none;
}
.table-avatar.avatar-user { background-color: var(--pufe-blue-mid); }
.table-avatar.avatar-client { background-color: var(--pufe-gold); }

/* ============================================================
   BADGES DE ESTADO
   ============================================================ */
.badge-estado {
  padding: 4px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600;
  letter-spacing: .3px; white-space: nowrap;
}

.badge-ingresada { background: #dbeafe; color: #1d4ed8; }
.badge-proceso   { background: #fef3c7; color: #92400e; }
.badge-digitada  { background: #ede9fe; color: #5b21b6; }
.badge-validada  { background: #cffafe; color: #0e7490; }
.badge-concluida { background: #d1fae5; color: #065f46; }
.badge-entregada { background: #dcfce7; color: #14532d; }

/* ============================================================
   TABLA
   ============================================================ */
.table-pufe {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
}

.table-pufe thead th {
  background: var(--pufe-bg);
  color: var(--pufe-muted);
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .8px;
  padding: 12px 16px;
  border-bottom: 2px solid var(--pufe-border);
  white-space: nowrap;
}

.table-pufe tbody tr {
  transition: background .15s;
}

.table-pufe tbody tr:hover {
  background: #f5f8ff;
}

.table-pufe td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--pufe-border);
  vertical-align: middle;
}

/* ============================================================
   TIMELINE
   ============================================================ */
.timeline {
  position: relative;
  padding: 0;
  list-style: none;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 20px; top: 0; bottom: 0;
  width: 2px;
  background: var(--pufe-border);
}

.timeline-item {
  position: relative;
  padding: 0 0 24px 56px;
}

.timeline-dot {
  position: absolute;
  left: 10px;
  width: 22px; height: 22px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
  z-index: 1;
  border: 3px solid white;
  box-shadow: 0 0 0 2px var(--pufe-border);
}

.timeline-dot.done { background: var(--c-concluida); box-shadow: 0 0 0 2px #d1fae5; }
.timeline-dot.active { background: var(--c-proceso); box-shadow: 0 0 0 2px #fef3c7; animation: pulse-dot 2s infinite; }
.timeline-dot.pending { background: var(--pufe-border); }

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 2px #fef3c7; }
  50% { box-shadow: 0 0 0 5px rgba(245,158,11,0.2); }
}

.timeline-content {
  background: white;
  border: 1px solid var(--pufe-border);
  border-radius: 10px;
  padding: 14px 16px;
}

.timeline-title {
  font-weight: 600; font-size: 14px; margin-bottom: 4px;
}

.timeline-date {
  font-size: 12px; color: var(--pufe-muted);
}

/* ============================================================
   BOTONES
   ============================================================ */
.btn-pufe {
  background: var(--pufe-blue);
  color: white; border: none;
  font-weight: 500;
  border-radius: 8px;
  transition: background .2s, box-shadow .2s;
}
.btn-pufe:hover {
  background: var(--pufe-blue-mid);
  color: white;
  box-shadow: 0 4px 12px rgba(13,45,110,0.25);
}

.btn-gold {
  background: var(--pufe-gold);
  color: white; border: none;
  font-weight: 500; border-radius: 8px;
}
.btn-gold:hover { background: var(--pufe-gold-lt); color: white; }

/* ============================================================
   FORMULARIOS
   ============================================================ */
.form-control, .form-select {
  border: 1.5px solid var(--pufe-border);
  border-radius: 8px;
  font-size: 14px;
  padding: 9px 14px;
  transition: border-color .2s, box-shadow .2s;
}
.form-control:focus, .form-select:focus {
  border-color: var(--pufe-blue-lt);
  box-shadow: 0 0 0 3px rgba(37,99,199,0.12);
}

.form-label {
  font-size: 13px; font-weight: 500;
  color: var(--pufe-text); margin-bottom: 5px;
}

/* ============================================================
   CONSULTA PÚBLICA (sin login)
   ============================================================ */
.consulta-hero {
  background: linear-gradient(135deg, var(--pufe-blue) 0%, var(--pufe-blue-lt) 100%);
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  padding: 40px 20px;
}

.consulta-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  max-width: 760px; width: 100%;
  box-shadow: 0 20px 60px rgba(13,45,110,0.25);
}

/* LOGIN */
.login-page {
  min-height: 100vh;
  background: linear-gradient(135deg, var(--pufe-blue) 0%, var(--pufe-blue-lt) 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.login-card {
  background: white;
  border-radius: 20px;
  padding: 44px 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 64px rgba(13,45,110,0.3);
}

.login-logo {
  text-align: center; margin-bottom: 28px;
}

.login-logo-icon {
  width: 64px; height: 64px;
  background: var(--pufe-blue);
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 30px; color: white;
  margin-bottom: 14px;
}

.login-title {
  font-family: 'Outfit', sans-serif;
  font-size: 22px; font-weight: 800;
  color: var(--pufe-blue); margin: 0;
}

.login-sub {
  font-size: 13px; color: var(--pufe-muted);
  margin-top: 4px;
}

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  margin-bottom: 24px;
}

.page-header h1 {
  font-family: 'Outfit', sans-serif;
  font-size: 24px; font-weight: 800;
  color: var(--pufe-text); margin: 0;
}

.page-header p {
  color: var(--pufe-muted); margin: 4px 0 0; font-size: 14px;
}

/* ============================================================
   UTILITIES
   ============================================================ */
.text-pufe { color: var(--pufe-blue); }
.text-gold  { color: var(--pufe-gold); }

.divider-pufe {
  border: none; height: 1px;
  background: var(--pufe-border); margin: 20px 0;
}

.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--pufe-muted);
}
.empty-state i { font-size: 48px; opacity: .3; display: block; margin-bottom: 12px; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert { border-radius: 10px; border: none; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination .page-link {
  border-radius: 8px !important;
  border: 1px solid var(--pufe-border);
  color: var(--pufe-blue); margin: 0 2px;
}
.pagination .page-item.active .page-link {
  background: var(--pufe-blue); border-color: var(--pufe-blue);
}

/* ============================================================
   MODALES
   ============================================================ */
.modal-content { border-radius: 16px; border: none; }
.modal-header {
  border-bottom: 1px solid var(--pufe-border);
  background: var(--pufe-blue);
  color: white; border-radius: 16px 16px 0 0;
}
.modal-header .btn-close { filter: invert(1); }
.modal-title { font-weight: 600; }

/* ============================================================
   SCROLLBAR
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--pufe-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--pufe-muted); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 992px) {
  .sidebar { transform: translateX(calc(-1 * var(--sidebar-w))); }
  .sidebar.sidebar-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .page-content { padding: 16px; }
}

@media (max-width: 576px) {
  .login-card { padding: 32px 24px; }
  .consulta-card { padding: 24px 20px; }
  .stat-number { font-size: 22px; }
}

/* ============================================================
   ESTILOS DE IMPRESIÓN Y MEJORA DE TABLAS DATATABLES
   ============================================================ */
.dt-buttons-target {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 2px;
}
.dt-buttons-target .btn {
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
}
.dt-buttons-target .btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.12);
}

/* Forzar que el texto de la tabla se comporte de manera normal (sin cortes forzados) */
.table-pufe td, .table-pufe th {
    white-space: normal !important;
    word-break: break-word !important;
}

@media print {
    @page {
        size: landscape;
        margin: 10mm;
    }
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 10pt !important;
    }
    /* Ocultar elementos de la interfaz de la web */
    .sidebar, .topbar, .card-header, .page-header, .alert, .dataTables_filter, .dataTables_info, .dataTables_paginate, .btn, form {
        display: none !important;
    }
    .main-content {
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
    }
    /* Forzar visibilidad y expansión al 100% */
    .table-responsive {
        overflow: visible !important;
    }
    table.table-pufe {
        width: 100% !important;
        border-collapse: collapse !important;
        font-size: 9pt !important;
    }
    table.table-pufe th, table.table-pufe td {
        border: 1px solid #000 !important;
        padding: 8px !important;
        white-space: normal !important;
        word-break: break-word !important;
        color: #000 !important;
        background: transparent !important;
    }
    /* Ocultar la última columna (que usualmente contiene los botones de 'Acciones') al imprimir */
    table.table-pufe th:last-child, table.table-pufe td:last-child {
        display: none !important;
    }
}

/* ============================================================
   ESTILOS DE HIGHCHARTS EN PANTALLA COMPLETA
   ============================================================ */
.highcharts-fullscreen-container {
  background-color: var(--pufe-bg) !important;
  background: var(--pufe-bg) !important;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 30px;
}
.highcharts-fullscreen-container .highcharts-container {
  background: white !important;
  background-color: white !important;
  border: 1px solid var(--pufe-border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
  padding: 20px;
  box-sizing: border-box;
}
.highcharts-fullscreen-container .highcharts-container svg {
  background: white !important;
  background-color: white !important;
  border-radius: 12px;
}

/* Eliminar el color negro del fondo nativo (backdrop) del navegador en fullscreen */
:fullscreen,
::backdrop,
.highcharts-fullscreen-container::backdrop {
  background-color: var(--pufe-bg) !important;
  background: var(--pufe-bg) !important;
}

@media (orientation: portrait) {
  .highcharts-fullscreen-container {
    transform: rotate(90deg);
    width: 100vh !important;
    height: 100vw !important;
    transform-origin: center;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 99999;
  }
}

