/* ==========================================================================
   FGA CONTROL DE ARMAMENTO - HOJA DE ESTILOS PREMIUM (Vanilla CSS)
   ========================================================================== */

/* 1. SISTEMA DE DISEÑO & VARIABLES */
:root {
  /* Paleta de Colores (Tema Slate-Dark Premium) */
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-tertiary: #1f2937;
  --card-bg: rgba(31, 41, 55, 0.45);
  --card-border: rgba(255, 255, 255, 0.08);
  
  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-tertiary: #6b7280;

  /* Colores de Acento (Armas, Seguridad y Trazabilidad) */
  --color-emerald: #10b981;
  --color-emerald-glow: rgba(16, 185, 129, 0.15);
  --color-amber: #f59e0b;
  --color-amber-glow: rgba(245, 158, 11, 0.15);
  --color-red: #ef4444;
  --color-red-glow: rgba(239, 68, 68, 0.15);
  --color-blue: #3b82f6;
  --color-blue-glow: rgba(59, 130, 246, 0.15);
  
  /* Degradados de Oro Federal (FGA Brand) */
  --gold-primary: #D4AF37;
  --gold-hover: #AA7C11;
  --gold-gradient: linear-gradient(135deg, #f3e5ab, #d4af37, #aa7c11);
  --emerald-gradient: linear-gradient(135deg, #34d399, #10b981, #047857);
  --blue-gradient: linear-gradient(135deg, #60a5fa, #3b82f6, #1d4ed8);
  
  /* Tipografía y Espaciados */
  --font-sans: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  /* Sombras y Efectos */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-glow-emerald: 0 0 20px rgba(16, 185, 129, 0.25);
  --shadow-glow-gold: 0 0 25px rgba(212, 175, 55, 0.25);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.4s ease;
}

/* 2. REGLAS GENERALES Y RESET */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-blue);
  text-decoration: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

/* 3. ESTRUCTURA Y CONTENEDOR PRINCIPAL (SPA LAYOUT) */
.app-container {
  display: flex;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

/* BARRA LATERAL (SIDEBAR) */
.sidebar {
  width: 280px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 10;
  transition: transform var(--transition-normal);
}

.sidebar-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--card-border);
}

.logo-container {
  width: 100%;
  display: flex;
  align-items: center;
}

.logo-container .fga-logo {
  width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

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

.sidebar-nav ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.nav-btn {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 500;
  text-align: left;
  transition: all var(--transition-fast);
}

.nav-btn i {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-fast);
}

.nav-btn:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-btn:hover i {
  transform: translateX(3px);
}

.nav-btn.active {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
  border-left: 3px solid var(--gold-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  box-shadow: inset 5px 0 10px rgba(0, 0, 0, 0.2);
}

.nav-btn.active i {
  color: var(--gold-primary);
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.nav-btn-settings {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.nav-btn-settings:hover {
  color: var(--text-primary);
  background-color: rgba(255, 255, 255, 0.05);
}

.nav-btn-settings.active {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
  border-left: 3px solid var(--gold-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.nav-btn-settings.active i {
  color: var(--gold-primary);
  animation: spin 4s linear infinite;
}

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

.db-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  padding: 4px 8px;
  background-color: rgba(0, 0, 0, 0.15);
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  position: relative;
}

.status-dot.green {
  background-color: var(--color-emerald);
  box-shadow: 0 0 8px var(--color-emerald);
}

.status-dot.orange {
  background-color: var(--color-amber);
  box-shadow: 0 0 8px var(--color-amber);
  animation: pulse 1.5s infinite alternate;
}

@keyframes pulse {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

/* CONTENIDO CENTRAL (MAIN) */
.main-content {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-primary);
}

.main-header {
  padding: 24px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--card-border);
  flex-shrink: 0;
}

.header-welcome h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.text-secondary {
  color: var(--text-secondary);
}

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

.current-date {
  font-size: 0.85rem;
  color: var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.03);
  padding: 6px 12px;
  border-radius: var(--radius-full);
  border: 1px solid var(--card-border);
}

.quick-stats-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-amber-glow);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
}

.stats-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.stats-value {
  color: var(--color-amber);
  font-weight: 800;
}

/* 4. CONTENEDORES DE PESTAÑAS (SPA SECTIONS) */
.tab-content-container {
  flex-grow: 1;
  padding: 32px;
  overflow-y: auto;
  position: relative;
}

.tab-section {
  display: none;
  opacity: 0;
  transform: translateY(15px);
  transition: opacity var(--transition-normal), transform var(--transition-normal);
  width: 100%;
}

.tab-section.active {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: translateY(0);
}

/* 5. KPIS Y TARJETAS ANALÍTICAS */
.grid-kpis {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  transition: background var(--transition-normal);
}

.kpi-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: var(--shadow-lg);
}

.kpi-card:hover::before {
  background: var(--gold-gradient);
}

.kpi-icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.emerald-glow {
  background: var(--color-emerald-glow);
  color: var(--color-emerald);
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.orange-glow {
  background: var(--color-amber-glow);
  color: var(--color-amber);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.red-glow {
  background: var(--color-red-glow);
  color: var(--color-red);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.blue-glow {
  background: var(--color-blue-glow);
  color: var(--color-blue);
  border: 1px solid rgba(59, 130, 246, 0.2);
}

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-info h3 {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.kpi-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  margin: 4px 0;
}

.kpi-desc {
  font-size: 0.75rem;
  color: var(--text-tertiary);
}

.text-amber { color: var(--color-amber) !important; }
.text-red { color: var(--color-red) !important; }
.text-blue { color: var(--color-blue) !important; }
.text-emerald { color: var(--color-emerald) !important; }

/* 6. ESTRUCTURA DE DASHBOARD PRINCIPAL */
.dashboard-details-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}

.col-span-2 {
  grid-column: span 2;
}

.dashboard-box {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.box-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.box-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
}

.box-badge {
  font-size: 0.75rem;
  font-weight: 600;
  background-color: rgba(255, 255, 255, 0.05);
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.box-body {
  padding: 24px;
  display: flex;
  flex-grow: 1;
}

.flex-col {
  flex-direction: column;
}

.gap-4 { gap: 1rem; }
.gap-2 { gap: 0.5rem; }
.gap-6 { gap: 1.5rem; }

.scrollable-y {
  overflow-y: auto;
}

.max-h-500 { max-height: 500px; }
.max-h-550 { max-height: 550px; }
.max-h-450 { max-height: 450px; }

/* 7. TABLAS DE DATOS */
.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  padding: 12px 16px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--card-border);
  font-weight: 600;
}

.data-table td {
  padding: 14px 16px;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--card-border);
  color: var(--text-primary);
}

.data-table tbody tr {
  transition: background var(--transition-fast);
}

.data-table tbody tr:hover {
  background-color: rgba(255, 255, 255, 0.02);
}

.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.w-400 { width: 400px; }
.w-350 { width: 350px; }
.w-250 { width: 250px; }
.cursor-pointer { cursor: pointer; }
.flex-shrink-0 { flex-shrink: 0; }
.flex-grow-1 { flex-grow: 1; }

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-status.disponible {
  background-color: var(--color-emerald-glow);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.badge-status.entregada {
  background-color: var(--color-amber-glow);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-status.mantenimiento {
  background-color: var(--color-red-glow);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* 8. BOTONES ACCIÓN RÁPIDA */
.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 24px;
  border-radius: var(--radius-md);
  cursor: pointer;
  border: 1px solid var(--card-border);
  transition: all var(--transition-normal);
  color: var(--text-primary);
  width: 100%;
}

.btn-primary-gradient {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(0, 0, 0, 0));
  border-left: 4px solid var(--gold-primary);
}

.btn-primary-gradient:hover {
  background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(255, 255, 255, 0.02));
  border-left-width: 6px;
  transform: translateX(4px);
  box-shadow: var(--shadow-glow-gold);
}

.btn-secondary-gradient {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(0, 0, 0, 0));
  border-left: 4px solid var(--color-emerald);
}

.btn-secondary-gradient:hover {
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(255, 255, 255, 0.02));
  border-left-width: 6px;
  transform: translateX(4px);
  box-shadow: var(--shadow-glow-emerald);
}

.quick-action-btn i {
  font-size: 1.5rem;
}

.quick-action-btn strong {
  font-size: 0.95rem;
  display: block;
}

.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.85rem; }
.opacity-80 { opacity: 0.8; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mr-2 { margin-right: 0.5rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.max-w-md { max-width: 450px; }
.max-w-lg { max-width: 600px; }
.max-w-2xl { max-width: 800px; }

.info-alert-box {
  display: flex;
  gap: 14px;
  background-color: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: var(--radius-md);
  padding: 16px;
}

/* 9. COMPONENTES DE FORMULARIO GENERAL */
.form-container-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 32px;
  box-shadow: var(--shadow-lg);
  width: 100%;
}

.form-steps {
  display: flex;
  justify-content: space-between;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--card-border);
  padding-bottom: 20px;
}

.step {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.4;
  transition: opacity var(--transition-normal);
}

.step.active {
  opacity: 1;
}

.step.completed {
  opacity: 0.8;
}

.step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
}

.step.active .step-num {
  background: var(--gold-gradient);
  border-color: var(--gold-primary);
  color: var(--bg-primary);
  box-shadow: var(--shadow-glow-gold);
}

.step.completed .step-num {
  background-color: var(--color-emerald);
  border-color: var(--color-emerald);
  color: var(--bg-primary);
}

.step-label {
  font-size: 0.9rem;
  font-weight: 600;
}

.form-step-content {
  display: none;
}

.form-step-content.active {
  display: block;
  animation: fadeIn var(--transition-normal) forwards;
}

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

.form-instructions {
  text-align: center;
  margin-bottom: 28px;
}

.form-instructions h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  width: 100%;
}

.form-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
}

.form-control {
  background-color: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.95rem;
  color: var(--text-primary);
  transition: all var(--transition-fast);
  width: 100%;
}

.form-control:focus {
  border-color: var(--gold-primary);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
  background-color: rgba(0, 0, 0, 0.35);
}

.form-control::placeholder {
  color: var(--text-tertiary);
}

.form-row {
  display: flex;
  gap: 16px;
}

.form-row .form-group {
  flex: 1;
}

.letter-spacing-10 {
  letter-spacing: 12px;
}

.helper-text {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

/* BOTONES GENERÁLICOS */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

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

.btn-primary {
  background: var(--gold-gradient);
  color: var(--bg-primary);
  box-shadow: var(--shadow-glow-gold);
}

.btn-primary:hover {
  background: var(--gold-primary);
  box-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
}

.btn-secondary {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background-color: rgba(255, 255, 255, 0.05);
}

.btn-success {
  background: var(--emerald-gradient);
  color: var(--bg-primary);
}

.btn-success:hover {
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.35);
}

.btn-danger-outline {
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: var(--color-red);
  background-color: rgba(239, 68, 68, 0.03);
}

.btn-danger-outline:hover {
  background-color: var(--color-red);
  color: var(--bg-primary);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.75rem;
}

/* CARD PREVIEW Y SUMMARY */
.card-detail-preview {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 20px;
}

.card-detail-preview.hidden {
  display: none;
}

.summary-preview-card {
  background-color: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 24px;
  max-w-md;
  margin: 0 auto 24px auto;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
  font-size: 0.9rem;
}

.summary-row:last-child {
  border-bottom: none;
}

.summary-label {
  color: var(--text-secondary);
}

.summary-value {
  font-weight: 600;
}

/* 10. ESTILOS DE FICHAJE DE DEVOLUCIÓN */
.flex-container {
  display: flex;
  width: 100%;
}

.flex-1 { flex: 1; }
.w-400 { width: 400px; }

.list-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--card-border);
}

.card-header h3 {
  font-size: 1.1rem;
  font-weight: 600;
}

.card-body {
  padding: 24px;
  display: flex;
  flex-grow: 1;
}

.search-box {
  position: relative;
  width: 100%;
}

.search-box i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-tertiary);
  width: 16px;
  height: 16px;
}

.search-box .form-control {
  padding-left: 44px;
}

.active-loans-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.loan-item-card {
  background-color: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 16px;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.loan-item-card:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--gold-primary);
  transform: translateX(2px);
}

.loan-item-card.selected {
  background-color: var(--color-amber-glow);
  border-color: var(--color-amber);
}

.loan-details h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.loan-details p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.loan-weapon {
  text-align: right;
}

.loan-weapon .serial {
  font-family: monospace;
  background-color: rgba(255, 255, 255, 0.08);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: 700;
}

.loan-weapon .ammo {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 4px;
  display: block;
}

.form-card {
  background: var(--card-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mini-summary-pill {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  padding: 12px;
  font-size: 0.85rem;
}

.stats-preview-box {
  background-color: rgba(245, 158, 11, 0.05);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

/* 11. GESTIÓN CRUD & CONFIGURACIÓN */
.border-b {
  border-bottom: 1px solid var(--card-border);
}

.pb-4 { padding-bottom: 1rem; }
.justify-between { justify-content: space-between; }
.items-center { align-items: center; }

.action-btn-group {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.action-icon-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--card-border);
  transition: all var(--transition-fast);
  color: var(--text-secondary);
}

.action-icon-btn:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

.action-icon-btn.edit:hover {
  color: var(--color-blue);
  border-color: var(--color-blue);
}

.action-icon-btn.delete:hover {
  color: var(--color-red);
  border-color: var(--color-red);
}

.action-icon-btn.pdf:hover {
  color: var(--color-emerald);
  border-color: var(--color-emerald);
}

/* FILTROS HISTORIAL */
.filters-container {
  display: flex;
  gap: 16px;
  padding: 16px 24px;
  background-color: rgba(255, 255, 255, 0.01);
  border-bottom: 1px solid var(--card-border);
  align-items: center;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-group label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.form-control-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  width: auto;
}

.wrap-responsive {
  flex-wrap: wrap;
}

/* CONFIGURACIÓN Y BACKUPS */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.badge.cloud {
  background: var(--emerald-gradient);
  color: var(--bg-primary);
  box-shadow: var(--shadow-glow-emerald);
}

.badge.local {
  background-color: var(--bg-tertiary);
  color: var(--text-secondary);
  border: 1px solid var(--card-border);
}

/* TOAST NOTIFICATIONS */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}

.toast {
  background-color: var(--bg-secondary);
  border-left: 4px solid var(--gold-primary);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 300px;
  max-width: 450px;
  transform: translateX(120%);
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  backdrop-filter: blur(10px);
  border: 1px solid var(--card-border);
}

@keyframes slideIn {
  to { transform: translateX(0); }
}

.toast.success {
  border-left-color: var(--color-emerald);
}

.toast.error {
  border-left-color: var(--color-red);
}

.toast.info {
  border-left-color: var(--color-blue);
}

.toast.warning {
  border-left-color: var(--color-amber);
}

/* 12. DISEÑO ADAPTATIVO (RESPONSIVE MEDIA QUERIES) */
@media (max-width: 1024px) {
  .dashboard-details-grid {
    grid-template-columns: 1fr;
  }
  .flex-container {
    flex-direction: column;
  }
  .w-400, .w-350 {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .app-container {
    flex-direction: column;
  }
  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--card-border);
  }
  .sidebar-header {
    padding: 16px;
  }
  .sidebar-nav {
    display: none; /* Sería ideal un botón de menú tipo hamburguesa */
  }
  .main-header {
    padding: 16px;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .tab-content-container {
    padding: 16px;
  }
  .form-steps {
    display: none; /* Oculta pasos en pantallas muy pequeñas */
  }
  .form-row {
    flex-direction: column;
    gap: 0;
  }
}

/* ==========================================================================
   13. ESTILOS DE RECIBO DIGITAL IMPRIMIBLE (PDF FORMAT)
   ========================================================================== */
.pdf-receipt-document {
  color: #0f172a;
  background-color: #ffffff;
  font-family: 'Outfit', 'Segoe UI', sans-serif;
  padding: 40px;
  border-radius: 0;
  box-sizing: border-box;
}

.pdf-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 3px solid #10b981;
  padding-bottom: 20px;
  margin-bottom: 24px;
}

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

.pdf-logo-placeholder {
  width: 60px;
  height: 60px;
  border: 2px solid #d4af37;
  padding: 2px;
  border-radius: 6px;
}

.pdf-logo-placeholder img {
  width: 100%;
  height: 100%;
}

.pdf-title h1 {
  font-size: 1.35rem;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: 1px;
}

.pdf-title p {
  font-size: 0.75rem;
  color: #475569;
  text-transform: uppercase;
  font-weight: 600;
  margin-top: 2px;
}

.pdf-header-right {
  text-align: right;
}

.pdf-header-right .doc-number {
  font-size: 0.9rem;
  font-weight: 700;
  color: #10b981;
  background-color: #ecfdf5;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.pdf-header-right .doc-date {
  font-size: 0.75rem;
  color: #475569;
  margin-top: 6px;
  display: block;
}

.pdf-section {
  margin-bottom: 24px;
}

.pdf-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #10b981;
  font-weight: 700;
  border-bottom: 1.5px solid rgba(16, 185, 129, 0.15);
  padding-bottom: 6px;
  margin-bottom: 12px;
}

.pdf-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.pdf-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.pdf-data-item {
  display: flex;
  flex-direction: column;
}

.pdf-data-item .label {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  margin-bottom: 4px;
  font-weight: 500;
}

.pdf-data-item .value {
  font-size: 0.9rem;
  font-weight: 600;
  color: #0f172a;
}

.pdf-weapon-display {
  background-color: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  margin: 16px 0;
  display: flex;
  justify-content: space-between;
}

.pdf-weapon-display .serial {
  font-family: monospace;
  background-color: #e2e8f0;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 700;
}

.pdf-audit-trail {
  background-color: #f8fafc;
  border: 1.5px dashed #cbd5e1;
  padding: 16px;
  border-radius: 8px;
  margin-top: 32px;
}

.pdf-audit-trail p {
  font-size: 0.75rem;
  color: #475569;
  line-height: 1.4;
}

.pdf-signatures {
  display: flex;
  justify-content: space-between;
  margin-top: 48px;
  gap: 40px;
}

.pdf-sign-box {
  flex: 1;
  text-align: center;
  border-top: 1.5px solid #94a3b8;
  padding-top: 10px;
}

.pdf-sign-box .name {
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
}

.pdf-sign-box .role {
  font-size: 0.7rem;
  color: #64748b;
  text-transform: uppercase;
  margin-top: 2px;
  font-weight: 500;
}

.pdf-sign-box .digital-signature {
  font-family: monospace;
  font-size: 0.65rem;
  color: #94a3b8;
  margin-top: 6px;
  background-color: #f8fafc;
  padding: 4px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
}
