/* ── Fonts: Google Fonts con fallback offline ── */
@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,300;1,400&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,300&display=swap');

/* ═══════════════════════════════════════════════════════════
   ZENTORIX — SISTEMA DE DISEÑO UNIVERSAL
   Multi-industria: Restaurantes · Hoteles · Bares · Retail
   Paleta base: Grises + Azul Marino + Beige/Arena
   Versión: 1.0
═══════════════════════════════════════════════════════════ */

:root {
  /* ── Grises ── */
  --gray-50:  #F7F6F4;
  --gray-100: #EEECE9;
  --gray-150: #E4E1DC;
  --gray-200: #D3CFC9;
  --gray-300: #B5B0A8;
  --gray-400: #8F8A82;
  --gray-500: #6B6660;
  --gray-600: #4D4944;
  --gray-700: #33302C;
  --gray-800: #1E1C19;
  --gray-900: #0E0D0B;

  /* ── Azules ── */
  --blue-50:  #EDF3F9;
  --blue-100: #C9DFF0;
  --blue-200: #93BDE0;
  --blue-300: #5697C8;
  --blue-400: #2B73AB;
  --blue-500: #1A5487;
  --blue-600: #0F3D67;
  --blue-700: #072A4A;
  --blue-800: #031B30;

  /* ── Beige / Arena ── */
  --beige-50:  #FDFBF7;
  --beige-100: #F6F1E7;
  --beige-200: #EAE0CC;
  --beige-300: #D5C5A3;
  --beige-400: #BCA87A;
  --beige-500: #9E8C5C;
  --beige-600: #7D6E43;

  /* ── Semánticos ── */
  --success:    #2E7D5E;
  --success-bg: #EAF5EF;
  --warning:    #92600A;
  --warning-bg: #FEF3E0;
  --danger:     #8B2323;
  --danger-bg:  #FCEAEA;
  --info:       #1A5487;
  --info-bg:    #EDF3F9;

  /* ── UI Base ── */
  --bg-base:    var(--gray-50);
  --bg-surface: #FFFFFF;
  --bg-raised:  var(--beige-50);
  --border:     var(--gray-150);
  --border-strong: var(--gray-200);
  --text-primary:   var(--gray-800);
  --text-secondary: var(--gray-500);
  --text-muted:     var(--gray-400);
  --text-on-dark:   #FFFFFF;
  --accent:         var(--blue-500);
  --accent-hover:   var(--blue-600);
  --accent-light:   var(--blue-50);

  /* ── Industria (override por JS) ── */
  --ind-accent:       var(--blue-500);
  --ind-accent-dark:  var(--blue-600);
  --ind-light:        var(--blue-50);
  --ind-text:         var(--blue-500);

  /* ── Sidebar ── */
  --sidebar-bg:           var(--gray-800);
  --sidebar-hover:        var(--gray-700);
  --sidebar-active:       var(--ind-accent, var(--blue-600));
  --sidebar-text:         var(--gray-300);
  --sidebar-text-active:  #FFFFFF;
  --sidebar-width:        260px;
  --sidebar-collapsed:    64px;

  /* ── Espaciado ── */
  --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;

  /* ── Radios ── */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-full: 9999px;

  /* ── Sombras ── */
  --shadow-sm: 0 1px 3px rgba(14,13,11,0.06), 0 1px 2px rgba(14,13,11,0.04);
  --shadow-md: 0 4px 12px rgba(14,13,11,0.08), 0 2px 6px rgba(14,13,11,0.05);
  --shadow-lg: 0 8px 24px rgba(14,13,11,0.10), 0 4px 10px rgba(14,13,11,0.06);
  --shadow-xl: 0 16px 40px rgba(14,13,11,0.14), 0 8px 20px rgba(14,13,11,0.08);

  /* ── Tipografía ── */
  --font-display: 'Cormorant Garamond', 'Palatino Linotype', 'Book Antiqua', Palatino, Georgia, serif;
  --font-body:    'DM Sans', 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  --font-mono:    'Courier New', 'Consolas', monospace;

  /* ── Transiciones ── */
  --transition-fast: 120ms ease;
  --transition-base: 200ms ease;
  --transition-slow: 350ms ease;
}

/* ── Temas por industria ── */
[data-industry="restaurante"] { --ind-accent:#B5352A; --ind-accent-dark:#8B2520; --ind-light:#FDECEA; --ind-text:#B5352A; }
[data-industry="hotel"]       { --ind-accent:#6B4FA0; --ind-accent-dark:#52387A; --ind-light:#F2EDF9; --ind-text:#6B4FA0; }
[data-industry="bar"]         { --ind-accent:#B5612A; --ind-accent-dark:#8A491F; --ind-light:#FEF0E6; --ind-text:#B5612A; }
[data-industry="abarrotes"]   { --ind-accent:#2A7A4B; --ind-accent-dark:#1E5E39; --ind-light:#EAF5EF; --ind-text:#2A7A4B; }
[data-industry="ferreteria"]  { --ind-accent:#1A5487; --ind-accent-dark:#0F3D67; --ind-light:#EDF3F9; --ind-text:#1A5487; }
[data-industry="gimnasio"]    { --ind-accent:#8B2323; --ind-accent-dark:#6B1A1A; --ind-light:#FCEAEA; --ind-text:#8B2323; }
[data-industry="farmacia"]    { --ind-accent:#147D68; --ind-accent-dark:#0D5E4F; --ind-light:#E4F5F2; --ind-text:#147D68; }
[data-industry="boutique"]    { --ind-accent:#8C4A2F; --ind-accent-dark:#6A3822; --ind-light:#F7EDE8; --ind-text:#8C4A2F; }

/* ═══ RESET ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-base);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
a { color: var(--accent); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--accent-hover); }
button { cursor: pointer; font-family: var(--font-body); }
input, select, textarea { font-family: var(--font-body); }
img { max-width: 100%; height: auto; }
::selection { background: var(--ind-light); color: var(--ind-text); }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ═══ LAYOUT ═══ */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width);
  min-height: 100vh;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0; top: 0; bottom: 0;
  z-index: 100;
  transition: width var(--transition-slow);
  overflow: hidden;
}
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-left var(--transition-slow);
}
.main-content.sidebar-collapsed { margin-left: var(--sidebar-collapsed); }

/* ── Sidebar Brand ── */
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-5) var(--space-4) var(--space-4);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  min-height: 64px;
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-brand-mark {
  width: 36px; height: 36px;
  background: var(--ind-accent, var(--blue-500));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: 18px; font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  transition: background var(--transition-base);
}
.sidebar-brand-text { overflow: hidden; }
.sidebar-brand-name {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 500;
  color: #fff;
  line-height: 1.2;
}
.sidebar-brand-sub {
  font-size: 10px;
  color: var(--gray-400);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 170px;
}
.sidebar-toggle {
  margin-left: auto;
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--gray-400);
  padding: 4px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: color var(--transition-fast);
}
.sidebar-toggle:hover { color: #fff; }

/* ── Sidebar Nav ── */
.sidebar-nav { flex: 1; overflow-y: auto; padding: var(--space-3) 0; }
.sidebar-section-label {
  padding: var(--space-4) var(--space-4) var(--space-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--gray-500);
  white-space: nowrap;
  overflow: hidden;
}
.collapsed .sidebar-section-label { opacity: 0; }
.sidebar-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  color: var(--sidebar-text);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  border-radius: 0;
  transition: background var(--transition-fast), color var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
  position: relative;
  cursor: pointer;
}
.sidebar-item:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-item.active {
  background: var(--ind-accent, var(--sidebar-active));
  color: var(--sidebar-text-active);
  font-weight: 500;
}
.sidebar-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: rgba(255,255,255,0.5);
}
.sidebar-icon {
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.sidebar-icon svg { width: 16px; height: 16px; }
.sidebar-label { overflow: hidden; text-overflow: ellipsis; }
.sidebar-badge {
  margin-left: auto;
  background: var(--ind-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}
.collapsed .sidebar-label,
.collapsed .sidebar-badge,
.collapsed .sidebar-section-label { display: none; }

/* ── Sidebar Footer ── */
.sidebar-footer {
  padding: var(--space-4);
  border-top: 1px solid rgba(255,255,255,0.07);
}
.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-user:hover { background: var(--sidebar-hover); }
.sidebar-avatar {
  width: 32px; height: 32px;
  background: var(--ind-accent, var(--blue-500));
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
  color: #fff;
  flex-shrink: 0;
}
.sidebar-user-info { overflow: hidden; }
.sidebar-user-name {
  font-size: 13px; font-weight: 500;
  color: #fff;
  overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px;
  color: var(--gray-400);
  overflow: hidden; text-overflow: ellipsis;
}
.collapsed .sidebar-user-info { display: none; }

/* Botón Salir */
.sidebar-logout-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  margin-top: 6px;
  padding: 7px var(--space-2);
  border-radius: var(--radius-md);
  border: 1px solid rgba(239,68,68,0.25);
  background: rgba(239,68,68,0.08);
  color: #FCA5A5;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  overflow: hidden;
}
.sidebar-logout-btn:hover {
  background: rgba(239,68,68,0.18);
  border-color: rgba(239,68,68,0.5);
  color: #FEE2E2;
}
.sidebar-logout-btn svg { flex-shrink: 0; }
.collapsed .sidebar-logout-btn .logout-label { display: none; }
.collapsed .sidebar-logout-btn { justify-content: center; padding: 7px; }

/* ═══ TOPBAR ═══ */
.topbar {
  height: 56px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--space-6);
  gap: var(--space-4);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
}
.topbar-breadcrumb-sep { color: var(--gray-300); }
.topbar-breadcrumb-current { color: var(--text-primary); font-weight: 500; }
.topbar-right { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.topbar-company {
  font-size: 12px;
  color: var(--text-secondary);
  padding: var(--space-1) var(--space-3);
  background: var(--bg-base);
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
}
.topbar-divider { width: 1px; height: 20px; background: var(--border); }
.topbar-btn {
  width: 32px; height: 32px;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  position: relative;
}
.topbar-btn:hover { background: var(--bg-base); color: var(--text-primary); border-color: var(--border-strong); }
.topbar-notif-dot {
  position: absolute;
  top: 6px; right: 6px;
  width: 6px; height: 6px;
  background: var(--danger);
  border-radius: 50%;
  border: 1.5px solid var(--bg-surface);
}
.topbar-avatar {
  font-size: 11px; font-weight: 600;
  background: var(--ind-light, var(--blue-50));
  color: var(--ind-text, var(--blue-600));
  border-color: transparent;
}

/* ═══ PAGE ═══ */
.page-body { padding: var(--space-6); flex: 1; }
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-6);
  gap: var(--space-4);
  flex-wrap: wrap;
}
.page-title-group { display: flex; flex-direction: column; gap: var(--space-1); }
.page-module-tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--ind-text, var(--accent));
  margin-bottom: var(--space-1);
}
.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-primary);
}
.page-subtitle { font-size: 13px; color: var(--text-secondary); }
.page-actions { display: flex; align-items: center; gap: var(--space-2); flex-wrap: wrap; }

/* ═══ CARDS ═══ */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.card-header {
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.card-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}
.card-subtitle { font-size: 12px; color: var(--text-secondary); margin-top: 1px; }
.card-body { padding: var(--space-5); }
.card-body.p-0 { padding: 0; }
.card-footer {
  padding: var(--space-4) var(--space-5);
  border-top: 1px solid var(--border);
  background: var(--bg-base);
}

/* ═══ KPI GRID ═══ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}
.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
  cursor: default;
}
.kpi-card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.kpi-icon {
  width: 36px; height: 36px;
  background: var(--kpi-bg, var(--ind-light, var(--blue-50)));
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  margin-bottom: var(--space-3);
}
.kpi-label { font-size: 11px; color: var(--text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: 0.4px; }
.kpi-value { font-family: var(--font-display); font-size: 26px; font-weight: 500; color: var(--text-primary); line-height: 1.2; margin: var(--space-1) 0; }
.kpi-delta { font-size: 11px; font-weight: 500; }
.kpi-delta.up { color: var(--success); }
.kpi-delta.down { color: var(--danger); }
.kpi-delta.neutral { color: var(--text-muted); }

/* ═══ BUTTONS ═══ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  text-decoration: none;
}
.btn svg { width: 14px; height: 14px; }
.btn-primary {
  background: var(--ind-accent, var(--accent));
  color: #fff;
  border-color: var(--ind-accent, var(--accent));
}
.btn-primary:hover {
  background: var(--ind-accent-dark, var(--accent-hover));
  border-color: var(--ind-accent-dark, var(--accent-hover));
  color: #fff;
}
.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}
.btn-secondary:hover { background: var(--bg-base); border-color: var(--gray-300); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
}
.btn-ghost:hover { background: var(--bg-base); color: var(--text-primary); }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #6B1A1A; border-color: #6B1A1A; color: #fff; }
.btn-sm { padding: 5px 12px; font-size: 12px; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-icon { padding: 8px; width: 34px; height: 34px; justify-content: center; }
.btn-icon.btn-sm { width: 28px; height: 28px; padding: 4px; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ═══ FORMS ═══ */
.form-group { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-4); }
.form-label {
  font-size: 12px; font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.form-control {
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  width: 100%;
}
.form-control:focus {
  outline: none;
  border-color: var(--ind-accent, var(--accent));
  box-shadow: 0 0 0 3px var(--ind-light, var(--blue-50));
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:disabled { background: var(--bg-base); color: var(--text-secondary); }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 80px; }
.form-hint { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.form-error { font-size: 11px; color: var(--danger); margin-top: 3px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-4); }

/* ═══ TABLES ═══ */
.table-wrapper { overflow-x: auto; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table thead tr {
  border-bottom: 1px solid var(--border-strong);
}
.data-table th {
  padding: var(--space-3) var(--space-4);
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--text-secondary);
  white-space: nowrap;
}
.data-table td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}
.data-table tbody tr:hover td { background: var(--bg-base); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table .td-id { font-family: var(--font-mono); font-size: 12px; color: var(--text-secondary); }
.data-table .td-amount { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.data-table .td-actions { text-align: right; white-space: nowrap; }

/* ═══ BADGES / STATUS ═══ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg); color: var(--danger); }
.badge-info    { background: var(--info-bg); color: var(--info); }
.badge-gray    { background: var(--gray-100); color: var(--gray-600); }
.badge-accent  { background: var(--ind-light, var(--blue-50)); color: var(--ind-text, var(--blue-600)); }

/* ═══ MODAL ═══ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(14,13,11,0.5);
  backdrop-filter: blur(2px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: var(--space-6);
  animation: fadeIn 150ms ease;
}
.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 200ms ease;
}
.modal-lg { max-width: 760px; }
.modal-xl { max-width: 960px; }
.modal-header {
  padding: var(--space-5) var(--space-6);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title {
  font-family: var(--font-display);
  font-size: 20px; font-weight: 500;
}
.modal-body { padding: var(--space-6); }
.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end;
  gap: var(--space-2);
  background: var(--bg-base);
}
.modal-close {
  background: none; border: none;
  color: var(--text-secondary);
  padding: 4px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { color: var(--text-primary); }

/* ═══ TABS ═══ */
.tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); margin-bottom: var(--space-5); }
.tab-btn {
  padding: var(--space-3) var(--space-5);
  background: none; border: none;
  font-family: var(--font-body); font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}
.tab-btn:hover { color: var(--text-primary); }
.tab-btn.active { color: var(--ind-text, var(--accent)); border-bottom-color: var(--ind-accent, var(--accent)); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ═══ SEARCH BAR ═══ */
.search-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 0 var(--space-4);
  margin-bottom: var(--space-4);
  flex-wrap: wrap;
}
.search-input-wrap {
  position: relative; flex: 1; min-width: 200px;
}
.search-input-wrap svg {
  position: absolute; left: 10px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  width: 14px; height: 14px;
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  font-size: 13px; color: var(--text-primary);
}
.search-input:focus { outline: none; border-color: var(--ind-accent, var(--accent)); }

/* ═══ EMPTY STATE ═══ */
.empty-state {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: var(--space-16) var(--space-8);
  text-align: center;
  color: var(--text-secondary);
  gap: var(--space-3);
}
.empty-state-icon { font-size: 48px; }
.empty-state-title { font-family: var(--font-display); font-size: 20px; color: var(--text-primary); }
.empty-state-desc { font-size: 13px; max-width: 300px; }

/* ═══ TOASTS ═══ */
.toast-container {
  position: fixed; bottom: var(--space-5); right: var(--space-5);
  display: flex; flex-direction: column; gap: var(--space-2);
  z-index: 9999; pointer-events: none;
}
.toast {
  background: var(--gray-800);
  color: #fff;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  animation: slideRight 250ms ease;
  display: flex; align-items: center; gap: var(--space-2);
  max-width: 320px;
}
.toast.success { background: var(--success); }
.toast.warning { background: var(--warning); }
.toast.error   { background: var(--danger); }

/* ═══ ANIMATIONS ═══ */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.animate-fade-in { animation: fadeIn 300ms ease; }
.animate-slide-up { animation: slideUp 350ms ease; }
.spinner { animation: spin 700ms linear infinite; }

/* ═══ UTILITIES ═══ */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: var(--space-6); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-6); }
.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-muted { color: var(--text-secondary); }
.text-right { text-align: right; }
.fw-600 { font-weight: 600; }
.mt-4 { margin-top: var(--space-4); }
.mt-6 { margin-top: var(--space-6); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.p-4 { padding: var(--space-4); }
.p-5 { padding: var(--space-5); }
.p-6 { padding: var(--space-6); }
.divider { height: 1px; background: var(--border); margin: var(--space-5) 0; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ═══ STAT ITEM (para listas de resumen) ═══ */
.stat-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  gap: var(--space-3);
}
.stat-item:last-child { border-bottom: none; }
.stat-label { font-size: 13px; color: var(--text-secondary); }
.stat-value { font-size: 13px; font-weight: 600; color: var(--text-primary); }

/* ═══ ACTIVITY FEED ═══ */
.activity-item {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
}
.activity-item:last-child { border-bottom: none; }
.activity-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--ind-accent, var(--accent));
  flex-shrink: 0;
  margin-top: 5px;
}
.activity-text { font-size: 12px; color: var(--text-primary); line-height: 1.5; }
.activity-time { font-size: 11px; color: var(--text-muted); margin-top: 2px; }

/* ═══ POS SPECIFIC ═══ */
.pos-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  height: calc(100vh - 56px);
  overflow: hidden;
}
.pos-products-panel { overflow-y: auto; padding: var(--space-4); background: var(--bg-base); }
.pos-cart-panel { border-left: 1px solid var(--border); background: var(--bg-surface); display: flex; flex-direction: column; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-3); }
.product-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}
.product-card:hover {
  border-color: var(--ind-accent, var(--accent));
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.product-card:active { transform: scale(0.98); }
.product-card-emoji { font-size: 28px; margin-bottom: var(--space-2); }
.product-card-name { font-size: 12px; font-weight: 500; color: var(--text-primary); line-height: 1.3; margin-bottom: 4px; }
.product-card-price { font-size: 13px; font-weight: 600; color: var(--ind-text, var(--accent)); }
.product-card-stock { font-size: 10px; color: var(--text-muted); margin-top: 2px; }
.cart-items { flex: 1; overflow-y: auto; padding: var(--space-4); }
.cart-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) 0; border-bottom: 1px solid var(--border);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-name { flex: 1; font-size: 13px; }
.cart-item-qty {
  display: flex; align-items: center; gap: var(--space-1);
}
.qty-btn {
  width: 24px; height: 24px;
  background: var(--bg-base);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 16px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--transition-fast);
  color: var(--text-primary);
}
.qty-btn:hover { background: var(--gray-200); }
.qty-num { width: 28px; text-align: center; font-size: 13px; font-weight: 500; }
.cart-item-price { font-size: 13px; font-weight: 600; min-width: 70px; text-align: right; }
.cart-totals { padding: var(--space-4); border-top: 1px solid var(--border); }
.cart-total-row {
  display: flex; justify-content: space-between;
  padding: var(--space-1) 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.cart-total-row.total {
  font-size: 18px; font-weight: 600;
  color: var(--text-primary);
  padding-top: var(--space-2); margin-top: var(--space-2);
  border-top: 1px solid var(--border-strong);
}
.cart-actions { padding: var(--space-4); border-top: 1px solid var(--border); display: flex; gap: var(--space-2); }
.cart-actions .btn { flex: 1; justify-content: center; }

/* ═══ TABLES FILTERS BAR ═══ */
.filters-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  background: var(--bg-surface);
}

/* ═══ RESPONSIVE ═══ */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .pos-layout { grid-template-columns: 1fr; }
  .pos-cart-panel { display: none; }
}
@media (max-width: 768px) {
  .sidebar { width: var(--sidebar-collapsed); }
  .main-content { margin-left: var(--sidebar-collapsed); }
  .page-body { padding: var(--space-4); }
  .kpi-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}

/* Sidebar toggle button always visible */
.sidebar-toggle {
  opacity: 1 !important;
  visibility: visible !important;
}
.sidebar.collapsed .sidebar-brand-text,
.sidebar.collapsed .sidebar-section-label,
.sidebar.collapsed .sidebar-label,
.sidebar.collapsed .sidebar-badge,
.sidebar.collapsed .sidebar-user-info { display: none; }
.sidebar.collapsed { width: var(--sidebar-collapsed); }
.sidebar.collapsed .sidebar-brand { justify-content: center; padding: var(--space-4) var(--space-3); }
.sidebar.collapsed .sidebar-item { justify-content: center; padding: var(--space-3); }
.sidebar.collapsed .sidebar-footer { padding: var(--space-2); }
.sidebar.collapsed .sidebar-avatar { margin: 0 auto; }
.sidebar.collapsed .sidebar-toggle { margin-left: 0; }
