/* Local Fonts (100% Offline, No CDN required) */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('fonts/outfit-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('fonts/outfit-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('fonts/pjs-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Plus Jakarta Sans';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('fonts/pjs-latinext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font-sans: 'Plus Jakarta Sans', 'Outfit', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  
  /* Curated Light Theme (Clean slate/blue tones) */
  --background: 210 40% 98%;
  --card: 0 0% 100%;
  --card-border: 214 32% 91%;
  --card-hover-border: 214 32% 80%;
  
  --text-primary: 222 47% 11%;
  --text-secondary: 215 16% 47%;
  --text-muted: 215 13% 63%;
  
  --primary: 221 83% 53%;
  --primary-glow: 221 83% 53% / 0.08;
  --primary-hover: 221 83% 45%;
  
  --accent: 262 83% 58%;
  --accent-glow: 262 83% 58% / 0.08;
  
  --success: 142 72% 29%;
  --success-glow: 142 72% 29% / 0.08;
  --danger: 346 84% 50%;
  --danger-glow: 346 84% 50% / 0.08;
  --warning: 38 92% 50%;
  --warning-glow: 38 92% 50% / 0.08;
  
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
  
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.1);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.01);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: hsl(var(--background));
  color: hsl(var(--text-primary));
  overflow-x: hidden;
  min-height: 100vh;
}

.layout-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: hsl(var(--background));
  width: 100%;
}

main {
  flex-grow: 1;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 24px 32px;
  display: flex;
  flex-direction: column;
  gap: 25px;
  box-sizing: border-box;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: hsl(var(--background));
}
::-webkit-scrollbar-thumb {
  background: hsl(var(--card-border));
  border-radius: var(--radius-sm);
}
::-webkit-scrollbar-thumb:hover {
  background: hsl(var(--card-hover-border));
}

/* Base Layout Classes */
.glass-panel {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.glass-panel-interactive {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid hsl(var(--card-border));
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  transition: var(--transition-smooth);
}

.glass-panel-interactive:hover {
  border-color: hsl(var(--card-hover-border));
  box-shadow: var(--shadow-glow), var(--shadow-card);
  transform: translateY(-2px);
}

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

.animate-fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Layout Utilities */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}

@media (min-width: 992px) {
  .dashboard-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* Custom Table Styles */
.custom-table-container {
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid hsl(var(--card-border));
}

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

.custom-table th {
  background: rgba(241, 245, 249, 0.8);
  padding: 14px 18px;
  font-weight: 600;
  color: hsl(var(--text-secondary));
  border-bottom: 1px solid hsl(var(--card-border));
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.custom-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  color: hsl(var(--text-primary));
  transition: var(--transition-smooth);
}

.custom-table tr:hover td {
  background: rgba(0, 0, 0, 0.015);
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-blue {
  background: hsla(217, 91%, 60%, 0.1);
  color: hsl(217, 91%, 70%);
  border: 1px solid hsla(217, 91%, 60%, 0.2);
}

.badge-purple {
  background: hsla(262, 83%, 58%, 0.1);
  color: hsl(262, 83%, 70%);
  border: 1px solid hsla(262, 83%, 58%, 0.2);
}

.badge-emerald {
  background: hsla(142, 76%, 36%, 0.1);
  color: hsl(142, 76%, 50%);
  border: 1px solid hsla(142, 76%, 36%, 0.2);
}

.badge-rose {
  background: hsla(346, 84%, 50%, 0.1);
  color: hsl(346, 84%, 65%);
  border: 1px solid hsla(346, 84%, 50%, 0.2);
}

.badge-amber {
  background: hsla(38, 92%, 50%, 0.1);
  color: hsl(38, 92%, 65%);
  border: 1px solid hsla(38, 92%, 50%, 0.2);
}

/* Form inputs styling */
.form-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid hsl(var(--card-border));
  color: hsl(var(--text-primary));
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  outline: none;
  font-size: 0.9rem;
  transition: var(--transition-smooth);
}

.form-input:focus {
  border-color: hsl(var(--primary));
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
}

/* Universal Modern Button System */
.btn,
.btn-primary,
.btn-secondary,
.btn-danger,
.btn-outline,
.btn-outline-primary,
.btn-outline-success,
.btn-success,
.btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.84rem;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none !important;
  border: 1px solid transparent;
  line-height: 1.4;
  user-select: none;
  white-space: nowrap;
  box-sizing: border-box;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

a.btn, a.btn-primary, a.btn-secondary, a.btn-outline, a.btn-danger, a.btn-success, a.btn-whatsapp {
  text-decoration: none !important;
}

.btn *, .btn-primary *, .btn-secondary *, .btn-outline *, .btn-danger * {
  text-decoration: none !important;
}

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

.btn svg {
  flex-shrink: 0;
}

/* Button Sizes */
.btn-sm {
  padding: 6px 12px;
  font-size: 0.78rem;
  border-radius: 8px;
  gap: 6px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 0.72rem;
  border-radius: 6px;
  gap: 4px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 0.95rem;
  border-radius: 12px;
  gap: 10px;
}

/* Primary Button */
.btn-primary {
  background: #2563eb;
  color: #ffffff !important;
  border: 1px solid #1d4ed8;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

.btn-primary:hover {
  background: #1d4ed8;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transform: translateY(-1px);
}

/* Secondary Button */
.btn-secondary {
  background: #f1f5f9;
  color: #334155 !important;
  border: 1px solid #cbd5e1;
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: #0f172a !important;
  border-color: #94a3b8;
  transform: translateY(-1px);
}

/* Outline Button */
.btn-outline {
  background: #ffffff;
  color: #334155 !important;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #94a3b8;
  color: #0f172a !important;
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.06);
}

/* Outline Primary */
.btn-outline-primary {
  background: #ffffff;
  color: #2563eb !important;
  border: 1.5px solid #bfdbfe;
}

.btn-outline-primary:hover {
  background: #eff6ff;
  border-color: #3b82f6;
  color: #1d4ed8 !important;
  transform: translateY(-1px);
}

/* Outline Success (Excel Green) */
.btn-outline-success {
  background: #ffffff;
  color: #15803d !important;
  border: 1.5px solid #bbf7d0;
}

.btn-outline-success:hover {
  background: #f0fdf4;
  border-color: #22c55e;
  color: #166534 !important;
  transform: translateY(-1px);
}

/* Success Button */
.btn-success {
  background: #10b981;
  color: #ffffff !important;
  border: 1px solid #059669;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.btn-success:hover {
  background: #059669;
  transform: translateY(-1px);
}

/* WhatsApp Button */
.btn-whatsapp {
  background: #25d366;
  color: #ffffff !important;
  border: 1px solid #1eb857;
  box-shadow: 0 2px 6px rgba(37, 211, 102, 0.25);
}

.btn-whatsapp:hover {
  background: #1eb857;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
  transform: translateY(-1px);
}

/* Danger Button */
.btn-danger {
  background: #ef4444;
  color: #ffffff !important;
  border: 1px solid #dc2626;
  box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

.btn-danger:hover {
  background: #dc2626;
  color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(239, 68, 68, 0.35);
  transform: translateY(-1px);
}

.btn-disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}

/* Modal styling */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 100;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  width: 100%;
  max-width: 640px;
  padding: 30px;
  max-height: 90vh;
  overflow-y: auto;
}

/* ==========================================================================
   Responsive Mobile Overrides
   ========================================================================== */

@media (max-width: 992px) {
  .layout-container {
    flex-direction: column !important;
    padding: 12px !important;
    gap: 16px !important;
  }

  aside {
    width: 100% !important;
    margin: 0 !important;
    padding: 16px 20px !important;
    border-radius: var(--radius-md) !important;
  }

  main {
    padding: 10px 0 !important;
    gap: 20px !important;
  }

  .nav-links {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-bottom: 12px !important;
  }

  .nav-button {
    width: auto !important;
    flex: 1 1 auto;
    font-size: 0.8rem;
    padding: 8px 12px !important;
  }

  .aside-user {
    margin-bottom: 15px !important;
  }

  .aside-header {
    margin-bottom: 20px !important;
  }

  aside .btn-danger {
    margin-top: 10px !important;
    width: 100% !important;
    justify-content: center !important;
    padding: 10px !important;
  }

  .header-bar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }

  .header-bar div {
    width: 100%;
  }

  .header-bar .btn-primary, 
  .header-bar .btn-secondary,
  .header-bar a {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Form & layout grids */
  .form-grid, .blast-grid {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

@media (max-width: 576px) {
  /* Search input layout wrapper (index.php) */
  form#search-form > div[style*="display: flex; gap: 12px"],
  form#search-form > div[style*="display: flex; gap: 12px;"] {
    flex-direction: column !important;
    gap: 8px !important;
  }

  form#search-form > div[style*="display: flex; gap: 12px"] > button,
  form#search-form > div[style*="display: flex; gap: 12px"] > a,
  form#search-form > div[style*="display: flex; gap: 12px;"] > button,
  form#search-form > div[style*="display: flex; gap: 12px;"] > a {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Pagination container styling */
  .pagination-container {
    flex-direction: column !important;
    gap: 12px !important;
    align-items: center !important;
  }

  /* Stack inline 2 or 3-column grids inside modal or forms */
  div[style*="grid-template-columns: 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr;"],
  div[style*="grid-template-columns: 1fr 1fr 1fr"],
  div[style*="grid-template-columns: 1fr 1fr 1fr;"] {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
}
