/* PandaPOS Garson (PWA) — Android garson uygulamasıyla aynı tema: renkler, köşeler ve ölçüler Theme.kt'den. */
:root {
  --brand: #FF4B1F; --brand-dark: #C2330F; --ink: #0E0E10; --bill: #7C3AED; --success: #067647; --danger: #D92D20;
  --danger-soft: #FEF3F2; --live: #22C55E; --warn: #B54708; --warn-soft: #FFF4E5;
  --page: #F6F6F7; --card: #FFFFFF; --field: #FFFFFF; --border: #E4E4E7; --text: #18181B; --muted: #71717A;
  --faint: #A1A1AA; --key: #F1F1F3; --brand-soft: #FFEDE7; --brand-text: #C2330F;
  --t-empty: transparent; --t-occupied: #FF4B1F; --t-bill: #D92D20;
  --safe-top: env(safe-area-inset-top, 0px); --safe-bottom: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --page: #0E0E10; --card: #18181B; --field: #1F1F23; --border: #2E2E33; --text: #FAFAFA; --muted: #A1A1AA;
    --faint: #71717A; --key: #1F1F23; --brand-soft: rgba(255, 75, 31, .2); --brand-text: #FF8A65; --danger-soft: rgba(217, 45, 32, .15);
    --warn-soft: rgba(181, 71, 8, .2); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --page: #0E0E10; --card: #18181B; --field: #1F1F23; --border: #2E2E33; --text: #FAFAFA; --muted: #A1A1AA;
  --faint: #71717A; --key: #1F1F23; --brand-soft: rgba(255, 75, 31, .2); --brand-text: #FF8A65; --danger-soft: rgba(217, 45, 32, .15);
  --warn-soft: rgba(181, 71, 8, .2); color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--page); color: var(--text); overscroll-behavior: none; }
body { font: 15px/1.35 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; user-select: none; }
#app { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
button { font: inherit; color: inherit; border: 0; background: none; cursor: pointer; padding: 0; }
input, textarea { font: inherit; color: var(--text); user-select: text; }
.hidden, [hidden] { display: none !important; }
.muted { color: var(--muted); }
.icon { width: 22px; height: 22px; flex: none; }
.pressable { transition: transform .12s; }
.pressable:active { transform: scale(.95); }

/* Düğmeler */
.btn { height: 54px; border-radius: 10px; padding: 0 18px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.btn--brand { background: var(--brand); color: #fff; }
.btn--bill { background: var(--bill); color: #fff; }
.btn--danger { background: var(--danger); color: #fff; }
.btn--outline { border: 1px solid var(--border); background: var(--card); }
.btn--ghost { background: var(--key); }
.btn:disabled { opacity: .45; }
.btn--block { width: 100%; }
.icon-btn { width: 44px; height: 44px; border-radius: 22px; display: inline-flex; align-items: center; justify-content: center; color: var(--text); }
.icon-btn:active { background: var(--key); }

/* Açılış */
.splash { flex: 1; background: var(--ink); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; }
.mark { width: 88px; height: 88px; }
.wordmark { font-size: 34px; font-weight: 800; letter-spacing: -.5px; }
.wordmark b { color: var(--brand); font-weight: 800; }
.splash__sub { color: rgba(255, 255, 255, .6); font-size: 15px; letter-spacing: 3px; }
.splash__bar { width: 140px; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .12); overflow: hidden; }
.splash__bar i { display: block; width: 40%; height: 100%; background: var(--brand); animation: slide 1.1s infinite ease-in-out; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
.splash__status { color: rgba(255, 255, 255, .7); min-height: 20px; text-align: center; }
.splash__version { position: absolute; bottom: calc(14px + var(--safe-bottom)); color: rgba(255, 255, 255, .35); font-size: 12px; }

/* Lisans ve PIN (koyu başlık + kart) */
.auth { flex: 1; display: flex; flex-direction: column; background: var(--ink); min-height: 0; }
.auth__head { color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: calc(24px + var(--safe-top)) 20px 24px; position: relative; }
.auth__head .mark { width: 56px; height: 56px; }
.auth__head .wordmark { font-size: 26px; }
.auth__clock { font-size: 44px; font-weight: 300; }
.auth__date { color: rgba(255, 255, 255, .6); }
.auth__card { flex: 1; background: var(--page); border-radius: 28px 28px 0 0; padding: 22px 20px calc(18px + var(--safe-bottom)); overflow: auto; display: flex; flex-direction: column; align-items: center; }
.auth__inner { width: 100%; max-width: 460px; display: flex; flex-direction: column; gap: 12px; }
.auth__title { font-size: 20px; font-weight: 700; text-align: center; }
.auth__foot { color: var(--muted); font-size: 12px; text-align: center; margin-top: 8px; }
.auth__corner { position: absolute; top: calc(10px + var(--safe-top)); right: 10px; color: #fff; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-size: 13px; color: var(--muted); }
.field input { height: 52px; border-radius: 10px; border: 1px solid var(--border); background: var(--field); padding: 0 14px; font-size: 16px; outline: none; }
.field input:focus { border-color: var(--brand); }
.error { color: var(--danger); background: var(--danger-soft); border-radius: 10px; padding: 10px 12px; font-weight: 600; }
.list-tile { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 14px; display: flex; align-items: center; gap: 12px; text-align: left; width: 100%; }
.list-tile strong { display: block; }

.pin-dots { display: flex; gap: 12px; justify-content: center; min-height: 20px; margin: 6px 0 10px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 7px; border: 2px solid var(--border); }
.pin-dots i.on { border-color: var(--brand); background: var(--brand); }
.pin-dots.err i { border-color: var(--danger); background: transparent; }
.pin-dots.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 380px; }
.key { aspect-ratio: 1.75; border-radius: 16px; background: var(--card); border: 1px solid var(--border); font-size: 26px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.key--go { background: var(--key); color: var(--faint); }
.key--go.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.status-line { display: flex; align-items: center; gap: 6px; justify-content: center; color: var(--muted); font-size: 12px; margin-top: 12px; }
.dot { width: 8px; height: 8px; border-radius: 4px; background: var(--faint); display: inline-block; }
.dot--live { background: var(--live); }
.dot--off { background: var(--danger); }

/* Üst çubuk */
.topbar { height: calc(60px + var(--safe-top)); padding: var(--safe-top) 6px 0 14px; display: flex; align-items: center; gap: 4px; background: var(--card); border-bottom: 1px solid var(--border); flex: none; }
.topbar__title { flex: 1; min-width: 0; }
.topbar__title strong { font-size: 21px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.topbar__title small { color: var(--muted); display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 38px; height: 38px; border-radius: 19px; background: var(--brand-soft); color: var(--brand-text); font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.search { padding: 8px 12px; background: var(--card); border-bottom: 1px solid var(--border); }
.search input { width: 100%; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--field); padding: 0 14px; outline: none; }

/* Masalar */
.tabs { display: flex; gap: 6px; padding: 10px 12px 4px; overflow-x: auto; flex: none; scrollbar-width: none; }
.tab { flex: 1 0 110px; height: 58px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); font-weight: 800; text-transform: uppercase; font-size: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.tab.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.tab small { font-size: 11px; opacity: .8; font-weight: 700; }
.chips { display: flex; gap: 8px; padding: 6px 12px 8px; overflow-x: auto; flex: none; scrollbar-width: none; }
.chip { height: 34px; border-radius: 17px; border: 1px solid var(--border); background: var(--card); padding: 0 12px; display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.chip.on { background: rgba(255, 75, 31, .13); border-color: var(--brand); color: var(--brand-text); }
.chip .dot { width: 8px; height: 8px; }
.stale { background: var(--warn-soft); color: var(--warn); font-weight: 600; padding: 8px 14px; flex: none; }
.grid-wrap { flex: 1; overflow: auto; padding: 4px 12px calc(12px + var(--safe-bottom)); }
.table-grid { display: grid; gap: 6px; grid-template-columns: repeat(var(--cols, 3), 1fr); }
.table-card { aspect-ratio: 1.25; border-radius: 16px; border: 1px solid var(--border); background: var(--card); padding: 10px 12px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; overflow: hidden; }
.table-card--wide { aspect-ratio: 1.95; }
.table-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 4px; }
.table-card__name { font-size: 19px; font-weight: 800; line-height: 1.1; word-break: break-word; }
.table-card__amount { font-size: 15px; font-weight: 800; }
.table-card__meta { font-size: 12px; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-card__area { font-size: 11px; opacity: .75; }
.empty-state { text-align: center; color: var(--muted); padding: 40px 20px; }
.skeleton { background: var(--key); border-radius: 16px; aspect-ratio: 1.25; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .5; } }

/* Sipariş ekranı */
.order { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.progress { height: 2px; background: var(--brand); animation: slide 1s infinite; transform-origin: left; flex: none; }
.strip { padding: 8px 14px; font-size: 14px; flex: none; }
.strip--note { background: var(--brand-soft); color: var(--brand-text); font-weight: 600; }
.strip--locked { background: rgba(124, 58, 237, .12); color: var(--bill); font-weight: 700; display: flex; align-items: center; justify-content: space-between; }
.menu { flex: 1; display: flex; min-height: 0; }
.cats { width: 104px; flex: none; overflow: auto; padding: 6px 4px 6px 6px; display: flex; flex-direction: column; gap: 4px; }
.cat { min-height: 60px; border-radius: 6px; background: var(--card); border: 1px solid var(--border); padding: 6px; font-size: 14px; font-weight: 700; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; text-align: center; word-break: break-word; }
.cat img { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; }
.cat.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.products { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.qtybar { display: flex; gap: 4px; padding: 6px 6px 4px; flex: none; }
.qtybar button { flex: 1; height: 34px; border-radius: 6px; background: var(--card); border: 1px solid var(--border); font-weight: 700; }
.qtybar button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.product-grid { flex: 1; overflow: auto; padding: 2px 6px 6px; display: grid; gap: 6px; grid-template-columns: repeat(var(--pcols, 3), 1fr); align-content: start; }
.product { position: relative; border-radius: 6px; border: 1px solid var(--border); background: var(--card); padding: 8px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; aspect-ratio: 1.05; overflow: hidden; }
.product.has-img { aspect-ratio: .82; padding: 0; }
.product.has-img .product__img { width: 100%; flex: 1; min-height: 0; object-fit: cover; background: var(--key); display: flex; align-items: center; justify-content: center; font-size: 30px; font-weight: 800; color: var(--faint); }
.product.has-img .product__text { padding: 6px 8px 8px; }
.product.in-ticket { border: 2px solid var(--brand); }
.product__name { font-size: 15px; font-weight: 700; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.product__price { font-size: 14px; color: var(--muted); }
.product__badge { position: absolute; top: 6px; right: 6px; min-width: 26px; height: 26px; border-radius: 13px; background: var(--brand); color: #fff; font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; padding: 0 6px; }
.product-grid.list { grid-template-columns: 1fr; }
.product-grid.list .product { aspect-ratio: auto; height: 64px; flex-direction: row; align-items: center; gap: 10px; padding: 0 12px 0 0; }
.product-grid.list .product .product__img { width: 64px; height: 64px; flex: none; }
.product-grid.list .product .product__text { flex: 1; display: flex; justify-content: space-between; gap: 8px; padding: 0; }
.menu.locked .product { opacity: .45; pointer-events: none; }
.handle { height: 38px; flex: none; background: var(--card); border-top: 1px solid var(--border); display: flex; align-items: center; padding: 0 14px; gap: 8px; touch-action: none; }
.handle strong { font-size: 14px; font-weight: 800; }
.handle .pill { background: var(--brand-soft); color: var(--brand-text); border-radius: 8px; padding: 2px 8px; font-size: 12px; font-weight: 700; }
.handle .grip { flex: 1; display: flex; justify-content: center; }
.handle .grip i { width: 36px; height: 5px; border-radius: 3px; background: var(--border); }
.handle .total { font-size: 16px; font-weight: 800; }
.lines { overflow: auto; background: var(--card); padding: 6px 10px 10px; flex: none; }
.section-title { font-size: 13px; font-weight: 700; margin: 4px 4px 8px; }
.line { background: var(--key); border-radius: 14px; padding: 8px 8px 8px 12px; display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.line__body { flex: 1; min-width: 0; }
.line__name { font-size: 16px; font-weight: 600; }
.line__sub { font-size: 13px; color: var(--muted); }
.tagline { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 2px; }
.tagline::before { content: ""; width: 5px; height: 5px; border-radius: 3px; background: rgba(255, 75, 31, .55); flex: none; }
.tagline span:first-child { flex: 1; }
.tagline b { color: var(--text); font-weight: 600; font-size: 12px; }
.step { width: 44px; height: 44px; border-radius: 22px; background: var(--card); display: flex; align-items: center; justify-content: center; }
.qty { width: 38px; text-align: center; font-size: 18px; font-weight: 800; }
.sent { background: var(--page); border-radius: 14px; padding: 12px; display: flex; align-items: flex-start; gap: 8px; margin-bottom: 6px; width: 100%; text-align: left; }
.sent__qty { width: 36px; font-weight: 700; color: var(--muted); flex: none; }
.state-chip { display: inline-block; font-size: 11px; font-weight: 600; color: var(--bill); background: rgba(124, 58, 237, .12); border-radius: 6px; padding: 2px 6px; margin: 3px 4px 0 0; }
.summary { background: var(--page); border-radius: 14px; padding: 10px 14px; margin-top: 6px; }
.summary__row { display: flex; justify-content: space-between; padding: 2px 0; font-size: 13px; color: var(--muted); }
.summary__row b { color: var(--text); font-weight: 600; }
.summary__row.strong { font-size: 15px; font-weight: 800; color: var(--text); }
.summary__row.strong b { font-size: 16px; font-weight: 800; }
.summary hr { border: 0; border-top: 1px solid var(--border); margin: 5px 0; }
.actionbar { display: flex; gap: 8px; padding: 8px 10px calc(8px + var(--safe-bottom)); background: var(--card); border-top: 1px solid var(--border); flex: none; }
.actionbar .btn { flex: 1; }
.actionbar .btn--brand, .actionbar .btn--danger { flex: 1.6; }

/* Alt sayfa, pencere, tost, meşgul */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; animation: fade .15s; }
.scrim--center { align-items: center; padding: 20px; }
@keyframes fade { from { opacity: 0; } }
.sheet { width: 100%; max-width: 640px; max-height: 88dvh; background: var(--card); border-radius: 20px 20px 0 0; padding: 10px 16px calc(16px + var(--safe-bottom)); overflow: auto; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(40px); opacity: .5; } }
.sheet__grip { width: 36px; height: 5px; border-radius: 3px; background: var(--border); margin: 0 auto 10px; }
.sheet h3 { margin: 0 0 2px; font-size: 19px; }
.sheet .sub { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.tile { width: 100%; background: var(--key); border-radius: 14px; padding: 14px; display: flex; align-items: center; gap: 12px; margin-bottom: 8px; text-align: left; font-weight: 600; }
.tile span { flex: 1; }
.tile small { color: var(--muted); font-weight: 500; }
.dialog { width: 100%; max-width: 420px; background: var(--card); border-radius: 20px; padding: 20px; animation: up .2s ease-out; }
.dialog h3 { margin: 0 0 6px; font-size: 19px; }
.dialog p { margin: 0 0 14px; color: var(--muted); }
.dialog__buttons { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; }
.dialog__buttons .btn { height: 46px; border-radius: 12px; }
.dialog textarea, .dialog input { width: 100%; border: 1px solid var(--border); background: var(--field); border-radius: 10px; padding: 10px 12px; outline: none; }
.group { margin: 12px 0 4px; display: flex; align-items: center; gap: 8px; font-weight: 700; }
.badge { font-size: 11px; font-weight: 700; border-radius: 6px; padding: 2px 6px; background: var(--key); color: var(--muted); }
.badge.req { background: var(--danger-soft); color: var(--danger); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { min-height: 40px; border-radius: 14px; border: 1px solid var(--border); background: var(--card); padding: 6px 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.opt.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.opt small { opacity: .8; font-weight: 500; }
.toast { position: fixed; top: calc(12px + var(--safe-top)); left: 50%; transform: translateX(-50%); z-index: 60; background: #18181B; color: #fff; border-radius: 14px; padding: 12px 16px; font-weight: 600; max-width: 92vw; box-shadow: 0 8px 30px rgba(0, 0, 0, .25); animation: drop .2s; }
.toast.err { background: var(--danger); }
@keyframes drop { from { transform: translate(-50%, -30px); opacity: 0; } }
.busy { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .35); display: flex; align-items: center; justify-content: center; }
.busy__card { background: #fff; border-radius: 24px; padding: 22px; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid rgba(255, 75, 31, .2); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.segmented { display: flex; background: var(--key); border-radius: 12px; padding: 3px; gap: 3px; }
.segmented button { flex: 1; height: 38px; border-radius: 9px; font-weight: 600; }
.segmented button.on { background: var(--card); box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.settings { flex: 1; overflow: auto; padding: 12px 14px calc(20px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 12px; }
.settings section { background: var(--card); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.settings h4 { margin: 0; font-size: 11px; color: var(--muted); letter-spacing: .6px; text-transform: uppercase; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 34px; height: 34px; border-radius: 17px; border: 2px solid var(--border); }
.swatch.on { outline: 3px solid var(--brand); outline-offset: 2px; }
@media (min-width: 900px) { .cats { width: 130px; } }
