/* Freguês — sistema visual (especificação visual do Lucas: minimalista, suave, arredondado, Urbanist, cobre) */
@import url("https://fonts.googleapis.com/css2?family=Urbanist:wght@400;500;600;700&display=swap");

:root {
  --font: "Urbanist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --fs-2xs: 11px; --fs-xs: 12px; --fs-sm: 12.5px; --fs-md: 13.5px; --fs-base: 14px;
  --fs-lg: 15px; --fs-xl: 17px; --fs-2xl: 20px; --fs-3xl: 22px; --fs-4xl: 26px; --fs-display: 34px;

  --bg: #eef0ec;
  --glow-a: color-mix(in srgb, var(--pine) 14%, #f8faf7);
  --glow-b: #f1ead6;
  --surface: #fcfdfc; --surface-2: #f3f5f2; --raised: #ffffff; --well: #14241c0e;
  --line: #14241c16; --line-2: #14241c2b; --hair: #14241c33;
  --shadow: 0 1px 2px #14241c0a, 0 14px 34px -22px #14241c47;
  --shadow-pop: 0 26px 60px -20px #14241c57, 0 2px 6px #14241c14;
  --text: #18201b; --muted: #56615a; --faint: #5f6a63;
  --primary: #a8481c; --on-primary: #fff7f2; --pine: #b9531f;
  --ochre: #c88a12; --teal: #1d8a7b; --sky: #3a72c8; --rose: #cf4a5c; --sage: #6d9a2c; --slate: #6b7380; --ocean: #1f7f99;
  --good: #23804d; --warn: #93600a; --bad: #bf3a2d; --info: #2f63b8;
  --soft: 14%;
  --r-card: 22px; --r-tile: 14px; --gap: 16px;
  --gutter: clamp(12px, 1.6vw, 24px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: light;
}

:root[data-theme="dark"] {
  --bg: #0f1412; --glow-a: color-mix(in srgb, var(--pine) 10%, transparent); --glow-b: #f2c0560d;
  --surface: #171d1a; --surface-2: #1c231f; --raised: #242c28; --well: #ffffff0e;
  --line: #ffffff14; --line-2: #ffffff29; --hair: #ffffff38;
  --shadow: 0 1px 0 #ffffff09 inset, 0 18px 40px -26px #000000d9;
  --shadow-pop: 0 26px 60px -18px #000000c7, 0 0 0 1px #ffffff14;
  --text: #ecf2ee; --muted: #a8b4ad; --faint: #88948d;
  --primary: #ffa77a; --on-primary: #2b0f03; --pine: #ffa77a;
  --ochre: #f2c056; --teal: #4fcab8; --sky: #7eacf2; --rose: #f2828f; --sage: #b4d66a; --slate: #a3acb8; --ocean: #5cbcd6;
  --good: #6fd38e; --warn: #f2c056; --bad: #f58c7f; --info: #8bb3f6; --soft: 18%;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box }
html { -webkit-text-size-adjust: 100% }
body {
  margin: 0; min-height: 100dvh; overflow-x: hidden; color: var(--text);
  background:
    radial-gradient(70vmax 50vmax at 0% -10%, var(--glow-a), transparent 70%),
    radial-gradient(60vmax 45vmax at 100% 0%, var(--glow-b), transparent 70%),
    var(--bg);
  background-attachment: fixed;
  font: 500 var(--fs-base)/1.45 var(--font);
  font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; overflow-wrap: break-word;
}
button, input, select, textarea { font: inherit; color: inherit }
button { cursor: pointer; background: none; border: 0; padding: 0 }
a { color: inherit; text-decoration: none }
a, button, input, select, textarea, label, [role=button] { -webkit-tap-highlight-color: transparent; touch-action: manipulation }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px }
::selection { background: color-mix(in srgb, var(--pine) 28%, transparent) }
[hidden] { display: none !important }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap }

/* ---------- ícones ---------- */
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round }
.ico--sm { width: 16px; height: 16px }

/* ---------- marca ---------- */
.marca { display: flex; align-items: center; gap: 10px; min-width: 0 }
.marca__selo {
  width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--primary) 65%, #fff), var(--primary) 70%);
  box-shadow: 0 8px 18px -10px var(--primary);
}
.marca__selo .ico { width: 20px; height: 20px }
.marca__nome { font-size: 19px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1 }
.marca__sub { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }

/* ---------- botões ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 999px; font-weight: 700; font-size: var(--fs-md); white-space: nowrap;
  transition: filter .15s, background-color .15s, transform .15s var(--ease);
}
.btn .ico { width: 17px; height: 17px }
.btn:active { transform: scale(.98) }
.btn--sm { height: 36px; padding: 0 14px; font-size: var(--fs-sm) }
.btn--lg { height: 52px; padding: 0 22px; font-size: var(--fs-lg) }
.btn--bloco { width: 100% }
.btn--primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 10px 22px -12px color-mix(in srgb, var(--primary) 85%, transparent) }
.btn--primary:hover { filter: brightness(.94) }
:root[data-theme="dark"] .btn--primary:hover { filter: brightness(1.12) }
.btn--dark { background: var(--text); color: var(--bg) }
.btn--ghost { background: var(--surface); border-color: var(--line-2) }
.btn--ghost:hover { background: var(--surface-2) }
.btn--soft { background: color-mix(in srgb, var(--pine) var(--soft), transparent); color: color-mix(in srgb, var(--primary) 85%, var(--text)) }
.btn--good { background: var(--good); color: #fff }
.btn--danger { background: var(--bad); color: #fff }
:root[data-theme="dark"] .btn--good { color: #062010 }
:root[data-theme="dark"] .btn--danger { color: #2b0905 }
.btn:disabled { opacity: .45; cursor: not-allowed }
@media (pointer: coarse) { .btn--sm { height: 44px } }

.ibtn {
  width: 40px; height: 40px; border-radius: 50%; display: inline-grid; place-items: center; flex: none;
  border: 1px solid var(--line-2); transition: background-color .15s;
}
.ibtn:hover { background: var(--well) }
.ibtn--plain { border-color: transparent }
.ibtn[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: transparent }

/* ---------- campos ---------- */
.field { display: grid; gap: 6px; min-width: 0 }
.field > span { font-size: var(--fs-sm); font-weight: 700; color: var(--muted) }
.field small { font-size: var(--fs-sm); color: var(--faint) }
.input, .select, .textarea {
  height: 44px; width: 100%; padding: 0 16px; border: 1px solid var(--line-2); background: var(--surface);
  border-radius: 999px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { height: auto; min-height: 84px; padding: 12px 16px; border-radius: 18px; resize: vertical }
.select { appearance: none; padding-right: 34px; font-weight: 600;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%; background-size: 5px 5px; background-repeat: no-repeat }
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent) }
.grade-campos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px }
.grade-campos .cheio { grid-column: 1 / -1 }
@media (max-width: 760px) { .grade-campos { grid-template-columns: 1fr } }

/* interruptor */
.switch { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); flex: none; transition: background-color .3s var(--ease) }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px #0003; transition: transform .3s var(--ease) }
.switch[aria-checked="true"] { background: var(--primary) }
.switch[aria-checked="true"]::after { transform: translateX(18px) }
.linha-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0 }

/* ---------- chips, selos ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
  mask-image: linear-gradient(90deg, #000 calc(100% - 24px), #0000) }
.chips::-webkit-scrollbar { display: none }
.chip {
  height: 38px; padding: 0 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  font-size: var(--fs-sm); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; flex: none;
}
.chip:hover { border-color: var(--line-2) }
.chip[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: transparent }
.chip b { opacity: .65 }
@media (pointer: coarse) { .chip { height: 44px } }

.badge { font-size: var(--fs-xs); font-weight: 700; padding: 3px 9px; border-radius: 999px; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap }
.badge--good { background: color-mix(in srgb, var(--good) var(--soft), transparent); color: var(--good) }
.badge--warn { background: color-mix(in srgb, var(--ochre) 20%, transparent); color: var(--warn) }
.badge--bad { background: color-mix(in srgb, var(--bad) var(--soft), transparent); color: var(--bad) }
.badge--info { background: color-mix(in srgb, var(--info) var(--soft), transparent); color: var(--info) }
.badge--plain { background: var(--well); color: var(--muted) }

.spill { --c: var(--slate); background: color-mix(in srgb, var(--c) 14%, transparent); color: color-mix(in srgb, var(--c) 52%, var(--text));
  font-size: var(--fs-sm); font-weight: 700; padding: 4px 10px 4px 8px; border-radius: 999px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap }
.spill i { width: 7px; height: 7px; border-radius: 50%; background: var(--c) }
.spill--good { --c: var(--good) } .spill--warn { --c: var(--ochre) } .spill--bad { --c: var(--bad) } .spill--info { --c: var(--info) }

/* ---------- cartões ---------- */
.card { position: relative; padding: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow); min-width: 0 }
.card__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 36px; margin-bottom: 16px; flex-wrap: wrap }
.card__title { font-size: var(--fs-lg); font-weight: 600; letter-spacing: -.005em; display: flex; align-items: center; gap: 10px }
.card__sub { font-size: var(--fs-sm); color: var(--muted); margin-top: 1px }
@media (max-width: 760px) { .card { padding: 16px; border-radius: 20px } }

.kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap) }
.kpi { position: relative; overflow: hidden; display: grid; gap: 8px; min-height: 132px; padding: 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow) }
.kpi::after { content: ""; position: absolute; bottom: -48px; right: -40px; width: 170px; height: 130px; border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, transparent 30%, color-mix(in srgb, var(--pine) 5%, transparent) 31% 44%, transparent 45% 58%, color-mix(in srgb, var(--pine) 4%, transparent) 59% 70%, transparent 71%) }
.kpi__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px }
.kpi__rotulo { font-size: var(--fs-md); font-weight: 700; color: var(--muted) }
.kpi__ico { --c: var(--pine); width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none;
  background: radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--c) 55%, #fff), var(--c) 75%); box-shadow: 0 8px 16px -8px var(--c) }
.kpi__ico .ico { width: 19px; height: 19px }
.kpi__valor { font-size: var(--fs-4xl); font-weight: 600; letter-spacing: -.025em; line-height: 1.05 }
.kpi__nota { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); align-self: end }
@media (max-width: 999px) { .kpis { grid-template-columns: repeat(2, minmax(0, 1fr)) } }
@media (max-width: 760px) { .kpi { min-height: 116px; padding: 14px; border-radius: 20px } .kpi__ico { width: 34px; height: 34px } .kpi__valor { font-size: var(--fs-3xl) } }

/* ---------- tabela ---------- */
.table-wrap { margin: 0 -6px; overflow-x: auto }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--fs-md) }
.table th { text-align: left; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--muted);
  padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap }
.table td { padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: middle }
.table tr:last-child td { border-bottom: 0 }
.table tbody tr { transition: background-color .15s }
.table tbody tr:hover { background: var(--surface-2) }
.table .r { text-align: right }
.table .is-link { cursor: pointer }
.riscado { text-decoration: line-through; color: var(--faint) }

/* ---------- vazio, aviso, modal ---------- */
.empty { text-align: center; padding: 36px 16px; color: var(--muted); font-size: var(--fs-md) }
.empty strong { display: block; color: var(--text); font-weight: 700; font-size: var(--fs-lg); margin-bottom: 4px }
.empty .ico { width: 28px; height: 28px; opacity: .7; margin-bottom: 8px }

.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 90; display: grid; gap: 8px; justify-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 24px) }
.toast { background: var(--text); color: var(--bg); box-shadow: var(--shadow-pop); padding: 10px 16px; border-radius: 999px; font-size: var(--fs-md); font-weight: 600;
  animation: toast-in .45s var(--ease) both }
.toast--erro { background: var(--bad); color: #fff }
@keyframes toast-in { from { opacity: 0; transform: translateY(18px) scale(.96) } }
@media (max-width: 760px) { .toasts { bottom: calc(96px + env(safe-area-inset-bottom)) } }

.scrim { position: fixed; inset: 0; z-index: 55; background: #1e10184d; animation: fade .2s both }
:root[data-theme="dark"] .scrim { background: #0009 }
.modal { position: fixed; z-index: 60; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(580px, 100vw - 24px); max-height: calc(100dvh - 24px);
  overflow: auto; background: var(--raised); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow-pop); animation: fade .2s both }
.modal__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 20px 20px 8px }
.modal__title { font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.02em; margin: 0 }
.modal__body { padding: 8px 20px 20px; display: grid; gap: 14px }
.modal__foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--raised) }
.erro-linha { color: var(--bad); font-size: var(--fs-sm); font-weight: 600; min-height: 18px }
@keyframes fade { from { opacity: 0 } }
@keyframes tremer { 20% { transform: translateX(-8px) } 40% { transform: translateX(6px) } 60% { transform: translateX(-4px) } 80% { transform: translateX(2px) } }
.tremer { animation: tremer .45s var(--ease) }

/* ponto ao vivo */
.ao-vivo { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: var(--fs-md) }
.ao-vivo i { width: 8px; height: 8px; border-radius: 50%; background: var(--good); animation: breathe 2.4s infinite }
.ao-vivo.off i { background: var(--bad); animation: none }
@keyframes breathe { 50% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--good) 12%, transparent) } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important }
}

/* nome longo do restaurante não vaza */
.marca > div { min-width: 0 }
