:root {
  color-scheme: light;
  --canvas: #f4efe5;
  --paper: #fffdf8;
  --paper-muted: #eee5d7;
  --ink: #29291e;
  --muted: #777363;
  --line: #ded4c4;
  --rust: #ad3b1b;
  --rust-dark: #8d2d13;
  --olive: #42533a;
  --olive-soft: #e8eee4;
  --warning: #a56d1f;
  --warning-soft: #fbf0dc;
  --danger: #a33222;
  --shadow: 0 16px 44px #352c1d12;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 14px/1.5 "DM Sans", "Segoe UI", Arial, sans-serif; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid #ad3b1b70; outline-offset: 2px; }
.wordmark { color: var(--rust); text-decoration: none; font: 700 25px/1 Georgia, "Times New Roman", serif; letter-spacing: -.06em; white-space: nowrap; }
.wordmark span { color: var(--olive); }
.eyebrow { margin: 0 0 7px; color: var(--rust); font-size: 10px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.muted { color: var(--muted); }

.login-screen { min-height: 100dvh; display: grid; place-items: center; padding: 22px; background: radial-gradient(ellipse at 18% 12%, #e9ddc9 0, transparent 38%), var(--canvas); }
.login-card { width: min(100%, 420px); padding: 38px; border: 1px solid var(--line); background: var(--paper); box-shadow: var(--shadow); }
.login-card .wordmark { display: inline-block; font-size: 32px; margin-bottom: 35px; }
.login-card h1 { margin: 0; font: 600 32px/1.15 Georgia, "Times New Roman", serif; letter-spacing: -.035em; }
.login-card .muted { margin: 10px 0 25px; }
.login-card form { display: grid; gap: 10px; }
.login-card label, .field > span { font-size: 12px; font-weight: 700; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 2px; padding: 11px 12px; background: white; color: var(--ink); }
textarea { resize: vertical; }
.login-footnote { border-top: 1px solid var(--line); padding-top: 16px; margin: 23px 0 0; color: var(--muted); font-size: 11px; }
.form-error { min-height: 18px; margin: 0; color: var(--danger); font-size: 12px; }

.app-shell { min-height: 100dvh; }
.topbar { height: 72px; padding: 0 clamp(18px, 4vw, 58px); display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: var(--paper); }
.topbar-right { display: flex; align-items: center; gap: 19px; }
.online-indicator { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: 11px; }
.online-indicator i, .live-dot { width: 8px; height: 8px; display: inline-block; border-radius: 50%; background: #648253; box-shadow: 0 0 0 4px #64825320; }
.button { min-height: 42px; padding: 10px 15px; border: 1px solid transparent; border-radius: 2px; background: none; font-size: 12px; font-weight: 750; cursor: pointer; transition: transform .15s, background .15s, color .15s; }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .45; }
.button-primary { background: var(--rust); color: white; }
.button-primary:hover:not(:disabled) { background: var(--rust-dark); }
.button-quiet { border-color: var(--line); color: var(--muted); }
.button-quiet:hover { color: var(--ink); background: var(--paper-muted); }
.button-wide { width: 100%; margin-top: 4px; }
.button-small { min-height: 34px; padding: 7px 11px; white-space: nowrap; }

.layout { max-width: 1600px; min-height: calc(100dvh - 72px); margin: auto; display: grid; grid-template-columns: 250px minmax(0, 1fr); }
.sidebar { position: sticky; top: 0; height: calc(100dvh - 72px); padding: 34px 22px 24px clamp(20px, 4vw, 56px); border-right: 1px solid var(--line); display: flex; flex-direction: column; }
.sidebar h1 { margin: 0 0 36px; font: 600 23px/1.1 Georgia, "Times New Roman", serif; letter-spacing: -.035em; }
.side-nav { display: grid; gap: 5px; }
.nav-item { min-height: 47px; padding: 9px 11px; display: flex; align-items: center; gap: 12px; border: 0; background: transparent; text-align: left; font-size: 12px; font-weight: 700; color: #686757; cursor: pointer; }
.nav-item:hover { background: #ffffff80; color: var(--ink); }
.nav-item.is-active { background: var(--olive); color: white; }
.nav-icon { width: 25px; font-size: 9px; font-weight: 800; letter-spacing: .12em; opacity: .75; }
.nav-count { min-width: 23px; height: 22px; margin-left: auto; display: grid; place-items: center; border-radius: 20px; background: #ffffff2b; font-size: 10px; }
.sidebar-note { margin-top: auto; padding: 19px 0 2px; border-top: 1px solid var(--line); display: flex; align-items: center; gap: 14px; color: var(--muted); font: italic 13px/1.5 Georgia, "Times New Roman", serif; }
.note-arch { width: 32px; height: 36px; border: 5px solid var(--rust); border-bottom: 0; border-radius: 24px 24px 0 0; box-shadow: inset 0 0 0 4px var(--canvas), inset 0 0 0 8px var(--olive); }
.sidebar-note p { margin: 0; }

.workspace { min-width: 0; padding: 35px clamp(18px, 4vw, 58px) 54px; }
.welcome-row { margin-bottom: 25px; display: flex; align-items: end; justify-content: space-between; gap: 18px; }
.welcome-row h2 { margin: 0; font: 600 clamp(28px, 3vw, 38px)/1.1 Georgia, "Times New Roman", serif; letter-spacing: -.045em; }
.today-label { margin: 0 0 3px; color: var(--muted); font-size: 11px; text-transform: capitalize; }
.notice { margin: 0 0 17px; padding: 10px 13px; background: var(--warning-soft); color: #704b18; font-size: 12px; }
.panel { min-width: 0; border: 1px solid var(--line); background: var(--paper); box-shadow: 0 5px 18px #352c1d08; }
.panel-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .75fr); align-items: start; gap: 16px; }
.order-panel, .today-panel, .kitchen-panel, .stock-panel { padding: clamp(18px, 2.2vw, 29px); }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; margin-bottom: 22px; }
.panel-heading h3 { margin: 0; font: 600 21px/1.2 Georgia, "Times New Roman", serif; letter-spacing: -.025em; }
.panel-heading .muted { max-width: 640px; margin: 9px 0 0; font-size: 12px; }
.step-mark { color: #b9ad9b; font: 700 12px Georgia, serif; }
.form-grid { display: grid; grid-template-columns: 1fr .7fr; gap: 13px; }
.field { display: grid; gap: 6px; }
.field-wide { grid-column: 1 / -1; }
.field > span small { color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea { font-size: 12px; }
.field select { appearance: auto; }
.order-products-head { padding-top: 24px; margin-top: 22px; border-top: 1px solid var(--line); display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.order-products-head h4 { margin: 0; font: 600 18px/1.2 Georgia, "Times New Roman", serif; }
.product-filters { display: flex; gap: 5px; }
.chip { padding: 7px 10px; border: 1px solid var(--line); border-radius: 20px; background: none; color: var(--muted); font-size: 10px; font-weight: 750; cursor: pointer; }
.chip:hover, .chip.is-active { border-color: var(--olive); background: var(--olive); color: white; }
.product-list { max-height: 480px; margin-top: 13px; overflow-y: auto; border-top: 1px solid var(--line); }
.product-row { min-height: 76px; padding: 11px 1px; display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); }
.product-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--paper-muted); color: var(--rust); font: 700 10px Georgia, serif; }
.product-copy { min-width: 0; }
.product-category { color: var(--rust); font-size: 8px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.product-copy h5 { margin: 1px 0; font: 600 14px/1.25 Georgia, "Times New Roman", serif; }
.product-copy p { margin: 0; color: var(--muted); font-size: 10px; }
.product-price { min-width: 76px; display: grid; text-align: right; }
.product-price strong { font-size: 12px; }
.product-price small { color: var(--muted); font-size: 9px; white-space: nowrap; }
.pending-price { color: var(--warning); font-size: 9px; font-weight: 750; }
.is-unavailable .product-copy { opacity: .6; }
.add-product, .quantity-control button { width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid var(--rust); border-radius: 50%; background: none; color: var(--rust); font-size: 19px; line-height: 1; cursor: pointer; }
.add-product:hover:not(:disabled), .quantity-control button:hover { background: var(--rust); color: white; }
.add-product:disabled { opacity: .28; cursor: not-allowed; }
.quantity-control { display: flex; align-items: center; gap: 7px; }
.quantity-control button { width: 26px; height: 26px; font-size: 16px; }
.quantity-control b { min-width: 14px; text-align: center; font-size: 11px; }
.order-submit-row { padding-top: 18px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.order-submit-row > div { display: grid; gap: 1px; }
.order-submit-row .muted { font-size: 10px; }
.order-submit-row strong { font-size: 18px; }
.empty-state { min-height: 126px; padding: 19px; display: grid; place-items: center; align-content: center; color: var(--muted); text-align: center; font-size: 11px; }
.empty-state p { margin: 7px 0 0; }
.empty-mark { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--olive); font: 700 10px Georgia, serif; }

.today-panel .panel-heading { margin-bottom: 8px; }
.today-panel .live-dot { margin: 7px 4px 0 0; }
.mini-order { padding: 13px 0; border-bottom: 1px solid var(--line); }
.mini-order-top { display: flex; justify-content: space-between; gap: 9px; font-size: 10px; }
.mini-order-top span { color: var(--muted); white-space: nowrap; }
.mini-order p { margin: 5px 0 8px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.status-tag { width: fit-content; display: inline-flex; align-items: center; padding: 3px 7px; border-radius: 20px; font-size: 8px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.status-recebido { background: #efe8dc; color: #736044; }
.status-preparo { background: #fff0d9; color: #865816; }
.status-pronto { background: var(--olive-soft); color: #49643d; }
.status-entregue { background: #edf0eb; color: #4f604a; }
.text-button { margin-top: 16px; padding: 0; border: 0; background: none; color: var(--rust); font-size: 10px; font-weight: 800; cursor: pointer; }
.text-button span { margin-left: 6px; }
.text-button:hover { text-decoration: underline; }

.kitchen-panel .panel-heading, .stock-panel .panel-heading { margin-bottom: 17px; }
.kitchen-panel .live-dot { margin: 5px; }
.kitchen-orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); align-items: start; gap: 12px; }
.ticket-card { min-width: 0; padding: 17px; border: 1px solid var(--line); border-left: 3px solid #b49a72; background: #fffefa; }
.status-border-preparo { border-left-color: #c48b38; }
.status-border-pronto { border-left-color: #668257; }
.ticket-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.ticket-top h4 { margin: 7px 0 0; font: 600 19px Georgia, "Times New Roman", serif; }
.ticket-top h4 small { color: var(--muted); font: 500 11px "DM Sans", "Segoe UI", sans-serif; }
.ticket-top time { margin-top: 2px; color: var(--muted); font-size: 10px; }
.ticket-customer { margin: 7px 0 0; color: var(--muted); font-size: 11px; }
.ticket-items { display: grid; gap: 9px; margin: 17px 0 0; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); list-style: none; }
.ticket-items li { display: grid; grid-template-columns: 25px minmax(0, 1fr) auto; gap: 7px; font-size: 11px; }
.ticket-items li > b { color: var(--rust); }
.ticket-items li > strong { white-space: nowrap; font-size: 10px; }
.ticket-items li span small { display: block; color: var(--muted); font-size: 9px; }
.ticket-note { display: grid; gap: 3px; margin: 11px 0 0; color: var(--muted); font-size: 10px; }
.ticket-note b { color: var(--ink); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.ticket-bottom { margin-top: 14px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ticket-bottom > strong { font-size: 13px; white-space: nowrap; }
.ticket-actions { display: flex; align-items: center; justify-content: end; flex-wrap: wrap; gap: 9px; }
.cancel-button { padding: 4px 0; border: 0; background: none; color: var(--danger); font-size: 9px; font-weight: 700; cursor: pointer; }
.cancel-button:hover { text-decoration: underline; }

.stock-summary { padding: 7px 10px; border-radius: 20px; background: var(--olive-soft); color: var(--olive); font-size: 9px; font-weight: 800; white-space: nowrap; }
.stock-list { border-top: 1px solid var(--line); }
.stock-item { min-height: 64px; display: grid; grid-template-columns: 37px minmax(0, 1fr) 72px 90px; align-items: center; gap: 13px; border-bottom: 1px solid var(--line); }
.stock-item-copy h4 { margin: 0; font: 600 14px Georgia, "Times New Roman", serif; }
.stock-item-copy p { margin: 3px 0 0; color: var(--muted); font-size: 10px; }
.stock-level { display: grid; text-align: right; }
.stock-level strong { font-size: 15px; }
.stock-level small { color: var(--muted); font-size: 9px; }
.stock-price { text-align: right; color: var(--olive); font-size: 11px; font-weight: 750; }
.price-form { width: 125px; justify-self: end; display: grid; gap: 3px; }
.price-form label { color: var(--warning); font-size: 8px; font-weight: 800; text-align: right; text-transform: uppercase; }
.price-form div { display: flex; align-items: center; gap: 3px; }
.price-form div span { color: var(--muted); font-size: 9px; }
.price-form input { min-width: 0; width: 67px; padding: 5px 4px; font-size: 10px; }
.price-form button { padding: 6px 7px; border: 0; background: var(--olive); color: white; font-size: 9px; font-weight: 700; cursor: pointer; }
.stock-note { margin: 16px 0 0; color: var(--muted); font-size: 10px; }
.toast { position: fixed; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 10; max-width: calc(100vw - 32px); padding: 11px 16px; background: #29291e; color: white; box-shadow: var(--shadow); font-size: 11px; opacity: 0; pointer-events: none; transform: translate(-50%, 10px); transition: opacity .18s, transform .18s; }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 1080px) {
  .layout { grid-template-columns: 205px minmax(0, 1fr); }
  .sidebar { padding-left: 20px; }
  .panel-grid { grid-template-columns: minmax(0, 1fr); }
  .today-panel { order: -1; }
  .active-orders { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
  .mini-order { border: 1px solid var(--line); padding: 11px; }
}
@media (max-width: 700px) {
  .topbar { height: 62px; padding: 0 16px; }
  .topbar-right { gap: 10px; }
  .online-indicator { font-size: 0; gap: 0; }
  .online-indicator i { width: 9px; height: 9px; }
  .button-quiet { min-height: 35px; padding: 7px 10px; }
  .layout { min-height: calc(100dvh - 62px); display: block; padding-bottom: 68px; }
  .sidebar { position: fixed; z-index: 5; top: auto; right: 0; bottom: 0; left: 0; height: auto; padding: 7px 8px max(8px, env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--line); background: var(--paper); }
  .sidebar > .eyebrow, .sidebar > h1, .sidebar-note { display: none; }
  .side-nav { grid-template-columns: repeat(3, 1fr); gap: 3px; }
  .nav-item { min-height: 49px; padding: 5px 3px; flex-direction: column; justify-content: center; gap: 1px; font-size: 9px; }
  .nav-icon { display: none; }
  .nav-count { position: absolute; transform: translate(32px, -10px); min-width: 17px; height: 17px; font-size: 8px; }
  .workspace { padding: 25px 13px 30px; }
  .welcome-row { align-items: center; margin-bottom: 18px; }
  .welcome-row h2 { font-size: 29px; }
  .today-label { max-width: 120px; text-align: right; font-size: 9px; }
  .order-panel, .today-panel, .kitchen-panel, .stock-panel { padding: 16px 13px; }
  .panel-heading h3 { font-size: 19px; }
  .form-grid { grid-template-columns: 1fr .65fr; gap: 10px; }
  .field-wide { grid-column: 1 / -1; }
  .order-products-head { align-items: start; flex-direction: column; }
  .product-filters { width: 100%; }
  .chip { flex: 1; }
  .product-row { grid-template-columns: 30px minmax(0, 1fr) auto auto; gap: 8px; }
  .product-mark { width: 29px; height: 29px; font-size: 9px; }
  .product-price { min-width: 64px; }
  .product-copy h5 { font-size: 13px; }
  .order-submit-row { align-items: stretch; flex-direction: column; }
  .order-submit-row > div { display: flex; justify-content: space-between; align-items: center; }
  .order-submit-row .button { width: 100%; }
  .active-orders { grid-template-columns: 1fr; }
  .mini-order { padding: 9px; }
  .kitchen-orders { grid-template-columns: 1fr; }
  .ticket-card { padding: 14px; }
  .stock-summary { font-size: 8px; padding: 6px 8px; }
  .stock-item { grid-template-columns: 30px minmax(0, 1fr) 53px auto; gap: 8px; }
  .stock-item-copy h4 { font-size: 12px; }
  .stock-item-copy p { font-size: 9px; }
  .stock-level strong { font-size: 13px; }
  .stock-price { font-size: 9px; }
  .price-form { width: 100px; }
  .price-form input { width: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
