:root {
  --bg: #f4f1ec; --panel: #ffffff; --ink: #1f1b16; --muted: #7a7064; --line: #e4ddd2;
  --accent: #c2410c; --accent-ink: #fff; --ok: #15803d; --warn: #b45309; --bad: #b91c1c; --info: #1d4ed8;
  --open: #fff3e8; --open-line: #f2b78f; --chip: #efe9e0;
  --r: 12px; --shadow: 0 1px 2px rgba(0,0,0,.06), 0 4px 14px rgba(0,0,0,.05);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg:#16130f; --panel:#221e19; --ink:#f3ede4; --muted:#a69a8b; --line:#3a332b;
    --open:#3a2416; --open-line:#8a4a22; --chip:#2e2821; --shadow: none; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); }
body { font-size: 15px; line-height: 1.4; -webkit-tap-highlight-color: transparent; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
a { color: inherit; }
h1 { font-size: 20px; } h2 { font-size: 17px; } h3 { font-size: 15px; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 9px 14px; }
button:active { transform: scale(.98); }
button:disabled { opacity: .5; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
button.danger { color: var(--bad); }
button.ghost { background: transparent; border-color: transparent; }
button.sm { padding: 5px 9px; font-size: 13px; border-radius: 8px; }
input, select { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 9px 11px; min-width: 0; }
input:focus, select:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.muted { color: var(--muted); } .small { font-size: 13px; } .right { text-align: right; } .num { font-variant-numeric: tabular-nums; }
.row { display: flex; gap: 8px; align-items: center; } .wrap { flex-wrap: wrap; } .grow { flex: 1; } .between { justify-content: space-between; }
.stack > * + * { margin-top: 10px; }
.hidden { display: none !important; }

header.bar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  background: var(--panel); border-bottom: 1px solid var(--line); }
header.bar .brand { font-weight: 700; }
.tabs { display: flex; gap: 4px; }
.tabs button { border-color: transparent; background: transparent; }
.tabs button.on { background: var(--chip); font-weight: 600; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 12px; text-align: center; font-weight: 700; }

.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; box-shadow: var(--shadow); }

/* Login */
.login { max-width: 340px; margin: 10vh auto; padding: 0 16px; text-align: center; }
.login .card { padding: 22px; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin: 16px 0; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--muted); }
.pin-dots span.f { background: var(--ink); border-color: var(--ink); }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.keypad button { font-size: 22px; padding: 14px 0; }
.err { color: var(--bad); min-height: 20px; font-size: 14px; margin-top: 8px; }

/* Masalar */
.tables { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.tbl { text-align: left; padding: 12px; border-radius: var(--r); min-height: 82px; display: flex; flex-direction: column; justify-content: space-between; position: relative; }
.tbl .n { font-weight: 700; font-size: 16px; }
.tbl.open { background: var(--open); border-color: var(--open-line); }
.tbl.sel { outline: 3px solid var(--accent); outline-offset: -1px; }
.tbl .badge { position: absolute; top: 8px; right: 8px; }

/* Ürünler */
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips button { white-space: nowrap; border-radius: 99px; background: var(--chip); border-color: transparent; }
.chips button.on { background: var(--ink); color: var(--bg); }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.prod { text-align: left; padding: 12px; min-height: 70px; display: flex; flex-direction: column; justify-content: space-between; }
.prod .p { color: var(--muted); font-size: 13px; }
.prod .q { position: absolute; }

/* Liste */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; gap: 8px; align-items: center; padding: 9px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.st { font-size: 12px; padding: 2px 8px; border-radius: 99px; background: var(--chip); white-space: nowrap; }
.st.yeni { background: #fde7d6; color: #9a3412; } .st.hazir { background: #dcfce7; color: #166534; }
.st.servis { background: #e0e7ff; color: #3730a3; } .st.iptal { background: #fee2e2; color: #991b1b; text-decoration: line-through; }
li.cancel .nm { text-decoration: line-through; color: var(--muted); }
.note { font-size: 12px; color: var(--warn); }

/* Toplamlar */
.totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
.totals .big { font-size: 22px; font-weight: 800; }

/* Toast */
#toasts { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); bottom: 18px; display: flex; flex-direction: column; gap: 8px; width: min(92vw, 420px); }
.toast { background: var(--ink); color: var(--bg); padding: 12px 14px; border-radius: 12px; box-shadow: 0 6px 24px rgba(0,0,0,.25); animation: tin .2s ease; }
.toast.ok { background: var(--ok); color: #fff; } .toast.bad { background: var(--bad); color: #fff; } .toast.order { background: var(--accent); color: #fff; }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }

/* Alt sayfa (sheet) */
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet { background: var(--panel); width: 100%; max-width: 560px; max-height: 88vh; overflow: auto; border-radius: 18px 18px 0 0; padding: 16px; }
@media (min-width: 700px) { .sheet-bg { align-items: center; } .sheet { border-radius: 18px; } }

.conn { width: 9px; height: 9px; border-radius: 50%; background: var(--bad); display: inline-block; }
.conn.on { background: var(--ok); }

table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.t th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }
