/* ============================================================================
   Panel MDM — sistema de diseño (réplica del Portal "Jobie" de Grupo Jerónimo).
   Verde salvia #8ABAA0 sobre gris muy claro, tarjetas blancas, sidebar verde
   oscuro con el ítem activo "mordido". Tipografía Inter + Poppins (display).
   ============================================================================ */

/* ── Fuentes autoalojadas ──────────────────────────────────────────────────── */
@font-face {
  font-family: "Inter Variable"; font-style: normal; font-weight: 100 900;
  font-display: swap; src: url("../assets/fonts/inter-latin-wght-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins"; font-style: normal; font-weight: 500;
  font-display: swap; src: url("../assets/fonts/poppins-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins"; font-style: normal; font-weight: 600;
  font-display: swap; src: url("../assets/fonts/poppins-latin-600-normal.woff2") format("woff2");
}

/* ── Tokens ─────────────────────────────────────────────────────────────────── */
:root {
  --radius: 1rem;
  --background: #f4f6f5;
  --foreground: #1b2620;
  --card: #ffffff;
  --card-foreground: #1b2620;
  --primary: #8abaa0;
  --primary-strong: #3f8a6a;
  --primary-foreground: #10211a;
  --secondary: #e9efeb;
  --muted: #eef2f0;
  --muted-foreground: #5c6b64;
  --accent: #e3ede7;
  --accent-soft: #e6f1ea;
  --accent-strong: #b7d6c4;
  --destructive: #d6463f;
  --success: #2e9e6b;
  --warning: #c8922a;
  --info: #2a6ec8;
  --border: #e2e7e4;
  --ring: #8abaa0;
  --sidebar: #2f5a46;
  --sidebar-foreground: #eaf3ee;
  --sidebar-muted: #a9c6b6;
  --shadow-sm: 0 1px 2px rgba(16, 33, 26, 0.04);
  --shadow-md: 0 8px 24px -10px rgba(16, 33, 26, 0.18);
  --font-sans: "Inter Variable", "Inter", "Segoe UI", system-ui, sans-serif;
  --font-display: "Poppins", "Inter Variable", "Segoe UI", system-ui, sans-serif;
}
:root[data-theme="dark"] {
  --background: #0e1512; --foreground: #e7ecea; --card: #171f1b; --card-foreground: #e7ecea;
  --primary: #8abaa0; --primary-strong: #63b892; --primary-foreground: #0e1512;
  --secondary: #1f2a24; --muted: #1f2a24; --muted-foreground: #9daea6;
  --accent: #233029; --accent-soft: #1d2924; --accent-strong: #2f4a3c;
  --destructive: #e06a63; --success: #41b481; --warning: #d8a445; --info: #5a90d8;
  --border: rgba(255,255,255,0.10); --ring: #8abaa0; --sidebar: #16241d; --sidebar-foreground: #dfeae4;
  --sidebar-muted: #7f9a8b; --shadow-sm: 0 1px 2px rgba(0,0,0,0.3); --shadow-md: 0 8px 24px -10px rgba(0,0,0,0.55);
}

* { box-sizing: border-box; }
/* El atributo hidden debe ganar SIEMPRE: si no, .login { display:grid } lo
   mantendría visible tapando la app tras iniciar sesión. */
[hidden] { display: none !important; }
html { font-size: 14px; }
body {
  margin: 0; background: var(--background); color: var(--foreground);
  font-family: var(--font-sans); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
.font-display { font-family: var(--font-display); letter-spacing: -0.02em; }
.tnum { font-variant-numeric: tabular-nums; }
a { color: inherit; }
/* Tamaño por defecto seguro para iconos SVG: evita que se vean gigantes si el
   contenedor no los dimensiona. :where() tiene especificidad 0, así que cualquier
   regla de componente (.btn svg, .stat__icon svg…) lo sobreescribe sin problema. */
:where(svg) { width: 1em; height: 1em; flex: none; }
.card__title { display: flex; align-items: center; gap: 8px; }
.card__title svg { width: 18px; height: 18px; color: var(--muted-foreground); }
.dev-card__name svg { width: 18px; height: 18px; color: var(--muted-foreground); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted-foreground) 30%, transparent); border-radius: 9999px; }
::-webkit-scrollbar-track { background: transparent; }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.app { display: grid; grid-template-columns: 244px 1fr; min-height: 100vh; }
.app.hidden { display: none; }

/* ── Sidebar ────────────────────────────────────────────────────────────────── */
.sidebar {
  background: var(--sidebar); color: var(--sidebar-foreground);
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; padding: 22px 0 16px;
}
.sidebar__brand { display: flex; align-items: center; gap: 10px; padding: 0 22px 20px; }
.sidebar__brand img { height: 30px; width: auto; filter: brightness(0) invert(1); opacity: 0.95; }
.sidebar__brand span { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.02em; }
.sidebar__nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 0 8px 14px; margin-top: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 11px 16px; border: 0; background: transparent;
  color: var(--sidebar-muted); font: inherit; font-size: 0.9rem; cursor: pointer; text-align: left;
  border-radius: 12px 0 0 12px; width: 100%; transition: color .18s, background .18s;
}
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; }
.nav-item:hover { color: var(--sidebar-foreground); background: rgba(255,255,255,0.06); }
.nav-item.active {
  position: relative; background: var(--background); color: var(--foreground); font-weight: 600;
  animation: nav-in .28s cubic-bezier(.4,0,.2,1);
}
/* pastilla "mordida": dos curvas cóncavas funden el ítem activo con el contenido */
.nav-item.active::before, .nav-item.active::after {
  content: ""; position: absolute; right: 0; width: 22px; height: 22px; background: var(--background); pointer-events: none;
}
.nav-item.active::before { top: -22px; -webkit-mask-image: radial-gradient(circle 22px at left top, transparent 21px, #000 22px); mask-image: radial-gradient(circle 22px at left top, transparent 21px, #000 22px); }
.nav-item.active::after  { bottom: -22px; -webkit-mask-image: radial-gradient(circle 22px at left bottom, transparent 21px, #000 22px); mask-image: radial-gradient(circle 22px at left bottom, transparent 21px, #000 22px); }
@keyframes nav-in { from { opacity: 0; transform: translateX(8px);} to { opacity: 1; transform: none; } }
.sidebar__foot { margin-top: auto; padding: 12px 22px 0; color: var(--sidebar-muted); font-size: 0.72rem; }

/* ── Header + contenido ─────────────────────────────────────────────────────── */
.main { display: flex; flex-direction: column; min-width: 0; }
.header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 26px; background: var(--background); position: sticky; top: 0; z-index: 5;
}
.header__title { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; letter-spacing: -0.02em; margin: 0; }
.header__sub { color: var(--muted-foreground); font-size: 0.82rem; margin-top: 2px; }
.header__right { display: flex; align-items: center; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 9px; background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 5px 6px 5px 12px; box-shadow: var(--shadow-sm); }
.user-chip .name { font-size: 0.82rem; font-weight: 500; }
.avatar { width: 30px; height: 30px; border-radius: 999px; background: var(--primary); color: var(--primary-foreground); display: grid; place-items: center; font-weight: 600; font-size: 0.8rem; }
.content { padding: 6px 26px 40px; }

/* ── Botones ────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 1px solid transparent; border-radius: 11px;
  padding: 9px 15px; font: inherit; font-size: 0.86rem; font-weight: 500; cursor: pointer; transition: .15s; white-space: nowrap;
}
.btn svg { width: 16px; height: 16px; }
.btn--primary { background: var(--primary); color: var(--primary-foreground); }
.btn--primary:hover { background: color-mix(in srgb, var(--primary) 86%, #000); }
.btn--ghost { background: var(--card); border-color: var(--border); color: var(--foreground); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { background: var(--muted); }
.btn--danger { background: color-mix(in srgb, var(--destructive) 12%, var(--card)); color: var(--destructive); border-color: color-mix(in srgb, var(--destructive) 24%, transparent); }
.btn--danger:hover { background: color-mix(in srgb, var(--destructive) 20%, var(--card)); }
.btn--sm { padding: 6px 11px; font-size: 0.8rem; border-radius: 9px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px; border: 1px solid var(--border); background: var(--card); color: var(--foreground); cursor: pointer; box-shadow: var(--shadow-sm); }
.icon-btn:hover { background: var(--muted); }
.icon-btn svg { width: 18px; height: 18px; }

/* Campana de avisos: el número va sobre el icono, como en el móvil. */
#alertBtn { position: relative; }
#alertBtn[data-n]:not([data-n=""])::after {
  content: attr(data-n);
  position: absolute; top: -5px; right: -5px;
  min-width: 17px; height: 17px; padding: 0 4px;
  display: grid; place-items: center;
  border-radius: 999px; background: var(--warning); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 1;
  border: 2px solid var(--card);
}
.icon-btn--critica[data-n]:not([data-n=""])::after { background: var(--destructive); }
.icon-btn--alerta { border-color: color-mix(in srgb, var(--warning) 50%, var(--border)); }

/* Contador en el menú lateral */
.nav-item__badge {
  margin-left: auto; min-width: 20px; padding: 1px 6px;
  border-radius: 999px; background: var(--destructive); color: #fff;
  font-size: 11px; font-weight: 700; text-align: center;
}

/* Avisos ya cerrados: presentes pero sin robar atención */
.aviso--cerrado { opacity: .62; }

/* ── Filtros rápidos de periodo ──────────────────────────────────────────────── */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--card); color: var(--muted-foreground);
  font: inherit; font-size: 0.83rem; font-weight: 500; transition: .15s;
}
.chip:hover { background: var(--muted); color: var(--foreground); }
.chip--on {
  background: var(--primary-strong); border-color: var(--primary-strong);
  color: #fff; box-shadow: var(--shadow-sm);
}

/* ── Rango de fechas + botón, alineados por la base ──────────────────────────── */
.fechas { display: flex; align-items: flex-end; gap: 8px; flex-wrap: wrap; }
.campo-fecha { display: flex; flex-direction: column; gap: 6px; }
.campo-fecha label { font-size: 0.8rem; color: var(--muted-foreground); line-height: 1; }
.campo-fecha .input { width: 158px; height: 42px; }
/* Misma altura exacta que los inputs de fecha, para que la fila quede a ras. */
.btn--alto { height: 42px; padding-top: 0; padding-bottom: 0; }

/* ── Paginación ──────────────────────────────────────────────────────────────── */
.paginacion { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; }
.paginacion .paginas { display: flex; align-items: center; gap: 6px; }
.paginacion .pag {
  min-width: 34px; height: 34px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 9px; background: var(--card);
  color: var(--foreground); font: inherit; font-size: 0.84rem; cursor: pointer;
}
.paginacion .pag:hover:not(:disabled) { background: var(--muted); }
.paginacion .pag:disabled { opacity: .4; cursor: default; }
.paginacion .pag--on { background: var(--primary-strong); border-color: var(--primary-strong); color: #fff; font-weight: 600; }

/* ── Selector de color de grupo ──────────────────────────────────────────────── */
.colores { display: flex; gap: 8px; flex-wrap: wrap; }
.color {
  width: 30px; height: 30px; border-radius: 999px; cursor: pointer;
  border: 2px solid transparent; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.color--on { border-color: var(--foreground); }
.punto { width: 10px; height: 10px; border-radius: 999px; flex: 0 0 10px; display: inline-block; }

/* ── Lista seleccionable (buscador de empleados, equipos de una persona) ─────── */
.lista-sel { max-height: 330px; overflow-y: auto; border: 1px solid var(--border); border-radius: 12px; }
.sel-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  padding: 9px 12px; border: 0; border-bottom: 1px solid var(--border);
  background: none; color: var(--foreground); font: inherit; cursor: pointer; text-align: left;
}
.sel-item:last-child { border-bottom: 0; }
.sel-item:hover { background: var(--muted); }
.sel-item--on { background: color-mix(in srgb, var(--primary) 16%, transparent); }
.sel-item svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--muted-foreground); }
.sel-item .avatar { width: 30px; height: 30px; flex: 0 0 30px; font-size: .8rem; }
.avatar--lg { width: 40px; height: 40px; flex: 0 0 40px; font-size: 1rem; }

/* ── Cards ──────────────────────────────────────────────────────────────────── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card--pad { padding: 18px 20px; }
.card__title { font-family: var(--font-display); font-weight: 600; font-size: 1rem; margin: 0 0 2px; }
.card__hint { color: var(--muted-foreground); font-size: 0.78rem; }

.grid { display: grid; gap: 16px; }
.grid--stats { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }

/* Stat card */
.stat { display: flex; align-items: center; gap: 14px; padding: 18px 20px; }
.stat__icon { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--primary-strong); flex: 0 0 42px; }
.stat__icon svg { width: 21px; height: 21px; }
.stat__num { font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; line-height: 1; }
.stat__label { color: var(--muted-foreground); font-size: 0.78rem; margin-top: 3px; }

/* ── Device cards ───────────────────────────────────────────────────────────── */
.dev-card { padding: 16px 18px; cursor: pointer; transition: .15s; display: flex; flex-direction: column; gap: 12px; }
.dev-card:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.dev-card__top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.dev-card__name { font-weight: 600; font-size: 0.98rem; display: flex; align-items: center; gap: 8px; }
.dev-card__meta { color: var(--muted-foreground); font-size: 0.8rem; display: flex; flex-direction: column; gap: 3px; }
.dev-card__meta div { display: flex; align-items: center; gap: 7px; }
.dev-card__meta svg { width: 14px; height: 14px; opacity: .7; }
.dev-card__foot { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── Badges / chips ─────────────────────────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 0.74rem; font-weight: 600; }
.badge--dot::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.badge--ok { background: color-mix(in srgb, var(--success) 14%, var(--card)); color: var(--success); }
.badge--bad { background: color-mix(in srgb, var(--destructive) 14%, var(--card)); color: var(--destructive); }
.badge--warn { background: color-mix(in srgb, var(--warning) 16%, var(--card)); color: var(--warning); }
.badge--neutral { background: var(--muted); color: var(--muted-foreground); }
.badge--info { background: color-mix(in srgb, var(--info) 13%, var(--card)); color: var(--info); }

/* ── Tablas ─────────────────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
table.tbl th { text-align: left; color: var(--muted-foreground); font-weight: 600; font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; padding: 10px 12px; border-bottom: 1px solid var(--border); }
table.tbl td { padding: 11px 12px; border-bottom: 1px solid var(--border); }
table.tbl tr:last-child td { border-bottom: 0; }
table.tbl tbody tr:hover { background: var(--muted); }

/* barra proporcional (para minutos por web) */
.bar { height: 7px; border-radius: 999px; background: var(--muted); overflow: hidden; min-width: 80px; }
.bar > span { display: block; height: 100%; background: var(--primary); border-radius: 999px; }

/* ── Info rows (inventario) ─────────────────────────────────────────────────── */
.kv { display: grid; grid-template-columns: 130px 1fr; gap: 8px 14px; font-size: 0.86rem; }
.kv dt { color: var(--muted-foreground); }
.kv dd { margin: 0; font-weight: 500; }

/* ── Tabs ───────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 18px; flex-wrap: wrap; }
.tab { border: 0; background: transparent; padding: 10px 14px; font: inherit; font-size: 0.86rem; color: var(--muted-foreground); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab:hover { color: var(--foreground); }
.tab.active { color: var(--primary-strong); border-bottom-color: var(--primary-strong); font-weight: 600; }

/* ── Toggle ─────────────────────────────────────────────────────────────────── */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; }
.switch input { display: none; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: var(--muted); transition: .2s; cursor: pointer; }
.switch .track::before { content: ""; position: absolute; width: 18px; height: 18px; border-radius: 999px; background: #fff; top: 3px; left: 3px; transition: .2s; box-shadow: var(--shadow-sm); }
.switch input:checked + .track { background: var(--primary-strong); }
.switch input:checked + .track::before { transform: translateX(18px); }

/* ── Acciones (barra en detalle) ────────────────────────────────────────────── */
.actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Toolbar + buscador ─────────────────────────────────────────────────────── */
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.searchbox { position: relative; flex: 1; min-width: 220px; max-width: 420px; display: flex; align-items: center; }
.searchbox svg { position: absolute; left: 12px; width: 17px; height: 17px; color: var(--muted-foreground); pointer-events: none; }
.searchbox .input { padding-left: 38px; }
.stat__icon--bad { background: color-mix(in srgb, var(--destructive) 12%, transparent); color: var(--destructive); }

/* ── Pasos (instrucciones de instalación) ───────────────────────────────────── */
.pasos { margin: 14px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--muted-foreground); }
.pasos li { padding-left: 4px; }
.pasos b { color: var(--foreground); font-weight: 600; }
a.btn { text-decoration: none; }

/* ── Login ──────────────────────────────────────────────────────────────────── */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(1200px 600px at 20% -10%, var(--accent-soft), transparent), var(--background); }
.login__card { width: 100%; max-width: 380px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow-md); padding: 32px 30px; }
.login__logo { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-bottom: 22px; }
.login__logo img { height: 44px; }
.login__logo b { font-family: var(--font-display); font-weight: 600; font-size: 1.15rem; }
.login__logo small { color: var(--muted-foreground); }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 0.8rem; color: var(--muted-foreground); margin-bottom: 6px; }
.input { width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 11px; background: var(--card); color: var(--foreground); font: inherit; font-size: 0.9rem; }
.input:focus { outline: none; border-color: var(--ring); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 30%, transparent); }
.login__err { background: color-mix(in srgb, var(--destructive) 12%, var(--card)); color: var(--destructive); border-radius: 10px; padding: 9px 12px; font-size: 0.82rem; margin-bottom: 12px; }

/* ── Modal ──────────────────────────────────────────────────────────────────── */
.modal-back { position: fixed; inset: 0; background: rgba(16,33,26,0.42); display: grid; place-items: center; z-index: 40; padding: 20px; }
.modal { width: 100%; max-width: 440px; background: var(--card); border-radius: 18px; box-shadow: var(--shadow-md); padding: 24px; }
.modal--wide { max-width: 560px; }
.modal h3 { font-family: var(--font-display); margin: 0 0 6px; }
.modal .foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* ── Mapa (Leaflet autoalojado) ─────────────────────────────────────────────── */
.mapa { height: 380px; border-radius: 14px; border: 1px solid var(--border); overflow: hidden; z-index: 0; }
.mapa .leaflet-container { font: inherit; background: var(--muted); }
.mapa .leaflet-control-attribution { font-size: .65rem; background: color-mix(in srgb, var(--card) 82%, transparent); }
.mapa .leaflet-bar a { color: var(--foreground); background: var(--card); border-bottom-color: var(--border); }
.mapa .leaflet-bar a:hover { background: var(--secondary); }
.mapa .leaflet-popup-content-wrapper, .mapa .leaflet-popup-tip { background: var(--card); color: var(--foreground); box-shadow: var(--shadow-md); }

/* ── Toast ──────────────────────────────────────────────────────────────────── */
.toasts { position: fixed; right: 20px; bottom: 20px; display: flex; flex-direction: column; gap: 10px; z-index: 60; }
.toast { background: var(--card); border: 1px solid var(--border); border-left: 3px solid var(--primary-strong); border-radius: 12px; box-shadow: var(--shadow-md); padding: 12px 16px; font-size: 0.85rem; min-width: 220px; animation: toast-in .2s ease; }
.toast--ok { border-left-color: var(--success); }
.toast--err { border-left-color: var(--destructive); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Utilidades ─────────────────────────────────────────────────────────────── */
.row { display: flex; align-items: center; gap: 10px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.muted { color: var(--muted-foreground); }
.mt { margin-top: 16px; } .mb { margin-bottom: 16px; }
.spacer { flex: 1; }
.empty { text-align: center; color: var(--muted-foreground); padding: 40px 20px; }
.empty svg { width: 40px; height: 40px; opacity: .4; margin-bottom: 10px; }
.section-title { font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; margin: 22px 0 12px; }
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted-foreground); background: none; border: 0; cursor: pointer; font: inherit; font-size: 0.85rem; padding: 4px 0; margin-bottom: 8px; }
.back-link:hover { color: var(--foreground); }
.skeleton { background: linear-gradient(90deg, var(--muted) 25%, var(--secondary) 37%, var(--muted) 63%); background-size: 400% 100%; animation: sk 1.3s ease infinite; border-radius: 8px; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

/* ── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 30; width: 244px; transform: translateX(-100%); transition: transform .22s; }
  .sidebar.open { transform: none; }
  .header { position: static; }
  .menu-toggle { display: grid; }
}
.menu-toggle { display: none; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
