/* SmartStay ONE — design system
   Jost only · brand blue · module accents · light/dark via [data-theme] on <html> */

:root {
  --font: 'Jost', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --blue: #2563eb;
  --blue-deep: #1a6fce;
  --blue-grad: linear-gradient(135deg, #1a6fce 0%, #2563eb 100%);
  --blue-soft: #eff6ff;

  --violet: #7c3aed;       /* Housekeeping */
  --violet-soft: #f5f3ff;
  --indigo: #4f46e5;       /* Inventar */
  --indigo-soft: #eef2ff;
  --teal: #0d9488;
  --teal-soft: #f0fdfa;

  --success: #059669;
  --success-soft: #ecfdf5;
  --warning: #d97706;
  --warning-soft: #fffbeb;
  --critical: #dc2626;
  --critical-soft: #fef2f2;

  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-2: #f1f5f9;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --glass: rgba(255, 255, 255, 0.78);
  --shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.06);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.14);

  --r-card: 16px;
  --r-ctl: 12px;
  --r-pill: 999px;

  --topbar-h: 60px;
  --nav-h: 68px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);

  color-scheme: light;
}

:root[data-theme="dark"] {
  --blue-soft: rgba(37, 99, 235, 0.16);
  --violet-soft: rgba(124, 58, 237, 0.16);
  --indigo-soft: rgba(79, 70, 229, 0.18);
  --teal-soft: rgba(13, 148, 136, 0.16);
  --success-soft: rgba(5, 150, 105, 0.16);
  --warning-soft: rgba(217, 119, 6, 0.16);
  --critical-soft: rgba(220, 38, 38, 0.16);

  --bg: #020617;
  --surface: #0f172a;
  --surface-2: #1e293b;
  --border: #1e293b;
  --text: #f1f5f9;
  --text-2: #94a3b8;
  --text-3: #64748b;
  --glass: rgba(15, 23, 42, 0.78);
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.5);

  color-scheme: dark;
}

/* ── Base ─────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--blue); text-decoration: none; }
h1, h2, h3 { margin: 0; letter-spacing: -0.02em; line-height: 1.2; }
p { margin: 0; }
.tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { width: 22px; height: 22px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 18px; height: 18px; }
.icon-lg { width: 28px; height: 28px; }

/* ── Logo ─────────────────────────────────────────────────────────────── */
.logo { display: inline-flex; align-items: center; }
.logo-img { display: block; height: 30px; width: auto; }
.logo-lg .logo-img { height: 56px; }
:root[data-theme="dark"] .logo .show-dark { display: block; }

/* ── App shell ────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 12px;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding: var(--safe-top) 16px 0;
  background: var(--glass);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { flex: 1; min-width: 0; font-size: 18px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px;
  border: 0; border-radius: var(--r-pill); background: transparent; color: var(--text-2);
  cursor: pointer;
}
.icon-btn:active { background: var(--surface-2); }
.avatar {
  display: inline-grid; place-items: center; width: 36px; height: 36px; flex: none;
  border-radius: var(--r-pill); background: var(--blue-grad); color: #fff;
  font-size: 14px; font-weight: 600; letter-spacing: 0.02em;
}
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }
.avatar.role-maid { background: linear-gradient(135deg, #6d28d9, #7c3aed); }
.avatar.role-manager { background: linear-gradient(135deg, #0f766e, #0d9488); }
.avatar.role-user { background: linear-gradient(135deg, #475569, #64748b); }
.avatar.is-inactive { background: var(--surface-2); color: var(--text-3); }

.main {
  width: 100%; max-width: 760px; margin: 0 auto;
  padding: 20px 16px calc(var(--nav-h) + var(--safe-bottom) + 28px);
}
.main.no-nav { padding-bottom: calc(var(--safe-bottom) + 32px); }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; justify-content: space-around;
  height: calc(var(--nav-h) + var(--safe-bottom));
  padding: 6px 6px var(--safe-bottom);
  background: var(--glass);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-top: 1px solid var(--border);
}
.nav-item {
  flex: 1; max-width: 96px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  border-radius: 14px; color: var(--text-3); font-size: 11.5px; font-weight: 500;
}
.nav-item .icon { width: 24px; height: 24px; }
.nav-item.is-active { color: var(--blue); }
.nav-item.is-active .nav-pill::before { background: var(--blue-soft); }
.nav-pill { position: relative; isolation: isolate; display: grid; place-items: center; width: 52px; height: 30px; border-radius: var(--r-pill); }
.nav-item[data-module="housekeeping"].is-active { color: var(--violet); }
.nav-item[data-module="housekeeping"].is-active .nav-pill::before { background: var(--violet-soft); }
.nav-item[data-module="inventory"].is-active { color: var(--indigo); }
.nav-item[data-module="inventory"].is-active .nav-pill::before { background: var(--indigo-soft); }

@media (max-width: 899px) { .desktop-only { display: none !important; } }

@media (min-width: 900px) {
  .main { padding-top: 32px; }
  .bottom-nav { left: 50%; right: auto; bottom: 16px; transform: translateX(-50%); width: 560px;
    border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow-lg); height: var(--nav-h); padding-bottom: 6px; }
}

/* ── Surfaces ─────────────────────────────────────────────────────────── */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.grow { flex: 1; min-width: 0; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-card); box-shadow: var(--shadow); padding: 16px;
}
.card-title { font-size: 16px; font-weight: 600; }
.card-link { color: inherit; }
.card.row { display: flex; }
.card-link:active { transform: scale(0.99); }
.section-title { font-size: 13px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin: 8px 4px 0; }

.hero { padding: 4px 4px 0; }
.hero h1 { font-size: 26px; font-weight: 700; }
.hero p { margin-top: 4px; color: var(--text-2); }

.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; color: inherit; border-top: 1px solid var(--border); }
.list-item:first-child { border-top: 0; }
a.list-item:active, button.list-item:active { background: var(--surface-2); }
button.list-item { width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; font: inherit; text-align: left; cursor: pointer; color: inherit; }
.list-item .chev { color: var(--text-3); }
.list-title { font-weight: 600; }
.list-sub { display: block; font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Module tiles on Home */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.tile { position: relative; display: flex; flex-direction: column; gap: 14px; padding: 16px; color: inherit;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow); min-height: 132px; }
.tile:active { transform: scale(0.98); }
.tile-icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 13px; background: var(--blue-soft); color: var(--blue); }
.tile[data-module="housekeeping"] .tile-icon { background: var(--violet-soft); color: var(--violet); }
.tile[data-module="inventory"] .tile-icon { background: var(--indigo-soft); color: var(--indigo); }
.tile[data-module="reports"] .tile-icon { background: var(--teal-soft); color: var(--teal); }
.tile-icon[data-module="housekeeping"] { background: var(--violet-soft); color: var(--violet); }
.tile-icon[data-module="inventory"] { background: var(--indigo-soft); color: var(--indigo); }
.tile-icon[data-module="reports"] { background: var(--teal-soft); color: var(--teal); }
.tile-name { font-weight: 600; font-size: 16px; }
.tile-meta { font-size: 13px; color: var(--text-3); margin-top: 2px; }

/* ── Chips, badges ────────────────────────────────────────────────────── */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px; margin: 0 -2px; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; flex: none;
  height: 36px; padding: 0 14px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border); color: var(--text-2);
  font: 500 14px var(--font); cursor: pointer;
}
.chip.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }
.chip .count { font-size: 12px; opacity: 0.75; font-variant-numeric: tabular-nums; }

.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: 12.5px; font-weight: 600; white-space: nowrap; background: var(--surface-2); color: var(--text-2); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-teal { background: var(--teal-soft); color: var(--teal); }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-critical { background: var(--critical-soft); color: var(--critical); }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; background: var(--text-3); }
.dot-ok { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.dot-warn { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.dot-error, .dot-missing { background: var(--critical); box-shadow: 0 0 0 4px var(--critical-soft); }

/* ── Forms ────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.label { font-size: 14px; font-weight: 500; color: var(--text-2); }
.input, .select {
  width: 100%; height: 50px; padding: 0 14px;
  font: 400 16px var(--font); /* ≥16px: no iOS zoom-on-focus */
  color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border); border-radius: var(--r-ctl);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none; appearance: none;
}
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 40px; }
.input:focus, .select:focus { border-color: var(--blue); box-shadow: 0 0 0 4px var(--blue-soft); }
.field.has-error .input, .field.has-error .select { border-color: var(--critical); }
.field-error { font-size: 13.5px; color: var(--critical); }
.hint { font-size: 13.5px; color: var(--text-3); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 52px; }
.input-wrap .icon-btn { position: absolute; right: 5px; top: 5px; }

.check { display: flex; align-items: center; gap: 10px; font-size: 15px; color: var(--text-2); cursor: pointer; user-select: none; }
.check input { width: 22px; height: 22px; accent-color: var(--blue); margin: 0; }

.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-ctl); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label { display: grid; place-items: center; height: 36px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--text-2); cursor: pointer; }
.segmented input:checked + label { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.segmented input:focus-visible + label { outline: 2px solid var(--blue); }

.perm-row { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--border); }
.perm-row:first-child { border-top: 0; padding-top: 0; }

/* ── Buttons ──────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 50px; padding: 0 20px; border: 0; border-radius: var(--r-ctl);
  font: 600 16px var(--font); cursor: pointer; white-space: nowrap;
  transition: transform 0.12s, opacity 0.15s;
}
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.55; pointer-events: none; }
.btn-primary { background: var(--blue-grad); color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, 0.28); }
.btn-secondary { background: var(--surface-2); color: var(--text); }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-danger { background: var(--critical-soft); color: var(--critical); }
.btn-block { width: 100%; }
.btn-sm { height: 40px; padding: 0 14px; font-size: 14.5px; }
.btn .spinner { display: none; }
.btn.is-loading .spinner { display: inline-block; }
.spinner { width: 18px; height: 18px; border: 2.5px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.fab-bar {
  position: sticky; bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px); z-index: 20;
  display: flex; gap: 10px; padding: 10px; margin: 8px -10px 0;
  background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow-lg);
}

/* ── Alerts, toasts ───────────────────────────────────────────────────── */
.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r-ctl); font-size: 14.5px; }
.alert .icon { margin-top: 1px; }
.alert-error { background: var(--critical-soft); color: var(--critical); }
.alert-success { background: var(--success-soft); color: var(--success); }
.alert-warning { background: var(--warning-soft); color: var(--warning); }
.alert-info { background: var(--blue-soft); color: var(--blue); }

.toasts { position: fixed; left: 16px; right: 16px; bottom: calc(var(--nav-h) + var(--safe-bottom) + 14px); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 12px 16px; border-radius: 14px;
  background: #0f172a; color: #fff; font-size: 14.5px; box-shadow: var(--shadow-lg);
  animation: toast-in 0.25s ease-out; }
:root[data-theme="dark"] .toast { background: #f1f5f9; color: #0f172a; }
.toast.is-leaving { animation: toast-out 0.2s ease-in forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(8px); } }

/* ── Auth screens (login, password, install) ─────────────────────────── */
.auth {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: calc(var(--safe-top) + 32px) 20px calc(var(--safe-bottom) + 32px);
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(37, 99, 235, 0.14), transparent 70%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 400px; }
.auth-head { text-align: center; margin-bottom: 28px; }
.auth-head h1 { font-size: 24px; font-weight: 700; margin-top: 22px; }
.auth-head p { color: var(--text-2); margin-top: 6px; }
.auth-foot { margin-top: 24px; text-align: center; font-size: 13px; color: var(--text-3); }

/* Install page */
.install-icon { width: 96px; height: 96px; border-radius: 24px; box-shadow: 0 16px 40px rgba(37, 99, 235, 0.3); }
.feature-list { display: grid; gap: 12px; margin: 0; padding: 16px; list-style: none; }
.feature-list li { display: flex; gap: 12px; align-items: center; font-size: 15px; color: var(--text-2); }
.feature-list .tile-icon { width: 38px; height: 38px; border-radius: 11px; }
.steps { counter-reset: step; display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.steps li { counter-increment: step; display: flex; gap: 12px; align-items: center; font-size: 15px; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; flex: none;
  border-radius: 50%; background: var(--blue-soft); color: var(--blue); font-weight: 600; font-size: 14px; }
.kbd-icon { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: var(--surface-2); color: var(--blue); vertical-align: middle; }
[hidden] { display: none !important; }
.show-dark { display: none; }
:root[data-theme="dark"] .show-dark { display: contents; }
:root[data-theme="dark"] .show-light { display: none; }

/* ── Status / empty states ────────────────────────────────────────────── */
.empty { text-align: center; padding: 40px 20px; }
.empty .tile-icon { width: 64px; height: 64px; border-radius: 20px; margin: 0 auto 16px; }
.empty h2 { font-size: 20px; font-weight: 600; }
.empty p { color: var(--text-2); margin-top: 6px; }

.kv { display: grid; grid-template-columns: 1fr auto; gap: 10px 12px; font-size: 14.5px; }
.kv dt { color: var(--text-2); }
.kv dd { margin: 0; text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; }

.credential { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-radius: var(--r-ctl); background: var(--surface-2); }
.credential code { font: 600 20px/1.2 ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: 0.04em; word-break: break-all; }

/* Skeleton */
.skeleton { background: linear-gradient(90deg, var(--surface-2) 25%, var(--border) 37%, var(--surface-2) 63%);
  background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Prompt „Activează notificările” — apare o dată la deschidere (push.js), deasupra navigației. */
.push-prompt { position: fixed; left: 12px; right: 12px; bottom: calc(var(--nav-h) + var(--safe-bottom) + 12px); z-index: 55;
  display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: var(--r-card);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(12px); transition: opacity 0.2s, transform 0.2s; }
.push-prompt.is-in { opacity: 1; transform: none; }
.push-prompt[hidden] { display: none; }
.push-prompt strong { display: block; font-size: 15.5px; }
.push-prompt p { margin: 2px 0 10px; font-size: 14px; color: var(--text-2); }
.push-prompt-actions { display: flex; gap: 8px; }
@media (min-width: 900px) { .push-prompt { left: auto; right: 24px; width: 380px; bottom: 24px; } }
@media (prefers-reduced-motion: reduce) { .push-prompt { transition: none; } }

/* ── Animații ușoare (1.4.5) ─────────────────────────────────────────────
   Doar transform/opacity, max. 200 ms, pornite de o stare (tap sau încărcarea unei liste).
   Fără JS de animație, fără will-change, fără nimic care rulează continuu. Reduced motion
   le anulează prin regula globală de mai sus. */
.chip { transition: background-color 0.15s, border-color 0.15s, color 0.15s, transform 0.12s; }
.chip:active { transform: scale(0.96); }
.icon-btn { transition: background-color 0.15s, transform 0.12s; }
.icon-btn:active { transform: scale(0.92); }
.nav-item { -webkit-tap-highlight-color: transparent; touch-action: manipulation; transition: color 0.15s; }
.nav-item .icon { transition: transform 0.18s cubic-bezier(0.2, 0.8, 0.2, 1); }
.nav-item:active .icon { transform: scale(0.88); }

/* Liste și cifre: o singură intrare, la încărcare (primele 4 elemente, 30 ms între ele). */
@keyframes one-rise { from { opacity: 0; transform: translateY(6px); } }
.is-entering > .card:nth-child(-n+4) { animation: one-rise 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.is-entering > .card:nth-child(2) { animation-delay: 30ms; }
.is-entering > .card:nth-child(3) { animation-delay: 60ms; }
.is-entering > .card:nth-child(4) { animation-delay: 90ms; }
[data-reports] .kpi, [data-reports] .stat { animation: one-rise 0.18s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }

/* ── Splash + preîncărcare (1.5.0) ─────────────────────────────────────────
   Logo: intrare + reflexie care trece peste formă (mască = chiar logo-ul), aură care „respiră”.
   Bara: progres real (shell.js mută fill-ul cu transform), luciu care curge prin ea, vârf luminos.
   Totul pe transform/opacity; rulează doar cât splash-ul e pe ecran. */
.splash { display: none; }
html.splash-on .splash {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; overflow: hidden;
  background: var(--bg); padding: var(--safe-top) 24px var(--safe-bottom);
  animation: splash-safety 0.3s ease-out 14s forwards;
}
html.splash-on body { overflow: hidden; }
.splash-aura { position: absolute; left: 50%; top: 50%; width: 560px; height: 560px; margin: -330px 0 0 -280px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(37, 99, 235, 0.16), rgba(5, 150, 224, 0.07) 55%, transparent 72%);
  animation: aura-in 0.9s ease-out both, aura-breathe 2.6s ease-in-out 0.9s infinite alternate; }
:root[data-theme="dark"] .splash-aura { background: radial-gradient(closest-side, rgba(59, 130, 246, 0.24), rgba(14, 165, 233, 0.08) 55%, transparent 72%); }
@keyframes aura-in { from { opacity: 0; transform: scale(0.6); } }
@keyframes aura-breathe { to { opacity: 0.65; transform: scale(1.08); } }

.splash-center { position: relative; display: flex; flex-direction: column; align-items: center; gap: 44px; }
.splash-logo { position: relative; width: 238px; height: 80px; animation: logo-in 0.75s cubic-bezier(0.16, 1, 0.3, 1) 0.05s both; }
.splash-logo-img { display: block; width: 100%; height: 100%; }
.splash .splash-logo-img.show-dark { display: none; }
:root[data-theme="dark"] .splash .splash-logo-img.show-light { display: none; }
:root[data-theme="dark"] .splash .splash-logo-img.show-dark { display: block; }
@keyframes logo-in { 0% { opacity: 0; transform: translate3d(0, 14px, 0) scale(0.9); } 60% { opacity: 1; } }
.splash-sheen { position: absolute; inset: 0; overflow: hidden; pointer-events: none;
  -webkit-mask: var(--logo-light) center / contain no-repeat; mask: var(--logo-light) center / contain no-repeat; }
:root[data-theme="dark"] .splash-sheen { -webkit-mask-image: var(--logo-dark); mask-image: var(--logo-dark); }
.splash-sheen::before { content: ''; position: absolute; top: -20%; bottom: -20%; left: 0; width: 45%;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.85) 50%, transparent 100%);
  transform: translate3d(-120%, 0, 0) skewX(-12deg); animation: sheen 1.9s cubic-bezier(0.45, 0, 0.25, 1) 0.6s infinite; }
@keyframes sheen { 0% { transform: translate3d(-120%, 0, 0) skewX(-12deg); } 55%, 100% { transform: translate3d(330%, 0, 0) skewX(-12deg); } }

.splash-loader { width: 232px; display: flex; flex-direction: column; gap: 12px; animation: loader-in 0.5s ease-out 0.35s both; }
@keyframes loader-in { from { opacity: 0; transform: translate3d(0, 8px, 0); } }
.splash-track { position: relative; height: 6px; border-radius: 99px; overflow: hidden;
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--border); }
.splash-fill { position: absolute; inset: 0; border-radius: 99px; overflow: hidden;
  background: linear-gradient(90deg, #1a6fce, #2563eb 45%, #0ea5e9);
  transform: translate3d(-96%, 0, 0); transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.splash-fill::after { content: ''; position: absolute; right: 0; top: 0; bottom: 0; width: 18px;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.95), transparent); }
.splash-shine { position: absolute; top: 0; bottom: 0; left: 0; width: 60px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  animation: shine 1.15s linear infinite; }
@keyframes shine { from { transform: translate3d(-60px, 0, 0); } to { transform: translate3d(260px, 0, 0); } }
.splash-meta { display: flex; justify-content: center; font-size: 13px; }
.splash-pct { font-weight: 600; color: var(--blue); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

.splash.is-done .splash-logo { animation: logo-out 0.45s cubic-bezier(0.4, 0, 1, 1) forwards; }
.splash.is-done .splash-loader { animation: loader-out 0.25s ease-in forwards; }
.splash.is-done { animation: splash-out 0.35s ease-in 0.15s forwards; }
@keyframes logo-out { to { opacity: 0; transform: scale(1.12); } }
@keyframes loader-out { to { opacity: 0; transform: translate3d(0, 6px, 0); } }
@keyframes splash-out { to { opacity: 0; visibility: hidden; } }
@keyframes splash-safety { to { opacity: 0; visibility: hidden; } }

/* ── Bara de jos: un singur indicator care alunecă între taburi (1.5.0) ───── */
.bottom-nav { isolation: isolate; }
.nav-glider { position: absolute; left: 0; top: 0; z-index: -1; width: 52px; height: 30px; border-radius: var(--r-pill);
  background: var(--blue-soft); opacity: 0; pointer-events: none; will-change: transform;
  transition: transform 0.42s cubic-bezier(0.34, 1.32, 0.64, 1), background-color 0.25s ease, opacity 0.2s; }
.nav-glider.is-placed { opacity: 1; }
.nav-glider.no-anim { transition: none; }
.nav-glider[data-tone="housekeeping"] { background: var(--violet-soft); }
.nav-glider[data-tone="inventory"] { background: var(--indigo-soft); }
.nav-glider[data-tone="reports"] { background: var(--teal-soft); }
.bottom-nav.has-glider .nav-pill::before { display: none; }
.nav-item .icon { transition: transform 0.32s cubic-bezier(0.34, 1.5, 0.64, 1); }
.nav-item.is-active .icon { transform: translate3d(0, -1px, 0) scale(1.08); }
.nav-item:active .icon { transform: scale(0.86); transition-duration: 0.1s; }

/* Fără glider (ex. înainte de JS): fundalul tabului activ e pe pill. */
.nav-pill::before { content: ''; position: absolute; inset: 0; z-index: -1; border-radius: inherit; }

/* ── Tranziții între pagini (shell.js) ────────────────────────────────────
   Push iOS: pagina veche e fixată pe loc; cea nouă (opacă, cu umbră pe margine) intră peste ea,
   iar un voal întunecă ușor pagina veche. Doar transform/opacity. */
html.is-swapping, html.is-swapping body { overflow-x: hidden; overflow-x: clip; }
.main.is-pushing { background: var(--bg); box-shadow: 0 0 28px rgba(15, 23, 42, 0.14); }
.swap-scrim { position: fixed; inset: 0; z-index: 1; pointer-events: none; background: rgba(15, 23, 42, 0.16); opacity: 0; }
:root[data-theme="dark"] .swap-scrim { background: rgba(0, 0, 0, 0.4); }
:root[data-theme="dark"] .main.is-pushing { box-shadow: 0 0 28px rgba(0, 0, 0, 0.5); }
.main.is-old { position: fixed; z-index: 1; margin: 0; pointer-events: none; }
.main.is-new { position: relative; z-index: 2; }
.swap-bar { position: fixed; left: 0; right: 0; top: calc(var(--topbar-h) + var(--safe-top)); z-index: 40; height: 3px;
  pointer-events: none; overflow: hidden; opacity: 0; transition: opacity 0.2s; }
.swap-bar.is-on { opacity: 1; }
.swap-bar span { position: absolute; inset: 0; background: linear-gradient(90deg, #1a6fce, #2563eb 45%, #0ea5e9);
  transform: translate3d(-100%, 0, 0); border-radius: 0 3px 3px 0; box-shadow: 0 0 10px rgba(37, 99, 235, 0.5); }

@media (prefers-reduced-motion: reduce) {
  .is-entering > .card, [data-reports] .kpi, [data-reports] .stat { animation: none; }
  .splash-aura, .splash-sheen::before, .splash-shine, .splash-logo, .splash-loader { animation: none; }
  .nav-glider, .nav-item .icon { transition: none; }
  .nav-item.is-active .icon { transform: none; }
}
