/* Yönetim paneli. Renkler theme.css'ten gelir. */
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 14.5px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; line-height: 1.2; }
.ico { width: 19px; height: 19px; flex: none; }

/* Yerleşim */
.shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100vh; }
.side { position: sticky; top: 0; z-index: 20; background: var(--ink); color: #f3ede7; min-width: 0; }
.side__top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.side__brand { display: flex; align-items: center; gap: 9px; font-family: var(--font-display); font-weight: 800; font-size: 17px; min-width: 0; }
.side__brand img { width: 32px; height: 32px; border-radius: 9px; background: #fff; object-fit: contain; }
.side__brand span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side nav { display: flex; gap: 4px; overflow-x: auto; padding: 0 10px 10px; scrollbar-width: none; }
.side nav::-webkit-scrollbar { display: none; }
.side nav a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; color: #cfc6be; white-space: nowrap; }
.side nav a.is-active { background: rgba(255,255,255,.12); color: #fff; }
.side nav a .count { background: var(--brand); color: var(--brand-ink); border-radius: 99px; font-size: 11.5px; padding: 0 7px; font-weight: 700; }
.side__foot { display: none; }
.main { padding: 16px; min-width: 0; max-width: 1200px; width: 100%; }
.main-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.main-head h1 { font-size: 22px; margin-right: auto; }

.orders-switch {
  margin-left: auto; display: flex; align-items: center; gap: 8px; padding: 6px 8px 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.08); font-size: 12.5px; font-weight: 600; white-space: nowrap;
}
.orders-switch.is-off { background: var(--danger); color: #fff; }

/* Anahtar (toggle) */
.switch { position: relative; display: inline-flex; width: 44px; height: 26px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #cfc6be; transition: background .15s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { outline: 2px solid var(--brand); outline-offset: 2px; }

/* Butonlar / form */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 16px; border-radius: var(--radius-sm); border: 1px solid transparent; background: var(--brand); color: var(--brand-ink); font-weight: 700; text-decoration: none; white-space: nowrap; }
.btn:hover { background: var(--brand-strong); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--danger { background: var(--danger-soft); color: var(--danger); }
.btn--danger:hover { background: #f9d6d6; }
.btn--sm { min-height: 34px; padding: 0 10px; font-size: 13.5px; }
.icon-btn { width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; flex: none; }
.icon-btn:hover { background: var(--surface-2); }
.icon-btn.is-wa { color: #128c4b; background: #f0fbf4; border-color: #cdebd9; }
.icon-btn.is-call { color: #1d4ed8; background: #eef3ff; border-color: #d4e0fd; }
.input, .select, .textarea { width: 100%; min-height: 40px; padding: 8px 11px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); outline: none; font-size: 15px; }
.textarea { min-height: 80px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 16%, transparent); }
.input--sm { min-height: 34px; width: 90px; padding: 5px 8px; }
.field { display: grid; gap: 5px; margin-bottom: 12px; }
.field > label, .field .label { font-size: 13px; font-weight: 600; color: var(--ink-2); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hint { font-size: 12.5px; color: var(--ink-3); }
.form-error { color: var(--danger); background: var(--danger-soft); border-radius: 10px; padding: 9px 12px; margin-bottom: 12px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 12px; }
.card > h2 { font-size: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.card > h2 .ico { color: var(--brand); }
.empty { text-align: center; color: var(--ink-3); padding: 36px 12px; }

/* Filtre sekmeleri */
.filters { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 12px; scrollbar-width: none; }
.filters a { flex: none; padding: 7px 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.filters a.is-active { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.filters a b { font-weight: 700; margin-left: 4px; }

/* Sipariş kartı */
.orders { display: grid; gap: 12px; }
.order { border-left: 4px solid var(--line); margin: 0; }
.order.st-new { border-left-color: #2563eb; animation: pulse 1.6s ease-out 2; }
.order.st-preparing { border-left-color: var(--warn); }
.order.st-on_the_way { border-left-color: #7e22ce; }
.order.st-delivered { border-left-color: var(--accent); opacity: .85; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(37,99,235,.35); } 100% { box-shadow: 0 0 0 12px rgba(37,99,235,0); } }
.order__top { display: flex; align-items: flex-start; gap: 10px; flex-wrap: wrap; }
.order__no { font-family: var(--font-display); font-size: 20px; font-weight: 800; }
.order__time { font-size: 12.5px; color: var(--ink-3); }
.tag { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: var(--radius-pill); background: var(--surface-2); color: var(--ink-2); }
.tag--later { background: #f3e8ff; color: #7e22ce; }
.tag--pay { background: var(--accent-soft); color: var(--accent); }
.order__grid { display: grid; gap: 12px; margin-top: 12px; }
.cust { display: flex; align-items: center; gap: 8px; }
.cust__name { font-weight: 700; font-size: 15px; }
.cust__phone { font-size: 13.5px; color: var(--ink-2); }
.cust__actions { margin-left: auto; display: flex; gap: 6px; }
.addr { font-size: 13.5px; color: var(--ink-2); margin-top: 6px; }
.addr strong { color: var(--ink); }
.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.items li { display: flex; gap: 8px; align-items: flex-start; font-size: 14.5px; }
.items .q { font-weight: 800; min-width: 28px; }
.items .removed { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
/* Hap (chip) — müşteri sitesiyle aynı dil */
.chip { display: inline-flex; align-items: center; gap: 5px; border-radius: var(--radius-pill); border: 1px solid var(--line); background: var(--surface); font-weight: 600; white-space: nowrap; }
.chip--removed { min-height: 26px; padding: 0 10px; font-size: 13px; background: var(--danger-soft); border-color: var(--danger-line); color: var(--danger); }
.chip--removed .ico { width: 12px; height: 12px; stroke-width: 2.6; }
.items .price { margin-left: auto; white-space: nowrap; color: var(--ink-2); }
.order-note { margin-top: 10px; padding: 9px 11px; border-radius: 10px; background: var(--warn-soft); color: #7a3e08; font-weight: 600; font-size: 14px; display: flex; gap: 8px; }
.order__sum { display: flex; justify-content: space-between; margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line); font-weight: 800; }
.seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin-top: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 4px; }
.seg button { border: 0; background: none; padding: 9px 4px; border-radius: var(--radius-pill); font-weight: 700; font-size: 13px; color: var(--ink-2); }
.seg button.is-on { color: #fff; }
.seg button.is-on[data-status=new] { background: #2563eb; }
.seg button.is-on[data-status=preparing] { background: var(--warn); }
.seg button.is-on[data-status=on_the_way] { background: #7e22ce; }
.seg button.is-on[data-status=delivered] { background: var(--accent); }
.seg button:not(.is-on):hover { background: var(--surface); }

/* Liste satırları */
.list { display: grid; gap: 0; }
.list-row { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.list-row:last-child { border-bottom: 0; }
.list-row.is-off { opacity: .55; }
.list-row__main { flex: 1; min-width: 0; }
.list-row__main strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-row__main small { color: var(--ink-3); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--surface-2); flex: none; }
.price { font-weight: 700; color: var(--brand); white-space: nowrap; }
.chip-menu { display: inline-block; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: var(--radius-pill); background: var(--brand-soft); color: var(--brand); margin-left: 6px; vertical-align: 1px; }
.group-title { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 700; margin: 4px 0 4px; }

.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.check { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius-pill); cursor: pointer; background: var(--surface); font-weight: 600; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.check:has(input:checked) { border-color: color-mix(in srgb, var(--brand) 45%, var(--line)); background: var(--brand-soft); }

.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.toolbar .input { max-width: 260px; }

/* Çalışma saatleri */
.hours-row { display: grid; grid-template-columns: 110px 50px 1fr; gap: 10px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); }
.hours-row:last-child { border-bottom: 0; }
.hours-row .times { display: flex; gap: 6px; align-items: center; }
.hours-row .times input { width: 110px; }
.hours-row.is-closed .times { opacity: .4; }

/* Banner */
.banner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.banner-item { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.banner-item img { width: 100%; aspect-ratio: 21 / 8; object-fit: cover; background: var(--surface-2); }
.banner-item__bar { display: flex; align-items: center; gap: 6px; padding: 8px; }
.banner-item.is-off img { opacity: .4; }

/* Görsel seçici */
.img-pick { display: flex; gap: 12px; align-items: center; }
.img-pick img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; background: var(--surface-2); border: 1px solid var(--line); }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(20,15,12,.5); }
.modal__panel { position: relative; width: 100%; max-width: 620px; max-height: 92dvh; overflow: auto; background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 18px 16px calc(16px + env(safe-area-inset-bottom)); }
.modal__panel h2 { font-size: 19px; margin-bottom: 14px; padding-right: 40px; }
.modal__close { position: absolute; top: 12px; right: 12px; }
.modal__foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; position: sticky; bottom: -16px; background: var(--surface); padding: 10px 0 0; }

/* Giriş */
.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login .card { width: 100%; max-width: 380px; padding: 24px; }
.login img { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 14px; }
.login h1 { text-align: center; font-size: 22px; margin-bottom: 18px; }
.warn-box { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 9px 12px; font-size: 13px; margin-bottom: 12px; }

.toast { position: fixed; z-index: 80; left: 50%; bottom: 20px; transform: translate(-50%, 20px); background: var(--ink); color: var(--surface); padding: 10px 16px; border-radius: 12px; font-weight: 600; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; max-width: calc(100% - 32px); text-align: center; }
.toast.is-show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  .order__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); }
  .modal { align-items: center; }
  .modal__panel { border-radius: var(--radius-lg); }
}
@media (min-width: 1000px) {
  .shell { grid-template-columns: 236px minmax(0, 1fr); }
  .side { height: 100vh; display: flex; flex-direction: column; }
  .side__top { flex-direction: column; align-items: stretch; padding: 18px 14px; gap: 14px; }
  .orders-switch { margin-left: 0; justify-content: space-between; border-radius: 12px; padding: 10px 12px; }
  .side nav { flex-direction: column; overflow: visible; padding: 0 10px; }
  .side nav a .count { margin-left: auto; }
  .side__foot { display: grid; gap: 6px; margin-top: auto; padding: 14px; }
  .side__foot a, .side__foot button { display: flex; align-items: center; gap: 8px; color: #cfc6be; background: none; border: 0; padding: 8px 12px; border-radius: 10px; text-decoration: none; font-weight: 600; text-align: left; }
  .side__foot a:hover, .side__foot button:hover { background: rgba(255,255,255,.08); }
  .main { padding: 24px 28px; }
  .mobile-only { display: none !important; }
  .orders { grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); }
}
