/* ===== Estoque CCB — design system ===== */
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-wght.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("../fonts/inter-latin-ext-wght.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* marca: azul-tinta, sóbrio */
  --brand: #2450c6;
  --brand-dark: #1a3b96;
  --brand-light: #eaf0fd;
  --brand-ring: rgba(36, 80, 198, .28);

  /* neutros levemente frios */
  --ink: #111a2b;
  --ink-soft: #5b6677;
  --line: #e3e7ee;
  --line-strong: #cfd5e0;
  --bg: #f5f6f9;
  --surface: #ffffff;
  --surface-2: #f8f9fb;

  /* menu lateral */
  --nav-bg: #0d1424;
  --nav-ink: #b9c3d6;
  --nav-ink-strong: #ffffff;
  --nav-hover: rgba(255, 255, 255, .07);
  --nav-active: rgba(255, 255, 255, .12);
  --nav-sep: #8b97ad;

  /* estados */
  --ok: #146c34;      --ok-bg: #e7f6ec;
  --warn: #946200;    --warn-bg: #fff3d4;
  --danger: #c0271b;  --danger-bg: #fdecea;
  --info: #2450c6;

  --radius: 12px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(17, 26, 43, .05);
  --shadow: 0 1px 2px rgba(17, 26, 43, .05), 0 4px 14px rgba(17, 26, 43, .05);
  --shadow-lg: 0 24px 60px -12px rgba(13, 20, 36, .35);
  --tap: 48px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light;
  --brand-text: var(--brand);          /* marca usada como texto/ícone sobre a superfície */
  --brand-hover-line: #b9c6ec;
  --line-hover: #b3bccb;
  --placeholder: #6b7585;
  --muted-bg: #edf0f4;
  --flash: #fff3c4;
  --ok-solid: #146c34;  --ok-strong: #12692f;
  --danger-solid: #c0271b;  --danger-hover: #a21f15;  --danger-strong: #a8231a;
  --toast-bg: var(--ink);
  --glass: rgba(255, 255, 255, .86);
  --glass-strong: rgba(255, 255, 255, .92);
  --glass-solid: rgba(255, 255, 255, .96);
  --bar-glass: rgba(245, 246, 249, .85);
  --bar-glass-strong: rgba(245, 246, 249, .92);
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --brand: #3b64d9;  --brand-dark: #2f53bd;  --brand-text: #8fb0ff;
    --brand-light: rgba(111, 147, 255, .16);  --brand-ring: rgba(143, 176, 255, .4);
    --brand-hover-line: rgba(143, 176, 255, .45);
    --ink: #e8ecf4;  --ink-soft: #a3aec2;
    --line: #273044;  --line-strong: #364158;  --line-hover: #4a5876;
    --bg: #0e1420;  --surface: #161d2d;  --surface-2: #1b2336;
    --nav-bg: #0a0f1a;  --nav-sep: #8b97ad;
    --ok: #5ad38a;  --ok-bg: rgba(90, 211, 138, .14);
    --warn: #f0b64a;  --warn-bg: rgba(240, 182, 74, .14);
    --danger: #ff8d83;  --danger-bg: rgba(255, 141, 131, .14);
    --info: #8fb0ff;
    --placeholder: #8592a8;  --muted-bg: #243049;  --flash: rgba(240, 182, 74, .3);
    --toast-bg: #2a3550;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 14px rgba(0, 0, 0, .25);
    --glass: rgba(22, 29, 45, .86);  --glass-strong: rgba(22, 29, 45, .92);  --glass-solid: rgba(22, 29, 45, .96);
    --bar-glass: rgba(14, 20, 32, .85);  --bar-glass-strong: rgba(14, 20, 32, .92);
  }
  .bigaction::after { filter: invert(1); }
  .auth { background: radial-gradient(900px 500px at 15% -10%, rgba(59, 100, 217, .25), transparent 60%), var(--bg); }
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scrollbar-color: var(--line-strong) transparent; }
body {
  font-family: var(--font);
  font-feature-settings: "cv11", "ss03";
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.25; margin: 0 0 .4em; letter-spacing: -.015em; text-wrap: balance; }
h1 { font-size: 1.55rem; font-weight: 700; }
h2 { font-size: 1.25rem; font-weight: 650; }
h3 { font-weight: 650; }
p { text-wrap: pretty; }
a { color: var(--brand-text); text-underline-offset: 3px; }
::selection { background: var(--brand-ring); }
:focus-visible { outline: 3px solid var(--brand-ring); outline-offset: 2px; border-radius: 6px; }
.ico { display: inline-flex; flex: none; }
.ico svg { display: block; }

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background: var(--line-hover); background-clip: padding-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: var(--tap); padding: .7rem 1.25rem;
  font-size: 1rem; font-weight: 600; font-family: inherit; letter-spacing: -.005em;
  border: 1px solid transparent; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff; cursor: pointer;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(26, 59, 150, .25), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: background .15s var(--ease), box-shadow .15s var(--ease), transform .08s var(--ease), border-color .15s;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn--block { width: 100%; }
.btn--lg { min-height: 56px; font-size: 1.08rem; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
.btn--ghost:hover { background: var(--surface-2); border-color: var(--line-hover); }
.btn--danger { background: var(--danger-solid); box-shadow: 0 1px 2px rgba(192, 39, 27, .25), inset 0 1px 0 rgba(255,255,255,.12); }
.btn--danger:hover { background: var(--danger-hover); }
/* perigo: texto branco sobre o vermelho; o .btn--ghost deixava o texto escuro (contraste 2,9:1) */
.btn--danger, .btn--ghost.btn--danger { color: #fff; border-color: transparent; }
.btn--ghost.btn--danger:hover { background: var(--danger-hover); border-color: transparent; }
.btn--success { background: var(--ok-solid); box-shadow: 0 1px 2px rgba(23, 128, 61, .25), inset 0 1px 0 rgba(255,255,255,.12); }
.btn--success:hover { background: var(--ok-strong); }

/* ---------- campos ---------- */
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; font-size: .92em; margin-bottom: .35rem; color: var(--ink); }
.field .hint { color: var(--ink-soft); font-size: .88em; margin-top: .3rem; }
.field .hint--error { color: var(--danger); font-weight: 600; }
.field .error { color: var(--danger); font-size: .88em; margin-top: .3rem; font-weight: 600; }
input, select, textarea {
  width: 100%; min-height: var(--tap); padding: .6rem .85rem;
  font-size: 1rem; font-family: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--placeholder); }
input:hover, select:hover, textarea:hover { border-color: var(--line-hover); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 4px var(--brand-ring); }
input:disabled, select:disabled { background: var(--surface-2); color: var(--ink-soft); }
input[type="checkbox"], input[type="radio"] { width: 1.15rem; min-height: 0; height: 1.15rem; accent-color: var(--brand); box-shadow: none; }
select { appearance: none; padding-right: 2.2rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6677' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; }

/* ---------- cartões ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.15rem;
}
.card + .card { margin-top: .9rem; }
.muted { color: var(--ink-soft); }
.stack > * + * { margin-top: .9rem; }
.row { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: .75rem; }
.grid { display: grid; gap: .9rem; }

/* ---------- selo de status ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .18rem .6rem; border-radius: 999px; font-size: .84rem; font-weight: 600; white-space: nowrap;
}
.badge::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: currentColor; }
.badge--ok { color: var(--ok); background: var(--ok-bg); }
.badge--warn { color: var(--warn); background: var(--warn-bg); }
.badge--danger { color: var(--danger); background: var(--danger-bg); }
.badge--info { color: var(--info); background: var(--brand-light); }
.badge--muted { color: var(--ink-soft); background: var(--muted-bg); }

/* ---------- login ---------- */
.auth {
  min-height: 100dvh; display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(900px 500px at 15% -10%, rgba(36, 80, 198, .16), transparent 60%),
    radial-gradient(700px 480px at 100% 110%, rgba(36, 80, 198, .10), transparent 60%),
    var(--bg);
}
.auth__box {
  width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 2.1rem 1.75rem 1.9rem; box-shadow: var(--shadow-lg);
  animation: rise .5s var(--ease) both;
}
.auth__logo {
  display: flex; flex-direction: column; align-items: center; gap: .85rem;
  text-align: center; font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; color: var(--ink);
  margin-bottom: 1.6rem;
}
.auth__logo::before {
  content: ""; width: 52px; height: 52px; border-radius: 15px;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='1.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7.5 4.27 9 5.15'/%3E%3Cpath d='M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z'/%3E%3Cpath d='m3.3 7 8.7 5 8.7-5M12 22V12'/%3E%3C/svg%3E") center / 28px no-repeat,
    linear-gradient(145deg, #3a67e0, var(--brand-dark));
  box-shadow: 0 8px 20px -6px rgba(36, 80, 198, .55), inset 0 1px 0 rgba(255, 255, 255, .25);
}

/* ---------- app shell (casa / mobile) ---------- */
.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.appbar {
  background: var(--glass); color: var(--ink); padding: .7rem 1rem;
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: .75rem; position: sticky; top: 0; z-index: 20;
  padding-top: max(.7rem, env(safe-area-inset-top));
}
.appbar__title { font-weight: 700; font-size: 1.08rem; letter-spacing: -.01em; margin: 0; }
.appbar__spacer { flex: 1; }
.appbar .iconbtn { min-height: 40px; padding: .4rem .9rem; font-size: .92rem; }
.iconbtn.btn--ghost { padding: .4rem .7rem; }

.content { flex: 1; padding: 1.1rem 1rem; max-width: 720px; width: 100%; margin: 0 auto; padding-bottom: 6.5rem; animation: rise .4s var(--ease) both; }

.bottomnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: flex; background: var(--glass-strong);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
  padding: .25rem .4rem env(safe-area-inset-bottom);
}
.bottomnav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: .2rem;
  padding: .5rem .25rem; text-decoration: none; color: var(--ink-soft); border-radius: 12px;
  font-size: .72rem; font-weight: 600; min-height: 58px; justify-content: center;
  transition: color .15s, background .15s;
}
.bottomnav a:hover { color: var(--ink); }
.bottomnav a[aria-current="page"] { color: var(--brand-text); background: var(--brand-light); }

/* ---------- ações grandes (casa) ---------- */
.bigaction {
  display: flex; align-items: center; gap: 1rem; width: 100%;
  padding: 1.1rem 1.15rem; border: 1px solid var(--line); border-radius: 16px;
  background: var(--surface); text-align: left; cursor: pointer; font-family: inherit; color: var(--ink);
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .2s var(--ease), transform .15s var(--ease);
}
.bigaction:hover { border-color: var(--brand-hover-line); box-shadow: 0 1px 2px rgba(17,26,43,.05), 0 10px 24px -8px rgba(36, 80, 198, .25); transform: translateY(-1px); }
.bigaction:active { transform: translateY(0); }
.bigaction .ico {
  width: 52px; height: 52px; border-radius: 14px; align-items: center; justify-content: center;
  background: var(--brand-light); color: var(--brand-text);
}
.bigaction .t { font-size: 1.05rem; font-weight: 700; letter-spacing: -.01em; }
.bigaction .s { color: var(--ink-soft); font-size: .92rem; }
.bigaction::after {
  content: ""; margin-left: auto; width: 20px; height: 20px; flex: none; opacity: .45;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23111a2b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m9 18 6-6-6-6'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------- contador − N + ---------- */
.stepper { display: flex; align-items: center; gap: .5rem; }
.stepper button {
  width: 52px; height: 52px; font-size: 1.6rem; font-weight: 600;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--brand-text);
  border-radius: 14px; cursor: pointer; line-height: 1; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); transition: background .12s, border-color .12s;
}
.stepper button:hover { border-color: var(--brand); }
.stepper button:active { background: var(--brand-light); }
.stepper .val { min-width: 3ch; text-align: center; font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.orderline { padding: 1rem 0; border-bottom: 1px solid var(--line); }
.orderline:last-child { border-bottom: 0; }
.orderline .name { font-size: 1.05rem; font-weight: 650; }
.orderline .sub { color: var(--ink-soft); font-size: .92rem; margin-bottom: .5rem; }

/* ---------- timeline do pedido ---------- */
.timeline { list-style: none; padding: 0; margin: 1rem 0; }
.timeline li { display: flex; gap: .75rem; padding: .4rem 0; align-items: center; }
.timeline .dot { display: inline-flex; color: var(--line-strong); }
.timeline .done { font-weight: 650; }
.timeline .done .dot, .timeline li:has(.done) .dot { color: var(--ok); }
.timeline .todo { color: var(--ink-soft); }

/* ---------- tela de sucesso ---------- */
.success { text-align: center; padding: 2rem 1rem; }
.success .mark {
  width: 88px; height: 88px; border-radius: 50%; background: var(--ok-bg); color: var(--ok);
  display: flex; align-items: center; justify-content: center; font-size: 2.6rem; margin: 0 auto 1rem;
  box-shadow: 0 0 0 10px rgba(23, 128, 61, .07);
  animation: pop .5s var(--ease) both;
}

/* ---------- desktop admin ---------- */
.admin { display: block; min-height: 100dvh; }
.sidebar {
  display: flex; flex-direction: column; background: var(--nav-bg); color: var(--nav-ink);
  padding: 1.1rem .7rem; gap: .15rem; overflow-y: auto; overflow-x: hidden;
  scrollbar-color: rgba(255,255,255,.15) transparent;
  /* celular: gaveta que desliza sobre a tela */
  position: fixed; inset: 0 auto 0 0; width: min(280px, 84vw); z-index: 40;
  transform: translateX(-102%); visibility: hidden;
  transition: transform .28s var(--ease), visibility 0s linear .28s;
}
.admin[data-nav="open"] .sidebar { transform: none; visibility: visible; transition: transform .28s var(--ease); box-shadow: var(--shadow-lg); }
.nav-backdrop { position: fixed; inset: 0; z-index: 35; background: rgba(13, 20, 36, .45); opacity: 0; pointer-events: none; transition: opacity .2s; }
.admin[data-nav="open"] .nav-backdrop { opacity: 1; pointer-events: auto; }
.navtoggle { gap: .5rem; padding: .4rem .8rem; flex: none; white-space: nowrap; }

.sidebar__brand {
  display: flex; align-items: center; gap: .7rem; color: var(--nav-ink-strong);
  font-weight: 700; font-size: 1rem; letter-spacing: -.01em; padding: .35rem .65rem 1.1rem;
}
.sidebar__logo {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff;
  background: linear-gradient(145deg, #3a67e0, var(--brand-dark));
  box-shadow: 0 6px 14px -5px rgba(58, 103, 224, .7), inset 0 1px 0 rgba(255,255,255,.25);
}
.sidebar a {
  display: flex; align-items: center; gap: .7rem; padding: .55rem .7rem; border-radius: 9px;
  color: var(--nav-ink); text-decoration: none; font-weight: 550;
  transition: background .12s, color .12s;
}
.sidebar a .ico { opacity: .85; }
.sidebar a:hover { background: var(--nav-hover); color: var(--nav-ink-strong); }
.sidebar a[aria-current="page"] { background: var(--nav-active); color: var(--nav-ink-strong); }
.sidebar a[aria-current="page"] .ico { color: #8fb0ff; opacity: 1; }
.sidebar .sep { margin: 1rem .7rem .3rem; font-size: .68rem; font-weight: 650; text-transform: uppercase; letter-spacing: .09em; color: var(--nav-sep); }
.sidebar__bottom { margin-top: auto; display: flex; flex-direction: column; gap: inherit; padding-top: .75rem; }
.sidebar__out { margin-top: .15rem; }
.navbadge { margin-left: auto; background: var(--danger-solid); color: #fff; border-radius: 999px; padding: 0 .45rem; min-width: 1.35rem; text-align: center; font-size: .72rem; font-weight: 700; line-height: 1.35rem; }

.admin__main { padding: 0 1rem 2rem; min-width: 0; }
.admin__topbar {
  display: flex; align-items: center; gap: .75rem;
  position: sticky; top: 0; z-index: 15;
  margin: 0 -1rem 1.25rem; padding: .8rem 1rem;
  background: var(--bar-glass);
  -webkit-backdrop-filter: saturate(1.4) blur(12px); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.admin__topbar h1 { font-size: 1.2rem; margin: 0; }
.admin__topbar .appbar__spacer { flex: 1; }
.userchip { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .9rem; color: var(--ink); }
.userchip__avatar {
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-light); color: var(--brand-text); font-weight: 700; font-size: .8rem; letter-spacing: .02em;
}
.userchip__name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin__content { animation: rise .4s var(--ease) both; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: .9rem; }
.kpi {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.1rem; display: block; text-align: left; font-family: inherit; color: var(--ink);
  box-shadow: var(--shadow);
  transition: border-color .15s, box-shadow .2s var(--ease), transform .15s var(--ease);
}
button.kpi { cursor: pointer; }
button.kpi:hover { border-color: var(--brand-hover-line); box-shadow: 0 1px 2px rgba(17,26,43,.05), 0 10px 24px -10px rgba(36, 80, 198, .3); transform: translateY(-1px); }
.kpi .l { color: var(--ink-soft); font-weight: 600; display: flex; align-items: center; gap: .45rem; }
.kpi .l::before { content: ""; width: .5rem; height: .5rem; border-radius: 50%; background: var(--brand); }
.kpi--ok .l::before { background: var(--ok); }
.kpi--warn .l::before { background: var(--warn); }
.kpi--danger .l::before { background: var(--danger); }
.kpi .n { order: 2; font-size: 2rem; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; margin-top: .25rem; }
.kpi { display: flex; flex-direction: column; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table.data { width: 100%; border-collapse: collapse; min-width: 560px; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: .75rem .95rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data th { background: var(--surface-2); font-size: .74rem; font-weight: 650; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-soft); white-space: nowrap; }
table.data tbody tr { transition: background .1s; }
table.data tbody tr:hover td { background: var(--surface-2); }

.toolbar { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; align-items: end; }
.toolbar .field, body[data-area="admin"] .toolbar .field { margin: 0; }

/* ---------- toast ---------- */
#toast-root { position: fixed; left: 50%; transform: translateX(-50%); bottom: 5.5rem; z-index: 100; display: grid; gap: .5rem; width: min(92vw, 420px); }
.toast {
  background: var(--toast-bg); color: #fff; padding: .8rem 1rem; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); font-weight: 600; font-size: .95rem;
  animation: rise .3s var(--ease) both;
}
.toast--ok { background: var(--ok-strong); }
.toast--err { background: var(--danger-strong); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(13, 20, 36, .5);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 1rem; z-index: 90;
  animation: fade .2s ease both;
}
.modal {
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px; width: min(96vw, 520px);
  max-height: 90dvh; overflow: auto; padding: 1.5rem; box-shadow: var(--shadow-lg);
  animation: rise .3s var(--ease) both;
}
.modal h2 { margin-top: 0; }
.modal__actions { display: flex; gap: .75rem; margin-top: 1.25rem; }
.modal__actions .btn { flex: 1; }

.loading { text-align: center; padding: 3rem 1rem; color: var(--ink-soft); }
.empty { text-align: center; padding: 2.5rem 1rem; color: var(--ink-soft); }
.list-reset { list-style: none; padding: 0; margin: 0; }

/* ---------- área administrativa (Admin / Responsável): compacta ---------- */
body[data-area="admin"] { font-size: 14px; }
body[data-area="admin"] h1 { font-size: 1.15rem; }
body[data-area="admin"] h2 { font-size: 1rem; }
body[data-area="admin"] h3 { font-size: .95rem; }
body[data-area="admin"] .btn { min-height: 36px; padding: .4rem .9rem; font-size: .88rem; }
body[data-area="admin"] .btn--lg { min-height: 42px; font-size: .95rem; }
body[data-area="admin"] input,
body[data-area="admin"] select,
body[data-area="admin"] textarea { min-height: 36px; padding: .38rem .65rem; font-size: .88rem; }
body[data-area="admin"] select { padding-right: 2rem; }
body[data-area="admin"] .field { margin-bottom: .85rem; }
body[data-area="admin"] .field label { font-size: .8rem; margin-bottom: .25rem; color: var(--ink-soft); }
body[data-area="admin"] .card { padding: 1rem; }
body[data-area="admin"] table.data th,
body[data-area="admin"] table.data td { padding: .55rem .8rem; }
body[data-area="admin"] table.data th { font-size: .75rem; }
body[data-area="admin"] table.data td { font-size: .86rem; }
body[data-area="admin"] .kpi { padding: .9rem 1rem; }
body[data-area="admin"] .kpi .n { font-size: 1.7rem; }
body[data-area="admin"] .kpi .l { font-size: .82rem; }
body[data-area="admin"] .admin__topbar h1 { font-size: 1.05rem; }
body[data-area="admin"] .badge { font-size: .76rem; }
body[data-area="admin"] .modal { font-size: 14px; padding: 1.25rem; }
body[data-area="admin"] .modal h2 { font-size: 1.05rem; }

/* ---------- desktop ---------- */
@media (min-width: 900px) {
  body { font-size: 16px; }
  body[data-area="admin"] { font-size: 14px; }
  .admin { display: grid; grid-template-columns: 248px minmax(0, 1fr); transition: grid-template-columns .28s var(--ease); }
  .admin[data-nav="closed"] { grid-template-columns: 0 minmax(0, 1fr); }
  .sidebar { position: sticky; top: 0; height: 100dvh; width: auto; z-index: auto; transform: none; visibility: visible; box-shadow: none; transition: visibility 0s linear .28s; }
  .admin[data-nav="closed"] .sidebar { visibility: hidden; padding-inline: 0; min-width: 0; overflow: hidden; }
  .admin[data-nav="open"] .sidebar { box-shadow: none; }
  .nav-backdrop { display: none; }
  .admin__main { padding: 0 2rem 2rem; max-width: 1280px; width: 100%; }
  .admin__topbar { margin: 0 -2rem 1.5rem; padding: .85rem 2rem; }
  .bottomnav { display: none; }
  .content { padding-bottom: 1rem; }
}

/* ---------- aviso com X ---------- */
.notice { position: relative; border-color: var(--ok); background: var(--ok-bg); padding-right: 3.2rem; }
.notice + .notice { margin-top: .9rem; }
.notice h2 { margin-top: 0; }
.notice__close {
  position: absolute; top: .6rem; right: .6rem; width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; border-radius: 10px; background: transparent; color: var(--ink-soft); cursor: pointer;
}
.notice__close:hover { background: rgba(17, 26, 43, .08); color: var(--ink); }

/* ---------- fazer pedido (lista longa) ---------- */
.orderpage { padding-bottom: 5.5rem; }
.pickbar {
  position: sticky; top: 56px; z-index: 10; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center;
  margin: 0 -1rem .6rem; padding: .6rem 1rem; background: var(--bar-glass-strong);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.picksearch { flex: 1 1 200px; min-height: 44px; }
.chip {
  min-height: 40px; padding: .35rem .9rem; border-radius: 999px; border: 1px solid var(--line-strong);
  background: var(--surface); color: var(--ink-soft); font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
}
.chip--on { background: var(--brand); border-color: var(--brand); color: #fff; }
.picklist { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.pickgroup {
  margin: 0; padding: .55rem .9rem; font-size: .78rem; font-weight: 650; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-soft); background: var(--surface-2); border-bottom: 1px solid var(--line);
}
.pickgroup:not(:first-child) { border-top: 1px solid var(--line); }
.pick { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .55rem .9rem; border-bottom: 1px solid var(--line); transition: background .15s; }
.pick:last-child { border-bottom: 0; }
.pick[hidden], .pickgroup[hidden], .empty[hidden] { display: none; }
.pick--on { background: var(--brand-light); }
.pick__name { min-width: 0; }
.pick__title { font-weight: 600; font-size: 1rem; line-height: 1.25; }
.pick__unit { color: var(--ink-soft); font-size: .84rem; }
.pick__ctl { display: flex; align-items: center; gap: .3rem; flex: none; }
/* produto com vários tamanhos: título à esquerda, um campo por tamanho na mesma linha */
.pick--multi { flex-direction: column; align-items: stretch; gap: .45rem; }
.pick__vars { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: .5rem; max-width: 460px; }
.pickvar { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.pickvar__label { font-size: .88rem; font-weight: 700; color: var(--ink-soft); text-align: center; }
.pick--multi .pick__ctl { flex-wrap: wrap; width: 100%; gap: .3rem; }
.pick--multi .pick__qty { order: -1; width: 100%; flex: 1 0 100%; }
.pick--multi .pick__btn { flex: 1 1 0; width: auto; min-width: 44px; }
/* tela larga: título à esquerda e os tamanhos alinhados à direita, como nos itens simples */
@media (min-width: 560px) {
  .pick--multi { flex-direction: row; align-items: center; gap: .75rem; }
  .pick__vars { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem 1rem; max-width: none; margin-left: auto; }
  .pickvar { align-items: center; }
  .pick--multi .pick__ctl { flex-wrap: nowrap; width: auto; }
  .pick--multi .pick__qty { order: 0; flex: none; width: 4.2ch; }
  .pick--multi .pick__btn { flex: none; width: 40px; }
}
.pick__btn {
  width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--brand-text); font-size: 1.3rem; font-weight: 600; line-height: 1; cursor: pointer;
}
.pick__btn:active { background: var(--brand-light); }
.pick__qty {
  width: 4.2ch; min-width: 56px; min-height: 40px; padding: .2rem .3rem; text-align: center;
  font-size: 1.1rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.orderbar {
  position: fixed; left: 0; right: 0; bottom: calc(60px + env(safe-area-inset-bottom)); z-index: 25;
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .6rem 1rem; background: var(--glass-solid); border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px -12px rgba(17, 26, 43, .25);
}
.orderbar .btn { min-height: 48px; }
.orderbar__sum { font-size: 1rem; }
@media (min-width: 900px) {
  .orderbar { bottom: 0; }
  .orderbar > * { max-width: 720px; }
  .pickbar { top: 0; }
}

@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .auth__box, .content, .admin__content, .toast, .modal, .modal-backdrop, .success .mark { animation: none; }
  .btn, .bigaction, .kpi, .stepper button { transition-property: background-color, border-color, box-shadow, color; }
  .btn:active, .bigaction:hover, button.kpi:hover { transform: none; }
  .admin, .sidebar, .admin[data-nav] .sidebar, .nav-backdrop { transition: none; }
  tr.flash td { animation: none; background: var(--flash); }
}

/* ---------- compras ---------- */
.qty-wrap { min-width: 96px; }
.qty-input { width: 100%; max-width: 120px; min-height: 40px; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; }
.qty-input[aria-invalid="true"] { border-color: var(--danger, #b42318); }
.qty-wrap .error { font-size: .78rem; color: var(--danger, #b42318); min-height: 0; }
tr.row--on td { background: var(--brand-light); }
tr.flash td { animation: flashrow 1.6s ease; }
@keyframes flashrow { 0%, 60% { background: var(--flash); } 100% { background: transparent; } }
.compras-bar { position: sticky; bottom: 0; left: auto; right: auto; border-radius: var(--radius); border: 1px solid var(--line); flex-wrap: wrap; }
.compras-bar .row { gap: .5rem; flex-wrap: wrap; }
@media (max-width: 760px) {
  table.cards-sm { min-width: 0; }
  table.cards-sm thead { display: none; }
  table.cards-sm tr { display: block; padding: .6rem .8rem; border-bottom: 1px solid var(--line); }
  table.cards-sm td { display: flex; justify-content: space-between; align-items: center; gap: .75rem; border: 0; padding: .3rem 0; }
  table.cards-sm td[data-label]::before { content: attr(data-label); color: var(--ink-soft); font-size: .8rem; flex: none; }
  table.cards-sm td[data-label=""]::before { content: "Selecionar"; }
  .compras-bar { bottom: calc(60px + env(safe-area-inset-bottom)); }
}

/* ---------- foco programático no título ao trocar de tela ---------- */
h1[tabindex="-1"]:focus { outline: none; }

/* ---------- toque: alvos de 44px no admin (desktop com mouse continua compacto) ---------- */
@media (pointer: coarse), (max-width: 899px) {
  body[data-area="admin"] .btn,
  body[data-area="admin"] .btn--lg { min-height: 44px; }
  body[data-area="admin"] input:not([type="checkbox"]):not([type="radio"]),
  body[data-area="admin"] select,
  body[data-area="admin"] textarea { min-height: 44px; }
  .sidebar a { min-height: 44px; }
  .appbar .iconbtn { min-height: 44px; min-width: 44px; }
  .notice__close { width: 44px; height: 44px; }
  .chip, .pick__btn, .pick__qty, .qty-input { min-height: 44px; }
  .pick__btn { width: 44px; }
}

/* ---------- barra superior em tela estreita ---------- */
@media (max-width: 599px) {
  .userchip__name { display: none; }
  .admin__topbar { gap: .5rem; }
  .admin__topbar h1 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

/* ---------- Nota Fiscal (importação de PDF) ---------- */
.dropzone {
  display: grid; justify-items: center; gap: .35rem; text-align: center; padding: 1.6rem 1rem;
  border: 2px dashed var(--line-strong, var(--line)); border-radius: var(--radius); background: var(--surface-2);
  color: var(--ink-soft); cursor: pointer; transition: border-color .12s, background .12s;
}
.dropzone strong { color: var(--ink); overflow-wrap: anywhere; }
.dropzone:hover, .dropzone:focus-visible, .dropzone--over { border-color: var(--brand); background: var(--brand-light); }
.nf-table { min-width: 760px; }
.nf-table td { vertical-align: top; }
.nf-table select, .nf-table input[type="text"] { width: 100%; min-width: 11rem; }
.nf-table input[type="number"] { width: 6.5rem; }
.nf-new { display: grid; grid-template-columns: 1fr 8rem; gap: .4rem; margin-top: .4rem; }
.nf-new select { min-width: 0; }
.nf-issue { font-size: .8rem; margin-top: .2rem; }
.nf-row--pend td { background: var(--warn-bg); }
.nf-table .is-invalid { border-color: var(--danger); }
.check { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; }

/* WhatsApp ao lado do celular (lista de usuários) */
.wa-link { display: inline-flex; align-items: center; justify-content: center; margin-left: 8px; vertical-align: middle;
  width: 24px; height: 24px; border-radius: 50%; color: #25d366; transition: background .15s, transform .15s; }
.wa-link:hover, .wa-link:focus-visible { background: rgba(37, 211, 102, .16); transform: scale(1.08); }
@media (pointer: coarse), (max-width: 640px) { .wa-link { width: 44px; height: 44px; margin-left: 4px; } .wa-link svg { width: 22px; height: 22px; } }
