/* ═══════════════════════════════════════════════════════════════════════
   SHELL — lateral + barra superior do PAINEL (comprecomigo → Micarla 17/09/2026
   → Layssa 06/10/2026). Só o Painel usa; as cores vêm dos tokens do próprio
   index.html (identidade vinho/bordô da Layssa). --gold* aqui é APELIDO de --accent*.
   O body vira grid: coluna 1 = lateral (sticky), coluna 2 = barra + conteúdo.
   Montado por /js/shell.js. Claro (padrão) e Escuro.
   ═══════════════════════════════════════════════════════════════════════ */
:root {
  --mf-sb-w: 248px;
  --mf-top-h: var(--topbar-h, 60px);
  --mf-card-shadow: 0 1px 2px rgba(42,20,22,.05), 0 10px 28px -14px rgba(42,20,22,.22);
  --mf-ring: 0 0 0 3px rgba(110,35,41,.18);
  /* Lateral: vinho no Claro (como a topbar das outras telas da Layssa) */
  --sb-bg: #5a1e22; --sb-border: rgba(40,12,14,.35); --sb-text: rgba(246,233,220,.78); --sb-text-strong: #f6e9dc;
  --sb-hover: rgba(246,233,220,.10); --sb-active-bg: #f3e4d4; --sb-active-ink: #5a1e22; --sb-sub: rgba(246,233,220,.62);
}
[data-theme="dark"] {
  --mf-card-shadow: 0 1px 0 rgba(0,0,0,.25), 0 14px 34px -20px rgba(0,0,0,.7); --mf-ring: 0 0 0 3px rgba(212,165,165,.24);
  --sb-bg: #1e293b; --sb-border: #334155; --sb-text: #94a3b8; --sb-text-strong: #e2e8f0;
  --sb-hover: #273549; --sb-active-bg: #d4a5a5; --sb-active-ink: #2a1416; --sb-sub: #94a3b8;
}

body.mf-shell-on {
  display: grid !important;
  grid-template-columns: var(--mf-sb-w) minmax(0, 1fr);
  grid-auto-rows: max-content;
  align-content: start;
  min-height: 100dvh;
}
body.mf-shell-on > * { grid-column: 2; min-width: 0; }
body.mf-shell-on > .mf-sidebar { grid-column: 1; grid-row: 1 / span 9999; }
body.mf-shell-on > .mf-legacy-hidden, body.mf-shell-on > header.topbar { display: none !important; }
body.mf-shell-on .mf-legacy-hidden { display: none !important; }
body.mf-shell-on > footer.footer { align-self: end; }
/* scripts soltos no body não ocupam linha da grade */
body.mf-shell-on > script { display: none; }

/* ── Lateral ─────────────────────────────────────────────────────── */
.mf-sidebar {
  position: sticky; top: 0; height: 100dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--sb-bg); border-right: 1px solid var(--sb-border); color: var(--sb-text-strong);
  display: flex; flex-direction: column; padding: 14px 12px; gap: 6px; z-index: 40;
  font-family: var(--font-ui);
}
.mf-brand { display: flex; align-items: center; gap: 12px; padding: 8px 8px 16px; border-bottom: 1px solid var(--sb-border); margin-bottom: 8px; color: inherit; text-decoration: none; }
.mf-brand__logo { width: 42px; height: 42px; border-radius: var(--r-ctl, 10px); flex: none; display: grid; place-items: center; background: var(--sb-active-bg); color: var(--sb-active-ink); font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.mf-brand__name { font-family: var(--font-ui); font-weight: 800; letter-spacing: -.02em; font-size: 14.5px; line-height: 1.15; color: var(--sb-text-strong); }
.mf-brand__sys { font-size: 11px; color: var(--sb-sub); margin-top: 3px; letter-spacing: .04em; }
.mf-nav { display: flex; flex-direction: column; gap: 2px; }
.mf-nav__item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-ctl, 10px); color: var(--sb-text); font-weight: 600; font-size: 13.5px; text-decoration: none; transition: background .15s, color .15s; position: relative; background: none; border: 0; width: 100%; text-align: left; cursor: pointer; font-family: inherit; white-space: nowrap; }
.mf-nav__item:hover { background: var(--sb-hover); color: var(--sb-text-strong); }
.mf-nav__item.is-active { background: var(--sb-active-bg); color: var(--sb-active-ink); box-shadow: 0 8px 18px -10px rgba(0,0,0,.45); }
.mf-nav__item .ti { font-size: 19px; flex: none; width: 19px; text-align: center; }
.mf-nav__label { overflow: hidden; text-overflow: ellipsis; }
.mf-nav__item .mf-chev { margin-left: auto; opacity: .55; font-size: 15px; width: 15px; }
.mf-nav__item.is-locked { opacity: .55; cursor: not-allowed; }
.mf-nav__lock { margin-left: auto; display: inline-flex; }
.mf-nav__lock .ti { font-size: 14px; width: 14px; }
.mf-nav__badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #fb923c; color: #fff; font-size: 11px; font-weight: 800; display: none; align-items: center; justify-content: center; }
.mf-nav__badge.on { display: inline-flex; animation: mfBadgePulse 1.1s ease-in-out infinite; }
@keyframes mfBadgePulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(251,146,60,0); } 50% { box-shadow: 0 0 0 4px rgba(251,146,60,.45); } }
.mf-sidebar__spacer { flex: 1; }
.mf-me { display: flex; align-items: center; gap: 10px; padding: 10px 8px; border-top: 1px solid var(--sb-border); margin-top: 8px; }
.mf-avatar { width: 38px; height: 38px; border-radius: 50%; background: var(--gold); color: var(--accent-ink, #fff); display: grid; place-items: center; font-weight: 800; font-size: 15px; flex: none; font-family: var(--font-ui); }
.mf-sidebar .mf-avatar { background: var(--sb-active-bg); color: var(--sb-active-ink); }
.mf-me__name { font-weight: 700; font-size: 13px; color: var(--sb-text-strong); }
.mf-me__mail { font-size: 11px; color: var(--sb-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 150px; }
.mf-logout { color: var(--sb-text); }
.mf-logout:hover { background: rgba(239,68,68,.18); color: #fecaca; }

/* ── Barra superior ──────────────────────────────────────────────── */
.mf-top { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 12px; height: var(--mf-top-h); padding: 0 22px; background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); font-family: var(--font-ui); }
.mf-icon-btn { width: 40px; height: 40px; border-radius: var(--r-ctl, 10px); border: 1px solid var(--border); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; position: relative; transition: background .15s, transform .15s; flex: none; }
.mf-icon-btn:hover { background: var(--surface2); }
.mf-icon-btn:active { transform: scale(.96); }
.mf-icon-btn .ti { font-size: 19px; }
.mf-icon-btn .mf-dot { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #fb923c; color: #fff; font-size: 10.5px; font-weight: 800; display: none; align-items: center; justify-content: center; border: 2px solid var(--surface); }
.mf-icon-btn .mf-dot.on { display: inline-flex; }
.mf-top__actions { display: flex; align-items: center; gap: 8px; min-width: 0; flex-wrap: nowrap; }
.mf-top__actions > * { flex: none; }
.mf-top__spacer { flex: 1; }
.mf-top__who { text-align: right; line-height: 1.2; }
.mf-top__who b { font-size: 13.5px; display: block; }
.mf-top__who span { font-size: 11.5px; color: var(--text-muted); }
.mf-top__sep { width: 1px; height: 28px; background: var(--border); }
.mf-scrim { position: fixed; inset: 0; background: rgba(15, 23, 42,.5); z-index: 35; display: none; }
.mf-scrim.on { display: block; }

/* Aviso "acesso exclusivo da administração" */
#navToast {
  position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(90px);
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 20px; font-size: 13.5px; font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,.28);
  opacity: 0; pointer-events: none; z-index: 2000; transition: transform .25s ease, opacity .25s ease; font-family: var(--font-ui);
}
#navToast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

/* ── Responsivo ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  body.mf-shell-on { grid-template-columns: minmax(0, 1fr); }
  body.mf-shell-on > * { grid-column: 1; }
  body.mf-shell-on > .mf-sidebar { position: fixed; left: 0; top: 0; width: min(300px, 86vw); transform: translateX(-104%); transition: transform .25s cubic-bezier(.2,.7,.2,1); z-index: 50; box-shadow: 0 20px 60px rgba(0,0,0,.35); grid-row: auto; }
  body.mf-shell-on > .mf-sidebar.open { transform: none; }
  .mf-top__who, .mf-top__sep { display: none; }
}
@media (max-width: 640px) {
  .mf-top { padding: 0 12px; gap: 8px; }
  .mf-top__actions button { font-size: 12px; padding: 6px 10px; }
}
@media (max-width: 480px) { .mf-top__actions > span { display: none; } }
/* Com a lateral fixa na tela, o ☰ não abre nada — some. */
@media (min-width: 1025px) { body.mf-shell-on #btnMenu { display: none; } }

@media print { .mf-sidebar, .mf-top, .mf-scrim { display: none !important; } body.mf-shell-on { display: block !important; } }
