/* =========================================================
   Garsonia - ortak tasarım sistemi
   ========================================================= */
:root {
  --brand: #e85d04;
  --brand-ink: #fff;
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f8f9fb;
  --line: #e4e7ec;
  --ink: #1d2433;
  --ink-2: #4a5468;
  --muted: #7a8497;
  --ok: #12a150;
  --ok-bg: #e6f6ed;
  --warn: #d98a00;
  --warn-bg: #fff5df;
  --bad: #d92d20;
  --bad-bg: #fdeceb;
  --info: #2563eb;
  --info-bg: #e9f0fe;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 2px 8px rgba(16, 24, 40, .06);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .18);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --topbar-h: 58px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--brand); text-decoration: none; }
img { max-width: 100%; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.08rem; }
code { background: var(--surface-2); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; font-size: .88em; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.grow { flex: 1; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }

/* ---------- Butonlar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 42px; padding: 8px 16px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 600; cursor: pointer; user-select: none;
  transition: transform .06s ease, background .15s, border-color .15s, box-shadow .15s;
  text-decoration: none; white-space: nowrap;
}
.btn:hover { border-color: #cfd4dc; background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.06); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.bad { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(0,0,0,.05); }
.btn.soft { background: var(--surface-2); }
.btn.sm { min-height: 32px; padding: 4px 10px; font-size: .86rem; border-radius: 8px; }
.btn.lg { min-height: 52px; font-size: 1.05rem; padding: 10px 22px; }
.btn.xl { min-height: 64px; font-size: 1.15rem; }
.btn.block { display: flex; width: 100%; }
.btn .badge { margin-left: 2px; }

/* ---------- Form ---------- */
label { display: block; font-weight: 600; font-size: .9rem; color: var(--ink-2); }
input[type=text], input[type=password], input[type=number], input[type=email], input[type=tel], input[type=date],
input[type=time], input[type=color], input:not([type]), select, textarea {
  display: block; width: 100%; margin-top: 5px;
  min-height: 44px; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 400;
  transition: border-color .15s, box-shadow .15s;
}
input[type=color] { padding: 4px; height: 44px; }
textarea { min-height: 90px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form h3 { margin-top: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.span2 { grid-column: span 2; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.hint { font-weight: 400; color: var(--muted); font-size: .82rem; margin-top: 3px; }

/* ---------- Kart / uyarı / rozet ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-title h2, .card-title h3 { margin: 0; }
.alert { padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid; margin: 10px 0; }
.alert.ok { background: var(--ok-bg); border-color: #b5e4c7; color: #0b6b35; }
.alert.warn { background: var(--warn-bg); border-color: #f3d79b; color: #8a5800; }
.alert.bad { background: var(--bad-bg); border-color: #f5c2bd; color: #9b1c13; }
.alert.info { background: var(--info-bg); border-color: #c4d6fb; color: #1d4ed8; }
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 99px;
  background: var(--bad); color: #fff; font-size: .75rem; font-weight: 700;
}
.badge.gray { background: #98a2b3; }
.badge.ok { background: var(--ok); }
.badge.warn { background: var(--warn); }
.badge.brand { background: var(--brand); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: .76rem; font-weight: 700; background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line); }
.pill.new { background: #eef2ff; color: #4338ca; border-color: #c7d2fe; }
.pill.preparing { background: var(--warn-bg); color: #8a5800; border-color: #f3d79b; }
.pill.ready { background: var(--ok-bg); color: #0b6b35; border-color: #b5e4c7; }
.pill.delivered { background: var(--surface-2); color: var(--muted); }
.pill.cancelled { background: var(--bad-bg); color: var(--bad); border-color: #f5c2bd; }
.pill.gift { background: #fdf2fa; color: #a21caf; border-color: #f5c6ee; }
.pill.paid { background: var(--info-bg); color: var(--info); border-color: #c4d6fb; }

/* ---------- Üst bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 14px;
  height: var(--topbar-h); padding: 0 14px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; min-width: 0; }
.brand img { height: 36px; width: auto; max-width: 120px; object-fit: contain; border-radius: 6px; }
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.brand-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--brand); color: #fff; font-weight: 800; font-size: 1.1rem; flex: none;
}
.brand-mark.big { width: 64px; height: 64px; font-size: 1.8rem; border-radius: 18px; }
.topnav { display: flex; gap: 4px; margin-left: 8px; }
.topnav a { padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 600; }
.topnav a:hover { background: var(--surface-2); }
.topnav a.active { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.topbar-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.user-chip { display: flex; align-items: center; gap: 8px; padding-left: 10px; border-left: 1px solid var(--line); }
.user-chip .avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; }
.user-chip .uname { display: flex; flex-direction: column; font-weight: 700; font-size: .88rem; line-height: 1.1; }
.user-chip .uname small { font-weight: 500; color: var(--muted); }
.user-chip .logout { font-size: 1.2rem; color: var(--muted); padding: 6px; }

/* ---------- Giriş / kurulum ---------- */
.auth-page { min-height: 100vh; background: radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--brand) 22%, transparent), transparent), var(--bg); }
.login-wrap, .install-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; padding: 26px; }
.login-brand { text-align: center; }
.login-brand img { max-height: 90px; max-width: 220px; object-fit: contain; }
.login-brand h1 { margin: 10px 0 2px; font-size: 1.4rem; }
.login-brand p { margin: 0; }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.pinpad button { height: 52px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font-size: 1.3rem; font-weight: 700; cursor: pointer; color: var(--ink); }
.pinpad button:active { background: var(--line); }
.pinpad .go { background: var(--brand); color: #fff; border-color: var(--brand); font-size: 1rem; }
.login-card > .btn.primary { display: none; }
@media (hover: hover) and (pointer: fine) { .pinpad { display: none; } .login-card > .btn.primary { display: flex; } }
.install-card { width: 100%; max-width: 640px; padding: 28px; }
.install-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.install-head h1 { margin: 0; }
.install-head p { margin: 2px 0 0; }
.req-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.req-list li { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-radius: 8px; background: var(--surface-2); }
.req-list li.ok span { color: var(--ok); }
.req-list li.bad span { color: var(--bad); }
.req-list li.warn span { color: var(--warn); }
.steps { padding-left: 20px; line-height: 1.9; }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 200; background: rgba(16, 24, 40, .5);
  display: flex; align-items: center; justify-content: center; padding: 16px;
  animation: fade .15s ease;
}
.modal {
  background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-lg);
  width: 100%; max-width: 520px; max-height: calc(100vh - 32px);
  display: flex; flex-direction: column; overflow: hidden;
  animation: pop .18s ease;
}
.modal.wide { max-width: 900px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; }
.modal-body { padding: 18px; overflow: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 18px; border-top: 1px solid var(--line); background: var(--surface-2); flex-wrap: wrap; }
.modal-close { border: 0; background: transparent; font-size: 1.5rem; cursor: pointer; color: var(--muted); line-height: 1; padding: 4px 8px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
@media (max-width: 640px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 18px 18px 0 0; max-height: 92vh; }
}

/* ---------- Toast ---------- */
.toasts { position: fixed; z-index: 300; left: 50%; transform: translateX(-50%); bottom: 18px; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 24px); max-width: 420px; }
.toast { pointer-events: auto; background: #1d2433; color: #fff; padding: 12px 16px; border-radius: 12px; box-shadow: var(--shadow-lg); font-weight: 600; animation: pop .2s ease; width: 100%; }
.toast.ok { background: #0f7a3e; }
.toast.bad { background: #b42318; }
.toast.warn { background: #b26b00; }

/* ---------- Sekme / çip ---------- */
.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.chip {
  flex: none; padding: 8px 14px; border-radius: 99px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink-2); font-weight: 600; cursor: pointer; font: inherit; font-weight: 600;
}
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip.toggle.active { background: var(--brand); border-color: var(--brand); }

/* =========================================================
   GARSON EKRANI
   ========================================================= */
.waiter-app { display: flex; flex-direction: column; min-height: calc(100vh - var(--topbar-h)); }
.alert-strip { display: flex; gap: 8px; padding: 10px 14px; overflow-x: auto; background: #fff8ec; border-bottom: 1px solid #f3d79b; }
.alert-strip:empty { display: none; }
.call-chip { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 99px; background: #fff; border: 1px solid #f3d79b; font-weight: 700; animation: pulse 1.4s infinite; }
.call-chip.hesap { border-color: #c4d6fb; }
@keyframes pulse { 50% { box-shadow: 0 0 0 5px rgba(232, 93, 4, .15); } }
.waiter-toolbar { display: flex; gap: 10px; align-items: center; padding: 12px 14px 0; flex-wrap: wrap; }
.waiter-toolbar .chips { flex: 1; min-width: 0; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; padding: 8px 14px 0; font-size: .8rem; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; padding: 14px; }
.tile {
  position: relative; min-height: 112px; padding: 12px; border-radius: var(--radius);
  background: var(--surface); border: 2px solid var(--line); cursor: pointer; text-align: left;
  display: flex; flex-direction: column; gap: 4px; font: inherit; color: var(--ink);
  transition: transform .08s ease, box-shadow .15s;
}
.tile:active { transform: scale(.97); }
.tile:hover { box-shadow: var(--shadow); }
.tile .t-name { font-size: 1.1rem; font-weight: 800; }
.tile .t-meta { font-size: .8rem; color: var(--muted); }
.tile .t-total { margin-top: auto; font-weight: 800; font-size: 1.05rem; }
.tile .t-badges { position: absolute; top: 8px; right: 8px; display: flex; gap: 4px; }
.tile.busy { border-color: color-mix(in srgb, var(--brand) 55%, white); background: color-mix(in srgb, var(--brand) 7%, white); }
.tile.has-ready { border-color: var(--ok); background: var(--ok-bg); }
.tile.bill { border-color: var(--info); background: var(--info-bg); }
.tile.calling { animation: pulse 1.2s infinite; border-color: var(--warn); }
.tile.quick { border-style: dashed; }
.empty-state { text-align: center; color: var(--muted); padding: 40px 20px; }

/* Sipariş ekranı (garson + kasa ortak) */
.order-screen { display: grid; grid-template-columns: minmax(300px, 400px) 1fr; height: calc(100vh - var(--topbar-h)); }
.order-side { display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--line); min-height: 0; }
.order-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 10px; }
.order-head h2 { margin: 0; font-size: 1.2rem; }
.order-head .sub { font-size: .82rem; color: var(--muted); }
.order-items { flex: 1; overflow: auto; padding: 6px 0; }
.oi { display: flex; gap: 10px; padding: 9px 14px; border-bottom: 1px dashed var(--line); align-items: flex-start; }
.oi .q { font-weight: 800; min-width: 28px; }
.oi .n { flex: 1; min-width: 0; }
.oi .n b { font-weight: 650; }
.oi .n .note { display: block; font-size: .82rem; color: var(--warn); font-weight: 600; }
.oi .n .meta { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.oi .p { font-weight: 700; white-space: nowrap; }
.oi.cancelled .n b, .oi.cancelled .p { text-decoration: line-through; color: var(--muted); }
.oi.gift .p { text-decoration: line-through; color: var(--muted); }
.oi.cart { background: #fffaf0; }
.oi .act { display: flex; gap: 4px; }
.cart-title { padding: 8px 14px; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: var(--surface-2); border-bottom: 1px solid var(--line); }
.qty-ctl { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qty-ctl button { width: 32px; height: 32px; border: 0; background: var(--surface-2); font-size: 1.1rem; font-weight: 700; cursor: pointer; color: var(--ink); }
.qty-ctl span { min-width: 30px; text-align: center; font-weight: 800; }
.order-sum { border-top: 1px solid var(--line); padding: 10px 14px; background: var(--surface-2); }
.sum-line { display: flex; justify-content: space-between; font-size: .92rem; padding: 2px 0; }
.sum-line.total { font-size: 1.2rem; font-weight: 800; padding-top: 6px; }
.sum-line.remain { font-size: 1.05rem; font-weight: 800; color: var(--bad); }
.order-actions { padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; border-top: 1px solid var(--line); }
.order-actions .span2 { grid-column: span 2; }

.menu-pane { display: flex; flex-direction: column; min-height: 0; }
.menu-top { padding: 12px 14px 8px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.search { position: relative; }
.search input { padding-left: 38px; margin: 0; }
.search::before { content: "⌕"; position: absolute; left: 13px; top: 50%; transform: translateY(-52%); font-size: 1.2rem; color: var(--muted); }
.product-grid { flex: 1; overflow: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; padding: 4px 14px 20px; align-content: start; }
.prod {
  position: relative; display: flex; flex-direction: column; gap: 4px; padding: 0; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer; text-align: left; font: inherit; color: var(--ink); min-height: 86px;
  transition: transform .06s, box-shadow .15s;
}
.prod:active { transform: scale(.96); }
.prod:hover { box-shadow: var(--shadow); }
.prod img { width: 100%; height: 86px; object-fit: cover; display: block; background: var(--surface-2); }
.prod .pn { padding: 8px 10px 0; font-weight: 650; line-height: 1.2; }
.prod .pp { padding: 0 10px 9px; margin-top: auto; color: var(--brand); font-weight: 800; }
.prod .incart { position: absolute; top: 6px; right: 6px; }
.prod.soldout { opacity: .45; cursor: not-allowed; }
.prod.soldout::after { content: "TÜKENDİ"; position: absolute; top: 8px; left: 8px; background: var(--bad); color: #fff; font-size: .7rem; font-weight: 800; padding: 2px 6px; border-radius: 6px; }

.mobile-tabs { display: none; }
@media (max-width: 820px) {
  .order-screen { grid-template-columns: 1fr; height: auto; min-height: calc(100vh - var(--topbar-h)); }
  .order-screen .menu-pane, .order-screen .order-side { display: none; }
  .order-screen[data-tab="order"] .order-side { display: flex; min-height: calc(100vh - var(--topbar-h) - 56px); }
  .order-screen[data-tab="menu"] .menu-pane { display: flex; min-height: calc(100vh - var(--topbar-h) - 56px); }
  .order-screen[data-tab="menu"] .product-grid { grid-template-columns: repeat(2, 1fr); padding-bottom: 90px; }
  .mobile-tabs {
    display: grid; grid-template-columns: 1fr 1fr; position: sticky; bottom: 0; z-index: 40;
    background: var(--surface); border-top: 1px solid var(--line); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); gap: 6px;
  }
  .mobile-tabs button { min-height: 44px; border-radius: 10px; border: 0; background: var(--surface-2); font: inherit; font-weight: 700; color: var(--ink-2); }
  .mobile-tabs button.active { background: var(--ink); color: #fff; }
  .topnav { display: none; }
  .brand-name { max-width: 140px; }
  .user-chip .uname { display: none; }
  .table-grid { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; padding: 10px; }
  .tile { min-height: 96px; padding: 10px; }
}

/* Hazır paneli (çekmece) */
.drawer-list { display: flex; flex-direction: column; gap: 10px; }
.ready-group { border: 1px solid #b5e4c7; background: var(--ok-bg); border-radius: 12px; padding: 10px 12px; }
.ready-group h4 { margin: 0 0 6px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.ready-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 0; border-top: 1px dashed #b5e4c7; }
.ready-item:first-of-type { border-top: 0; }

.pick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 8px; }
.pick-list button { min-height: 54px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-weight: 700; cursor: pointer; color: var(--ink); }
.pick-list button.busy { background: color-mix(in srgb, var(--brand) 10%, white); border-color: color-mix(in srgb, var(--brand) 45%, white); }
.pick-list button:disabled { opacity: .35; cursor: not-allowed; }
.pick-area { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; margin: 12px 0 6px; }

/* =========================================================
   MUTFAK EKRANI (koyu tema)
   ========================================================= */
body.kds { --bg: #10141c; --surface: #1a202b; --surface-2: #222a37; --line: #2e3746; --ink: #eef1f6; --ink-2: #c4cad6; --muted: #8a94a6; background: var(--bg); }
body.kds .topbar { background: #151a23; }
body.kds .user-chip .avatar { background: #eef1f6; color: #10141c; }
body.kds .btn { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
body.kds .btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
body.kds .btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
body.kds .chip { background: var(--surface-2); color: var(--ink-2); border-color: var(--line); }
body.kds .chip.active { background: var(--ink); color: #10141c; }
body.kds select { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.kds-bar { display: flex; gap: 10px; align-items: center; padding: 10px 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); }
.kds-stats { display: flex; gap: 14px; margin-left: auto; color: var(--muted); font-weight: 600; font-size: .9rem; }
.kds-stats b { color: var(--ink); font-size: 1.1rem; }
.kds-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; padding: 14px; align-items: start; }
.ticket { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.ticket-head { padding: 10px 12px; display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; background: #263042; }
.ticket-head h3 { margin: 0; font-size: 1.15rem; }
.ticket-head .sub { font-size: .8rem; color: var(--muted); }
.ticket-head .timer { font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; padding: 2px 8px; border-radius: 8px; background: rgba(255,255,255,.08); }
.ticket.warn .ticket-head { background: #5a4100; }
.ticket.late .ticket-head { background: #6b1a14; }
.ticket.late .timer { animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .45; } }
.ticket.started .ticket-head h3::after { content: " · Hazırlanıyor"; font-size: .78rem; color: #fbbf24; font-weight: 600; }
.ticket-items { padding: 4px 0; }
.ti { display: flex; gap: 10px; padding: 9px 12px; border-bottom: 1px dashed var(--line); cursor: pointer; align-items: flex-start; }
.ti:last-child { border-bottom: 0; }
.ti .q { font-weight: 900; font-size: 1.2rem; min-width: 30px; color: #fbbf24; }
.ti .n { flex: 1; font-size: 1.05rem; font-weight: 650; }
.ti .n .note { display: block; margin-top: 2px; font-size: .88rem; font-weight: 700; color: #fb923c; }
.ti .n .st { display: block; font-size: .75rem; color: var(--muted); font-weight: 500; }
.ti.ready { opacity: .5; }
.ti.ready .n { text-decoration: line-through; }
.ti.ready .q { color: var(--ok); }
.ti.cancelled .n { text-decoration: line-through; color: #f87171; }
.ti.cancelled .n::after { content: " İPTAL"; font-size: .75rem; font-weight: 800; color: #f87171; text-decoration: none; display: inline-block; margin-left: 4px; }
.ticket-note { margin: 0 12px 8px; padding: 6px 10px; border-radius: 8px; background: rgba(251,146,60,.12); color: #fdba74; font-size: .85rem; font-weight: 600; }
.ticket-foot { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); margin-top: auto; }
.ticket-foot.single { grid-template-columns: 1fr; }
.kds-recent { padding: 0 14px 20px; }
.kds-recent h3 { color: var(--muted); font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; }
.recent-list { display: flex; gap: 8px; flex-wrap: wrap; }
.recent-chip { display: flex; gap: 8px; align-items: center; padding: 6px 6px 6px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 99px; font-size: .88rem; }

/* =========================================================
   KASA EKRANI
   ========================================================= */
.cash-app { display: grid; grid-template-columns: 300px minmax(320px, 1fr) 380px; height: calc(100vh - var(--topbar-h)); }
.cash-list { background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; }
.cash-list-head { padding: 12px; display: flex; flex-direction: column; gap: 8px; border-bottom: 1px solid var(--line); }
.cash-list-body { flex: 1; overflow: auto; }
.cl-item { display: flex; justify-content: space-between; align-items: center; gap: 8px; width: 100%; padding: 12px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; font: inherit; color: var(--ink); cursor: pointer; }
.cl-item:hover { background: var(--surface-2); }
.cl-item.active { background: color-mix(in srgb, var(--brand) 10%, white); box-shadow: inset 3px 0 0 var(--brand); }
.cl-item .t { font-weight: 750; }
.cl-item .s { font-size: .78rem; color: var(--muted); }
.cl-item .a { font-weight: 800; text-align: right; }
.cl-item.bill .t::after { content: "HESAP"; margin-left: 6px; font-size: .66rem; background: var(--info); color: #fff; padding: 1px 6px; border-radius: 6px; vertical-align: 2px; }
.cash-detail { display: flex; flex-direction: column; min-height: 0; background: var(--surface); border-right: 1px solid var(--line); }
.cash-detail .order-items .oi { cursor: default; }
.oi .sel { width: 22px; height: 22px; margin-top: 1px; accent-color: var(--brand); }
.cash-pay { display: flex; flex-direction: column; min-height: 0; overflow: auto; padding: 14px; gap: 12px; }
.pay-amount input { font-size: 1.8rem; font-weight: 800; text-align: right; min-height: 62px; }
.pay-quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-methods .btn { min-height: 54px; white-space: normal; line-height: 1.15; }
.pay-methods .btn.cash { background: var(--ok); border-color: var(--ok); color: #fff; }
.pay-methods .btn.card { background: var(--info); border-color: var(--info); color: #fff; }
.change-box { background: var(--ok-bg); border: 1px solid #b5e4c7; border-radius: 12px; padding: 10px 12px; }
.change-box .big { font-size: 1.5rem; font-weight: 800; color: #0b6b35; }
.pay-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
.cash-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); padding: 30px; text-align: center; flex: 1; }
.today-box { padding: 12px; border-top: 1px solid var(--line); background: var(--surface-2); font-size: .88rem; }
.today-box .row { justify-content: space-between; }
@media (max-width: 1180px) {
  .cash-app { grid-template-columns: 260px 1fr; grid-template-rows: auto; height: auto; }
  .cash-pay { grid-column: 2; border-top: 1px solid var(--line); background: var(--surface); }
  .cash-detail { min-height: 50vh; }
}
@media (max-width: 760px) {
  .cash-app { grid-template-columns: 1fr; }
  .cash-pay { grid-column: 1; }
  .cash-list { max-height: 40vh; }
}

/* =========================================================
   YÖNETİM PANELİ
   ========================================================= */
.admin { display: grid; grid-template-columns: 230px 1fr; min-height: calc(100vh - var(--topbar-h)); }
.sidebar { background: var(--surface); border-right: 1px solid var(--line); padding: 14px 10px; display: flex; flex-direction: column; gap: 2px; }
.sidebar a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; }
.sidebar a .ic { width: 22px; text-align: center; }
.sidebar a:hover { background: var(--surface-2); }
.sidebar a.active { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); }
.sidebar .sep { height: 1px; background: var(--line); margin: 8px 6px; }
.admin-main { padding: 22px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.kpi .l { color: var(--muted); font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.kpi .v { font-size: 1.7rem; font-weight: 800; margin-top: 4px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols > * { min-width: 0; }
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 10px 10px; border-bottom: 1px solid var(--line); background: var(--surface-2); white-space: nowrap; }
.tbl td { padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl tr:hover td { background: #fafbfc; }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tbl .thumb { width: 46px; height: 46px; border-radius: 8px; object-fit: cover; background: var(--surface-2); display: block; }
.tbl .acts { display: flex; gap: 6px; justify-content: flex-end; }
.tbl tr.off td { opacity: .5; }
.bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 160px; padding-top: 10px; }
.bar-chart .b { flex: 1; background: color-mix(in srgb, var(--brand) 75%, white); border-radius: 4px 4px 0 0; position: relative; min-height: 2px; }
.bar-chart .b:hover { background: var(--brand); }
.bar-chart .b span { position: absolute; bottom: -18px; left: 50%; transform: translateX(-50%); font-size: .68rem; color: var(--muted); }
.bar-chart .b[data-v]:hover::after { content: attr(data-v); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 2px 6px; border-radius: 6px; font-size: .72rem; white-space: nowrap; margin-bottom: 4px; }
.hbar { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.hbar i { display: block; height: 100%; background: var(--brand); border-radius: 99px; }
.filters { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.filters label { min-width: 150px; }
.logo-preview { display: flex; align-items: center; gap: 14px; padding: 10px; border: 1px dashed var(--line); border-radius: 12px; background: var(--surface-2); }
.logo-preview img { max-height: 70px; max-width: 180px; object-fit: contain; }
.cat-list { display: flex; flex-direction: column; gap: 4px; }
.cat-list a { display: flex; justify-content: space-between; padding: 9px 12px; border-radius: 9px; color: var(--ink-2); font-weight: 600; }
.cat-list a:hover { background: var(--surface-2); }
.cat-list a.active { background: var(--ink); color: #fff; }
.menu-admin { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.qr-sheet { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.qr-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; text-align: center; break-inside: avoid; }
.qr-card img.logo { max-height: 46px; max-width: 150px; object-fit: contain; }
.qr-card .qr-name { font-weight: 800; font-size: 1.05rem; margin-top: 4px; }
.qr-card canvas, .qr-card svg { width: 100%; max-width: 180px; height: auto; margin: 10px auto; display: block; }
.qr-card .qr-table { font-size: 1.5rem; font-weight: 900; }
.qr-card .qr-hint { font-size: .8rem; color: var(--muted); }
@media (max-width: 900px) {
  .admin { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 8px; position: sticky; top: var(--topbar-h); z-index: 20; }
  .sidebar a { flex: none; padding: 8px 10px; }
  .sidebar .sep { display: none; }
  .admin-main { padding: 14px; }
  .cols, .menu-admin, .grid2, .grid3 { grid-template-columns: 1fr; }
  .span2 { grid-column: auto; }
}

/* =========================================================
   YAZDIRMA (80 mm termal yazıcı)
   ========================================================= */
.receipt { width: 72mm; margin: 0 auto; font-family: "Courier New", ui-monospace, monospace; font-size: 12.5px; color: #000; background: #fff; padding: 4mm 0; }
.receipt .c { text-align: center; }
.receipt .logo { max-width: 46mm; max-height: 22mm; display: block; margin: 0 auto 4px; filter: grayscale(1); }
.receipt h1 { font-size: 16px; margin: 2px 0; }
.receipt .line { border-top: 1px dashed #000; margin: 6px 0; }
.receipt table { width: 100%; border-collapse: collapse; }
.receipt td { padding: 1px 0; vertical-align: top; }
.receipt td.r { text-align: right; white-space: nowrap; }
.receipt .big { font-size: 16px; font-weight: 800; }
.receipt .kitchen-item { font-size: 16px; font-weight: 800; }
.receipt .kitchen-note { font-size: 13px; font-weight: 700; padding-left: 14px; }
.print-tools { text-align: center; padding: 14px; font-family: var(--font); }
@media print {
  @page { size: 80mm auto; margin: 0; }
  body { background: #fff; }
  .print-tools, .no-print { display: none !important; }
}

/* Lisans uyarı şeridi */
.license-bar { padding: 8px 14px; font-size: .88rem; font-weight: 600; border-bottom: 1px solid; }
.license-bar.info { background: var(--info-bg); color: #1d4ed8; border-color: #c4d6fb; }
.license-bar.warn { background: var(--warn-bg); color: #8a5800; border-color: #f3d79b; }
.license-bar.bad { background: var(--bad-bg); color: #9b1c13; border-color: #f5c2bd; }
.license-bar a { color: inherit; text-decoration: underline; }
.license-key { font-family: ui-monospace, monospace; font-size: .8rem; word-break: break-all; }
.call-chip.qr { border-color: color-mix(in srgb, var(--brand) 50%, white); }
