/* ==========================================================================
   CENTRO COMERCIAL POPULAR LOS COMUNEROS - PROPIEDAD HORIZONTAL
   SISTEMA DE GESTIÓN DEL RÉGIMEN SANCIONATORIO (SGS)
   Estilos CSS Profesionales con Paleta Oficial Los Comuneros
   ========================================================================== */

:root {
  /* Paleta Oficial Los Comuneros */
  --primary: #003865;
  --primary-light: #005a9c;
  --primary-dark: #002244;
  --secondary: #00a3e0;
  --secondary-light: #48cae4;
  --accent-fuchsia: #e6007e;
  --accent-magenta: #c2185b;
  --accent-yellow: #ffcc00;
  --accent-gold: #f59e0b;
  --accent-green: #00a86b;
  --danger: #e53935;
  --danger-light: #ff4d6d;
  --success: #00a86b;
  --warning: #f59e0b;
  --info: #00a3e0;

  /* Superficies y Fondos */
  --bg-main: #f3f6fb;
  --bg-card: #ffffff;
  --bg-sidebar: #002b4d;
  --bg-sidebar-hover: #003865;
  --bg-header: #ffffff;
  --border-color: #e2e8f0;
  --border-focus: #00a3e0;

  /* Tipografía */
  --text-main: #1e293b;
  --text-muted: #64748b;
  --text-light: #f8fafc;
  --font-family: 'Segoe UI', system-ui, -apple-system, BlinkMacSystemFont, Roboto, sans-serif;

  /* Sombras */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 10px rgba(0, 56, 101, 0.08);
  --shadow-lg: 0 10px 20px rgba(0, 56, 101, 0.12);
  --shadow-xl: 0 20px 30px rgba(0, 56, 101, 0.18);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reseteo y Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
}

/* Scrollbar Personalizado */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.03);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 163, 224, 0.4);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}

/* Layout Principal */
.app-container {
  display: flex;
  width: 100vw;
  min-height: 100vh;
  position: relative;
}

/* ==========================================================================
   PANTALLA DE LOGIN INSTITUCIONAL
   ========================================================================== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #002244 0%, #003865 50%, #005a9c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.login-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.4);
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
  animation: slideIn 0.35s ease-out;
}

.login-header {
  padding: 28px 24px 20px 24px;
  text-align: center;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
  border-bottom: 1px solid var(--border-color);
}

.login-logo-container {
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
}

.login-header h2 {
  font-size: 17px;
  color: var(--primary);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.login-header p {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.login-body {
  padding: 26px 28px;
}

.login-demo-pills {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border-color);
}

.login-demo-pills h4 {
  font-size: 11.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  letter-spacing: 0.5px;
  font-weight: 700;
}

.demo-roles-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.btn-demo-role {
  font-size: 11.5px;
  padding: 6px 10px;
  text-align: left;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  color: var(--text-main);
  font-weight: 600;
}

.btn-demo-role:hover {
  background: #e0f2fe;
  border-color: var(--secondary);
  color: var(--primary);
}

/* ==========================================================================
   BARRA LATERAL (SIDEBAR) CON SCROLL Y ACORDEÓN ELEGANTE
   ========================================================================== */
.sidebar {
  width: 290px;
  background: var(--bg-sidebar);
  color: var(--text-light);
  display: flex;
  flex-direction: column;
  transition: var(--transition);
  z-index: 100;
  box-shadow: var(--shadow-lg);
  flex-shrink: 0;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar-header {
  padding: 18px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-shrink: 0;
  background: #ffffff;
}

.sidebar-logo-img {
  width: 100%;
  max-width: 245px;
  height: auto;
  display: block;
}

.sidebar-user-card {
  margin: 12px 14px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--secondary), var(--accent-fuchsia));
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 14px;
  color: white;
  border: 2px solid var(--accent-yellow);
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-info .user-name {
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-info .user-role-badge {
  display: inline-block;
  font-size: 9.5px;
  background: var(--accent-fuchsia);
  color: #fff;
  padding: 2px 7px;
  border-radius: 12px;
  font-weight: 700;
  margin-top: 2px;
}

.btn-logout-mini {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  transition: var(--transition);
}

.btn-logout-mini:hover {
  color: var(--danger-light);
}

/* Menú Scrollable */
.sidebar-menu {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 10px 12px;
  scroll-behavior: smooth;
}

.sidebar-menu::-webkit-scrollbar {
  width: 5px;
}
.sidebar-menu::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}
.sidebar-menu::-webkit-scrollbar-thumb:hover {
  background: var(--secondary);
}

/* Acordeón Estricto por Categoría */
.menu-group {
  margin-bottom: 6px;
}

.menu-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  user-select: none;
  background: rgba(255, 255, 255, 0.03);
}

.menu-category-header:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.09);
}

/* Iconos de flecha pequeños y elegantes */
.menu-category-header .chevron-icon {
  font-size: 9px;
  width: 12px;
  height: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--secondary-light);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform: rotate(0deg);
}

.menu-group.collapsed .menu-category-header .chevron-icon {
  transform: rotate(-90deg);
}

.menu-group-items {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 3px;
  overflow: hidden;
  max-height: 400px;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  opacity: 1;
}

.menu-group.collapsed .menu-group-items {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 12.8px;
  font-weight: 500;
  transition: var(--transition);
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  transform: translateX(3px);
}

.nav-item.active {
  background: linear-gradient(90deg, var(--secondary) 0%, rgba(0, 163, 224, 0.6) 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(0, 163, 224, 0.35);
  border-left: 3px solid var(--accent-yellow);
}

.nav-item .nav-icon {
  font-size: 15px;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 10.5px;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  flex-shrink: 0;
}

/* ==========================================================================
   CONTENIDO PRINCIPAL Y CABECERA
   ========================================================================== */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
  height: 100vh;
}

.top-header {
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: var(--shadow-sm);
  gap: 16px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-title h1 {
  font-size: 18.5px;
  font-weight: 800;
  color: var(--primary);
}

.header-title p {
  font-size: 11.5px;
  color: var(--text-muted);
}

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

.role-switcher-select {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.role-switcher-select:focus {
  border-color: var(--secondary);
}

.btn-user-profile {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.btn-user-profile:hover {
  background: #e0f2fe;
  border-color: var(--secondary);
}

/* Área de Vistas Dinámicas */
.content-area {
  padding: 24px;
  flex: 1;
}

/* Tarjetas */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  margin-bottom: 22px;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
  gap: 12px;
  flex-wrap: wrap;
}

.card-title {
  font-size: 16.5px;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Stepper / Barra de Progreso */
.status-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 16px 0 24px 0;
  position: relative;
  overflow-x: auto;
  padding: 10px 0;
}

.step-node-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  flex: 1;
  min-width: 95px;
}

.step-node {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 12px;
  border: 3px solid #fff;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.step-node-wrapper.completed .step-node {
  background: var(--success);
  color: #fff;
}

.step-node-wrapper.current .step-node {
  background: var(--accent-fuchsia);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(230, 0, 126, 0.25);
  transform: scale(1.15);
}

.step-node-wrapper.danger .step-node {
  background: var(--danger);
  color: #fff;
}

.step-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
  white-space: nowrap;
}

.step-node-wrapper.current .step-label {
  color: var(--primary);
  font-weight: 800;
}

.step-connector {
  position: absolute;
  top: 25px;
  left: 5%;
  right: 5%;
  height: 4px;
  background: #e2e8f0;
  z-index: 1;
}

.step-connector-progress {
  height: 100%;
  background: linear-gradient(90deg, var(--success), var(--secondary), var(--accent-fuchsia));
  transition: width 0.4s ease;
}

/* Grilla de Métricas (KPIs) */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 22px;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  border-left: 4px solid var(--primary);
}

.kpi-card.kpi-primary { border-left-color: var(--primary); }
.kpi-card.kpi-secondary { border-left-color: var(--secondary); }
.kpi-card.kpi-warning { border-left-color: var(--accent-gold); }
.kpi-card.kpi-danger { border-left-color: var(--danger); }
.kpi-card.kpi-success { border-left-color: var(--success); }

.kpi-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: rgba(0, 56, 101, 0.08);
  color: var(--primary);
}

.kpi-primary .kpi-icon { background: rgba(0, 56, 101, 0.1); color: var(--primary); }
.kpi-secondary .kpi-icon { background: rgba(0, 163, 224, 0.1); color: var(--secondary); }
.kpi-warning .kpi-icon { background: rgba(255, 204, 0, 0.15); color: var(--accent-gold); }
.kpi-danger .kpi-icon { background: rgba(229, 57, 53, 0.1); color: var(--danger); }
.kpi-success .kpi-icon { background: rgba(0, 168, 107, 0.1); color: var(--success); }

.kpi-info h4 {
  font-size: 11.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}

.kpi-info .kpi-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--text-main);
  margin-top: 3px;
}

.kpi-info .kpi-detail {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Tablas */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.custom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  text-align: left;
}

.custom-table th {
  background: #f8fafc;
  color: var(--text-muted);
  font-weight: 700;
  padding: 11px 14px;
  border-bottom: 2px solid var(--border-color);
  text-transform: uppercase;
  font-size: 10.5px;
  letter-spacing: 0.5px;
}

.custom-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-main);
  vertical-align: middle;
}

.custom-table tbody tr:hover {
  background: rgba(0, 163, 224, 0.04);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.badge-reportado { background: #e0f2fe; color: #0369a1; }
.badge-en_revision { background: #e0f2fe; color: #0369a1; }
.badge-notificado_cargos { background: #fef3c7; color: #b45309; }
.badge-en_termino_descargos { background: #fdf2f8; color: #be185d; }
.badge-descargos_presentados { background: #fdf2f8; color: #be185d; }
.badge-en_evaluacion_consejo { background: #ffedd5; color: #c2410c; }
.badge-sancionado { background: #fee2e2; color: #b91c1c; }
.badge-en_recurso_reposicion { background: #fae8ff; color: #86198f; }
.badge-ejecutoriado { background: #dcfce7; color: #15803d; }
.badge-cerrado_cumplido { background: #dcfce7; color: #15803d; }
.badge-archivado_desestimado { background: #f1f5f9; color: #475569; }

.badge-leve { background: #e0f2fe; color: #0284c7; }
.badge-grave { background: #fef3c7; color: #d97706; }
.badge-gravisima { background: #fee2e2; color: #dc2626; }

/* Botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: inherit;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--primary);
  color: white;
}
.btn-primary:hover {
  background: var(--primary-light);
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}
.btn-secondary:hover {
  background: #008cc9;
}

.btn-fuchsia {
  background: var(--accent-fuchsia);
  color: white;
}
.btn-fuchsia:hover {
  background: #c2185b;
}

.btn-success {
  background: var(--success);
  color: white;
}
.btn-success:hover {
  background: #008f5a;
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover {
  background: #c62828;
}

.btn-warning {
  background: var(--accent-gold);
  color: #fff;
}
.btn-warning:hover {
  background: #d97706;
}

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-main);
}
.btn-outline:hover {
  background: #f1f5f9;
  border-color: var(--text-muted);
}

.btn-sm {
  padding: 4px 9px;
  font-size: 11.5px;
}

/* Formularios */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.form-label .required {
  color: var(--danger);
}

.form-control {
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 13px;
  font-family: inherit;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(0, 163, 224, 0.15);
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* Modales */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 34, 68, 0.65);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  padding: 16px;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-card {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-backdrop.active .modal-card {
  transform: translateY(0);
}

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}

.modal-header h3 {
  font-size: 15.5px;
  font-weight: 800;
  color: var(--primary);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
}

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

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
}

/* Línea de Tiempo del Expediente */
.timeline {
  position: relative;
  padding-left: 28px;
  margin: 18px 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: var(--border-color);
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.timeline-point {
  position: absolute;
  left: -28px;
  top: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  border: 3px solid var(--secondary);
  box-shadow: var(--shadow-sm);
}

.timeline-item.completed .timeline-point {
  background: var(--success);
  border-color: var(--success);
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
}

.timeline-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--primary);
}

.timeline-date {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

/* Formato de Documentos Oficiales e Impresión */
.document-paper {
  background: white;
  color: #1a1a1a;
  padding: 36px;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  box-shadow: var(--shadow-lg);
  max-width: 800px;
  margin: 0 auto 24px auto;
  font-family: 'Times New Roman', Times, serif;
  line-height: 1.6;
}

.doc-header {
  text-align: center;
  border-bottom: 2px solid #003865;
  padding-bottom: 14px;
  margin-bottom: 20px;
}

.doc-header h2 {
  font-size: 15.5px;
  font-weight: bold;
  color: #003865;
  text-transform: uppercase;
}

.doc-header p {
  font-size: 11.5px;
  color: #4b5563;
  margin: 2px 0;
}

.doc-body {
  font-size: 13px;
  text-align: justify;
}

.doc-body h3 {
  font-size: 13.5px;
  text-align: center;
  margin: 18px 0 10px 0;
  text-transform: uppercase;
}

.doc-footer {
  margin-top: 36px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.signature-box {
  text-align: center;
  border-top: 1px solid #1a1a1a;
  width: 230px;
  padding-top: 6px;
  font-size: 11.5px;
}

.doc-hash-stamp {
  font-family: monospace;
  font-size: 9px;
  color: #6b7280;
  border: 1px dashed #9ca3af;
  padding: 5px;
  border-radius: 4px;
}

/* Toast Alerts */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 10000;
}

.toast {
  background: var(--bg-card);
  color: var(--text-main);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  box-shadow: var(--shadow-xl);
  border-left: 4px solid var(--primary);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  font-weight: 500;
  animation: slideIn 0.3s ease-out;
}

.toast-success { border-left-color: var(--success); }
.toast-danger { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
.toast-info { border-left-color: var(--secondary); }

/* Animaciones */
@keyframes slideIn {
  from { transform: translateY(15px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* Reglas de Impresión */
@media print {
  body {
    background: white;
    color: black;
  }
  .sidebar, .top-header, .no-print, .btn, .modal-backdrop, .login-overlay {
    display: none !important;
  }
  .main-wrapper, .content-area {
    padding: 0;
    overflow: visible;
    height: auto;
  }
  .document-paper {
    box-shadow: none;
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    max-width: 100%;
  }
}
