/* ============================================================
   dashboard.css - Panel administrativo SAC (estilo SaaS premium)
   Paleta: azul institucional → violeta · Glassmorphism
   Animaciones: transform/opacity, prefers-reduced-motion al final
   ============================================================ */

:root {
  --bg:          #F4F7F5;
  --surface:     #ffffff;
  --glass:       rgba(255, 255, 255, 0.72);
  --ink:         #17201B;
  --ink-2:       #4B5550;
  --ink-3:       #68736C;
  --border:      #E5ECE7;
  --border-2:    #D6ECDD;

  --primary:     #168447;
  --primary-dark:#0D5F32;
  --primary-light:#EAF7EF;
  --primary-2:   #0D5F32;
  --accent:      #10b981;
  --grad:        linear-gradient(135deg, #168447 0%, #0D5F32 100%);
  --grad-soft:   linear-gradient(135deg, rgba(22,132,71,.12), rgba(13,95,50,.08));

  --success:     #10b981;
  --warning:     #f59e0b;
  --danger:      #ef4444;
  --info:        #0ea5e9;

  --sidebar-w:   260px;
  --sidebar-w-c: 78px;
  --topbar-h:    68px;
  --radius:      18px;
  --radius-sm:   12px;
  --shadow-1:    0 1px 2px rgba(22,132,71,.04), 0 4px 16px rgba(0,0,0,.06);
  --shadow-2:    0 6px 24px -6px rgba(22,132,71,.16);
  --shadow-3:    0 20px 50px -16px rgba(22,132,71,.25);
  --ease:        cubic-bezier(.22,1,.36,1);
  --font:        'Inter', system-ui, -apple-system, sans-serif;
  --font-head:   'Inter', sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

/* ---------- Layout ---------- */
.app-shell { display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  position: sticky; top: 0; z-index: 50;
  height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 14px; }
.topbar-title { display: flex; align-items: center; gap: 10px; }
.topbar-title h1 { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: -.2px; }
.topbar-badge {
  font-size: 11px; font-weight: 800; letter-spacing: .8px; color: #fff;
  padding: 4px 10px; border-radius: 8px; background: var(--grad);
  box-shadow: 0 4px 12px rgba(22,132,71,.4);
}
.topbar-right { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  width: 40px; height: 40px; border: none; border-radius: 12px;
  display: grid; place-items: center; cursor: pointer;
  background: transparent; color: var(--ink-2); position: relative; overflow: hidden;
  transition: background .2s, transform .2s, color .2s;
}
.icon-btn:hover { background: var(--grad-soft); color: var(--primary); }
.icon-btn svg { width: 20px; height: 20px; transition: transform .3s var(--ease); }
.icon-btn:hover svg { transform: rotate(8deg); }
body.sidebar-collapsed .sidebar-toggle svg { transform: rotate(180deg); }

.app-body { display: flex; flex: 1; min-height: 0; }

/* ---------- Sidebar ---------- */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 18px 14px 16px;
  display: flex; flex-direction: column; gap: 12px;
  min-height: calc(100vh - var(--topbar-h));
  position: sticky;
  top: var(--topbar-h);
  align-self: flex-start;
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
  overflow-x: hidden;
  transition: width .32s var(--ease);
}
body.sidebar-collapsed .sidebar { width: var(--sidebar-w-c); }

.sidebar-brand { display: flex; align-items: center; gap: 12px; padding: 2px 6px; }
.brand-logo {
  width: 42px; height: 42px; flex-shrink: 0;
  display: grid; place-items: center;
  font-family: var(--font-head); font-weight: 700; font-size: 20px; color: #fff;
  border-radius: 13px; background: var(--grad);
  box-shadow: var(--shadow-3);
  animation: floaty 6s var(--ease) infinite;
}
.brand-text { font-family: var(--font-head); font-weight: 700; font-size: 17px; letter-spacing: .3px; white-space: nowrap; transition: opacity .25s; }
.brand-text small { display: block; font-weight: 500; font-size: 10px; letter-spacing: 2.5px; color: var(--ink-3); }

.sidebar-nav { display: flex; flex-direction: column; gap: 6px; flex: 1; }
.nav-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.4px;
  color: var(--ink-3); padding: 6px 10px; white-space: nowrap; transition: opacity .25s;
}
body.sidebar-collapsed .nav-label { opacity: 0; pointer-events: none; }

.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 12px;
  padding: 12px 13px; border-radius: 13px;
  color: var(--ink-2); text-decoration: none; overflow: hidden;
  transition: background .25s, color .25s, transform .2s;
}
.nav-item::before {
  content: "";
  position: absolute; left: -3px; top: 20%; height: 60%; width: 4px;
  border-radius: 4px; background: var(--grad);
  opacity: 0; transform: translateX(-4px);
  transition: opacity .3s, transform .3s var(--ease);
}
.nav-item:hover { background: var(--grad-soft); color: var(--primary); transform: translateX(2px); }
.nav-item:hover .nav-icon svg { animation: bounce  .5s var(--ease); }
.nav-item.active { background: var(--grad); color: #fff; box-shadow: 0 10px 24px -8px rgba(99,102,241,.55); }
.nav-item.active::before { opacity: 1; transform: translateX(0); }
.nav-icon { width: 22px; height: 22px; flex-shrink: 0; display: grid; place-items: center; }
.nav-icon svg { width: 21px; height: 21px; }
.nav-text { white-space: nowrap; font-size: 14px; font-weight: 600; transition: opacity .2s, transform .2s; }

body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .brand-text { opacity: 0; width: 0; pointer-events: none; }
body.sidebar-collapsed .nav-item { justify-content: center; padding: 12px; }
body.sidebar-collapsed .nav-item::before { display: none; }
body.sidebar-collapsed .sidebar-user div { display: none; }

.sidebar-foot { border-top: 1px solid var(--border); padding-top: 14px; }
.sidebar-user { display: flex; align-items: center; gap: 11px; padding: 4px 6px; white-space: nowrap; }
.sidebar-user strong { font-size: 13px; display: block; }
.sidebar-user small { color: var(--ink-3); font-size: 11.5px; }
body.sidebar-collapsed .sidebar-user { justify-content: center; }

/* Avatar */
.avatar {
  width: 38px; height: 38px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 12px;
  background: var(--grad); color: #fff; font-weight: 700; font-size: 15px;
  box-shadow: 0 6px 14px rgba(99,102,241,.35);
}
.avatar.sm { width: 34px; height: 34px; font-size: 13px; border-radius: 10px; }

/* ---------- Main ---------- */
.main { flex: 1; min-width: 0; display: flex; }
.main-inner { flex: 1; padding: 26px 28px 90px; max-width: 1420px; margin: 0 auto; width: 100%; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-head h2 { font-family: var(--font-head); font-size: 24px; font-weight: 700; margin: 0; letter-spacing: -.4px; }
.page-head p { color: var(--ink-2); margin: 6px 0 0; font-size: 14px; }

/* ---------- Cards ---------- */
.card {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.75);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  padding: 20px;
  animation: rise .55s var(--ease) both;
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-2); }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; }
.card-title { font-family: var(--font-head); font-weight: 600; font-size: 15px; margin: 0; }
.card-title small { display: block; font-family: var(--font); font-weight: 500; color: var(--ink-3); font-size: 12.5px; }

/* ---------- Metric cards ---------- */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 18px; margin-bottom: 26px;
}
.metric {
  position: relative; overflow: hidden; padding: 20px 18px;
  animation-name: rise;
}
.metric .accent-bar {
  position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--mc); border-radius: 4px;
  transition: transform .4s var(--ease);
  transform-origin: top;
}
.metric:hover .accent-bar { transform: scaleY(1.12); }
.metric-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.metric-label { color: var(--ink-2); font-size: 13px; font-weight: 600; }
.metric-icon {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  color: #fff; background: var(--mc-grad); box-shadow: 0 10px 22px -8px var(--mc-shad);
  transition: transform .4s var(--ease);
}
.metric:hover .metric-icon { transform: scale(1.12) rotate(8deg); animation: pulse 2.2s var(--ease) infinite; }
.metric-icon svg { width: 22px; height: 22px; }
.metric-value { font-family: var(--font-head); font-size: 30px; font-weight: 700; line-height: 1; letter-spacing: -.5px; }
.metric-foot { margin-top: 12px; font-size: 12.5px; color: var(--ink-3); }
.metric-foot .trend { font-weight: 700; }
.trend.up { color: var(--success); }
.trend.down { color: var(--danger); }

/* ---------- Grid ---------- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 1100px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }

/* ---------- Tables ---------- */
.table-wrap { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow-1); overflow: hidden; }
.table-scroll { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; }
table.data thead th {
  text-align: left; font-size: 11.5px; text-transform: uppercase; letter-spacing: 1px;
  color: var(--ink-3); font-weight: 700; padding: 14px 16px; border-bottom: 1px solid var(--border);
  background: #fafbfc; white-space: nowrap;
}
table.data tbody td { padding: 13px 16px; font-size: 13.5px; border-bottom: 1px solid var(--border); vertical-align: middle; }
table.data tbody tr { transition: background .2s, transform .2s; }
table.data tbody tr:hover { background: var(--grad-soft); }
table.data tbody tr.no-data td { text-align: center; color: var(--ink-3); padding: 40px; }
.cell-strong { font-weight: 700; color: var(--primary); font-family: var(--font-head); }

/* ---------- Badges / chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 700; padding: 5px 11px; border-radius: 999px;
  white-space: nowrap;
}
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.badge.ok      { color: var(--success); background: rgba(16,185,129,.12); }
.badge.alerta  { color: var(--warning); background: rgba(245,158,11,.14); }
.badge.critico { color: var(--danger);  background: rgba(239,68,68,.12); animation: pulseBadge 1.6s ease infinite; }
.badge.info    { color: var(--info);    background: rgba(14,165,233,.12); }
.badge.sla     { color: var(--ink-2);   background: var(--grad-soft); }
.badge.neutral { color: var(--ink-2);   background: #f1f5f9; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 14px; border-radius: 999px; border: 1.5px solid var(--border-2);
  background: var(--surface); color: var(--ink-2); font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all .28s var(--ease);
}
.chip:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.chip.active { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 18px -8px rgba(22,132,71,.5); }

/* ---------- Buttons ---------- */
.btn {
  position: relative; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font); font-size: 14px; font-weight: 600;
  padding: 11px 20px; border-radius: 12px; border: 1px solid transparent;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .3s, background .3s, color .3s, border-color .3s;
}
.btn svg { width: 17px; height: 17px; }
.btn:active { transform: scale(.97); }
.btn-primary {
  color: #fff; background: var(--grad); box-shadow: 0 10px 24px -10px rgba(22,132,71,.4);
}
.btn-primary:hover { box-shadow: 0 14px 30px -10px rgba(22,132,71,.55); transform: translateY(-2px); }
.btn-ghost { background: var(--surface); border-color: var(--border-2); color: var(--ink-2); }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); transform: translateY(-2px); }
.btn-danger { background: rgba(239,68,68,.1); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-success { background: rgba(16,185,129,.12); color: var(--success); }
.btn-success:hover { background: var(--success); color: #fff; }
.btn-sm { padding: 8px 13px; font-size: 12.5px; border-radius: 10px; }
.btn-lg { padding: 14px 26px; font-size: 15px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon-only { padding: 10px; display: inline-grid; place-items: center; }

/* Ripple */
.ripple-effect {
  position: absolute; border-radius: 50%; pointer-events: none;
  background: rgba(255,255,255,.45);
  transform: scale(0); animation: ripple .6s ease-out;
}
.btn-ghost .ripple-effect, .btn-danger .ripple-effect { background: rgba(22,132,71,.22); }

/* FAB */
.fab {
  position: fixed; right: 30px; bottom: 30px; z-index: 40;
  width: 62px; height: 62px; border: none; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  color: #fff; background: var(--grad); box-shadow: 0 16px 34px -10px rgba(22,132,71,.65);
  transition: transform .3s var(--ease), box-shadow .3s;
}
.fab:hover { transform: translateY(-4px) scale(1.06); box-shadow: 0 22px 44px -12px rgba(22,132,71,.8); }
.fab:active { transform: scale(.95); }
.fab svg { width: 26px; height: 26px; }

/* ---------- User dropdown ---------- */
.user-menu { position: relative; }
.user-trigger {
  display: flex; align-items: center; gap: 10px;
  background: var(--glass); border: 1px solid var(--border); border-radius: 14px;
  padding: 6px 12px 6px 6px; cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}
.user-trigger:hover { border-color: rgba(22,132,71,.5); box-shadow: var(--shadow-1); }
.user-meta { text-align: left; line-height: 1.2; }
.user-meta strong { font-size: 13px; display: block; }
.user-meta small { font-size: 11px; color: var(--ink-3); }
.user-trigger .chevron { width: 16px; height: 16px; color: var(--ink-3); transition: transform .3s var(--ease); }
.user-menu.open .chevron { transform: rotate(180deg); }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); min-width: 240px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  box-shadow: var(--shadow-2); padding: 10px; z-index: 60;
  opacity: 0; transform: scale(.9) translateY(-6px); pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
.user-menu.open .user-dropdown { opacity: 1; transform: scale(1) translateY(0); pointer-events: auto; }
.dropdown-head { display: flex; align-items: center; gap: 10px; padding: 8px 6px 12px; border-bottom: 1px solid var(--border); margin-bottom: 8px; }
.dropdown-head strong { font-size: 13.5px; display: block; }
.dropdown-head small { color: var(--ink-3); font-size: 12px; }
.dropdown-info { font-size: 12.5px; color: var(--ink-2); padding: 8px 10px; background: var(--grad-soft); border-radius: 10px; margin-bottom: 8px; }
.dropdown-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; color: var(--ink-2); text-decoration: none; font-size: 13.5px; font-weight: 500;
  transition: background .2s, color .2s;
}
.dropdown-item:hover { background: var(--grad-soft); color: var(--primary); }
.dropdown-item.danger:hover { background: rgba(239,68,68,.1); color: var(--danger); }
.dropdown-item svg { width: 17px; height: 17px; }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(15,23,42,.45); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none; transition: opacity .28s;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }
.modal {
  position: fixed; z-index: 100; left: 50%; top: 50%;
  width: min(640px, 92vw); max-height: 88vh; overflow-y: auto;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-3);
  padding: 24px;
  opacity: 0; transform: translate(-50%, -50%) scale(.95);
  pointer-events: none;
  transition: opacity .26s var(--ease), transform .26s var(--ease);
}
.modal.show { opacity: 1; transform: translate(-50%, -50%) scale(1); pointer-events: auto; }
.modal.wide { width: min(820px, 94vw); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.modal-head h3 { font-family: var(--font-head); font-size: 19px; margin: 0; }
.modal-head p { margin: 4px 0 0; color: var(--ink-3); font-size: 13px; }
.modal-close {
  width: 34px; height: 34px; border: none; border-radius: 10px; cursor: pointer;
  background: #f1f5f9; color: var(--ink-2); font-size: 16px; display: grid; place-items: center;
  transition: background .2s, transform .2s;
}
.modal-close:hover { background: rgba(239,68,68,.12); color: var(--danger); transform: rotate(90deg); }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 22px; }

/* ---------- Toast ---------- */
.toast-container {
  position: fixed; top: 84px; right: 22px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.toast {
  display: flex; align-items: center; gap: 10px;
  background: var(--surface); border-left: 4px solid var(--toc, var(--success));
  border-radius: 13px; box-shadow: var(--shadow-2); padding: 13px 18px;
  font-size: 13.5px; font-weight: 500; min-width: 260px; max-width: 380px;
  animation: toastIn .45s var(--ease);
  pointer-events: auto; position: relative; overflow: hidden;
}
.toast::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%;
  background: var(--toc, var(--success)); transform-origin: left;
  animation: toastBar 4s linear forwards;
}
.toast-success { --toc: var(--success); }
.toast-error   { --toc: var(--danger); }
.toast-warning { --toc: var(--warning); }
.toast-info    { --toc: var(--info); }
.toast.leaving { animation: toastOut .35s var(--ease) forwards; }
.toast-static { position: static; margin-bottom: 16px; animation: none; }
.toast-static::after { animation: none; }

/* ---------- Progress ring SLA ---------- */
.sla-ring { position: relative; width: 46px; height: 46px; display: inline-grid; place-items: center; }
.sla-ring svg { width: 46px; height: 46px; transform: rotate(-90deg); }
.sla-ring .ring-bg { fill: none; stroke: #eef2f7; stroke-width: 6; }
.sla-ring .ring-fill {
  fill: none; stroke-width: 6; stroke-linecap: round;
  stroke: var(--rc, var(--success));
  transition: stroke-dashoffset 1s var(--ease), stroke .5s;
}
.sla-ring .ring-fill.pulse { animation: slaPulse 1.6s ease infinite; }
.ring-center { position: absolute; font-size: 12px; font-weight: 700; line-height: 1; text-align: center; }
.ring-center span { display: block; font-size: 8.5px; color: var(--ink-3); }

/* ---- Semáforo SLA de Alta Visibilidad ---- */
.semaforo-container {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.semaforo-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  white-space: nowrap;
  box-shadow: 0 3px 10px rgba(0,0,0,0.06);
  transition: all 0.25s var(--ease);
}
.semaforo-pill.ok {
  color: #047857;
  background: #d1fae5;
  border: 1.5px solid #10b981;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}
.semaforo-pill.alerta {
  color: #b45309;
  background: #fef3c7;
  border: 1.5px solid #f59e0b;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.3);
  animation: semaforoGlow 1.8s infinite alternate;
}
.semaforo-pill.critico {
  color: #b91c1c;
  background: #fee2e2;
  border: 1.5px solid #ef4444;
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.4);
  animation: semaforoAlertPulse 1.4s infinite alternate;
}
@keyframes semaforoGlow {
  0% { box-shadow: 0 0 4px rgba(245, 158, 11, 0.3); }
  100% { box-shadow: 0 0 14px rgba(245, 158, 11, 0.85); }
}
@keyframes semaforoAlertPulse {
  0% { transform: scale(1); box-shadow: 0 0 4px rgba(239, 68, 68, 0.4); }
  100% { transform: scale(1.04); box-shadow: 0 0 18px rgba(239, 68, 68, 0.9); }
}

/* ---------- Skeleton ---------- */
.skeleton {
  position: relative; overflow: hidden; background: #eef2f7; border-radius: 8px;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.75), transparent);
  animation: shimmer 1.3s infinite;
}

/* ---------- Animaciones ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }
@keyframes pulseBadge { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
@keyframes bounce { 0% { transform: scale(1); } 40% { transform: scale(1.25) rotate(-6deg); } 100% { transform: scale(1); } }
@keyframes ripple { to { transform: scale(4); opacity: 0; } }
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }
@keyframes slaPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes toastIn {
  0%   { opacity: 0; transform: translateX(40px) scale(.95); }
  60%  { transform: translateX(-4px); }
  100% { opacity: 1; transform: translateX(0) scale(1); }
}
@keyframes toastOut { to { opacity: 0; transform: translateX(40px) scale(.9); } }
@keyframes toastBar { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* Stagger de entrada para cards: aplicar con retrasos por nth-child */
.stagger > * { opacity: 0; animation: rise .55s var(--ease) forwards; }
.stagger > *:nth-child(1) { animation-delay: .05s; }
.stagger > *:nth-child(2) { animation-delay: .12s; }
.stagger > *:nth-child(3) { animation-delay: .19s; }
.stagger > *:nth-child(4) { animation-delay: .26s; }
.stagger > *:nth-child(5) { animation-delay: .33s; }
.stagger > *:nth-child(6) { animation-delay: .40s; }
.stagger > *:nth-child(7) { animation-delay: .47s; }
.stagger > *:nth-child(8) { animation-delay: .54s; }

/* Responsive */
@media (max-width: 900px) {
  .sidebar { position: fixed; left: 0; top: var(--topbar-h); bottom: 0; z-index: 80; width: var(--sidebar-w); transform: translateX(-100%); transition: transform .32s var(--ease); }
  .sidebar.mobile-open { transform: translateX(0); }
  body.sidebar-collapsed .sidebar { width: var(--sidebar-w); }
  body.sidebar-collapsed .nav-text, body.sidebar-collapsed .brand-text { opacity: 1; width: auto; }
  body.sidebar-collapsed .sidebar-user div { display: block; }
  body.sidebar-collapsed .nav-item { justify-content: flex-start; padding: 12px 13px; }
  .main-inner { padding: 20px 16px 90px; }
  .topbar-title h1 { font-size: 14px; }
  .user-meta, .user-trigger .chevron { display: none; }
}