/* ---------------- Boot / splash ---------------- */
#boot {
  position: fixed; inset: 0; display: grid; place-items: center; background: var(--espresso-900); color: var(--cream-100); z-index: 9999;
  transition: opacity .5s var(--ease);
}
#boot.out { opacity: 0; pointer-events: none; }
.boot-inner { text-align: center; }
.boot-mark { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 18px; display: grid; place-items: center; background: linear-gradient(145deg, var(--gold-400), var(--gold-600)); color: var(--espresso-900); font-family: var(--font-display); font-size: 30px; font-weight: 700; box-shadow: 0 10px 40px -10px rgba(207,174,122,.6); }
.boot-title { font-family: var(--font-display); font-size: 26px; letter-spacing: -.01em; }
.boot-sub { color: var(--gold-300); opacity: .75; font-size: 12px; letter-spacing: .24em; text-transform: uppercase; margin-top: 6px; }
.boot-bar { width: 220px; height: 3px; border-radius: 3px; background: rgba(255,255,255,.08); margin: 26px auto 10px; overflow: hidden; }
.boot-bar > i { display: block; height: 100%; width: 0; background: var(--gold-400); transition: width .3s var(--ease); }
.boot-status { font-size: 12px; color: var(--charcoal-300); min-height: 18px; }

/* ---------------- Login ---------------- */
.login {
  position: fixed; inset: 0; display: grid; grid-template-columns: 1.15fr 1fr; background: var(--cream-50); z-index: 50;
  animation: fadeIn .4s var(--ease);
}
.login-hero { position: relative; overflow: hidden; background: var(--espresso-900); }
.login-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .55; transform: scale(1.04); animation: heroZoom 22s ease-in-out infinite alternate; }
@keyframes heroZoom { to { transform: scale(1.12); } }
.login-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,13,9,.2) 0%, rgba(20,13,9,.15) 40%, rgba(20,13,9,.92) 100%); }
.login-hero-content { position: absolute; left: 56px; right: 56px; bottom: 56px; z-index: 2; color: var(--cream-100); }
.login-hero-content h1 { font-family: var(--font-display); font-size: 46px; line-height: 1.05; font-weight: 520; letter-spacing: -.02em; max-width: 560px; }
.login-hero-content p { color: var(--gold-300); margin-top: 14px; max-width: 480px; line-height: 1.6; opacity: .9; }
.login-stats { display: flex; gap: 36px; margin-top: 34px; }
.login-stats b { display: block; font-family: var(--font-display); font-size: 26px; font-weight: 520; color: #fff; }
.login-stats span { font-size: 12px; color: var(--charcoal-300); letter-spacing: .04em; }
.login-brand { position: absolute; top: 40px; left: 56px; z-index: 2; display: flex; align-items: center; gap: 12px; color: var(--cream-100); }
.login-panel { display: flex; align-items: center; justify-content: center; padding: 40px; overflow: auto; }
.login-card { width: 100%; max-width: 420px; }
.login-card h2 { font-family: var(--font-display); font-size: 30px; font-weight: 540; }
.login-users { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 22px 0 18px; }
.login-user { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); text-align: left; transition: all var(--t-fast) var(--ease); }
.login-user:hover { border-color: var(--gold-400); }
.login-user.active { border-color: var(--gold-500); box-shadow: var(--ring); background: var(--accent-soft); }
.login-user .meta { min-width: 0; }
.login-user .meta b { display: block; font-size: 13px; }
.login-user .meta span { font-size: 11.5px; color: var(--text-3); }
.pin-row { display: flex; gap: 10px; justify-content: center; margin: 8px 0 18px; }
.pin-row input { width: 52px; height: 56px; text-align: center; font-size: 22px; border: 1px solid var(--border-strong); border-radius: var(--r-md); background: var(--surface); }
.pin-row input:focus { outline: none; border-color: var(--gold-500); box-shadow: var(--ring); }
.login-foot { margin-top: 22px; font-size: 12px; color: var(--text-3); display: flex; gap: 8px; align-items: flex-start; line-height: 1.5; }

/* ---------------- App shell ---------------- */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }
.app.collapsed { grid-template-columns: var(--sidebar-w-collapsed) 1fr; }

.sidebar {
  position: sticky; top: 0; height: 100vh; background: var(--espresso-900); color: var(--cream-200);
  display: flex; flex-direction: column; border-right: 1px solid rgba(255,255,255,.04); z-index: 30;
  background-image: radial-gradient(120% 60% at 0% 0%, rgba(184,146,90,.10), transparent 60%);
}
.sb-brand { display: flex; align-items: center; gap: 12px; height: var(--topbar-h); padding: 0 18px; border-bottom: 1px solid rgba(255,255,255,.05); flex: none; }
.sb-logo { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(145deg, var(--gold-400), var(--gold-600)); color: var(--espresso-900); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 18px; flex: none; }
.sb-brand-text b { display: block; font-family: var(--font-display); font-weight: 560; font-size: 17px; color: #fff; letter-spacing: -.01em; }
.sb-brand-text span { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-400); opacity: .8; }
.sb-nav { flex: 1; overflow-y: auto; padding: 12px 10px 18px; }
.sb-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.08); }
.sb-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .16em; color: var(--charcoal-400); padding: 14px 12px 6px; }
.sb-link {
  display: flex; align-items: center; gap: 12px; padding: 9px 12px; margin: 1px 0; border-radius: 9px; color: #cbbfae; font-size: 13.5px; font-weight: 450;
  transition: background var(--t-fast), color var(--t-fast); position: relative; white-space: nowrap;
}
.sb-link svg { color: #9e907e; transition: color var(--t-fast); }
.sb-link:hover { background: rgba(255,255,255,.04); color: #fff; }
.sb-link:hover svg { color: var(--gold-300); }
.sb-link.active { background: linear-gradient(90deg, rgba(184,146,90,.20), rgba(184,146,90,.06)); color: #fff; }
.sb-link.active svg { color: var(--gold-400); }
.sb-link.active::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--gold-400); }
.sb-link .sb-badge { margin-left: auto; font-size: 10.5px; padding: 1px 7px; border-radius: 999px; background: var(--gold-500); color: var(--espresso-900); font-weight: 700; }
.sb-link.locked { opacity: .38; }
.sb-link.locked::after { content: ""; }
.sb-foot { padding: 12px; border-top: 1px solid rgba(255,255,255,.05); flex: none; }
.sb-status { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: rgba(255,255,255,.03); border-radius: 10px; font-size: 12px; color: var(--charcoal-300); }
.sb-status .dot { width: 8px; height: 8px; border-radius: 50%; background: #5fbf8a; box-shadow: 0 0 0 4px rgba(95,191,138,.15); flex: none; }
.app.collapsed .sb-brand-text, .app.collapsed .sb-group, .app.collapsed .sb-link span, .app.collapsed .sb-link .sb-badge, .app.collapsed .sb-status span { display: none; }
.app.collapsed .sb-link { justify-content: center; padding: 11px; }
.app.collapsed .sb-brand { justify-content: center; padding: 0; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 25; height: var(--topbar-h); display: flex; align-items: center; gap: 14px; padding: 0 var(--gutter);
  background: rgba(245,241,234,.86); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--border);
}
.tb-search { position: relative; flex: 1 1 340px; max-width: 460px; min-width: 180px; }
.tb-search input { width: 100%; height: 40px; padding: 0 70px 0 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); transition: border var(--t-fast), box-shadow var(--t-fast); }
.tb-search input:focus { outline: none; border-color: var(--gold-400); box-shadow: var(--ring); }
.tb-search > svg { position: absolute; left: 13px; top: 11px; color: var(--text-3); }
.tb-search kbd { position: absolute; right: 10px; top: 10px; font-family: var(--font-sans); font-size: 11px; color: var(--text-3); border: 1px solid var(--border); border-radius: 5px; padding: 1px 6px; background: var(--surface-2); }
.search-results { position: absolute; top: 46px; left: 0; right: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); box-shadow: var(--shadow-lg); max-height: 440px; overflow: auto; padding: 6px; animation: popIn .16s var(--ease); }
.sr-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .12em; color: var(--text-3); padding: 8px 10px 4px; }
.sr-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 8px; cursor: pointer; }
.sr-item:hover, .sr-item.focus { background: var(--surface-3); }
.sr-item img { width: 32px; height: 32px; border-radius: 7px; object-fit: cover; }
.sr-item .sr-ic { width: 32px; height: 32px; border-radius: 7px; background: var(--accent-soft); color: var(--accent-strong); display: grid; place-items: center; }

.tb-spacer { flex: 1 1 0; min-width: 0; }
.tb-chip { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); font-size: 13px; color: var(--text-2); white-space: nowrap; }
.tb-chip b { color: var(--text); font-weight: 600; }
.tb-clock { font-variant-numeric: tabular-nums; }
.tb-demo { background: var(--espresso-900); color: var(--gold-300); border-color: var(--espresso-900); font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }
.tb-demo .dot { width: 7px; height: 7px; border-radius: 50%; background: #ef6b4a; animation: pulse 1.6s infinite; }
.tb-icon { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); display: grid; place-items: center; position: relative; color: var(--text-2); transition: all var(--t-fast); }
.tb-icon:hover { color: var(--text); border-color: var(--border-strong); }
.tb-icon .count { position: absolute; top: -5px; right: -5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--bg); }
.tb-user { display: flex; align-items: center; gap: 10px; padding: 4px 10px 4px 4px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); }
.tb-user .meta b { display: block; font-size: 13px; line-height: 1.2; }
.tb-user .meta span { font-size: 11px; color: var(--text-3); }
.tb-burger { display: none; }

.content { padding: var(--gutter); flex: 1; min-width: 0; }
.page { animation: riseIn .28s var(--ease) both; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-family: var(--font-display); font-weight: 540; font-size: 28px; letter-spacing: -.02em; }
.page-head .crumb { font-size: 12px; color: var(--text-3); letter-spacing: .04em; margin-bottom: 4px; display: flex; gap: 6px; align-items: center; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Full-screen mode (kitchen) */
.app.fullscreen { grid-template-columns: 1fr; }
.app.fullscreen .sidebar, .app.fullscreen .topbar { display: none; }
.app.fullscreen .content { padding: 0; }

/* Overlays */
.drawer-backdrop, .modal-backdrop { position: fixed; inset: 0; background: rgba(20,13,9,.42); backdrop-filter: blur(2px); z-index: 80; animation: fadeIn .18s var(--ease); }
.sidebar-backdrop { display: none; }
