/* Portal do cliente Inova — identidade laranja/dourada da marca. */
:root {
  color-scheme: light;
  --bg: #f8f5f1;
  --surface: #ffffff;
  --surface2: #f3ede6;
  --ink: #2e2926;
  --muted: #766d66;
  --line: #e8ded4;
  --accent: #b7562c;
  --accent-strong: #a84e26;
  --accent2: #c25a2a;
  --gold: #e9af56;
  --ok: #127a52;
  --warn: #9a6200;
  --bad: #b3362c;
  --bad-ink: #ffffff;
  --accent-ink: #ffffff;
  --shadow: 0 1px 2px rgba(46, 41, 38, .04), 0 10px 30px rgba(120, 70, 40, .08);
  --radius: 16px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #191715;
    --surface: #241f1b;
    --surface2: #2f2823;
    --ink: #f8f1eb;
    --muted: #c1b4aa;
    --line: #40362f;
    --accent: #e89a6e;
    --accent-strong: #a84e26;
    --accent2: #c25a2a;
    --gold: #e9af56;
    --ok: #4cc594;
    --warn: #e9af56;
    --bad: #f07167;
    --bad-ink: #241f1b;
    --accent-ink: #241f1b;
    --shadow: 0 6px 24px rgba(0, 0, 0, .25);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body { background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
a { color: var(--accent); }

/* Estrutura */
.shell { display: grid; grid-template-columns: 248px 1fr; min-height: 100vh; min-height: 100dvh; }
.side { position: sticky; top: 0; height: 100vh; height: 100dvh; padding: 28px 16px; display: flex; flex-direction: column; gap: 4px; border-right: 1px solid var(--line); background: var(--surface); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 750; font-size: 19px; letter-spacing: -.02em; padding: 4px 10px 28px; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.nav { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; font-weight: 600; border: 0; background: none; cursor: pointer; text-align: left; width: 100%; position: relative; }
.nav:hover { background: var(--surface2); color: var(--ink); }
.nav.on { background: color-mix(in srgb, var(--accent) 12%, var(--surface)); color: var(--accent); box-shadow: none; }
.nav svg { width: 20px; height: 20px; flex: none; }
.nav .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.badge { margin-left: auto; background: var(--bad); color: var(--bad-ink); border-radius: 99px; font-size: 12px; font-weight: 700; padding: 1px 8px; min-width: 22px; text-align: center; }
.nav.on .badge { background: var(--accent); color: var(--accent-ink); }
.grow { flex: 1; }
.who { font-size: 12px; color: var(--muted); padding: 8px 12px; overflow: hidden; text-overflow: ellipsis; }
main { padding: 44px clamp(18px, 4vw, 48px) 90px; max-width: 1240px; width: 100%; }
.top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 30px; flex-wrap: wrap; }
.top h1 { font-size: 30px; line-height: 1.2; letter-spacing: -.03em; }
.top p { color: var(--muted); margin-top: 7px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; }
.grid { display: grid; gap: 18px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

/* Destaque e indicadores */
.hero { min-height: 190px; background: linear-gradient(115deg, #6f2f13, #a84e26 60%, #c25a2a); color: #fff; border: 0; display: flex; gap: 20px; align-items: center; justify-content: space-between; flex-wrap: wrap; position: relative; overflow: hidden; box-shadow: 0 14px 32px rgba(120, 70, 40, .18); }
.hero:after { content: ""; position: absolute; right: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: rgba(233, 175, 86, .18); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero h2 { max-width: 650px; font-size: 25px; letter-spacing: -.02em; }
.hero p { max-width: 600px; opacity: .92; margin-top: 4px; }
.pill { display: inline-flex; align-items: center; gap: 8px; border-radius: 99px; padding: 5px 12px; font-weight: 650; font-size: 13px; background: var(--surface2); color: var(--ink); }
.hero .pill { color: #fff; background: rgba(255, 255, 255, .2); }
.dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 25%, transparent); }
.pill.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.pill.warn { color: var(--warn); background: color-mix(in srgb, var(--warn) 16%, transparent); }
.pill.bad { color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, transparent); }

/* Botões e formulários */
.btn { border: 0; border-radius: 10px; padding: 11px 18px; font-weight: 650; cursor: pointer; background: linear-gradient(135deg, var(--accent-strong), var(--accent2)); color: #fff; box-shadow: 0 6px 16px rgba(168, 78, 38, .22); transition: transform .12s, opacity .12s, filter .12s; }
.btn:hover { transform: translateY(-1px); filter: brightness(1.05); }
.btn:active { transform: none; }
.btn:disabled { opacity: .55; cursor: default; transform: none; filter: none; }
.btn.ghost { background: var(--surface2); color: var(--ink); box-shadow: none; }
.btn.danger { background: var(--bad); color: var(--bad-ink); box-shadow: none; }
.btn.white { background: #fff; color: var(--accent-strong); box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
.btn.sm { padding: 7px 12px; font-size: 13px; border-radius: 8px; }
.stat { display: flex; flex-direction: column; gap: 2px; text-align: left; min-height: 112px; justify-content: center; cursor: pointer; transition: border-color .15s, transform .15s; }
.stat:hover { border-color: var(--accent); transform: translateY(-2px); }
.stat b { font-size: 30px; letter-spacing: -.03em; line-height: 1.1; }
.stat span { color: var(--muted); font-size: 13px; font-weight: 600; margin-top: 6px; }
h3 { font-size: 16px; letter-spacing: -.01em; margin-bottom: 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
[hidden] { display: none !important; }
.f { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; color: var(--muted); }
input, select, textarea { background: var(--surface2); border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; width: 100%; outline: none; color: var(--ink); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
input[type=checkbox] { width: auto; accent-color: var(--accent); }
textarea { resize: vertical; min-height: 110px; }
.form { display: grid; gap: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.row > * { flex: 1; min-width: 140px; }
.row .btn { flex: none; }
.row > input[type=checkbox] { flex: none; min-width: 0; }
.row > .pill, .row > .timer { flex: none; min-width: 0; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty input { flex: 1; min-width: 0; }
.qty .unit-tag { flex: none; min-width: 2ch; font-weight: 700; color: var(--muted); }
.tones { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tone { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: var(--surface2); cursor: pointer; font-weight: 500; }
.tone input { width: auto; flex: none; margin-top: 3px; accent-color: var(--accent); }
.tone b { display: block; color: var(--ink); font-size: 14px; }
.tone span { display: block; color: var(--muted); font-size: 12px; line-height: 1.45; }
.tone:has(input:checked) { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
@media (max-width: 620px) { .tones { grid-template-columns: 1fr; } }

/* Listas, catálogo e memória */
.item { display: flex; gap: 14px; align-items: flex-start; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.item + .item { margin-top: 10px; }
.item .body { flex: 1; min-width: 0; }
.item .q { font-weight: 650; font-size: 16px; overflow-wrap: anywhere; white-space: pre-wrap; }
.timer { font-size: 12px; font-weight: 700; color: var(--warn); }
.empty { text-align: center; padding: 46px 16px; color: var(--muted); line-height: 1.6; }
.empty .big { font-size: 42px; margin-bottom: 6px; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.prod { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; box-shadow: var(--shadow); transition: transform .15s, border-color .15s; }
.prod:hover { transform: translateY(-3px); border-color: var(--accent); }
.prod .ph { aspect-ratio: 4 / 3; background: linear-gradient(135deg, var(--surface2), var(--line)); display: grid; place-items: center; font-size: 34px; color: var(--muted); }
.prod .ph img { width: 100%; height: 100%; object-fit: cover; }
.prod .info { padding: 12px 14px; }
.prow { display: flex; align-items: center; justify-content: space-between; gap: 4px 8px; margin-top: 4px; flex-wrap: wrap; }
.prow b { white-space: nowrap; }
.prod .name { font-weight: 650; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.tl { position: relative; padding-left: 22px; }
.tl:before { content: ""; position: absolute; left: 6px; top: 6px; bottom: 6px; width: 2px; background: var(--line); }
.fact { position: relative; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; margin-bottom: 12px; }
.fact:before { content: ""; position: absolute; left: -21px; top: 20px; width: 12px; height: 12px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg); }

/* Simulação */
.chat { display: flex; flex-direction: column; gap: 10px; height: min(52vh, 520px); overflow: auto; padding: 6px 2px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: linear-gradient(135deg, var(--accent-strong), var(--accent2)); color: #fff; border-bottom-right-radius: 4px; }
.bubble.bot { align-self: flex-start; background: var(--surface2); border-bottom-left-radius: 4px; }
.bubble code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .95em; }
.seg { display: inline-flex; background: var(--surface2); padding: 4px; border-radius: 12px; gap: 4px; }
.seg button { border: 0; background: none; padding: 7px 14px; border-radius: 9px; font-weight: 650; cursor: pointer; color: var(--muted); }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* Diálogos, avisos e mensagens */
dialog { --dlg-pad: 26px; border: 0; border-radius: 22px; padding: 0; width: min(560px, 94vw); background: var(--surface); color: var(--ink); box-shadow: 0 30px 80px rgba(0, 0, 0, .35); }
dialog::backdrop { background: rgba(25, 20, 16, .55); backdrop-filter: blur(4px); }
dialog .in { padding: var(--dlg-pad); display: grid; gap: 14px; max-height: 88vh; overflow: auto; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); z-index: 99; animation: up .25s; max-width: calc(100vw - 32px); text-align: center; }
@keyframes up { from { opacity: 0; transform: translate(-50%, 10px); } }
.err { color: var(--bad); font-weight: 600; font-size: 13px; }
.notif { border-left: 4px solid var(--accent); }
.notif.new { background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }

/* Atalhos rápidos no celular */
.quick { display: none; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }

/* Entrada do portal */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 20px; background: radial-gradient(ellipse at 15% 0%, rgba(217, 107, 54, .10), transparent 43%), radial-gradient(ellipse at 90% 100%, rgba(233, 175, 86, .13), transparent 42%), #f8f5f1; }
.auth .card { width: min(440px, 100%); padding: 40px; border-color: #eee5dc; box-shadow: 0 18px 60px rgba(76, 48, 28, .08); }
.auth .brand { justify-content: flex-start; gap: 4px; padding: 0 0 34px; font-size: 25px; color: #2e2926; }
.auth .brand img { width: 46px; height: 47px; border-radius: 0; }
.auth-title { font-size: 25px; line-height: 1.25; letter-spacing: -.035em; color: #2e2926; }
.auth p.sub { text-align: left; margin: 8px 0 26px; color: #766d66; }
.auth label.f { color: #554c46; }
.auth input { background: #fcfaf8; border-color: #e7ded6; color: #2e2926; }
.auth input:focus { border-color: #b7562c; box-shadow: 0 0 0 4px rgba(217, 107, 54, .16); }
.auth .btn { background: #b7562c; color: #fff; box-shadow: none; margin-top: 4px; min-height: 48px; }
.auth .btn:hover { background: #984522; }
@media (prefers-color-scheme: dark) {
  .auth { background: radial-gradient(ellipse at 15% 0%, rgba(217, 107, 54, .13), transparent 43%), #191715; }
  .auth .card { background: #25211e; border-color: #40362f; }
  .auth .brand, .auth-title { color: #f8f1eb; }
  .auth p.sub { color: #c1b4aa; }
  .auth label.f { color: #e0d4ca; }
  .auth input { background: #302b27; border-color: #51443a; color: #f8f1eb; }
  .auth .btn { background: #b7562c; }
}

/* Acessibilidade */
.prod:focus-visible, .nav:focus-visible, .btn:focus-visible, button:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 65%, transparent); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Celular e tablet */
@media (max-width: 820px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); z-index: 20; justify-content: space-between; gap: 0; }
  .side .brand, .side .grow, .side .who { display: none; }
  .side { overflow-x: auto; justify-content: flex-start; scrollbar-width: thin; overscroll-behavior-x: contain; }
  .side .nav { flex: 0 0 68px; }
  .nav { flex: 1 1 0; min-width: 0; min-height: 56px; flex-direction: column; gap: 2px; font-size: 11px; padding: 7px 4px; justify-content: center; align-items: center; text-align: center; }
  .nav span.t { font-size: 10px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .nav .badge { position: absolute; top: 2px; right: 8px; margin: 0; font-size: 10px; min-width: 18px; padding: 0 5px; }
  main { max-width: none; padding: 22px 18px calc(100px + env(safe-area-inset-bottom)); }
  .top { align-items: flex-start; margin-bottom: 22px; }
  .top h1 { font-size: 25px; }
  .top > .btn { width: 100%; }
  .card { padding: 19px; }
  .hero { min-height: 0; flex-direction: column; align-items: stretch; }
  .hero h2 { font-size: 21px; }
  .hero .btn { width: 100%; }
  .g2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); }
  .g3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 140px), 1fr)); }
  .products { grid-template-columns: repeat(auto-fill, minmax(min(100%, 145px), 1fr)); }
  .row > * { min-width: 0; }
  .bubble { max-width: 92%; }
  .seg { display: flex; width: 100%; }
  .seg button { flex: 1; padding: 8px 6px; font-size: 12px; }
  .chat { height: min(48vh, 440px); }
  input, select, textarea { font-size: 16px; }
  .toast { bottom: calc(84px + env(safe-area-inset-bottom)); }
  dialog .in > .row:last-child { position: sticky; bottom: calc(-1 * var(--dlg-pad)); margin: 0 calc(-1 * var(--dlg-pad)) calc(-1 * var(--dlg-pad)); padding: 12px var(--dlg-pad) var(--dlg-pad); background: var(--surface); border-top: 1px solid var(--line); }
  .quick { display: grid; }
}
@media (max-width: 480px) {
  .top h1 { font-size: 22px; }
  .card { padding: 16px; }
  .hero h2 { font-size: 20px; }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { min-height: 92px; }
  .stat b { font-size: 26px; }
  .item { padding: 14px; }
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .prod .info { padding: 10px 12px; }
  dialog { width: 96vw; --dlg-pad: 20px; }
  dialog .in { max-height: 92vh; }
  .auth .card { padding: 30px 25px; }
  .auth .brand { padding-bottom: 28px; }
}
@media (max-width: 360px) {
  .nav { padding-left: 1px; padding-right: 1px; }
  .nav span.t { font-size: 9px; letter-spacing: -.02em; }
  .quick { grid-template-columns: 1fr; }
}
