/* ============================================================
   Empanada Store — Design System CSS
   Colores: Dorado, Naranja, Azul Oscuro, Morado
   Tipografía: Inter + Outfit (Google Fonts)
   Responsive: Mobile-first
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

/* ============================================================
   1. CSS Custom Properties (Tokens)
   ============================================================ */
:root {
  /* Brand Colors */
  --color-gold:         #F4A22B;
  --color-gold-light:   #F8C56D;
  --color-gold-dark:    #D4891A;
  --color-orange:       #E07B14;
  --color-orange-light: #F0A050;

  /* Dark Palette */
  --color-navy:         #1A1F3C;
  --color-navy-light:   #252B4A;
  --color-navy-mid:     #2E3560;
  --color-purple:       #6B3FA0;
  --color-purple-light: #8B5DC4;

  /* Status Colors */
  --color-success:      #22C55E;
  --color-success-bg:   #DCFCE7;
  --color-warning:      #F59E0B;
  --color-warning-bg:   #FEF3C7;
  --color-danger:       #EF4444;
  --color-danger-bg:    #FEE2E2;
  --color-info:         #3B82F6;
  --color-info-bg:      #DBEAFE;
  --color-gray:         #6B7280;
  --color-gray-bg:      #F3F4F6;

  /* Light Theme */
  --bg-primary:         #F8F6F0;
  --bg-secondary:       #FFFFFF;
  --bg-tertiary:        #F0EDE6;
  --bg-card:            #FFFFFF;
  --bg-sidebar:         #1A1F3C;
  --bg-header:          #FFFFFF;
  --bg-overlay:         rgba(26, 31, 60, 0.6);

  --text-primary:       #1A1F3C;
  --text-secondary:     #4B5563;
  --text-muted:         #9CA3AF;
  --text-inverse:       #FFFFFF;
  --text-link:          #F4A22B;

  --border-color:       #E5E0D8;
  --border-radius-sm:   6px;
  --border-radius:      10px;
  --border-radius-lg:   16px;
  --border-radius-xl:   24px;
  --border-radius-full: 9999px;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.05);
  --shadow:      0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md:   0 10px 15px rgba(0,0,0,0.08), 0 4px 6px rgba(0,0,0,0.05);
  --shadow-lg:   0 20px 25px rgba(0,0,0,0.1), 0 10px 10px rgba(0,0,0,0.04);
  --shadow-gold: 0 4px 20px rgba(244,162,43,0.3);

  /* Spacing */
  --space-1: 4px;   --space-2: 8px;   --space-3: 12px;
  --space-4: 16px;  --space-5: 20px;  --space-6: 24px;
  --space-8: 32px;  --space-10: 40px; --space-12: 48px;
  --space-16: 64px;

  /* Sidebar */
  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --header-height: 64px;
  --bottom-nav-height: 64px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition:      250ms ease;
  --transition-slow: 400ms ease;

  /* Typography */
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-display: 'Outfit', 'Inter', sans-serif;
  --font-size-xs:   11px;
  --font-size-sm:   13px;
  --font-size-base: 14px;
  --font-size-md:   15px;
  --font-size-lg:   16px;
  --font-size-xl:   18px;
  --font-size-2xl:  22px;
  --font-size-3xl:  28px;
  --font-size-4xl:  36px;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary:   #0F1225;
  --bg-secondary: #151A35;
  --bg-tertiary:  #1C2240;
  --bg-card:      #1C2240;
  --bg-sidebar:   #0F1225;
  --bg-header:    #151A35;

  --text-primary:   #F0EDE6;
  --text-secondary: #A8B2CC;
  --text-muted:     #6B7A99;

  --border-color: #2A3055;
  --shadow:       0 4px 6px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.2);
  --shadow-md:    0 10px 15px rgba(0,0,0,0.3), 0 4px 6px rgba(0,0,0,0.2);
  --shadow-lg:    0 20px 25px rgba(0,0,0,0.4), 0 10px 10px rgba(0,0,0,0.2);

  --color-success-bg: rgba(34, 197, 94, 0.15);
  --color-warning-bg: rgba(245, 158, 11, 0.15);
  --color-danger-bg:  rgba(239, 68, 68, 0.15);
  --color-info-bg:    rgba(59, 130, 246, 0.15);
  --color-gray-bg:    rgba(107, 114, 128, 0.15);
}

/* ============================================================
   2. Reset & Base
   ============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  line-height: 1.6;
  transition: background-color var(--transition), color var(--transition);
  min-height: 100vh;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; }
a  { color: var(--color-gold); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul, ol { list-style: none; }

textarea.form-input {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  font-weight: 600;
}

/* ============================================================
   3. Typography
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-md); }
h6 { font-size: var(--font-size-base); }

.text-xs    { font-size: var(--font-size-xs); }
.text-sm    { font-size: var(--font-size-sm); }
.text-base  { font-size: var(--font-size-base); }
.text-lg    { font-size: var(--font-size-lg); }
.text-xl    { font-size: var(--font-size-xl); }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.font-bold  { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }

/* ============================================================
   4. Layout — App Shell
   ============================================================ */
#app-shell {
  display: none;
  min-height: 100vh;
}

#app-shell.visible {
  display: flex;
}

/* Sidebar */
#sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 200;
  transition: width var(--transition), transform var(--transition);
  overflow: hidden;
  box-shadow: 2px 0 20px rgba(0,0,0,0.15);
}

/* Main Content Area */
#main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  transition: margin-left var(--transition);
}

/* Header */
#top-header {
  height: var(--header-height);
  background: var(--bg-header);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

/* Page Content */
#page-content {
  flex: 1;
  padding: var(--space-6);
  overflow-y: auto;
}

/* ============================================================
   5. Sidebar Components
   ============================================================ */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.sidebar-brand-logo {
  width: 40px;
  height: 40px;
  border-radius: var(--border-radius);
  object-fit: contain;
  background: rgba(244,162,43,0.1);
  padding: 2px;
}

.sidebar-brand-text {
  display: flex;
  flex-direction: column;
}

.sidebar-brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: var(--font-size-sm);
  color: var(--color-gold);
  letter-spacing: 0.5px;
  line-height: 1.1;
  white-space: nowrap;
}

.sidebar-brand-sub {
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.4);
  white-space: nowrap;
}

/* Sidebar Navigation */
.sidebar-nav {
  flex: 1;
  padding: var(--space-3) 0;
  overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-section {
  padding: var(--space-3) var(--space-4) var(--space-1);
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255,255,255,0.3);
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin: 2px var(--space-2);
  border-radius: var(--border-radius);
  color: rgba(255,255,255,0.6);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  position: relative;
  border: none;
  background: none;
  width: calc(100% - var(--space-4));
  text-align: left;
}

.nav-item:hover {
  background: rgba(244,162,43,0.1);
  color: var(--color-gold-light);
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(244,162,43,0.2), rgba(224,123,20,0.15));
  color: var(--color-gold);
  font-weight: 600;
  border-left: 3px solid var(--color-gold);
  padding-left: calc(var(--space-4) - 3px);
}

.nav-item.active::before {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 60%;
  background: var(--color-gold);
  border-radius: 2px;
  opacity: 0.5;
}

.nav-icon {
  width: 20px;
  height: 20px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

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

/* Sidebar Footer */
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: var(--space-4);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.sidebar-user:hover { background: rgba(255,255,255,0.05); }

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-full);
  background: linear-gradient(135deg, var(--color-gold), var(--color-orange));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
  font-weight: 700;
  flex-shrink: 0;
}

.sidebar-user-info { min-width: 0; }
.sidebar-user-name {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.4);
}

/* ============================================================
   6. Header Components
   ============================================================ */
#header-menu-toggle {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-secondary);
  padding: var(--space-2);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-fast);
  display: none;
}

#header-menu-toggle:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.header-title {
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
}

.header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

/* Global Search */
.global-search {
  position: relative;
  display: flex;
  align-items: center;
}

.global-search-input {
  width: 260px;
  padding: var(--space-2) var(--space-3) var(--space-2) 36px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  outline: none;
}

.global-search-input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(244,162,43,0.15);
  width: 320px;
}

.global-search-input::placeholder { color: var(--text-muted); }

.global-search-icon {
  position: absolute;
  left: 10px;
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

/* Theme Toggle */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-full);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-fast);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--color-gold);
  border-color: var(--color-gold);
  transform: rotate(20deg);
}

/* Notification Bell */
.notif-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-full);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-fast);
  cursor: pointer;
  position: relative;
}

.notif-btn:hover {
  background: var(--color-gold);
  border-color: var(--color-gold);
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 16px;
  height: 16px;
  background: var(--color-danger);
  border-radius: var(--border-radius-full);
  font-size: 9px;
  font-weight: 700;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-header);
}

/* Sync button */
.sync-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-sm);
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.sync-btn:hover {
  background: var(--color-gold);
  border-color: var(--color-gold);
  color: white;
}

.sync-btn.syncing .sync-icon { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   7. Login Page
   ============================================================ */
#login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-navy) 0%, var(--color-navy-mid) 40%, #3D2080 100%);
  position: relative;
  overflow: hidden;
}

#login-page::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(244,162,43,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(107,63,160,0.15) 0%, transparent 50%),
    radial-gradient(ellipse at 60% 80%, rgba(224,123,20,0.06) 0%, transparent 50%);
  pointer-events: none;
}

/* Floating particles */
.login-particles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: rgba(244,162,43,0.2);
  border-radius: 50%;
  animation: float-particle 8s infinite ease-in-out;
}
.particle:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; animation-duration: 7s; }
.particle:nth-child(2) { top: 60%; left: 20%; animation-delay: 1s; animation-duration: 9s; width: 4px; height: 4px; }
.particle:nth-child(3) { top: 80%; left: 70%; animation-delay: 2s; animation-duration: 6s; width: 8px; height: 8px; }
.particle:nth-child(4) { top: 30%; left: 80%; animation-delay: 3s; animation-duration: 10s; width: 3px; height: 3px; }
.particle:nth-child(5) { top: 50%; left: 90%; animation-delay: 0.5s; animation-duration: 8s; }
.particle:nth-child(6) { top: 10%; left: 60%; animation-delay: 4s; animation-duration: 7s; width: 5px; height: 5px; }

@keyframes float-particle {
  0%, 100% { transform: translateY(0) rotate(0deg); opacity: 0.2; }
  50% { transform: translateY(-30px) rotate(180deg); opacity: 0.6; }
}

.login-card {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--border-radius-xl);
  padding: var(--space-10) var(--space-10);
  width: 100%;
  max-width: 420px;
  position: relative;
  z-index: 1;
  box-shadow: 0 30px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(244,162,43,0.1);
  animation: card-appear 0.6s ease-out;
}

@keyframes card-appear {
  from { opacity: 0; transform: translateY(30px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.login-mascot {
  text-align: center;
  margin-bottom: var(--space-6);
}

.login-mascot img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  filter: drop-shadow(0 10px 30px rgba(244,162,43,0.4));
  animation: mascot-float 3s ease-in-out infinite;
}

@keyframes mascot-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.login-brand {
  text-align: center;
  margin-bottom: var(--space-8);
}

.login-brand-name {
  font-family: var(--font-display);
  font-size: var(--font-size-2xl);
  font-weight: 800;
  background: linear-gradient(135deg, var(--color-gold), var(--color-orange-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  display: block;
}

.login-brand-sub {
  color: rgba(255,255,255,0.5);
  font-size: var(--font-size-sm);
  margin-top: var(--space-1);
}

.login-form { display: flex; flex-direction: column; gap: var(--space-4); }

.form-group { display: flex; flex-direction: column; gap: var(--space-2); }

.form-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: rgba(255,255,255,0.8);
}

.form-input {
  padding: var(--space-3) var(--space-4);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--border-radius);
  font-size: var(--font-size-base);
  color: white;
  transition: all var(--transition-fast);
  outline: none;
}

.form-input::placeholder { color: rgba(255,255,255,0.3); }

.form-input:focus {
  border-color: var(--color-gold);
  background: rgba(255,255,255,0.12);
  box-shadow: 0 0 0 3px rgba(244,162,43,0.2);
}

.form-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.form-input-wrapper .form-input { padding-right: 44px; flex: 1; }

.input-icon-btn {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition-fast);
}
.input-icon-btn:hover { color: var(--color-gold); }

.btn-login {
  margin-top: var(--space-2);
  padding: var(--space-4);
  background: linear-gradient(135deg, var(--color-gold), var(--color-orange));
  border: none;
  border-radius: var(--border-radius);
  font-size: var(--font-size-md);
  font-weight: 700;
  color: white;
  cursor: pointer;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
  letter-spacing: 0.5px;
}

.btn-login::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -60%;
  width: 60%;
  height: 200%;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.2), transparent);
  transform: skewX(-20deg);
  transition: left 0.5s ease;
}

.btn-login:hover::before { left: 120%; }

.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(244,162,43,0.5);
}

.btn-login:active { transform: translateY(0); }

.login-demo-note {
  text-align: center;
  margin-top: var(--space-4);
  padding: var(--space-3);
  background: rgba(244,162,43,0.1);
  border: 1px solid rgba(244,162,43,0.2);
  border-radius: var(--border-radius);
  font-size: var(--font-size-xs);
  color: rgba(255,255,255,0.6);
}

.login-demo-note strong { color: var(--color-gold); }

/* ============================================================
   8. Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: linear-gradient(135deg, var(--color-gold), var(--color-orange));
  color: white;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-gold);
}

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

.btn-success {
  background: linear-gradient(135deg, #16A34A, #22C55E);
  color: white;
}
.btn-success:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(34,197,94,0.4); }

.btn-danger {
  background: linear-gradient(135deg, #DC2626, #EF4444);
  color: white;
}
.btn-danger:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(239,68,68,0.4); }

.btn-warning {
  background: linear-gradient(135deg, #D97706, #F59E0B);
  color: white;
}
.btn-warning:hover { transform: translateY(-1px); }

.btn-whatsapp {
  background: linear-gradient(135deg, #128C7E, #25D366);
  color: white;
}
.btn-whatsapp:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(37,211,102,0.4); }

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

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--border-radius-sm);
}

.btn-sm {
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-xs);
  border-radius: var(--border-radius-sm);
}

.btn-lg {
  padding: var(--space-4) var(--space-6);
  font-size: var(--font-size-md);
  border-radius: var(--border-radius-lg);
}

.btn-full { width: 100%; }

/* FAB — Floating Action Button */
.fab {
  position: fixed;
  bottom: calc(var(--bottom-nav-height) + var(--space-4));
  right: var(--space-4);
  z-index: 150;
  width: 56px;
  height: 56px;
  border-radius: var(--border-radius-full);
  background: linear-gradient(135deg, var(--color-gold), var(--color-orange));
  border: none;
  color: white;
  font-size: 24px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(244,162,43,0.5);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.fab:hover { transform: scale(1.1) rotate(90deg); }
.fab:active { transform: scale(0.95); }

/* ============================================================
   9. Cards
   ============================================================ */
.card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5) var(--space-6);
  transition: all var(--transition-fast);
}

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

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-5);
  gap: var(--space-4);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
}

.card-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: 2px;
}

/* Metric Cards */
.metric-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--metric-color, var(--color-gold)), transparent);
}

.metric-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.metric-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--metric-bg, rgba(244,162,43,0.1));
}

.metric-value {
  font-family: var(--font-display);
  font-size: var(--font-size-3xl);
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.metric-label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  font-weight: 500;
}

.metric-change {
  font-size: var(--font-size-xs);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 3px;
}
.metric-change.up { color: var(--color-success); }
.metric-change.down { color: var(--color-danger); }

/* ============================================================
   10. Badges & Status
   ============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 700;
  white-space: nowrap;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge-success { background: var(--color-success-bg); color: #15803D; }
[data-theme="dark"] .badge-success { color: #4ADE80; }

.badge-danger  { background: var(--color-danger-bg);  color: #B91C1C; }
[data-theme="dark"] .badge-danger { color: #F87171; }

.badge-warning { background: var(--color-warning-bg); color: #B45309; }
[data-theme="dark"] .badge-warning { color: #FCD34D; }

.badge-info    { background: var(--color-info-bg);    color: #1D4ED8; }
[data-theme="dark"] .badge-info { color: #93C5FD; }

.badge-gray    { background: var(--color-gray-bg);    color: #374151; }
[data-theme="dark"] .badge-gray { color: #D1D5DB; }

.badge-gold    {
  background: rgba(244,162,43,0.15);
  color: var(--color-gold-dark);
}
[data-theme="dark"] .badge-gold { color: var(--color-gold); }

/* Status indicators */
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: var(--space-2);
}
.status-dot.activo   { background: var(--color-success); animation: pulse-green 2s infinite; }
.status-dot.vencido  { background: var(--color-danger); }
.status-dot.por-vencer { background: var(--color-warning); animation: pulse-yellow 2s infinite; }
.status-dot.inactivo { background: var(--color-gray); }

@keyframes pulse-green {
  0%, 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
  50% { box-shadow: 0 0 0 4px rgba(34,197,94,0); }
}
@keyframes pulse-yellow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245,158,11,0.4); }
  50% { box-shadow: 0 0 0 4px rgba(245,158,11,0); }
}

/* ============================================================
   11. Tables
   ============================================================ */
.table-container {
  overflow-x: auto;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  background: var(--bg-card);
}

.table-container::-webkit-scrollbar { height: 6px; }
.table-container::-webkit-scrollbar-track { background: var(--bg-tertiary); }
.table-container::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }

table {
  width: 100%;
  border-collapse: collapse;
}

thead tr {
  background: var(--bg-primary);
  border-bottom: 2px solid var(--border-color);
}

th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
}

td {
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

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

tbody tr:hover { background: var(--bg-primary); }
tbody tr:last-child td { border-bottom: none; }

/* Table row status colors */
tbody tr.row-danger  { background: rgba(239,68,68,0.04); }
tbody tr.row-warning { background: rgba(245,158,11,0.04); }
tbody tr.row-success { background: rgba(34,197,94,0.04); }

[data-theme="dark"] tbody tr.row-danger  { background: rgba(239,68,68,0.08); }
[data-theme="dark"] tbody tr.row-warning { background: rgba(245,158,11,0.08); }
[data-theme="dark"] tbody tr.row-success { background: rgba(34,197,94,0.08); }

/* Table Actions */
.table-actions {
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

/* ============================================================
   12. Forms
   ============================================================ */
.app-form { display: flex; flex-direction: column; gap: var(--space-4); }

.form-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.form-row.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-row.cols-1 { grid-template-columns: 1fr; }
.form-col-full   { grid-column: 1 / -1; }

.app-form .form-group { display: flex; flex-direction: column; gap: var(--space-2); }

.app-form .form-label {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
}

.form-label .required { color: var(--color-danger); margin-left: 2px; }

.app-form .form-input,
.app-form .form-select,
.app-form .form-textarea {
  padding: var(--space-3) var(--space-4);
  background: var(--bg-primary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  outline: none;
}

.app-form .form-input:focus,
.app-form .form-select:focus,
.app-form .form-textarea:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(244,162,43,0.15);
  background: var(--bg-secondary);
}

.app-form .form-input.error { border-color: var(--color-danger); }
.app-form .form-input.error:focus { box-shadow: 0 0 0 3px rgba(239,68,68,0.15); }

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

.form-select {
  cursor: pointer;
}

.form-hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.form-error {
  font-size: var(--font-size-xs);
  color: var(--color-danger);
  font-weight: 600;
  margin-top: 2px;
  display: none;
}

.form-error.visible { display: block; }

/* Password field */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}
.password-field .form-input { padding-right: 44px; width: 100%; }
.password-toggle {
  position: absolute;
  right: 12px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  transition: color var(--transition-fast);
}
.password-toggle:hover { color: var(--color-gold); }

/* ============================================================
   13. Modals
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  backdrop-filter: blur(4px);
}

.modal-overlay.visible {
  display: flex;
  animation: overlay-in 0.2s ease;
}

@keyframes overlay-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.modal {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-xl);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: modal-in 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-sm { max-width: 420px; }
.modal-lg { max-width: 800px; }
.modal-xl { max-width: 1000px; }

@keyframes modal-in {
  from { opacity: 0; transform: scale(0.9) translateY(-20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.modal-title {
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  font-weight: 700;
}

.modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-sm);
  background: var(--bg-tertiary);
  border: none;
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--color-danger-bg); color: var(--color-danger); }

.modal-body {
  padding: var(--space-6);
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

/* ============================================================
   14. Toast Notifications
   ============================================================ */
.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: var(--border-radius-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  min-width: 280px;
  max-width: 380px;
  pointer-events: all;
  animation: toast-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  position: relative;
  overflow: hidden;
}

.toast.removing {
  animation: toast-out 0.3s ease-in forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(100%) scale(0.8); }
  to   { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateX(0); max-height: 100px; }
  to   { opacity: 0; transform: translateX(100%); max-height: 0; padding: 0; }
}

.toast::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--toast-color);
  animation: toast-progress var(--toast-duration, 4s) linear forwards;
}

@keyframes toast-progress {
  from { width: 100%; }
  to   { width: 0%; }
}

.toast-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.toast-content { flex: 1; min-width: 0; }
.toast-title {
  font-size: var(--font-size-sm);
  font-weight: 700;
  margin-bottom: 2px;
}
.toast-message {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.toast-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px;
  flex-shrink: 0;
  transition: color var(--transition-fast);
}
.toast-close:hover { color: var(--text-primary); }

.toast.success { --toast-color: var(--color-success); border-left: 4px solid var(--color-success); }
.toast.error   { --toast-color: var(--color-danger);  border-left: 4px solid var(--color-danger); }
.toast.warning { --toast-color: var(--color-warning); border-left: 4px solid var(--color-warning); }
.toast.info    { --toast-color: var(--color-info);    border-left: 4px solid var(--color-info); }

/* ============================================================
   15. Search & Filters
   ============================================================ */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
}

.search-input {
  width: 100%;
  padding: var(--space-3) var(--space-3) var(--space-3) 38px;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  outline: none;
}

.search-input:focus {
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(244,162,43,0.15);
}

.search-input::placeholder { color: var(--text-muted); }

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
}

.filter-select {
  padding: var(--space-2) var(--space-3);
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-color);
  border-radius: var(--border-radius);
  font-size: var(--font-size-sm);
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: border-color var(--transition-fast);
}
.filter-select:focus { border-color: var(--color-gold); }

/* ============================================================
   16. Dashboard Grid
   ============================================================ */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.dashboard-row {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-6);
  margin-bottom: var(--space-6);
}

/* ============================================================
   17. Empty States
   ============================================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-12) var(--space-6);
  text-align: center;
  gap: var(--space-4);
}

.empty-state img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  opacity: 0.8;
}

.empty-state-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-secondary);
}

.empty-state-text {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  max-width: 320px;
}

/* ============================================================
   18. Skeleton Loaders
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--bg-primary) 50%, var(--bg-tertiary) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: var(--border-radius);
}

@keyframes skeleton-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

.skeleton-text { height: 14px; margin-bottom: 8px; }
.skeleton-text:last-child { width: 70%; }
.skeleton-card { height: 120px; }
.skeleton-row  { height: 50px; margin-bottom: 4px; }

/* ============================================================
   19. Tabs
   ============================================================ */
.tabs {
  display: flex;
  gap: 2px;
  background: var(--bg-primary);
  padding: 4px;
  border-radius: var(--border-radius);
  flex-wrap: wrap;
}

.tab {
  padding: var(--space-2) var(--space-4);
  border-radius: calc(var(--border-radius) - 2px);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border: none;
  background: transparent;
  transition: all var(--transition-fast);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.tab:hover { color: var(--text-primary); background: var(--bg-secondary); }

.tab.active {
  background: var(--bg-secondary);
  color: var(--color-gold);
  box-shadow: var(--shadow-sm);
}

.tab-count {
  background: var(--bg-primary);
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: var(--border-radius-full);
}
.tab.active .tab-count {
  background: rgba(244,162,43,0.15);
  color: var(--color-gold);
}

/* ============================================================
   20. Section Page Headers
   ============================================================ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
  flex-wrap: wrap;
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--font-size-2xl);
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.page-title-icon {
  font-size: 28px;
}

.page-subtitle {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* ============================================================
   21. Account Cards (Cuentas view)
   ============================================================ */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-5);
}

.account-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 2px solid var(--border-color);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.account-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.account-card.vencido   { border-color: rgba(239,68,68,0.4);  background: rgba(239,68,68,0.02); }
.account-card.lleno     { border-color: rgba(245,158,11,0.4); background: rgba(245,158,11,0.02); }
.account-card.por-vencer { border-color: rgba(245,158,11,0.4); }
.account-card.activo    { border-color: rgba(34,197,94,0.3); }

.account-service-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(244,162,43,0.1);
  border: 1px solid rgba(244,162,43,0.2);
  border-radius: var(--border-radius);
  padding: var(--space-1) var(--space-3);
  font-size: var(--font-size-xs);
  font-weight: 700;
  color: var(--color-gold-dark);
}
[data-theme="dark"] .account-service-badge { color: var(--color-gold); }

.account-name {
  font-size: var(--font-size-md);
  font-weight: 700;
  color: var(--text-primary);
}

.account-credential {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

.credential-value {
  font-family: monospace;
  background: var(--bg-primary);
  padding: 2px 8px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
}

/* Profile slots */
.profile-slots {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.profile-slot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px dashed var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  transition: all var(--transition-fast);
}

.profile-slot.used {
  background: linear-gradient(135deg, var(--color-gold), var(--color-orange));
  border-color: var(--color-gold);
  color: white;
  font-weight: 700;
  border-style: solid;
}

.profile-slot.empty {
  color: var(--text-muted);
}

/* ============================================================
   22. Vencimientos — Urgency Rows
   ============================================================ */
.urgency-vencido   { --urgency-color: var(--color-danger); }
.urgency-hoy       { --urgency-color: var(--color-orange); }
.urgency-manana    { --urgency-color: var(--color-warning); }
.urgency-pronto    { --urgency-color: #EAB308; }
.urgency-activo    { --urgency-color: var(--color-success); }

.dias-restantes {
  font-weight: 700;
  color: var(--urgency-color, var(--text-primary));
  font-size: var(--font-size-sm);
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   23. Charts
   ============================================================ */
.chart-wrapper {
  position: relative;
  width: 100%;
}

.chart-wrapper canvas {
  max-width: 100%;
}

/* ============================================================
   24. WhatsApp Section
   ============================================================ */
.whatsapp-template-card {
  background: var(--bg-card);
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: all var(--transition-fast);
}
.whatsapp-template-card:hover { border-color: #25D366; }

.whatsapp-preview {
  background: #DCF8C6;
  border-radius: 12px 12px 12px 0;
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm);
  color: #1A1A1A;
  line-height: 1.5;
  position: relative;
}

[data-theme="dark"] .whatsapp-preview {
  background: #1F4A1F;
  color: #E0F0E0;
}

.whatsapp-preview::before {
  content: '';
  position: absolute;
  bottom: -8px;
  left: -1px;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 8px 8px 0 0;
  border-color: #DCF8C6 transparent transparent transparent;
}
[data-theme="dark"] .whatsapp-preview::before {
  border-color: #1F4A1F transparent transparent transparent;
}

/* ============================================================
   25. Alert Banner (Dashboard Urgency)
   ============================================================ */
.alert-banner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-6);
  border-radius: var(--border-radius-lg);
  border: 1px solid;
  margin-bottom: var(--space-6);
  animation: alert-pulse 2s infinite;
}

.alert-banner.danger {
  background: var(--color-danger-bg);
  border-color: rgba(239,68,68,0.3);
  color: #B91C1C;
}
[data-theme="dark"] .alert-banner.danger { color: #F87171; }

.alert-banner.warning {
  background: var(--color-warning-bg);
  border-color: rgba(245,158,11,0.3);
  color: #B45309;
}
[data-theme="dark"] .alert-banner.warning { color: #FCD34D; }

@keyframes alert-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
  50% { box-shadow: 0 0 0 4px rgba(239,68,68,0.1); }
}

.alert-banner-icon { font-size: 24px; flex-shrink: 0; }
.alert-banner-text { flex: 1; }
.alert-banner-title { font-weight: 700; font-size: var(--font-size-md); }
.alert-banner-sub   { font-size: var(--font-size-sm); opacity: 0.8; margin-top: 2px; }

/* ============================================================
   26. Mobile — Bottom Navigation
   ============================================================ */
#bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--bottom-nav-height);
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  z-index: 200;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
  padding: 0 var(--space-2);
}

.bottom-nav-items {
  display: flex;
  height: 100%;
  align-items: center;
  justify-content: space-around;
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: var(--space-2);
  cursor: pointer;
  border-radius: var(--border-radius);
  background: none;
  border: none;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  min-width: 52px;
}

.bottom-nav-item:hover, .bottom-nav-item.active {
  color: var(--color-gold);
}

.bottom-nav-item.active {
  background: rgba(244,162,43,0.08);
}

.bottom-nav-icon { font-size: 20px; }
.bottom-nav-label { font-size: 10px; font-weight: 600; }

/* ============================================================
   27. Mobile Sidebar Overlay
   ============================================================ */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 190;
  backdrop-filter: blur(2px);
}

/* ============================================================
   28. Utility Classes
   ============================================================ */
.flex      { display: flex; }
.flex-col  { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center  { justify-content: center; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.mb-2  { margin-bottom: var(--space-2); }
.mb-4  { margin-bottom: var(--space-4); }
.mb-6  { margin-bottom: var(--space-6); }
.mt-4  { margin-top: var(--space-4); }
.mt-6  { margin-top: var(--space-6); }
.p-4   { padding: var(--space-4); }
.w-full { width: 100%; }
.hidden { display: none !important; }
.visible { display: block; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.overflow-hidden { overflow: hidden; }
.truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ============================================================
   29. Scroll Styles
   ============================================================ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   30. RESPONSIVE BREAKPOINTS
   ============================================================ */
@media (max-width: 1024px) {
  .dashboard-row { grid-template-columns: 1fr; }
  .form-row.cols-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  #sidebar { transform: translateX(-100%); }
  #sidebar.open { transform: translateX(0); }
  #sidebar-overlay.visible { display: block; }

  #main-content { margin-left: 0; }
  #top-header { padding: 0 var(--space-4); }
  #header-menu-toggle { display: flex; }

  .global-search { display: none; }
  .sync-btn span { display: none; }
  .sync-btn { padding: var(--space-2); width: 36px; justify-content: center; }

  #bottom-nav { display: flex; }
  #page-content {
    padding: var(--space-4);
    padding-bottom: calc(var(--bottom-nav-height) + var(--space-4));
  }

  .fab { display: flex; }

  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
  .accounts-grid  { grid-template-columns: 1fr; }
  .form-row       { grid-template-columns: 1fr; }
  .form-row.cols-3 { grid-template-columns: 1fr; }

  .page-header { flex-direction: column; align-items: flex-start; }
  .search-bar  { flex-direction: column; }
  .search-input-wrapper { min-width: 100%; }

  .modal { max-width: 100%; border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }

  /* Mobile Table → Cards */
  .mobile-cards table,
  .mobile-cards thead,
  .mobile-cards tbody,
  .mobile-cards th,
  .mobile-cards td,
  .mobile-cards tr { display: block; }

  .mobile-cards thead tr { display: none; }

  .mobile-cards tbody tr {
    margin-bottom: var(--space-3);
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid var(--border-color);
    padding: var(--space-4);
    box-shadow: var(--shadow-sm);
  }

  .mobile-cards td {
    border: none;
    padding: var(--space-1) 0;
    font-size: var(--font-size-sm);
    display: flex;
    align-items: center;
    gap: var(--space-2);
  }

  .mobile-cards td::before {
    content: attr(data-label);
    font-weight: 700;
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 80px;
    flex-shrink: 0;
  }

  .mobile-cards .table-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    margin-top: var(--space-2);
    padding-top: var(--space-2);
    border-top: 1px solid var(--border-color);
  }

  .mobile-cards .table-actions::before { display: none; }
}

@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .metric-card { padding: var(--space-4); }
  .metric-value { font-size: var(--font-size-2xl); }

  .btn-lg { padding: var(--space-3) var(--space-5); font-size: var(--font-size-base); }

  .toast-container { left: var(--space-2); right: var(--space-2); }
  .toast { min-width: auto; max-width: 100%; }
}

/* ============================================================
   31. Animations & Micro-interactions
   ============================================================ */
@keyframes fade-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-in { animation: fade-in 0.3s ease forwards; }

@keyframes slide-in-right {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}
.slide-in { animation: slide-in-right 0.3s ease forwards; }

/* Page transition */
.page-view {
  animation: fade-in 0.25s ease;
}

/* ============================================================
   32. Print Styles (basic)
   ============================================================ */
@media print {
  #sidebar, #top-header, #bottom-nav, .fab,
  .btn-primary, .btn-whatsapp, .toast-container { display: none !important; }
  #main-content { margin-left: 0 !important; }
}

/* ============================================================
   33. Extra — Missing component styles
   ============================================================ */

/* Urgency classes for table rows and cells */
.urgency-vencido  { color: var(--color-danger) !important; font-weight: 700; }
.urgency-hoy      { color: var(--color-danger) !important; font-weight: 700; }
.urgency-manana   { color: var(--color-warning) !important; font-weight: 700; }
.urgency-pronto   { color: var(--color-warning) !important; }
.urgency-activo   { color: var(--color-success); }

.dias-restantes   { font-size: 12px; font-weight: 700; white-space: nowrap; }

/* Danger and warning row highlights */
.row-danger { background: rgba(239, 68, 68, 0.04) !important; }
.row-danger:hover { background: rgba(239, 68, 68, 0.08) !important; }
.row-warning { background: rgba(245, 158, 11, 0.04) !important; }
.row-warning:hover { background: rgba(245, 158, 11, 0.08) !important; }

/* Password field — used inside modal forms */
.password-field {
  position: relative;
  display: flex;
  align-items: center;
}
.password-field .form-input { padding-right: 44px; }
.password-toggle {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition-fast);
  padding: 4px;
}
.password-toggle:hover { color: var(--color-gold); }

/* 3-column form row */
.form-row.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Form hint text */
.form-hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: var(--space-1);
}

/* Required field marker */
.required { color: var(--color-danger); }

/* Form error message */
.form-error {
  font-size: var(--font-size-xs);
  color: var(--color-danger);
  display: none;
}
.form-error.visible { display: block; }
.form-input.error {
  border-color: var(--color-danger);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15);
}

/* Dashboard layout: cards grid + sidebar */
.dashboard-row {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: var(--space-6);
  margin-top: var(--space-6);
}
@media (max-width: 1024px) {
  .dashboard-row { grid-template-columns: 1fr; }
}

/* Chart canvas wrapper */
.chart-wrapper {
  position: relative;
  width: 100%;
}

/* Accounts grid */
.accounts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--space-5);
}

/* Account card */
.account-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: all var(--transition);
  box-shadow: var(--shadow-sm);
}
.account-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.account-card.vencido { border-color: rgba(239, 68, 68, 0.4); }
.account-card.lleno   { border-color: rgba(245, 158, 11, 0.4); }
.account-card.activo  { border-color: rgba(34, 197, 94, 0.2); }

.account-name {
  font-family: var(--font-display);
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
}
.account-service-badge {
  font-size: var(--font-size-xs);
  font-weight: 600;
  padding: 3px 10px;
  background: rgba(244, 162, 43, 0.12);
  color: var(--color-gold);
  border-radius: var(--border-radius-full);
}
.account-credential {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  gap: var(--space-2);
}
.profile-slots {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.profile-slot {
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  transition: all var(--transition-fast);
}
.profile-slot.used {
  background: rgba(34, 197, 94, 0.15);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.profile-slot.empty {
  background: var(--bg-primary);
  color: var(--text-muted);
  border: 2px dashed var(--border-color);
}
.profile-slot.empty:hover {
  border-color: var(--color-gold);
  color: var(--color-gold);
  cursor: pointer;
}

/* Tabs component */
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0;
  margin-bottom: 0;
}
.tab {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-bottom: -2px;
  white-space: nowrap;
}
.tab:hover { color: var(--color-gold); }
.tab.active {
  color: var(--color-gold);
  border-bottom-color: var(--color-gold);
}
.tab-count {
  font-size: 10px;
  padding: 1px 6px;
  background: var(--bg-primary);
  border-radius: var(--border-radius-full);
  font-weight: 700;
}
.tab.active .tab-count {
  background: rgba(244, 162, 43, 0.15);
  color: var(--color-gold);
}

/* Alert Banner */
.alert-banner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4) var(--space-5);
  border-radius: var(--border-radius-lg);
  margin-bottom: var(--space-6);
  animation: fade-in 0.3s ease;
}
.alert-banner.danger {
  background: var(--color-danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
}
.alert-banner.warning {
  background: var(--color-warning-bg);
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.alert-banner-icon { font-size: 24px; flex-shrink: 0; }
.alert-banner-title {
  font-weight: 700;
  color: var(--color-danger);
  font-size: var(--font-size-sm);
}
.alert-banner.warning .alert-banner-title { color: var(--color-warning); }
.alert-banner-sub {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

/* WhatsApp template cards */
.whatsapp-template-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-5);
  transition: all var(--transition-fast);
}
.whatsapp-template-card:hover {
  border-color: #25D366;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.1);
}

/* App form inside modals (override dark login styles) */
#main-content .app-form .form-label,
.modal .app-form .form-label {
  color: var(--text-secondary);
}
#main-content .app-form .form-input,
.modal .app-form .form-input,
#main-content .app-form .form-select,
.modal .app-form .form-select {
  background: var(--bg-primary);
  border-color: var(--border-color);
  color: var(--text-primary);
}
#main-content .app-form .form-input::placeholder,
.modal .app-form .form-input::placeholder {
  color: var(--text-muted);
}
#main-content .app-form .form-input:focus,
.modal .app-form .form-input:focus {
  background: var(--bg-secondary);
  border-color: var(--color-gold);
  box-shadow: 0 0 0 3px rgba(244, 162, 43, 0.15);
}

/* mt-4 utility */
.mt-4 { margin-top: var(--space-4); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mt-2 { margin-top: var(--space-2); }

/* .btn-full */
.btn-full { width: 100%; }

/* btn-lg */
.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--font-size-md);
}

/* App form inside card */
.card .app-form { display: flex; flex-direction: column; gap: var(--space-4); }

/* badge-info color */
.badge-info {
  background: var(--color-info-bg);
  color: var(--color-info);
}

/* Text center */
.text-center { text-align: center; }

/* flex utilities */
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* sidebar-overlay */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg-overlay);
  z-index: 199;
  backdrop-filter: blur(4px);
}
#sidebar-overlay.visible { display: block; }
