/* ==========================================================================
   MISTERO — Yönetici tablet paneli (yalnızca ekrana özel stiller)
   Ortak bileşenler /shared/styles.css'te. Burada yalnızca token kullanılır.
   ========================================================================== */

html, body { height: 100%; }
body.app--admin { overflow: hidden; font-variant-numeric: lining-nums; font-feature-settings: "lnum" 1; } /* BUG-06 */
/* BUG-12: toastlar sağ alt köşede (üst çubuk ve çağrı bandını örtmesin) */
.app--admin .toast-region { z-index: 100; top: auto; bottom: calc(var(--sp-6) + var(--safe-bottom, 0px)); }
.pin-device { width: min(320px, 100%); margin: 0; }
.icon { width: 24px; height: 24px; }

/* ---------- PIN ekranı ---------- */
.pin-screen {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  overflow-y: auto;
  padding: var(--sp-6);
  background:
    radial-gradient(circle at 50% 0%, var(--c-primary-soft) 0%, transparent 55%),
    var(--c-bg);
}
.pin-screen__inner { display: flex; flex-direction: column; align-items: center; gap: var(--sp-6); }
.pin-screen__brand { display: flex; flex-direction: column; align-items: center; gap: var(--sp-3); text-align: center; }
.pin-screen__title { color: var(--c-text-muted); font-weight: var(--fw-medium); }
.pin-screen__hint { font-size: var(--fs-sm); }
.pin-screen .pin__dots { min-height: 28px; }
.keypad.is-busy { opacity: .6; pointer-events: none; }
@media (max-height: 700px) {
  .pin-screen .brand-mark--lg { --size: 56px; }
  .pin-screen__inner { gap: var(--sp-4); }
  .keypad { --tap-key: 68px; gap: var(--sp-3); }
}

/* ---------- Ana yerleşim ---------- */
.admin-layout {
  display: grid;
  grid-template-columns: 96px 1fr;
  height: 100vh; height: 100dvh;
}
@media (min-width: 1200px) { .admin-layout { grid-template-columns: 220px 1fr; } }

.admin-main {
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  height: 100vh; height: 100dvh;
}
.views { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 var(--sp-6) var(--sp-8); }
.view { min-height: 100%; }

/* ---------- Yan menü ---------- */
.sidenav {
  display: flex; flex-direction: column;
  background: var(--c-espresso);
  color: var(--c-text-inverse);
  padding: var(--sp-4) var(--sp-2);
  gap: var(--sp-2);
  overflow-y: auto;
}
.sidenav__brand {
  display: flex; flex-direction: column; align-items: center; gap: var(--sp-1);
  padding: var(--sp-2) 0 var(--sp-4);
  border-bottom: 1px solid rgba(255, 251, 245, .12);
  margin-bottom: var(--sp-2);
}
.sidenav__brand-name { font-family: var(--font-serif); font-weight: var(--fw-bold); letter-spacing: .18em; font-size: var(--fs-xs); }
.sidenav__items { display: flex; flex-direction: column; gap: var(--sp-1); flex: 1; }
.sidenav__bottom { display: flex; flex-direction: column; gap: var(--sp-1); border-top: 1px solid rgba(255, 251, 245, .12); padding-top: var(--sp-2); }

.sidenav__item {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--sp-1);
  min-height: 64px;
  padding: var(--sp-2) var(--sp-1);
  border-radius: var(--r-md);
  color: var(--c-text-inverse);
  opacity: .82;
  font-size: var(--fs-xs); font-weight: var(--fw-semibold);
  text-align: center;
  transition: background-color var(--dur-fast) var(--ease), opacity var(--dur-fast);
}
.sidenav__item:hover { background: rgba(255, 251, 245, .08); opacity: 1; }
.sidenav__item:focus-visible { box-shadow: 0 0 0 3px var(--c-caramel); border-radius: var(--r-md); }
.sidenav__item.is-active {
  opacity: 1;
  background: rgba(217, 130, 43, .18);
  box-shadow: inset 4px 0 0 var(--c-caramel);
  color: #fff;
}
.sidenav__item .icon { width: 26px; height: 26px; }
.sidenav__item--small { min-height: 56px; }
/* 9 menü öğesi: kısa ekranlarda sıkıştır (1024×768, 1280×800) */
@media (max-height: 860px) {
  .sidenav { padding-block: var(--sp-2); gap: var(--sp-1); }
  .sidenav__brand { padding: var(--sp-1) 0 var(--sp-2); margin-bottom: 0; }
  .sidenav__item { min-height: 52px; padding-block: var(--sp-1); }
  .sidenav__item--small { min-height: 46px; }
  .sidenav__item .icon { width: 22px; height: 22px; }
}
@media (max-height: 860px) and (min-width: 1200px) {
  .sidenav__item { min-height: 50px; padding-block: var(--sp-2); }
}
.sidenav__item.is-muted { color: var(--c-caramel); }
.sidenav__label { line-height: 1.15; }
.sidenav__item .badge--count {
  position: absolute; top: 6px; right: 14px;
  box-shadow: 0 0 0 2px var(--c-espresso);
}
@media (min-width: 1200px) {
  .sidenav { padding: var(--sp-4) var(--sp-3); }
  .sidenav__brand { flex-direction: row; justify-content: flex-start; padding-left: var(--sp-2); }
  .sidenav__brand-name { font-size: var(--fs-md); }
  .sidenav__item { flex-direction: row; justify-content: flex-start; gap: var(--sp-3); padding: var(--sp-3) var(--sp-4); font-size: var(--fs-md); text-align: left; }
  .sidenav__item .badge--count { position: static; margin-left: auto; }
}

/* ---------- Üst çubuk ---------- */
.topbar {
  display: flex; align-items: center; gap: var(--sp-4);
  padding: var(--sp-5) var(--sp-6) var(--sp-4);
}
.topbar__title { font-size: var(--fs-2xl); }
.topbar__clock { font-size: var(--fs-xl); font-weight: var(--fw-semibold); color: var(--c-coffee); }
.conn {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  min-height: 36px; padding: 0 var(--sp-4);
  border-radius: var(--r-pill);
  background: var(--c-done-bg); color: var(--c-done-fg);
  font-weight: var(--fw-semibold); font-size: var(--fs-sm);
}
.conn__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c-done-accent); }
.conn[data-state="connecting"] { background: var(--c-info-bg); color: var(--c-info-fg); }
.conn[data-state="connecting"] .conn__dot { background: var(--c-info-accent); }
.conn[data-state="offline"] { background: var(--c-alert-bg); color: var(--c-alert-fg); }
.conn[data-state="offline"] .conn__dot { background: transparent; border: 2px solid var(--c-alert-accent); }

/* Çevrimdışı uyarısı — belirgin */
.offline-banner {
  margin: 0; border-radius: 0;
  padding: var(--sp-4) var(--sp-6);
  font-size: var(--fs-lg); font-weight: var(--fw-bold);
  border-left-width: 8px;
}
.offline-banner .icon { width: 26px; height: 26px; }
body.is-offline .views { opacity: .75; }

.sound-hint {
  width: 100%; border-radius: 0; text-align: left;
  min-height: var(--tap-lg);
  padding: var(--sp-3) var(--sp-6);
}

/* Çağrı bandı ek parçaları */
.callbar__label { font-weight: var(--fw-bold); text-transform: uppercase; letter-spacing: .1em; font-size: var(--fs-sm); }
.callbar__ok { min-height: 44px; }
.callbar__item--bill .callbar__ok { --btn-bg: var(--c-bill-accent); }

/* Ortak araç çubuğu */
.view-toolbar {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-3);
  margin-bottom: var(--sp-5);
}

/* Tehlike metinli ghost buton */
.btn--danger-text { --btn-fg: var(--c-danger); }
.btn--danger-text:hover:not([disabled]) { --btn-bg: var(--c-alert-bg); }

/* ---------- Kanban ---------- */
.kanban {
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5);
  align-items: start;
}
.kanban__col {
  background: var(--c-surface-2);
  border-radius: var(--r-xl);
  padding: var(--sp-4);
  min-height: 320px;
  border-top: 5px solid var(--c-idle-accent);
}
.kanban__col--new { border-top-color: var(--c-new-accent); }
.kanban__col--prep { border-top-color: var(--c-prep-accent); }
.kanban__head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); padding: 0 var(--sp-1); }
.kanban__title { font-family: var(--font-serif); font-size: var(--fs-xl); flex: 1; }
.kanban__list { display: flex; flex-direction: column; gap: var(--sp-4); }
.kanban__list .empty { padding: var(--sp-8) var(--sp-4); }
.order-skeleton { height: 220px; border-radius: var(--r-lg); }

/* ---------- Sipariş kartı ---------- */
.order-card {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  padding: var(--sp-4) var(--sp-5) var(--sp-5);
  border-left: 6px solid var(--c-new-accent);
  display: flex; flex-direction: column; gap: var(--sp-3);
}
.order-card--preparing { border-left-color: var(--c-prep-accent); }
.order-card__head { display: flex; align-items: flex-start; gap: var(--sp-3); }
.order-card__table {
  flex: 1;
  font-family: var(--font-serif);
  font-size: var(--fs-3xl); font-weight: var(--fw-bold);
  line-height: 1; text-transform: uppercase; letter-spacing: .02em;
  overflow-wrap: anywhere;
}
.order-card__time {
  display: inline-flex; align-items: center; gap: var(--sp-1);
  font-size: var(--fs-lg); font-weight: var(--fw-semibold);
  color: var(--c-text-muted);
  white-space: nowrap; padding-top: var(--sp-1);
}
.order-card__time .icon { width: 20px; height: 20px; }
.order-card__time.is-warn { color: var(--c-prep-fg); }
.order-card__time.is-late { color: var(--c-alert-fg); }
.order-card__meta { display: flex; gap: var(--sp-2); color: var(--c-text-muted); font-size: var(--fs-sm); }
.order-card__items { list-style: none; display: flex; flex-direction: column; gap: var(--sp-2); border-top: 1px solid var(--c-border); padding-top: var(--sp-3); }
.order-card__item { display: grid; grid-template-columns: auto 1fr; column-gap: var(--sp-2); font-size: var(--fs-lg); line-height: 1.35; }
.order-card__qty { font-weight: var(--fw-bold); min-width: 2.2ch; }
.order-card__name { font-weight: var(--fw-medium); }
.order-card__note {
  grid-column: 2;
  font-style: italic; font-weight: var(--fw-semibold);
  color: var(--c-primary);
  font-size: var(--fs-md);
}
.order-card__item .order-card__note::before { content: "\21B3  "; font-style: normal; }
.order-card__total {
  display: flex; justify-content: space-between; align-items: baseline;
  border-top: 1px solid var(--c-border); padding-top: var(--sp-3);
  color: var(--c-text-muted);
}
.order-card__total strong { color: var(--c-text); font-size: var(--fs-xl); }
.order-card__actions { display: flex; gap: var(--sp-3); }
.order-card__actions .btn { flex: 1; white-space: normal; padding-inline: var(--sp-3); }
.order-card.is-new { border-left-color: var(--c-new-accent); }

/* ---------- Çağrılar ekranı ---------- */
.call-list { display: flex; flex-direction: column; gap: var(--sp-4); max-width: 880px; }
.call-card {
  display: flex; align-items: center; gap: var(--sp-5);
  padding: var(--sp-5);
  border-left: 6px solid var(--c-alert-accent);
}
.call-card--bill { border-left-color: var(--c-bill-accent); }
.call-card__icon {
  width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--c-alert-bg); color: var(--c-alert-fg);
}
.call-card--bill .call-card__icon { background: var(--c-bill-bg); color: var(--c-bill-fg); }
.call-card__icon .icon { width: 30px; height: 30px; }
.call-card__info { flex: 1; display: flex; flex-direction: column; gap: var(--sp-2); }
.call-card__table { font-family: var(--font-serif); font-size: var(--fs-2xl); font-weight: var(--fw-bold); }
.call-card .callbar__time { font-size: var(--fs-md); }

.alert--bill { --a-bg: var(--c-bill-bg); --a-fg: var(--c-bill-fg); --a-accent: var(--c-bill-accent); }

/* ---------- Masalar ---------- */
.legend { display: flex; flex-wrap: wrap; gap: var(--sp-4); color: var(--c-text-muted); font-weight: var(--fw-medium); }
.legend__item { display: inline-flex; align-items: center; gap: var(--sp-2); }
.table-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-4); }
.table-skeleton { height: 150px; border-radius: var(--r-lg); }
.table-grid > .empty { grid-column: 1 / -1; }

.table-tile {
  --t-bg: var(--c-idle-bg); --t-fg: var(--c-idle-fg); --t-accent: var(--c-idle-accent);
  display: flex; flex-direction: column; align-items: stretch; gap: var(--sp-1);
  min-height: 150px;
  padding: var(--sp-3) var(--sp-4) var(--sp-4);
  border-radius: var(--r-lg);
  background: var(--t-bg); color: var(--t-fg);
  border: 2px solid transparent;
  border-top: 6px solid var(--t-accent);
  text-align: left;
  box-shadow: var(--sh-1);
  transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease);
}
.table-tile:hover { box-shadow: var(--sh-2); }
.table-tile:active { transform: scale(.98); }
.table-tile:focus-visible { border-radius: var(--r-lg); }
.table-tile--active { --t-bg: var(--c-surface); --t-fg: var(--c-text); --t-accent: var(--c-done-accent); }
.table-tile--open { --t-bg: var(--c-prep-bg); --t-fg: var(--c-prep-fg); --t-accent: var(--c-prep-accent); }
.table-tile--call { --t-bg: var(--c-alert-bg); --t-fg: var(--c-alert-fg); --t-accent: var(--c-alert-accent); border-color: var(--c-alert-accent); }
.table-tile--bill { --t-bg: var(--c-bill-bg); --t-fg: var(--c-bill-fg); --t-accent: var(--c-bill-accent); border-color: var(--c-bill-accent); }
.table-tile__top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); }
.table-tile__no { font-family: var(--font-serif); font-size: var(--fs-4xl); font-weight: var(--fw-bold); line-height: 1; }
.table-tile__icons { display: flex; gap: var(--sp-1); }
.table-tile__icons .icon { width: 28px; height: 28px; }
.table-tile__name { font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.table-tile__status { font-weight: var(--fw-bold); font-size: var(--fs-lg); }
.table-tile__foot { margin-top: auto; display: flex; justify-content: space-between; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.table-tile__since { opacity: .85; }

/* Sağdan açılan detay paneli (modal varyantı) */
.modal--drawer {
  left: auto; right: 0; top: 0;
  width: min(520px, 100%); max-width: none;
  height: 100vh; height: 100dvh; max-height: none;
  border-radius: var(--r-xl) 0 0 var(--r-xl);
  transform: translateX(100%);
}
.modal--drawer.is-open { transform: translateX(0); }
.modal--drawer .modal__title { font-size: var(--fs-2xl); }
.modal--drawer .modal__body { flex: 1; }
.modal--drawer .modal__footer { justify-content: stretch; flex-wrap: wrap; }
.modal--drawer .modal__footer .btn:last-child { flex: 1; }
.detail-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-4); }
.detail-summary__total { font-family: var(--font-serif); font-size: var(--fs-2xl); font-weight: var(--fw-bold); }
.detail-order { display: flex; flex-direction: column; gap: var(--sp-2); }
.detail-order__items { list-style: none; display: flex; flex-direction: column; gap: var(--sp-1); }
.detail-order__items li { display: flex; flex-wrap: wrap; gap: 0 var(--sp-1); }
.detail-order__line { margin-left: auto; color: var(--c-text-muted); }
.detail-order__total { display: flex; justify-content: space-between; border-top: 1px solid var(--c-border); padding-top: var(--sp-2); }

.modal__footer--stack { flex-wrap: wrap; }
.modal__footer--stack .btn { flex: 1 1 auto; }
.modal__footer-start { margin-right: auto; }

/* ---------- Menü yönetimi ---------- */
.menu-admin { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
@media (min-width: 1280px) { .menu-admin { grid-template-columns: 340px minmax(0, 1fr); } }
@media (max-width: 1100px) { .menu-admin { grid-template-columns: 250px minmax(0, 1fr); } }
.menu-admin__main { min-width: 0; }
.menu-admin__side { padding: var(--sp-3); position: sticky; top: 0; max-height: calc(100dvh - 120px); display: flex; flex-direction: column; }
.menu-admin__side-head { display: flex; align-items: center; justify-content: space-between; padding: var(--sp-2) var(--sp-2) var(--sp-3); }
.cat-list { overflow-y: auto; display: flex; flex-direction: column; }
.cat-list__item {
  display: flex; align-items: center; gap: 2px;
  border-bottom: 1px solid var(--c-border);
  border-radius: var(--r-sm);
}
.cat-list__item:last-child { border-bottom: 0; }
.cat-list__item.is-active { background: var(--c-primary-soft); box-shadow: inset 4px 0 0 var(--c-primary); }
.cat-list__select {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: var(--sp-2);
  min-height: var(--tap-lg); padding: var(--sp-2) var(--sp-3);
  text-align: left; font-weight: var(--fw-medium);
}
.cat-list__item.is-active .cat-list__select { color: var(--c-primary-hover); font-weight: var(--fw-bold); }
.cat-list__name { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.cat-list__move { width: 40px; min-width: 40px; padding: 0; }
.cat-list__move--up svg { transform: rotate(-90deg); }
.cat-list__move--down svg { transform: rotate(90deg); }
.cat-list .btn--plain { --btn-fg: var(--c-coffee); }
.menu-admin__title { margin-bottom: 0; border-bottom: 0; padding-bottom: 0; font-size: var(--fs-xl); }
.menu-admin__main .cat-note { margin: 0; }

.product-table td { padding-top: var(--sp-2); padding-bottom: var(--sp-2); }
.product-table__name { font-weight: var(--fw-semibold); }
.product-table__desc { max-width: 48ch; }
.product-table__price { white-space: nowrap; font-weight: var(--fw-semibold); }
.product-table .toggle__label { min-width: 6.5em; }
.toggle--hint { cursor: help; }
.toggle--hint .toggle__label { color: var(--c-prep-fg); font-style: italic; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--sp-4); }
.form-grid__full { grid-column: 1 / -1; }

/* ---------- QR ---------- */
.qr-card { position: relative; }
.qr-card__brand { display: inline-flex; align-items: center; gap: var(--sp-2); }
.qr-card__spinner { width: 180px; height: 180px; display: grid; place-items: center; }
.qr-card__table { font-size: var(--fs-xl); }
.qr-card__url { font-size: var(--fs-xs); color: var(--c-text-muted); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
#view-qr .alert { margin-bottom: var(--sp-4); }

/* ==========================================================================
   v2 ekleri
   ========================================================================== */

/* ---------- Sipariş kartı ekleri ---------- */
.order-card__badges { display: inline-flex; flex-wrap: wrap; gap: var(--sp-1); align-items: center; }
.order-card__head .order-card__badges { align-self: center; }
.order-card__deal { grid-column: 2; font-size: var(--fs-sm); color: var(--c-text-muted); }
.order-card__discount { display: flex; justify-content: space-between; color: var(--c-done-fg); font-weight: var(--fw-semibold); }
.order-card__add { --btn-fg: var(--c-coffee); border: 1px dashed var(--c-border-strong, var(--c-border)); min-height: 48px; }
.kanban__added { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--c-done-fg); background: var(--c-done-bg); border-radius: var(--r-pill); padding: 2px var(--sp-3); }
.order-card .item-options { grid-column: 2; }

/* ---------- Çağrılar (garson + iki eylem) ---------- */
.call-card__actions { display: flex; gap: var(--sp-3); flex-wrap: wrap; justify-content: flex-end; }
.call-card__actions .btn { min-height: var(--tap-lg); }
.call-card__person { font-weight: var(--fw-semibold); }
.callbar__dismiss { --btn-fg: inherit; }
.callbar__item--bill .callbar__dismiss { --btn-bg: transparent; }
.callbar__pay { --btn-bg: var(--c-bill-accent); }

/* ---------- Masa detayı ---------- */
.drawer__tools { justify-content: flex-end; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.modal--drawer .modal__footer.drawer__footer { display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--sp-3); }
.modal--drawer .modal__footer.drawer__footer .btn { min-height: var(--tap-lg); width: 100%; }

/* ---------- Hesabı Kapat ---------- */
.modal--checkout .modal__body { display: flex; flex-direction: column; gap: var(--sp-4); }
.checkout__label { font-weight: var(--fw-bold); font-size: var(--fs-md); margin-bottom: var(--sp-2); }
.modal__footer--checkout { gap: var(--sp-3); }
.modal__footer--checkout .btn:last-child { flex: 1; min-height: var(--tap-lg); }
.pay-method__label { font-weight: var(--fw-semibold); }

/* ---------- Menü yönetimi v2 ---------- */
.menu-filters { margin-bottom: var(--sp-4); }
.price-cell { display: inline-flex; flex-direction: column; align-items: flex-start; gap: 2px; white-space: nowrap; }
.product-table__photo { width: 64px; }
.product-table__status { display: flex; flex-direction: column; gap: var(--sp-1); align-items: flex-start; }
.cat-tr-badge { margin-left: var(--sp-2); }
.allergen-wrap { margin-top: var(--sp-3); }
.allergen-grid.is-disabled { opacity: .45; pointer-events: none; }
.form-error:empty { display: none; }
.assigned-groups { display: flex; flex-direction: column; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.assigned-group {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface);
}
.assigned-group__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.assign-row { gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.assign-row select { min-height: var(--tap-lg); min-width: 220px; }
.disc-body { display: flex; flex-direction: column; gap: var(--sp-3); margin-top: var(--sp-3); }
.disc-status { display: flex; align-items: center; gap: var(--sp-2); font-weight: var(--fw-semibold); margin: 0; }
.disc-status--active .status-dot { background: var(--c-done-accent); }
.disc-status--scheduled .status-dot { background: var(--c-info-accent); }
.disc-status--expired .status-dot { background: var(--c-idle-accent); }
.dirty-note { display: inline-flex; align-items: center; gap: var(--sp-2); color: var(--c-prep-fg); font-weight: var(--fw-semibold); font-size: var(--fs-sm); }
.tab__extra { margin-left: var(--sp-1); }
.has-missing { position: relative; }
.has-missing::after { content: ""; position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--c-alert-accent); }
.tr-editor .form-section { margin-bottom: var(--sp-4); }
.tr-editor .alert { margin-bottom: var(--sp-3); }

/* ---------- Seçenek grupları ---------- */
.group-item__name { display: block; font-weight: var(--fw-semibold); overflow-wrap: anywhere; }
.group-item__meta { display: block; font-weight: var(--fw-regular, 400); }
.cat-list__empty { padding: var(--sp-4); }
.og-card { padding: var(--sp-5); margin-top: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
.og-card .h3 { margin: 0; }
.og-actions { gap: var(--sp-3); }
.opt-rows { display: flex; flex-direction: column; gap: var(--sp-2); }
.opt-row {
  display: grid; align-items: center; gap: var(--sp-2);
  grid-template-columns: auto minmax(140px, 1fr) 120px auto auto auto auto;
  padding: var(--sp-2); border: 1px solid var(--c-border); border-radius: var(--r-md); background: var(--c-surface);
}
.opt-row.is-muted > input { color: var(--c-text-muted); text-decoration: line-through; }
.opt-row__move { display: inline-flex; flex-direction: column; }
.opt-row__move .cat-list__move { min-height: 28px; height: 28px; }
.opt-row__delta { min-width: 0; }
.opt-row__delta .field__control { min-width: 0; }
.opt-row__default { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-sm); white-space: nowrap; min-height: var(--tap); cursor: pointer; }
.opt-row__default input { width: 20px; height: 20px; accent-color: var(--c-primary); }
.opt-add { display: grid; grid-template-columns: minmax(160px, 1fr) 120px auto; gap: var(--sp-2); align-items: center; }
.chip--removable { padding-inline-end: var(--sp-1); gap: var(--sp-1); }
.chip__remove { width: 32px; height: 32px; min-height: 32px; display: inline-grid; place-items: center; border-radius: 50%; }
.chip__remove:hover { background: var(--c-surface-2); }
.chip__remove .icon { width: 16px; height: 16px; }
.bulk-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--sp-3); }
.bulk-count { font-weight: var(--fw-semibold); color: var(--c-text-muted); }

/* ---------- Garsonlar ---------- */
.waiter-form { display: flex; flex-direction: column; gap: var(--sp-3); }
.kvkk-note { max-width: 880px; margin-top: var(--sp-4); }

/* ---------- Ayarlar ---------- */
.settings { display: flex; flex-direction: column; gap: var(--sp-4); max-width: 820px; padding-bottom: var(--sp-6); }
.settings__card { padding: var(--sp-5) var(--sp-6); }
.settings__card .h3, .settings__card h2 { margin-top: 0; }
.sticky-actions {
  position: sticky; bottom: calc(-1 * var(--sp-8)); z-index: 2;
  display: flex; align-items: center; gap: var(--sp-3);
  max-width: 820px; margin-bottom: calc(-1 * var(--sp-8));
  padding: var(--sp-3) var(--sp-4) var(--sp-8);
  background: linear-gradient(to bottom, transparent, var(--c-bg) 22%);
}

/* ---------- QR ---------- */
.qr-intro { margin: 0; max-width: 46ch; }
.qr-layout .segment { margin: 0; }

/* ---------- Raporlar ---------- */
.report-toolbar { margin-bottom: var(--sp-2); }
.date-nav__text { font-weight: var(--fw-semibold); }
.report-meta-row { margin-bottom: var(--sp-4); }
.report-body { display: flex; flex-direction: column; gap: var(--sp-5); }
.report-open { align-items: center; }
.report-ratio .h3 { margin: 0 0 var(--sp-2); }
.range-pop { display: flex; flex-direction: column; gap: var(--sp-3); padding: var(--sp-3); min-width: 300px; }
.range-pop .btn { align-self: flex-end; }
.stat-skeleton { height: 108px; border-radius: var(--r-lg); }
.table-scroll { overflow-x: auto; }
.report-card .table tr.is-split td { border-bottom: 0; }
.report-card .table tr.is-split-2 td { padding-top: 0; }
.split-arrow { color: var(--c-text-muted); }
.report-print-head { display: none; }
.correction__head { font-weight: var(--fw-semibold); margin: 0 0 var(--sp-3); }
.correction__history { margin-top: var(--sp-4); }
.correction__list { list-style: none; display: flex; flex-direction: column; gap: var(--sp-1); font-size: var(--fs-sm); }

/* ---------- Personel siparişi seçici ---------- */
.modal--picker .modal__body.picker-body { flex: 1; min-height: 0; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.modal--picker .modal__footer { display: none; }
.picker-loading { flex: 1; display: grid; place-items: center; }
.picker__mode { font-size: var(--fs-sm); }
.field--search { margin: 0; }
.picker__existing { padding: var(--sp-2) var(--sp-3); background: var(--c-surface-2); border-radius: var(--r-md); list-style: none; }
.picker__existing-list { list-style: none; font-size: var(--fs-sm); margin-top: var(--sp-1); }
.picker__empty { list-style: none; padding: var(--sp-6) var(--sp-3); }
.picker__note { margin-top: var(--sp-2); }
.picker__note textarea, .picker__note input { width: 100%; }
.text-xs { font-size: var(--fs-xs); }

/* ---------- Dar tablet / küçük ekran ---------- */
@media (max-width: 900px) {
  .kanban { grid-template-columns: 1fr; }
  .menu-admin { grid-template-columns: 1fr; }
  .menu-admin__side { position: static; max-height: 320px; }
  .detail-summary { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 1100px) {
  .opt-row { display: flex; flex-wrap: wrap; }
  .opt-row > input { flex: 1 1 180px; min-width: 0; }
  .opt-row__delta { flex: 0 0 110px; }
  .opt-row > .toggle { margin-left: 44px; }
  .opt-row > .btn:last-child { margin-left: auto; }
  .opt-add { grid-template-columns: minmax(0, 1fr) 100px; }
  .opt-add .btn { grid-column: 1 / -1; justify-self: start; }
  .report-grid { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .stat--primary { grid-column: 1 / -1; }
}

/* ---------- Yazdırma ---------- */
@media print {
  body.app--admin { overflow: visible; }
  .admin-layout { display: block; height: auto; }
  .admin-main { height: auto; display: block; }
  .views { overflow: visible; padding: 0; }
  .topbar, .offline-banner, .sound-hint, .pin-screen { display: none !important; }
  .view[hidden] { display: none !important; }
  .qr-card__url { color: #333; }
  .report-print-head { display: block !important; font-weight: 700; margin-bottom: 12px; }
  .report-card, .stat { break-inside: avoid; }
  .report-grid { grid-template-columns: 1fr; }
  .report-open .btn { display: none !important; }
  .table-scroll { overflow: visible; }
}
.modal--picker .section-title.picker__group-title { text-transform: none; letter-spacing: normal; }

/* BUG-18: ürün tablosu yatay tablette kaydırmadan sığsın; işlem sütunu her zaman görünür */
.product-table__desc { max-width: 32ch; overflow-wrap: anywhere; }
.product-table td:first-child + td { min-width: 12rem; }
.product-table th:last-child,
.product-table td:last-child {
  position: sticky; inset-inline-end: 0; z-index: 1;
  background: var(--c-surface);
  box-shadow: -8px 0 8px -8px rgb(0 0 0 / .18);
}
[dir="rtl"] .product-table td:last-child { box-shadow: 8px 0 8px -8px rgb(0 0 0 / .18); }
@media (max-width: 1366px) {
  .product-table .toggle__label { min-width: 0; }
  .product-table__desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* PM düzeltmesi: dar kenar sütununda kategori adı ezilmesin — ad tam satır, sıralama/düzenle butonları altında */
.cat-list__item { flex-wrap: wrap; justify-content: flex-end; padding-block-end: var(--sp-1); }
.cat-list__select { flex: 1 1 100%; }
.cat-list__name { overflow-wrap: normal; word-break: normal; hyphens: auto; }
/* BUG-18 (devam): 1024–1280px'te durum sütunu sıkışık; açıklama satırı gizlenir, işlem sütunu yapışkan */
@media (max-width: 1280px) {
  .product-table__desc { display: none; }
  .product-table th, .product-table td { padding-inline: var(--sp-2); }
}
