/* ═══════════════════════════════════════════════════════════════════════════
   KUSANALI — Operations CRM
   Complete Design System / CSS Framework
   Version 1.0
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Design Tokens (Light) ── */
:root {
  --color-bg: #f1f5f9;
  --color-bg-alt: #f8fafc;
  --color-card: #ffffff;
  --color-card-border: #e2e8f0;
  --color-text-primary: #1e293b;
  --color-text-secondary: #64748b;
  --color-text-muted: #94a3b8;
  --color-accent: #0d9488;
  --color-accent-hover: #0f766e;
  --color-accent-light: #f0fdfa;
  --color-sidebar-bg: #1e293b;
  --color-sidebar-text: #e2e8f0;
  --color-sidebar-active: #0d9488;
  --color-success: #16a34a;
  --color-warning: #d97706;
  --color-danger: #dc2626;
  --color-info: #2563eb;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.04);
}

/* ── Dark Mode ── */
.dark {
  --color-bg: #0f172a;
  --color-bg-alt: #1e293b;
  --color-card: #1e293b;
  --color-card-border: #334155;
  --color-text-primary: #f1f5f9;
  --color-text-secondary: #94a3b8;
  --color-text-muted: #64748b;
  --color-accent: #14b8a6;
  --color-accent-hover: #0d9488;
  --color-accent-light: #134e4a;
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  --color-info: #3b82f6;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.2);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.3), 0 2px 4px -2px rgba(0,0,0,0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.4), 0 4px 6px -4px rgba(0,0,0,0.2);
}

.dark .sidebar { background: #0f172a; border-right: 1px solid #334155; }
.dark .sidebar-link { color: #64748b; }
.dark .sidebar-link:hover { background: rgba(255,255,255,0.04); color: #e2e8f0; }
.dark .sidebar-link.active { background: rgba(20, 184, 166, 0.12); }
.dark ::-webkit-scrollbar-thumb { background: #475569; }
.dark .table-row { border-color: #334155; }
.dark .input-field { background: #1e293b; color: #f1f5f9; border-color: #334155; }
.dark .kanban-card { background: #1e293b; }
.dark .modal-content { background: #1e293b; }

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--color-bg);
  color: var(--color-text-primary);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  min-height: 100%;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }

/* ═══════════════════════════════════════════════════════════════════════════
   LAYOUT
   ═══════════════════════════════════════════════════════════════════════════ */

.app-layout { display: flex; height: 100vh; }
.main-content { flex: 1; overflow: auto; padding: 1.25rem 2rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   SIDEBAR
   ═══════════════════════════════════════════════════════════════════════════ */

.sidebar { background: var(--color-sidebar-bg); min-height: 100vh; width: 220px; min-width: 220px; padding: 1rem; display: flex; flex-direction: column; }
.sidebar-brand { font-size: 1.3rem; font-weight: 700; color: #f8fafc; padding: 0.5rem 0 0.25rem 0; }
.sidebar-brand span { color: var(--color-accent); }
.sidebar-subtitle { font-size: 0.7rem; color: #94a3b8; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 600; padding: 0.5rem 0 0.25rem 0; }
.sidebar-divider { border: none; border-top: 1px solid #334155; margin: 0.75rem 0; }
.sidebar-nav { display: flex; flex-direction: column; gap: 0.125rem; }
.sidebar-link {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0.75rem; border-radius: 6px;
  font-size: 0.85rem; font-weight: 500;
  color: #94a3b8; text-decoration: none;
  transition: all 0.15s ease;
  cursor: pointer; border: none; background: none; width: 100%; text-align: left;
  font-family: var(--font-sans);
}
.sidebar-link:hover { background: rgba(255,255,255,0.06); color: #e2e8f0; }
.sidebar-link.active {
  background: rgba(13, 148, 136, 0.15);
  color: #e2e8f0;
  border-left: 3px solid var(--color-accent);
  border-radius: 0 6px 6px 0;
  font-weight: 600;
}
.sidebar-status { display: flex; align-items: center; gap: 0.4rem; font-size: 0.78rem; font-weight: 500; padding: 0.3rem 0; color: #e2e8f0; }
.sidebar-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; animation: pulse 2s ease-in-out infinite; }
.sidebar-btn {
  width: 100%; padding: 0.35rem 0; border-radius: 6px; border: 1px solid #334155;
  background: transparent; color: #e2e8f0; font-size: 0.78rem; font-weight: 500;
  margin-top: 0.25rem; cursor: pointer; font-family: var(--font-sans);
}
.sidebar-footer { margin-top: auto; padding-top: 0.75rem; }
.sidebar-user { font-size: 0.7rem; color: #94a3b8; margin-bottom: 0.35rem; font-weight: 500; }

/* ═══════════════════════════════════════════════════════════════════════════
   HEADINGS & TEXT
   ═══════════════════════════════════════════════════════════════════════════ */

.h1 { font-size: 1.4rem; font-weight: 700; margin-bottom: 0.75rem; letter-spacing: -0.02em; }
.h2 { font-size: 1.2rem; font-weight: 700; margin-bottom: 0.75rem; letter-spacing: -0.02em; }
.h3 { font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; }
.h4 { font-size: 0.9rem; font-weight: 600; margin-bottom: 0.5rem; }
.text-body { font-size: 0.95rem; font-weight: 400; line-height: 1.6; }
.text-sm { font-size: 0.85rem; }
.text-xs { font-size: 0.72rem; }
.text-fine { font-size: 0.65rem; }
.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }
.text-accent { color: var(--color-accent); }
.text-success { color: var(--color-success); }
.text-warning { color: var(--color-warning); }
.text-danger { color: var(--color-danger); }
.font-regular { font-weight: 400; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-extrabold { font-weight: 800; }
.text-uppercase { text-transform: uppercase; letter-spacing: 0.04em; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

/* ═══════════════════════════════════════════════════════════════════════════
   CARDS
   ═══════════════════════════════════════════════════════════════════════════ */

.card {
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: 10px;
  padding: 0.85rem 1rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.card:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.card-metric { }
.card-metric-label { font-size: 0.68rem; font-weight: 600; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.25rem; }
.card-metric-value { font-size: 1.5rem; font-weight: 700; color: var(--color-text-primary); line-height: 1.2; }
.card-metric-delta { font-size: 0.68rem; font-weight: 600; margin-top: 0.15rem; }
.card-metric-delta.up { color: var(--color-success); }
.card-metric-delta.down { color: var(--color-danger); }
.card-metric-delta.neutral { color: var(--color-text-muted); }
.card-alert-left { border-left: 3px solid; }
.card-alert-left.danger { border-left-color: var(--color-danger); }
.card-alert-left.warning { border-left-color: var(--color-warning); }
.card-alert-left.success { border-left-color: var(--color-success); }

.card-kpi { }
.card-kpi-label { font-size: 0.85rem; font-weight: 500; color: var(--color-text-secondary); }
.card-kpi-value { font-size: 1.8rem; font-weight: 700; color: var(--color-text-primary); }

.card-kpi-sm { }
.card-kpi-sm-label { font-size: 0.72rem; font-weight: 600; color: var(--color-text-secondary); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 0.25rem; }
.card-kpi-sm-value { font-size: 1.4rem; font-weight: 700; color: var(--color-text-primary); }

/* ═══════════════════════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════════════════════ */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  font-family: var(--font-sans); cursor: pointer; border: none;
  transition: all 0.2s ease; white-space: nowrap;
}
.btn-primary { padding: 0.5rem 1.25rem; border-radius: 8px; background: var(--color-accent); color: #fff; font-size: 0.85rem; font-weight: 600; transition: all 0.2s ease; }
.btn-primary:hover { background: var(--color-accent-hover); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(13,148,136,0.3); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { background: rgba(13,148,136,0.5); cursor: not-allowed; opacity: 0.5; transform: none; box-shadow: none; }

.btn-secondary { padding: 0.45rem 1rem; border-radius: 6px; border: 1px solid var(--color-card-border); background: var(--color-card); color: var(--color-text-primary); font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; }
.btn-secondary:hover { background: var(--color-bg-alt); border-color: var(--color-text-muted); }

.btn-ghost { padding: 0.45rem 1rem; border-radius: 6px; border: none; background: transparent; color: var(--color-text-secondary); font-size: 0.85rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; }
.btn-ghost:hover { background: var(--color-bg-alt); color: var(--color-text-primary); }

.btn-sm { padding: 0.3rem 0.6rem; border-radius: 4px; border: 1px solid var(--color-card-border); background: var(--color-card); font-size: 0.75rem; cursor: pointer; transition: all 0.15s ease; }
.btn-sm:hover { background: var(--color-bg-alt); transform: scale(1.05); }

.btn-icon { padding: 0.2rem; background: none; border: none; font-size: 0.8rem; cursor: pointer; border-radius: 4px; transition: all 0.15s ease; }
.btn-icon:hover { background: var(--color-bg-alt); transform: scale(1.1); }

.btn-sidebar { width: 100%; padding: 0.35rem 0; border-radius: 6px; border: 1px solid #334155; background: transparent; color: #e2e8f0; font-size: 0.78rem; font-weight: 500; cursor: pointer; font-family: var(--font-sans); transition: all 0.2s ease; }
.btn-sidebar:hover { background: rgba(255,255,255,0.06); border-color: #475569; }

.btn-danger { padding: 0.5rem 1.25rem; border-radius: 8px; background: var(--color-danger); color: #fff; font-size: 0.85rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease; }
.btn-danger:hover { opacity: 0.9; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(220,38,38,0.3); }
.btn-danger:active { transform: translateY(0); }

.btn-export { padding: 0.4rem 1rem; border-radius: 6px; border: 1px solid var(--color-card-border); background: var(--color-card); color: var(--color-text-secondary); font-size: 0.8rem; font-weight: 500; cursor: pointer; transition: all 0.2s ease; }
.btn-export:hover { background: var(--color-bg-alt); border-color: var(--color-text-muted); }

.btn-confirm {
  flex: 1; font-size: 0.68rem; font-weight: 600; padding: 0.2rem 0;
  border: 2px solid var(--color-accent); border-radius: 6px;
  background: var(--color-accent-light); color: var(--color-accent);
}

.btn-action {
  flex: 1; font-size: 0.68rem; font-weight: 600; padding: 0.2rem 0;
  border: 1px solid var(--color-card-border); border-radius: 6px;
  background: var(--color-card); color: var(--color-text-secondary); cursor: pointer;
}
.btn-action:hover { background: var(--color-bg-alt); }
.btn-action:disabled { opacity: 0.35; cursor: not-allowed; color: var(--color-text-muted); }

/* ═══════════════════════════════════════════════════════════════════════════
   BADGES (Status)
   ═══════════════════════════════════════════════════════════════════════════ */

.badge {
  font-size: 0.6rem; font-weight: 600;
  padding: 0.1rem 0.45rem; border-radius: 99px;
  display: inline-block; border: 1px solid;
  transition: all 0.2s ease;
}
.badge:hover { transform: scale(1.06); }

.badge-pending { background: #f3f4f6; color: #6b7280; border-color: #6b728033; }
.badge-review { background: #f3f4f6; color: #6b7280; border-color: #6b728033; }
.badge-enruta { background: #eff6ff; color: #2563eb; border-color: #2563eb33; }
.badge-esperando { background: #fffbeb; color: #d97706; border-color: #d9770633; }
.badge-entregado { background: #f0fdf4; color: #16a34a; border-color: #16a34a33; }
.badge-reagendado { background: #fff7ed; color: #ea580c; border-color: #ea580c33; }
.badge-cancelado { background: #fef2f2; color: #dc2626; border-color: #dc262633; }
.badge-rechazado { background: #fef2f2; color: #dc2626; border-color: #dc262633; }
.badge-preorden { background: #f5f3ff; color: #7c3aed; border-color: #7c3aed33; }
.badge-archivado { background: #f1f5f9; color: #475569; border-color: #47556933; }

/* ═══════════════════════════════════════════════════════════════════════════
   CHIPS / ALERTS
   ═══════════════════════════════════════════════════════════════════════════ */

.chip {
  font-size: 0.75rem; font-weight: 600;
  padding: 0.3rem 0.75rem; border-radius: 99px;
  display: inline-flex; align-items: center; gap: 0.25rem;
}
.chip-danger { background: #fef2f2; color: var(--color-danger); }
.chip-warning { background: #fffbeb; color: var(--color-warning); }
.chip-info { background: #eff6ff; color: var(--color-info); }
.chip-success { background: #f0fdf4; color: var(--color-success); }

/* ═══════════════════════════════════════════════════════════════════════════
   FORMS
   ═══════════════════════════════════════════════════════════════════════════ */

.form-group { margin-bottom: 0.6rem; }
.form-label { font-size: 0.72rem; font-weight: 600; color: var(--color-text-secondary); display: block; margin-bottom: 0.3rem; }
.input-field {
  width: 100%; padding: 0.5rem 0.75rem; font-size: 0.85rem;
  border: 1px solid var(--color-card-border); border-radius: 8px;
  outline: none; background: var(--color-card); color: var(--color-text-primary);
  font-family: var(--font-sans); transition: border-color 0.2s; box-sizing: border-box;
}
.input-field:focus { border-color: var(--color-accent); box-shadow: 0 0 0 3px rgba(13,148,136,0.1); }
.input-field::placeholder { color: var(--color-text-muted); }

select.input-field { appearance: auto; }
textarea.input-field { resize: vertical; min-height: 60px; line-height: 1.5; }

.input-group { display: flex; gap: 0.25rem; align-items: center; }

/* ── Login Form ── */
.login-input {
  width: 100%; padding: 0.75rem 0.75rem 0.5rem; font-size: 0.85rem;
  background: rgba(15, 23, 42, 0.5); border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 10px; outline: none; color: #f1f5f9; box-sizing: border-box;
  transition: border-color 0.2s; font-family: var(--font-sans);
}
.login-input:focus { border-color: var(--color-accent); }
.login-label {
  position: absolute; left: 0.75rem; pointer-events: none;
  font-size: 0.82rem; color: #64748b; font-weight: 500;
  top: 0.75rem; transition: all 0.2s ease;
}
.login-input:focus + .login-label,
.login-input:not(:placeholder-shown) + .login-label {
  font-size: 0.65rem; color: var(--color-accent); top: -18px;
}
.login-error {
  font-size: 0.75rem; color: #ef4444; font-weight: 500;
  padding: 0.5rem 0.75rem; background: rgba(239, 68, 68, 0.1);
  border-radius: 8px; border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ═══════════════════════════════════════════════════════════════════════════
   METRICS BAR
   ═══════════════════════════════════════════════════════════════════════════ */

.metrics-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

/* ═══════════════════════════════════════════════════════════════════════════
   KANBAN / PIPELINE
   ═══════════════════════════════════════════════════════════════════════════ */

.kanban-container {
  display: flex; gap: 1rem; overflow-x: auto;
  padding-bottom: 0.5rem; min-height: 400px;
}
.kanban-column {
  flex: 0 0 260px; min-width: 240px;
  background: var(--color-bg-alt);
  border-radius: 14px; padding: 0.75rem;
  border: 1px solid var(--color-card-border);
}
.kanban-header {
  border-radius: 10px; padding: 0.6rem 0.75rem; margin-bottom: 0.75rem;
  border-left: 3px solid;
}
.kanban-header-unassigned { background: #fef2f2; border-left-color: var(--color-danger); }
.kanban-header-default { background: var(--color-accent-light); border-left-color: var(--color-accent); }
.kanban-header-title { font-weight: 700; font-size: 0.82rem; color: var(--color-text-primary); }
.kanban-header-meta { font-size: 0.68rem; color: var(--color-text-muted); font-weight: 500; }

.kanban-card {
  background: var(--color-card); border: 1px solid var(--color-card-border);
  border-radius: 10px; padding: 0.7rem 0.8rem; margin-bottom: 0.5rem;
  box-shadow: var(--shadow-sm);
  animation: fadeSlideUp 0.3s ease forwards;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--color-accent); }
.kanban-card.delivered { opacity: 0.7; }
.kanban-card-top { display: flex; justify-content: space-between; margin-bottom: 0.25rem; }
.kanban-card-client { font-size: 0.85rem; font-weight: 600; color: var(--color-text-primary); }
.kanban-card-id { font-size: 0.65rem; color: var(--color-text-muted); font-weight: 500; }
.kanban-card-info { font-size: 0.72rem; color: var(--color-text-secondary); line-height: 1.4; margin-bottom: 0.4rem; }
.kanban-card-bottom { display: flex; justify-content: space-between; align-items: center; }
.kanban-card-price { font-size: 0.8rem; font-weight: 700; color: var(--color-text-primary); }
.kanban-card-actions { display: flex; gap: 0.25rem; margin-top: 0.4rem; padding-top: 0.4rem; border-top: 1px solid var(--color-card-border); }

/* ═══════════════════════════════════════════════════════════════════════════
   TABLES
   ═══════════════════════════════════════════════════════════════════════════ */

.table-section { margin-bottom: 0.75rem; }
.table-summary { cursor: pointer; font-size: 0.85rem; font-weight: 700; color: var(--color-text-primary); padding: 0.4rem 0; border-bottom: 1px solid var(--color-card-border); }
.table-summary-count { color: var(--color-text-muted); font-weight: 500; margin-left: 0.5rem; font-size: 0.78rem; }
.table-header {
  display: grid; gap: 0.5rem; padding: 0.4rem 0;
  font-size: 0.65rem; font-weight: 600; color: var(--color-text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--color-card-border);
}
.table-row {
  display: grid; gap: 0.5rem; padding: 0.45rem 0; align-items: center;
  border-bottom: 1px solid var(--color-card-border); font-size: 0.78rem;
  transition: background 0.15s ease;
}
.table-row:hover { background: var(--color-bg-alt); }
.table-row:last-child { border-bottom: none; }

.table-row-clickable { cursor: pointer; transition: all 0.15s ease; }
.table-row-clickable:hover { background: var(--color-bg-alt); transform: translateX(2px); }
.table-id { color: var(--color-text-muted); font-weight: 500; font-size: 0.7rem; }
.table-client { font-weight: 600; }
.table-address { color: var(--color-text-secondary); font-size: 0.72rem; }
.table-product { font-size: 0.72rem; }
.table-qty { color: var(--color-text-muted); }
.table-repartidor { font-size: 0.72rem; color: var(--color-text-secondary); }
.table-price { font-weight: 700; font-size: 0.78rem; }
.table-actions { display: flex; gap: 0.2rem; }

/* Responsive table columns */
.table-cols-8 { grid-template-columns: 1.2fr 1.5fr 2.2fr 1.2fr 1fr 1fr 0.9fr 0.6fr; }

/* ═══════════════════════════════════════════════════════════════════════════
   GRID HELPERS
   ═══════════════════════════════════════════════════════════════════════════ */

.grid { display: grid; }
.grid-cols-2 { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); gap: 0.75rem; }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); gap: 0.75rem; }
.grid-cols-2-4 { grid-template-columns: 1fr 2fr 0.6fr 0.6fr; gap: 0.5rem; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   FLEX HELPERS
   ═══════════════════════════════════════════════════════════════════════════ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }

/* ═══════════════════════════════════════════════════════════════════════════
   SPACING
   ═══════════════════════════════════════════════════════════════════════════ */

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-5 { margin-bottom: 1.5rem; }
.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 0.75rem; }
.p-4 { padding: 1rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   CUSTOMER PANEL (Slide-out)
   ═══════════════════════════════════════════════════════════════════════════ */

.panel-overlay {
  position: fixed; inset: 0;
  background: rgba(15, 23, 42, 0.35);
  z-index: 999;
}
.customer-panel {
  position: fixed; top: 0; right: 0;
  width: 420px; max-width: 100vw; height: 100vh;
  background: var(--color-card);
  box-shadow: var(--shadow-lg);
  z-index: 1000; overflow-y: auto;
  padding: 1.5rem;
  animation: slideIn 0.2s ease;
}
.panel-close { float: right; background: none; border: none; color: var(--color-text-muted); padding: 0.25rem; cursor: pointer; }
.panel-name { font-size: 1.05rem; font-weight: 700; color: var(--color-text-primary); }
.panel-id { font-size: 0.72rem; color: var(--color-text-muted); }
.panel-section { margin-bottom: 1.25rem; }
.panel-section-title { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); margin-bottom: 0.5rem; }
.panel-field { display: flex; justify-content: space-between; padding: 0.3rem 0; font-size: 0.8rem; border-bottom: 1px solid var(--color-card-border); }
.panel-field:last-child { border-bottom: none; }
.panel-field-label { color: var(--color-text-secondary); font-weight: 500; }
.panel-field-value { color: var(--color-text-primary); font-weight: 600; text-align: right; }
.panel-actions { display: flex; gap: 0.5rem; margin-top: 1rem; }

/* ── Notification Toast ── */
#notification-container {
  position: fixed; top: 1rem; right: 1rem; z-index: 9999;
  display: flex; flex-direction: column; gap: 0.5rem;
  pointer-events: none;
}
.notify-toast {
  border-radius: 8px; padding: 0.65rem 1rem;
  font-size: 0.82rem; font-weight: 500;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  animation: fadeSlideUp 0.25s ease;
  max-width: 380px;
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}
.notify-toast.notify-hiding {
  opacity: 0;
  transform: translateX(20px);
}
.notify-info { background: #eff6ff; color: #2563eb; border: 1px solid #2563eb33; }
.notify-success { background: #f0fdf4; color: #16a34a; border: 1px solid #16a34a33; }
.notify-warning { background: #fffbeb; color: #d97706; border: 1px solid #d9770633; }
.notify-danger { background: #fef2f2; color: #dc2626; border: 1px solid #dc262633; }

/* ═══════════════════════════════════════════════════════════════════════════
   MODAL
   ═══════════════════════════════════════════════════════════════════════════ */

.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 23, 42, 0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-content {
  background: var(--color-card);
  border: 1px solid var(--color-card-border);
  border-radius: 14px; padding: 1.5rem;
  width: 100%; max-width: 600px;
  max-height: 90vh; overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  animation: fadeIn 0.15s ease;
}
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; }
.modal-title { font-weight: 700; font-size: 1rem; }
.modal-close { background: none; border: none; font-size: 1.2rem; color: var(--color-text-muted); padding: 0.2rem; cursor: pointer; }
.modal-footer { display: flex; gap: 0.5rem; justify-content: flex-end; margin-top: 1rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   DETAILS / COLLAPSIBLE
   ═══════════════════════════════════════════════════════════════════════════ */

details summary { cursor: pointer; }
details summary::-webkit-details-marker { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   DIVIDER
   ═══════════════════════════════════════════════════════════════════════════ */

.tab-divider { border: none; border-top: 1px solid var(--color-card-border); margin: 1.25rem 0; }

/* ═══════════════════════════════════════════════════════════════════════════
   INVENTORY ITEM
   ═══════════════════════════════════════════════════════════════════════════ */

.inv-item { display: flex; align-items: center; gap: 0.5rem; padding: 0.35rem 0.6rem; border-radius: 6px; margin-bottom: 0.25rem; }
.inv-item.critico { background: #fef2f2; }
.inv-item.bajo { background: #fffbeb; }
.inv-item.ok { background: #f0fdf4; }
.inv-item-dot { font-size: 0.85rem; }
.inv-item-name { font-weight: 500; flex: 2; font-size: 0.85rem; }
.inv-item-variant { color: var(--color-text-muted); flex: 1; font-size: 0.78rem; }
.inv-item-stock { font-weight: 700; min-width: 3rem; text-align: right; font-size: 0.85rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   PRODUCT LIST
   ═══════════════════════════════════════════════════════════════════════════ */

.product-row {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.75rem;
  background: var(--color-card); border: 1px solid var(--color-card-border);
  border-radius: 8px; margin-bottom: 0.5rem;
}
.product-row.inactive { background: var(--color-bg); opacity: 0.5; }
.product-name { font-weight: 600; flex: 2; font-size: 0.9rem; }
.product-category { font-size: 0.75rem; color: var(--color-text-muted); background: var(--color-bg); padding: 0.15rem 0.45rem; border-radius: 4px; }
.product-price { font-size: 0.78rem; color: var(--color-text-muted); flex: 1; text-align: right; }

/* ═══════════════════════════════════════════════════════════════════════════
   LOGIN PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  position: relative; overflow: hidden;
}
.login-bg {
  position: absolute; inset: 0;
  background: linear-gradient(-45deg, #0f172a, #1e293b, #0d1b2a, #134e4a, #0f172a);
  background-size: 400% 400%;
  animation: gradientShift 15s ease infinite;
  z-index: 0;
}
.login-particles { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.login-particle {
  position: absolute; border-radius: 50%;
  opacity: 0.2; animation: float 5s ease-in-out infinite;
}
.login-card-wrap {
  position: relative; z-index: 1;
  width: 100%; max-width: 420px; padding: 0 1rem;
}
.login-card {
  background: rgba(30, 41, 59, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(148, 163, 184, 0.15);
  border-radius: 20px; padding: 2.5rem 2rem;
  animation: glowPulse 4s ease-in-out infinite;
}
.login-title-wrap { text-align: center; margin-bottom: 2rem; min-height: 50px; }
.login-title {
  font-size: 1.8rem; font-weight: 800; letter-spacing: 0.08em; color: #f1f5f9;
}
.login-title-letter {
  display: inline-block;
  animation: letterReveal 0.5s ease forwards;
  opacity: 0;
}
.login-title-letter.accent { color: var(--color-accent); }
.login-subtitle {
  font-size: 0.72rem; color: #94a3b8; font-weight: 500; margin-top: 0.5rem;
  letter-spacing: 0.15em; text-transform: uppercase;
}
.login-form { display: flex; flex-direction: column; gap: 1.5rem; }
.login-field {
  position: relative;
  animation: fadeSlideUp 0.35s ease forwards;
  opacity: 0;
}
.login-field:nth-child(1) { animation-delay: 0.1s; }
.login-field:nth-child(2) { animation-delay: 0.2s; }
.login-field:nth-child(3) { animation-delay: 0.3s; }
.login-btn {
  padding: 0.75rem 0; border-radius: 12px; border: none;
  background: var(--color-accent); color: #fff; font-size: 0.85rem;
  font-weight: 700; letter-spacing: 0.03em; cursor: pointer;
  font-family: var(--font-sans); transition: all 0.3s ease;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  animation: fadeSlideUp 0.35s ease forwards;
  opacity: 0;
  animation-delay: 0.4s;
}
.login-btn:hover { background: var(--color-accent-hover); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(13,148,136,0.3); }
.login-btn:active { transform: translateY(0); }
.login-btn:disabled { background: rgba(13,148,136,0.5); cursor: not-allowed; transform: none; box-shadow: none; }
.login-footer {
  text-align: center; margin-top: 1.5rem; font-size: 0.78rem;
  color: #64748b; font-weight: 500;
}
.login-link { color: var(--color-accent); font-weight: 600; text-decoration: none; }
.login-link:hover { text-decoration: underline; }

/* ── Themes (Flavors) ── */
.theme-nature {
  --color-accent: #166534;
  --color-accent-hover: #14532d;
  --color-accent-light: #f0fdf4;
  --color-sidebar-bg: #064e3b;
  --color-sidebar-active: #166534;
}
.theme-cyber {
  --color-accent: #7c3aed;
  --color-accent-hover: #6d28d9;
  --color-accent-light: #f5f3ff;
  --color-sidebar-bg: #1e1b4b;
  --color-sidebar-active: #7c3aed;
}

/* ── Extended Utilities ── */
/* Spacing (1-8 scale) */
.mt-5 { margin-top: 1.5rem; } .mt-6 { margin-top: 2rem; } .mt-7 { margin-top: 2.5rem; } .mt-8 { margin-top: 3rem; }
.mb-6 { margin-bottom: 2rem; } .mb-7 { margin-bottom: 2.5rem; } .mb-8 { margin-bottom: 3rem; }
.ml-1 { margin-left: 0.25rem; } .ml-2 { margin-left: 0.5rem; } .ml-3 { margin-left: 0.75rem; } .ml-4 { margin-left: 1rem; }
.mr-1 { margin-right: 0.25rem; } .mr-2 { margin-right: 0.5rem; } .mr-3 { margin-right: 0.75rem; } .mr-4 { margin-right: 1rem; }
.p-5 { padding: 1.5rem; } .p-6 { padding: 2rem; }
.px-1 { padding-left: 0.25rem; padding-right: 0.25rem; } .px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; } .px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-1 { padding-top: 0.25rem; padding-bottom: 0.25rem; } .py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; } .py-4 { padding-top: 1rem; padding-bottom: 1rem; }

/* Display & Layout */
.inline-flex { display: inline-flex; }
.block { display: block; }
.inline-block { display: inline-block; }
.hidden { display: none; }
.relative { position: relative; }
.absolute { position: absolute; }
.overflow-hidden { overflow: hidden; }
.w-full { width: 100%; }
.h-full { height: 100%; }

/* Flexbox utilities */
.flex-shrink-0 { flex-shrink: 0; }
.flex-grow-1 { flex-grow: 1; }
.gap-5 { gap: 1.5rem; }
.gap-6 { gap: 2rem; }

/* Typography */
.italic { font-style: italic; }
.leading-tight { line-height: 1.25; }
.leading-relaxed { line-height: 1.625; }
.tracking-tight { letter-spacing: -0.025em; }
.tracking-wide { letter-spacing: 0.025em; }

/* ═══════════════════════════════════════════════════════════════════════════
   STEPPER
   ═══════════════════════════════════════════════════════════════════════════ */
.stepper { display: flex; justify-content: space-between; position: relative; margin-bottom: 2rem; padding: 0 1rem; }
.stepper::before { content: ""; position: absolute; top: 16px; left: 0; right: 0; height: 2px; background: var(--color-card-border); z-index: 0; }
.step { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.step-circle { width: 32px; height: 32px; border-radius: 50%; background: var(--color-card); border: 2px solid var(--color-card-border); color: var(--color-text-muted); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 0.85rem; transition: all 0.2s; }
.step.active .step-circle { border-color: var(--color-accent); color: var(--color-accent); box-shadow: 0 0 0 4px var(--color-accent-light); }
.step.completed .step-circle { background: var(--color-accent); border-color: var(--color-accent); color: #fff; }
.step-label { font-size: 0.72rem; font-weight: 600; color: var(--color-text-muted); }
.step.active .step-label { color: var(--color-text-primary); }

/* ═══════════════════════════════════════════════════════════════════════════
   TOOLTIP
   ═══════════════════════════════════════════════════════════════════════════ */
[data-tooltip] { position: relative; cursor: help; }
[data-tooltip]::before {
  content: attr(data-tooltip);
  position: absolute; bottom: 125%; left: 50%; transform: translateX(-50%) translateY(10px);
  padding: 0.4rem 0.6rem; background: #1e293b; color: #fff;
  font-size: 0.72rem; border-radius: 6px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: all 0.2s ease;
  z-index: 1000; box-shadow: var(--shadow-md);
}
[data-tooltip]:hover::before { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ═══════════════════════════════════════════════════════════════════════════
   BREADCRUMBS
   ═══════════════════════════════════════════════════════════════════════════ */
.breadcrumbs { display: flex; align-items: center; gap: 0.5rem; font-size: 0.78rem; margin-bottom: 1rem; color: var(--color-text-muted); }
.breadcrumb-item { display: flex; align-items: center; gap: 0.5rem; }
.breadcrumb-item:not(:last-child)::after { content: "/"; opacity: 0.5; }
.breadcrumb-item a { color: var(--color-text-muted); text-decoration: none; transition: color 0.2s; }
.breadcrumb-item a:hover { color: var(--color-accent); }
.breadcrumb-item.active { color: var(--color-text-primary); font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════════════════
   TIMELINE
   ═══════════════════════════════════════════════════════════════════════════ */
.timeline { position: relative; padding-left: 1.5rem; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 0; bottom: 0; width: 2px; background: var(--color-card-border); }
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-item::before { content: ""; position: absolute; left: -1.5rem; top: 4px; width: 10px; height: 10px; border-radius: 50%; background: var(--color-card); border: 2px solid var(--color-accent); z-index: 1; transform: translateX(-3px); }
.timeline-date { font-size: 0.65rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; margin-bottom: 0.25rem; }
.timeline-title { font-size: 0.85rem; font-weight: 600; color: var(--color-text-primary); }
.timeline-content { font-size: 0.78rem; color: var(--color-text-secondary); margin-top: 0.15rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   EMPTY STATE
   ═══════════════════════════════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 3rem 1.5rem; }
.empty-state-icon { font-size: 3rem; margin-bottom: 1rem; opacity: 0.5; }
.empty-state-img { width: 120px; height: auto; margin-bottom: 1.5rem; filter: grayscale(1) opacity(0.3); }
.empty-state-title { font-size: 1.1rem; font-weight: 700; color: var(--color-text-primary); margin-bottom: 0.5rem; }
.empty-state-text { font-size: 0.85rem; color: var(--color-text-muted); max-width: 280px; margin: 0 auto 1.5rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   CHAT PANEL (MIA)
   ═══════════════════════════════════════════════════════════════════════════ */
.chat-panel { display: flex; flex-direction: column; height: 400px; background: var(--color-bg-alt); border-radius: 12px; overflow: hidden; border: 1px solid var(--color-card-border); }
.chat-messages { flex: 1; padding: 1rem; overflow-y: auto; display: flex; flex-direction: column; gap: 0.75rem; }
.chat-bubble { max-width: 85%; padding: 0.6rem 0.85rem; border-radius: 12px; font-size: 0.82rem; line-height: 1.4; position: relative; }
.bubble-bot { align-self: flex-start; background: var(--color-card); border: 1px solid var(--color-card-border); color: var(--color-text-primary); border-bottom-left-radius: 2px; }
.bubble-user { align-self: flex-end; background: var(--color-accent); color: #fff; border-bottom-right-radius: 2px; }
.chat-input-area { padding: 0.75rem; background: var(--color-card); border-top: 1px solid var(--color-card-border); display: flex; gap: 0.5rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   CHARTS & DATA VIZ
   ═══════════════════════════════════════════════════════════════════════════ */
.chart-container { position: relative; height: 300px; width: 100%; margin-bottom: 1.5rem; }
.chart-card { min-height: 350px; display: flex; flex-direction: column; }
.chart-card .h3 { margin-bottom: 1.5rem; }

/* ═══════════════════════════════════════════════════════════════════════════
   WIZARD (Configuration Assistant)
   ═══════════════════════════════════════════════════════════════════════════ */
.wizard { background: var(--color-card); border: 1px solid var(--color-card-border); border-radius: 14px; overflow: hidden; }
.wizard-header { padding: 1.5rem; border-bottom: 1px solid var(--color-card-border); background: var(--color-bg-alt); }
.wizard-body { padding: 2rem; min-height: 300px; }
.wizard-footer { padding: 1.25rem 2rem; border-top: 1px solid var(--color-card-border); display: flex; justify-content: space-between; background: var(--color-bg-alt); }
.wizard-step-content { display: none; animation: fadeIn 0.3s ease; }
.wizard-step-content.active { display: block; }

/* ═══════════════════════════════════════════════════════════════════════════
   PRINT STYLES (PDF Reports)
   ═══════════════════════════════════════════════════════════════════════════ */
@media print {
  body { background: white !important; color: black !important; }
  .sidebar, .breadcrumbs, .sidebar-btn, .btn, .chat-panel, .input-group, .table-actions { display: none !important; }
  .main-content { padding: 0 !important; margin: 0 !important; width: 100% !important; }
  .card { border: 1px solid #eee !important; box-shadow: none !important; break-inside: avoid; }
  .h1, .h2, .h3 { color: black !important; }
  .grid { display: block !important; }
  .card { margin-bottom: 1rem !important; }
  .print-only { display: block !important; }
  .no-print { display: none !important; }
}
.print-only { display: none; }

/* ═══════════════════════════════════════════════════════════════════════════
   ACCORDION
   ═══════════════════════════════════════════════════════════════════════════ */
.accordion { border: 1px solid var(--color-card-border); border-radius: 10px; overflow: hidden; background: var(--color-card); }
.accordion-item { border-bottom: 1px solid var(--color-card-border); }
.accordion-item:last-child { border-bottom: none; }
.accordion-header { padding: 1rem 1.25rem; display: flex; justify-content: space-between; align-items: center; cursor: pointer; font-weight: 600; font-size: 0.88rem; transition: background 0.2s; }
.accordion-header:hover { background: var(--color-bg-alt); }
.accordion-header::after { content: "▼"; font-size: 0.6rem; opacity: 0.5; transition: transform 0.2s; }
.accordion-item.active .accordion-header::after { transform: rotate(180deg); }
.accordion-body { padding: 0 1.25rem; max-height: 0; overflow: hidden; transition: all 0.3s ease; font-size: 0.85rem; color: var(--color-text-secondary); line-height: 1.6; }
.accordion-item.active .accordion-body { padding: 1rem 1.25rem; max-height: 500px; }

/* ═══════════════════════════════════════════════════════════════════════════
   ADVANCED TABLES (Sorting & Pagination)
   ═══════════════════════════════════════════════════════════════════════════ */
.table-sort-header { cursor: pointer; display: flex; align-items: center; gap: 0.25rem; }
.table-sort-header:hover { color: var(--color-accent); }
.table-sort-header::after { content: "↕"; font-size: 0.7rem; opacity: 0.3; }
.table-sort-header.asc::after { content: "↑"; opacity: 1; }
.table-sort-header.desc::after { content: "↓"; opacity: 1; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 1.5rem; }
.page-btn { padding: 0.35rem 0.75rem; border-radius: 6px; border: 1px solid var(--color-card-border); background: var(--color-card); font-size: 0.75rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.page-btn:hover:not(:disabled) { border-color: var(--color-accent); color: var(--color-accent); }
.page-btn.active { background: var(--color-accent); color: #fff; border-color: var(--color-accent); }
.page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ═══════════════════════════════════════════════════════════════════════════
   PICKERS & SPECIAL INPUTS
   ═══════════════════════════════════════════════════════════════════════════ */
/* File Upload Zone */
.file-upload-zone {
  border: 2px dashed var(--color-card-border); border-radius: 12px; padding: 2rem;
  text-align: center; cursor: pointer; transition: all 0.2s; background: var(--color-bg-alt);
}
.file-upload-zone:hover { border-color: var(--color-accent); background: var(--color-accent-light); }
.file-upload-icon { font-size: 2rem; margin-bottom: 0.5rem; display: block; }
.file-upload-text { font-size: 0.85rem; font-weight: 500; color: var(--color-text-secondary); }
.file-upload-hint { font-size: 0.72rem; color: var(--color-text-muted); margin-top: 0.25rem; }

/* Color Picker Wrapper */
.color-picker-wrap { display: flex; align-items: center; gap: 0.75rem; }
.input-color { width: 40px; height: 40px; padding: 0; border: none; border-radius: 8px; cursor: pointer; background: none; }
.input-color::-webkit-color-swatch-wrapper { padding: 0; }
.input-color::-webkit-color-swatch { border: 1px solid var(--color-card-border); border-radius: 8px; }

/* ═══════════════════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
  .app-layout { flex-direction: column; }
  .sidebar { min-height: auto; width: 100% !important; min-width: unset !important; }
  .sidebar-nav { display: flex; flex-wrap: wrap; gap: 0.25rem; flex-direction: row; }
  .main-content { padding: 1rem !important; }
  .metrics-bar { grid-template-columns: repeat(2, 1fr); gap: 0.5rem; }
  .kanban-container { flex-direction: column; }
  .kanban-column { flex: 1 1 auto; min-width: unset; }
  .customer-panel { width: 100vw; }
  .grid-cols-2, .grid-cols-3, .grid-cols-4 { grid-template-columns: 1fr !important; }
  .grid-cols-2-4 { grid-template-columns: 1fr !important; }
  .table-cols-8 { grid-template-columns: 1.2fr 1.5fr 2.2fr 1.2fr 1fr 1fr; }
}

@media (max-width: 480px) {
  .metrics-bar { grid-template-columns: 1fr; }
  .table-cols-8 { grid-template-columns: 1fr 1fr; font-size: 0.72rem; }
  .login-card { padding: 1.5rem; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════════════════ */

@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
@keyframes fadeIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes float {
  0%, 100% { transform: translateY(0) scale(1); opacity: 0.3; }
  50% { transform: translateY(-30px) scale(1.1); opacity: 0.6; }
}
@keyframes glowPulse {
  0%, 100% { box-shadow: 0 0 20px rgba(13, 148, 136, 0.2); }
  50% { box-shadow: 0 0 40px rgba(13, 148, 136, 0.4); }
}
@keyframes letterReveal {
  0% { opacity: 0; transform: translateY(20px) scale(0.8); filter: blur(4px); }
  60% { transform: translateY(-5px) scale(1.05); filter: blur(0); }
  100% { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}
@keyframes fadeSlideUp {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.7; transform: scale(1.02); }
}
@keyframes skeleton {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bounceIn {
  0% { opacity: 0; transform: scale(0.85); }
  60% { opacity: 1; transform: scale(1.04); }
  100% { transform: scale(1); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(16px); }
  to { opacity: 1; transform: translateX(0); }
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes countUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes badgePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* ── Animation Utility Classes ── */
.animate-shake { animation: shake 0.4s ease; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }
.animate-spin { animation: spin 1s linear infinite; display: inline-block; }
.animate-bounce-in { animation: bounceIn 0.35s ease forwards; }
.animate-fade-in { animation: fadeIn 0.25s ease forwards; }
.animate-fade-up { animation: fadeSlideUp 0.35s ease forwards; }
.animate-fade-left { animation: fadeInLeft 0.3s ease forwards; }
.animate-fade-right { animation: fadeInRight 0.3s ease forwards; }
.animate-fade-down { animation: fadeInDown 0.25s ease forwards; }
.animate-scale-in { animation: scaleIn 0.25s ease forwards; }
.animate-count-up { animation: countUp 0.4s ease forwards; }
.animate-shimmer {
  background: linear-gradient(90deg, var(--color-bg-alt) 25%, var(--color-card-border) 50%, var(--color-bg-alt) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 6px;
}
.animate-badge-pop { animation: badgePop 0.3s ease; }

/* ── Staggered children animations ── */
.stagger-fade > * { opacity: 0; animation: fadeIn 0.3s ease forwards; }
.stagger-fade > *:nth-child(1) { animation-delay: 0.02s; }
.stagger-fade > *:nth-child(2) { animation-delay: 0.06s; }
.stagger-fade > *:nth-child(3) { animation-delay: 0.10s; }
.stagger-fade > *:nth-child(4) { animation-delay: 0.14s; }
.stagger-fade > *:nth-child(5) { animation-delay: 0.18s; }
.stagger-fade > *:nth-child(6) { animation-delay: 0.22s; }
.stagger-fade > *:nth-child(7) { animation-delay: 0.26s; }
.stagger-fade > *:nth-child(8) { animation-delay: 0.30s; }
.stagger-fade > *:nth-child(9) { animation-delay: 0.34s; }
.stagger-fade > *:nth-child(10) { animation-delay: 0.38s; }

.stagger-up > * { opacity: 0; animation: fadeSlideUp 0.35s ease forwards; }
.stagger-up > *:nth-child(1) { animation-delay: 0.03s; }
.stagger-up > *:nth-child(2) { animation-delay: 0.08s; }
.stagger-up > *:nth-child(3) { animation-delay: 0.13s; }
.stagger-up > *:nth-child(4) { animation-delay: 0.18s; }
.stagger-up > *:nth-child(5) { animation-delay: 0.23s; }
.stagger-up > *:nth-child(6) { animation-delay: 0.28s; }
.stagger-up > *:nth-child(7) { animation-delay: 0.33s; }
.stagger-up > *:nth-child(8) { animation-delay: 0.38s; }

/* ── Skeleton loading ── */
.skeleton {
  background: linear-gradient(90deg, var(--color-bg-alt) 25%, var(--color-card-border) 50%, var(--color-bg-alt) 75%);
  background-size: 200px 100%;
  animation: skeleton 1.5s ease-in-out infinite;
  border-radius: 6px;
  color: transparent !important;
  user-select: none;
  pointer-events: none;
}
.skeleton-text { height: 0.85rem; margin-bottom: 0.4rem; width: 80%; }
.skeleton-text.short { width: 40%; }
.skeleton-text.long { width: 95%; }
.skeleton-block { height: 60px; width: 100%; }
.skeleton-card { height: 100px; border-radius: 10px; }

/* ── Hover animations ── */
.hover-lift { transition: transform 0.2s ease, box-shadow 0.2s ease; }
.hover-lift:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.hover-glow { transition: box-shadow 0.2s ease; }
.hover-glow:hover { box-shadow: 0 0 16px rgba(13, 148, 136, 0.2); }
.hover-scale { transition: transform 0.15s ease; }
.hover-scale:hover { transform: scale(1.04); }
.hover-bright { transition: filter 0.2s ease; }
.hover-bright:hover { filter: brightness(1.08); }
