/* 808burger — painel (v2). Design system leve, sem framework. */
:root {
  --bg: #f3f4f6; --surface: #ffffff; --surface-2: #f9fafb; --line: #e5e7eb; --line-2: #d1d5db;
  --text: #111827; --text-2: #374151; --muted: #6b7280; --muted-2: #9ca3af;
  --brand: #e11d2e; --brand-2: #c81828; --brand-soft: #fdecee; --brand-ink: #7f1019;
  --green: #16a34a; --green-soft: #dcfce7; --amber: #d97706; --amber-soft: #fef3c7; --blue: #2563eb; --blue-soft: #dbeafe; --purple: #7c3aed; --purple-soft: #ede9fe; --red: #dc2626; --red-soft: #fee2e2; --gray-soft: #f3f4f6;
  --sidebar: #111318; --sidebar-2: #1a1d24; --sidebar-text: #c9ccd3;
  --radius: 14px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08); --shadow-lg: 0 20px 50px rgba(16,24,40,.22);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --mono: ui-monospace, SFMono-Regular, Menlo, monospace;
  --sidebar-w: 248px; --topbar-h: 64px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; } h2 { font-size: 17px; } h3 { font-size: 15px; } h4 { font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }
p { margin: 0; }
.muted { color: var(--muted); } .small { font-size: 12.5px; } .mono { font-family: var(--mono); font-size: 12.5px; } .strong { font-weight: 600; } .nowrap { white-space: nowrap; }
.right { text-align: right; } .center { text-align: center; }
.stack { display: grid; gap: 16px; align-content: start; } .stack-sm { display: grid; gap: 8px; align-content: start; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .row--between { justify-content: space-between; } .row--end { justify-content: flex-end; }
.grow { flex: 1; min-width: 0; }
.grid { display: grid; gap: 16px; }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

.show-sm { display: none !important; }

/* ---------- Login */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: radial-gradient(800px 500px at 20% 0%, rgba(225,29,46,.12), transparent 60%), var(--bg); }
.login__card { width: min(420px, 100%); background: var(--surface); border-radius: 20px; padding: 36px 32px; box-shadow: var(--shadow-lg); border: 1px solid var(--line); }
.login__logo { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.login__logo img { height: 42px; background: #111; padding: 6px 10px; border-radius: 10px; }
.login__logo span { font-size: 12px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; }
.login h1 { margin-bottom: 4px; }
.login .sub { color: var(--muted); margin-bottom: 22px; }
.login__help { margin-top: 18px; text-align: center; font-size: 13px; color: var(--muted); }
.login__help button { color: var(--brand); font-weight: 500; }
.login__reset { margin-top: 16px; padding: 14px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--line); font-size: 13px; color: var(--text-2); }
.login__reset code { font-family: var(--mono); background: #fff; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); }

/* ---------- Layout */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: var(--sidebar); color: var(--sidebar-text); display: flex; flex-direction: column; padding: 18px 14px; gap: 6px; }
.sidebar__brand { display: flex; align-items: center; gap: 12px; padding: 6px 10px 18px; color: #fff; }
.sidebar__brand img { height: 34px; }
.sidebar__brand small { display: block; color: var(--muted-2); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.nav { display: grid; gap: 2px; }
.nav__label { padding: 14px 12px 6px; font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: #6b7280; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--sidebar-text); font-weight: 500; transition: background .15s, color .15s; }
.nav a:hover { background: var(--sidebar-2); color: #fff; }
.nav a.active { background: var(--brand); color: #fff; box-shadow: 0 8px 20px rgba(225,29,46,.35); }
.nav .count { margin-left: auto; min-width: 22px; height: 22px; padding: 0 7px; border-radius: 999px; background: rgba(255,255,255,.14); font-size: 11.5px; font-weight: 700; display: inline-grid; place-items: center; }
.nav a.active .count { background: rgba(0,0,0,.25); }
.nav .count.hot { background: var(--brand); color: #fff; }
.sidebar__foot { margin-top: auto; display: grid; gap: 10px; padding: 12px 10px 4px; border-top: 1px solid rgba(255,255,255,.08); }
.storepill { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--sidebar-2); font-size: 13px; }
.storepill .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted-2); }
.storepill.open .dot { background: #22c55e; box-shadow: 0 0 10px #22c55e; }
.storepill.closed .dot { background: var(--brand); }
.storepill a { margin-left: auto; color: #fff; font-size: 12px; opacity: .8; }
.sidebar__user { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, #f6c453, #e11d2e); color: #fff; display: grid; place-items: center; font-weight: 700; flex: none; }
.sidebar__user b { display: block; color: #fff; font-weight: 600; }
.sidebar__user small { color: var(--muted-2); }
.sidebar__user button { margin-left: auto; color: var(--muted-2); padding: 6px; border-radius: 8px; }
.sidebar__user button:hover { background: var(--sidebar-2); color: #fff; }
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; height: var(--topbar-h); display: flex; align-items: center; gap: 12px; padding: 0 28px; background: rgba(243,244,246,.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar__menu { display: none; width: 40px; height: 40px; border-radius: 10px; place-items: center; }
.topbar__title h1 { font-size: 19px; }
.topbar__title p { font-size: 12.5px; color: var(--muted); }
.topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.content { padding: 24px 28px 60px; display: grid; gap: 20px; align-content: start; }
.scrim { position: fixed; inset: 0; background: rgba(17,19,24,.5); z-index: 30; }

/* ---------- Cards, KPIs */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.card__head h2 { font-size: 15px; }
.card__body { padding: 20px; }
.card__body--flush { padding: 0; }
.card__foot { padding: 12px 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
.kpi { padding: 18px 20px; display: grid; gap: 6px; }
.kpi__label { font-size: 12.5px; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: 8px; }
.kpi__icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--gray-soft); color: var(--text-2); }
.kpi__icon.red { background: var(--brand-soft); color: var(--brand); } .kpi__icon.green { background: var(--green-soft); color: var(--green); } .kpi__icon.blue { background: var(--blue-soft); color: var(--blue); } .kpi__icon.amber { background: var(--amber-soft); color: var(--amber); } .kpi__icon.purple { background: var(--purple-soft); color: var(--purple); }
.kpi__value { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.kpi__delta { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.delta { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 999px; font-weight: 600; font-size: 11.5px; }
.delta.up { background: var(--green-soft); color: #15803d; } .delta.down { background: var(--red-soft); color: #b91c1c; } .delta.flat { background: var(--gray-soft); color: var(--muted); }
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--radius-sm); border: 1px solid; font-size: 13.5px; }
.alert b { display: block; margin-bottom: 2px; }
.alert--warn { background: var(--amber-soft); border-color: #fcd34d; color: #78350f; }
.alert--danger { background: var(--red-soft); border-color: #fca5a5; color: #7f1d1d; }
.alert--info { background: var(--blue-soft); border-color: #93c5fd; color: #1e3a8a; }
.alert--ok { background: var(--green-soft); border-color: #86efac; color: #14532d; }
.alert .btn { margin-left: auto; flex: none; }
.empty { padding: 40px 20px; text-align: center; color: var(--muted); display: grid; gap: 8px; justify-items: center; }
.empty svg.i { width: 34px; height: 34px; color: var(--muted-2); }

/* ---------- Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 14px; border-radius: 10px; border: 1px solid transparent; font-weight: 500; font-size: 13.5px; line-height: 1.2; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn--primary { background: var(--brand); color: #fff; box-shadow: 0 6px 16px rgba(225,29,46,.25); }
.btn--primary:hover:not(:disabled) { background: var(--brand-2); }
.btn--secondary { background: var(--surface); border-color: var(--line-2); color: var(--text-2); box-shadow: var(--shadow); }
.btn--secondary:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted-2); }
.btn--ghost { color: var(--text-2); }
.btn--ghost:hover:not(:disabled) { background: var(--gray-soft); }
.btn--danger { background: var(--red-soft); color: #b91c1c; }
.btn--danger:hover:not(:disabled) { background: #fecaca; }
.btn--success { background: var(--green); color: #fff; }
.btn--success:hover:not(:disabled) { background: #15803d; }
.btn--dark { background: #111318; color: #fff; }
.btn--dark:hover:not(:disabled) { background: #24272f; }
.btn--wa { background: #25d366; color: #052e16; }
.btn--wa:hover:not(:disabled) { background: #1fbf5a; }
.btn--sm { padding: 6px 10px; font-size: 12.5px; border-radius: 8px; }
.btn--lg { padding: 12px 20px; font-size: 14.5px; }
.btn--block { width: 100%; }
.btn--icon { padding: 8px; width: 36px; height: 36px; }
.btn--icon.btn--sm { width: 30px; height: 30px; padding: 5px; }
.btn--icon svg.i { width: 18px; height: 18px; }
.btn .spinner { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.link { color: var(--brand); font-weight: 500; }
.link:hover { text-decoration: underline; }

/* ---------- Formulários */
.field { display: grid; gap: 6px; }
.field > span, .field > label > span, .label { font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.field .hint { font-size: 12px; color: var(--muted); }
.input, .select, .textarea { width: 100%; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); outline: 0; transition: border-color .15s, box-shadow .15s; font-size: 14px; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(225,29,46,.12); }
.input.invalid { border-color: var(--red); }
.input--sm { padding: 6px 10px; font-size: 13px; }
.textarea { resize: vertical; min-height: 72px; }
.select { appearance: none; -webkit-appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; padding-right: 32px; }
.inputgroup { display: flex; align-items: stretch; }
.inputgroup .prefix { display: flex; align-items: center; padding: 0 12px; border: 1px solid var(--line-2); border-right: 0; border-radius: 10px 0 0 10px; background: var(--surface-2); color: var(--muted); font-size: 13px; }
.inputgroup .input { border-radius: 0 10px 10px 0; }
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track { width: 40px; height: 22px; border-radius: 999px; background: var(--line-2); position: relative; transition: background .15s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.switch input:checked + .track { background: var(--green); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px rgba(22,163,74,.25); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.check input { width: 16px; height: 16px; accent-color: var(--brand); margin: 0; }
.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; }
.checkgrid .check { padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.form-error { padding: 10px 12px; border-radius: 10px; background: var(--red-soft); color: #991b1b; font-size: 13px; }
.form-ok { padding: 10px 12px; border-radius: 10px; background: var(--green-soft); color: #166534; font-size: 13px; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.chip:hover { border-color: var(--muted-2); }
.chip.active { background: #111318; color: #fff; border-color: #111318; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--muted); font-weight: 500; white-space: nowrap; display: inline-flex; gap: 8px; align-items: center; margin-bottom: -1px; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--brand); border-bottom-color: var(--brand); }
.tabs .count { background: var(--gray-soft); padding: 1px 7px; border-radius: 999px; font-size: 11.5px; color: var(--text-2); }
.tabs button.active .count { background: var(--brand-soft); color: var(--brand); }
.search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: var(--surface); min-width: 220px; }
.search input { border: 0; outline: 0; padding: 9px 0; width: 100%; background: none; }
.search svg.i { color: var(--muted); width: 16px; height: 16px; }
.upload { border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 16px; display: flex; gap: 14px; align-items: center; background: var(--surface-2); cursor: pointer; transition: border-color .15s, background .15s; }
.upload:hover, .upload.drag { border-color: var(--brand); background: var(--brand-soft); }
.upload img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; background: #111; }
.upload .ph { width: 96px; height: 72px; border-radius: 8px; background: var(--gray-soft); display: grid; place-items: center; color: var(--muted-2); }
.upload input { display: none; }
.upload__text b { display: block; font-size: 13px; }
.upload__text span { font-size: 12px; color: var(--muted); }
.hours { display: grid; gap: 8px; }
.hours__row { display: grid; grid-template-columns: 110px 1fr auto 1fr; gap: 10px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; }
.hours__row.off { opacity: .6; }
.hours__row .input { padding: 6px 10px; }
.hours__row .sep { color: var(--muted); font-size: 12px; }

/* ---------- Tabelas */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr.clickable { cursor: pointer; }
.table tr.clickable:hover td { background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions .btn { vertical-align: middle; }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: #111; }
.thumb--ph { display: grid; place-items: center; color: var(--muted-2); background: var(--gray-soft); }
.cell-title { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--muted); }
.table td:first-child .cell-sub { white-space: nowrap; }
.cell-items { max-width: 340px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
.inactive td { opacity: .55; }
.pagination { display: flex; align-items: center; gap: 8px; justify-content: space-between; padding: 12px 16px; font-size: 13px; color: var(--muted); border-top: 1px solid var(--line); }
.drag-handle { cursor: grab; color: var(--muted-2); }
tr.dragging { opacity: .4; }
tr.drop-target td { box-shadow: inset 0 2px 0 var(--brand); }

/* ---------- Badges de status */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap; background: var(--gray-soft); color: var(--text-2); }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.pending { background: var(--amber-soft); color: #92400e; } .badge.confirmed { background: var(--blue-soft); color: #1e40af; } .badge.preparing { background: var(--purple-soft); color: #5b21b6; }
.badge.ready { background: #cffafe; color: #155e75; } .badge.out_for_delivery { background: #e0e7ff; color: #3730a3; } .badge.delivered { background: var(--green-soft); color: #166534; } .badge.cancelled { background: var(--red-soft); color: #991b1b; }
.badge.on { background: var(--green-soft); color: #166534; } .badge.off { background: var(--gray-soft); color: var(--muted); } .badge.promo { background: var(--amber-soft); color: #92400e; }
.badge--plain::before { display: none; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--gray-soft); font-size: 12px; font-weight: 500; }
.pill.delivery { background: var(--blue-soft); color: #1e40af; } .pill.pickup { background: var(--purple-soft); color: #5b21b6; }

/* ---------- Gráficos (SVG) */
.chart { width: 100%; height: auto; display: block; font-family: var(--font); }
.chart .grid-line { stroke: var(--line); stroke-width: 1; }
.chart .axis { font-size: 10.5px; fill: var(--muted); }
.chart .bar { fill: var(--brand); opacity: .9; }
.chart .bar:hover { opacity: 1; }
.chart .bar--alt { fill: #111318; }
.chart .line { fill: none; stroke: #111318; stroke-width: 2; }
.chart .area { fill: url(#areaFill); }
.chart .dot { fill: #fff; stroke: #111318; stroke-width: 2; }
.chart .label { font-size: 10.5px; fill: var(--text-2); font-weight: 600; }
.chart .bar[data-tip], .chart .dot[data-tip] { cursor: pointer; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.legend span::before { content: ''; display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; background: var(--c, var(--brand)); }
.donut { display: grid; grid-template-columns: 130px 1fr; gap: 16px; align-items: center; }
.donut svg { width: 130px; height: 130px; }
.donut__list { display: grid; gap: 6px; font-size: 13px; }
.donut__list div { display: grid; grid-template-columns: 10px 1fr auto; align-items: center; gap: 8px; }
.donut__list i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.donut__list b { font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12.5px; }
.donut__list .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bars { display: grid; gap: 8px; }
.bars div { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center; font-size: 13px; }
.bars .track { height: 8px; background: var(--gray-soft); border-radius: 999px; overflow: hidden; }
.bars .fill { height: 100%; background: var(--brand); border-radius: 999px; }
.bars b { font-variant-numeric: tabular-nums; min-width: 70px; text-align: right; }
.bars .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tip { position: fixed; z-index: 90; background: #111318; color: #fff; padding: 6px 10px; border-radius: 8px; font-size: 12px; pointer-events: none; transform: translate(-50%, calc(-100% - 10px)); white-space: nowrap; box-shadow: var(--shadow-lg); }

/* ---------- Modais / drawer / toast */
.modal { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(17,19,24,.55); animation: fade .15s; }
.modal__panel { position: relative; width: min(560px, 100%); max-height: calc(100vh - 40px); background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: pop .18s ease; }
.modal__panel--lg { width: min(760px, 100%); } .modal__panel--sm { width: min(420px, 100%); }
.modal__head { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal__head h2 { font-size: 16px; }
.modal__head .btn--icon { margin-left: auto; }
.modal__body { padding: 22px; overflow: auto; display: grid; gap: 16px; }
.modal__foot { display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 14px 22px; border-top: 1px solid var(--line); background: var(--surface-2); border-radius: 0 0 18px 18px; }
.modal__foot .left { margin-right: auto; }
@keyframes fade { from { opacity: 0; } } @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.drawer { position: fixed; inset: 0; z-index: 50; display: flex; justify-content: flex-end; }
.drawer__panel { position: relative; width: min(520px, 100%); height: 100%; background: var(--surface); box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: slide .2s ease; }
@keyframes slide { from { transform: translateX(30px); opacity: 0; } }
.drawer__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.drawer__body { flex: 1; padding: 20px; overflow: auto; display: grid; gap: 18px; align-content: start; }
.drawer__foot { padding: 14px 20px; border-top: 1px solid var(--line); background: var(--surface-2); display: grid; gap: 8px; }
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: grid; gap: 8px; }
.toast { padding: 12px 16px; border-radius: 12px; background: #111318; color: #fff; font-size: 13.5px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 10px; animation: pop .2s; max-width: 360px; }
.toast--error { background: var(--red); } .toast--ok { background: var(--green); }

/* ---------- Pedido (detalhe) */
.order-items { display: grid; gap: 8px; }
.order-item { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; font-size: 13.5px; }
.order-item .qty { font-weight: 700; color: var(--brand); }
.order-item .sub { font-size: 12px; color: var(--muted); }
.kv { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; font-size: 13.5px; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; }
.totals { display: grid; gap: 4px; font-size: 13.5px; padding-top: 10px; border-top: 1px dashed var(--line); }
.totals div { display: flex; justify-content: space-between; }
.totals .total { font-weight: 700; font-size: 15px; }
.timeline { display: grid; gap: 0; }
.timeline > div { display: grid; grid-template-columns: 18px 1fr; gap: 10px; padding: 4px 0; font-size: 13px; }
.timeline i { width: 10px; height: 10px; border-radius: 50%; background: var(--line-2); margin: 6px auto 0; }
.timeline > div:first-child i { background: var(--brand); }
.timeline small { color: var(--muted); display: block; }
.status-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.status-actions .btn--block { grid-column: 1 / -1; }

/* ---------- Print */
#printArea { display: none; }
@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea { display: block; position: absolute; left: 0; top: 0; width: 80mm; padding: 4mm; font: 12px/1.35 var(--mono); color: #000; }
  #printArea h2 { font-size: 16px; margin: 0 0 4px; } #printArea .line { border-top: 1px dashed #000; margin: 6px 0; }
  #printArea table { width: 100%; border-collapse: collapse; } #printArea td { padding: 2px 0; vertical-align: top; } #printArea .r { text-align: right; }
}

/* ---------- Responsivo */
@media (max-width: 1100px) { .grid--main { grid-template-columns: 1fr; } .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(300px, 86vw); z-index: 40; transform: translateX(-100%); transition: transform .2s ease; height: 100vh; }
  .sidebar.open { transform: none; }
  .topbar { padding: 0 16px; } .topbar__menu { display: grid; }
  .content { padding: 16px 16px 90px; }
  .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .grid--kpi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hide-sm { display: none !important; }
  .show-sm { display: inline-flex !important; }
  .hours__row { grid-template-columns: 90px 1fr auto 1fr; }
  .kv { grid-template-columns: 100px 1fr; }
  .status-actions { grid-template-columns: 1fr; }
  .modal { padding: 0; align-items: flex-end; }
  .modal__panel { max-height: 94vh; border-radius: 18px 18px 0 0; width: 100%; }
  .modal__foot { border-radius: 0; }
  .toasts { left: 16px; right: 16px; bottom: 16px; }
  .kpi__value { font-size: 22px; }
  .table td, .table th { padding: 10px 12px; }
}
