/* ==========================================================================
   Masada QR - Ortak tasarım sistemi (panel + admin + site)
   ========================================================================== */
:root {
  --primary: #ff5a1f;
  --primary-600: #e94a12;
  --primary-50: #fff3ed;
  --primary-100: #ffe1d1;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #f1f5f9;
  --bg: #f6f7fb;
  --card: #ffffff;
  --success: #16a34a;
  --success-50: #ecfdf3;
  --warning: #d97706;
  --warning-50: #fffbeb;
  --danger: #dc2626;
  --danger-50: #fef2f2;
  --info: #2563eb;
  --info-50: #eff6ff;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 6px 24px -8px rgba(15, 23, 42, .12);
  --shadow-lg: 0 24px 48px -16px rgba(15, 23, 42, .25);
  --sidebar-w: 260px;
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.02em; }
p { margin: 0 0 1em; }
small, .text-muted { color: var(--muted); }
.text-sm { font-size: 13px; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.fw-bold { font-weight: 700; }
.mt-0 { margin-top: 0 } .mt-1 { margin-top: 8px } .mt-2 { margin-top: 16px } .mt-3 { margin-top: 24px }
.mb-0 { margin-bottom: 0 } .mb-1 { margin-bottom: 8px } .mb-2 { margin-bottom: 16px } .mb-3 { margin-bottom: 24px }
.flex { display: flex; align-items: center; gap: 10px; }
.flex-wrap { flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

/* ------------------------------ Butonlar ------------------------------ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: 12px;
  font: 600 14px/1 var(--font); cursor: pointer; white-space: nowrap;
  background: var(--primary); color: #fff;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
  touch-action: manipulation; user-select: none;
}
.btn:hover { background: var(--primary-600); }
.btn:active { transform: scale(.97); }
.btn i { font-size: 18px; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 13px; border-radius: 10px; }
.btn-lg { height: 54px; padding: 0 26px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-light { background: var(--line-2); color: var(--ink); }
.btn-light:hover { background: var(--line); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover { background: var(--line-2); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #1e293b; }
.btn-success { background: var(--success); }
.btn-success:hover { background: #15803d; }
.btn-danger { background: var(--danger-50); color: var(--danger); }
.btn-danger:hover { background: var(--danger); color: #fff; }
.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: 10px; }
.btn[disabled], .btn.loading { opacity: .6; pointer-events: none; }

/* ------------------------------ Formlar ------------------------------ */
.form-group { margin-bottom: 16px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
label, .label { display: block; font-weight: 600; font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.input, select.input, textarea.input {
  width: 100%; height: 46px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 12px;
  background: #fff; color: var(--ink);
  font: 500 16px var(--font); /* 16px: iOS'ta otomatik zoom'u engeller */
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none; appearance: none;
}
select.input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%2364748b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
textarea.input { height: auto; min-height: 100px; padding: 12px 14px; resize: vertical; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-50); }
.input-color { width: 60px; padding: 4px; height: 46px; }
.hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.input-group { display: flex; align-items: stretch; }
.input-group .addon { display: flex; align-items: center; padding: 0 12px; background: var(--line-2); border: 1.5px solid var(--line); border-right: 0; border-radius: 12px 0 0 12px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.input-group .input { border-radius: 0 12px 12px 0; }

.check { display: flex; align-items: center; gap: 10px; font-weight: 500; font-size: 14px; cursor: pointer; margin: 0; }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check { position: relative; }
.chip-check input { position: absolute; opacity: 0; }
.chip-check span { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1.5px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 600; cursor: pointer; background: #fff; }
.chip-check input:checked + span { border-color: var(--primary); background: var(--primary-50); color: var(--primary-600); }

/* Toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 12px; cursor: pointer; font-weight: 600; font-size: 14px; margin: 0; }
.switch input { position: absolute; opacity: 0; }
.switch .slider { width: 46px; height: 26px; background: #cbd5e1; border-radius: 99px; position: relative; transition: .2s; flex-shrink: 0; }
.switch .slider::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: var(--shadow-sm); }
.switch input:checked + .slider { background: var(--success); }
.switch input:checked + .slider::after { transform: translateX(20px); }

/* ------------------------------ Kart ------------------------------ */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow-sm); border: 1px solid var(--line); }
.card-body { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.card-head h3 { margin: 0; font-size: 16px; }
.card + .card { margin-top: 20px; }
.grid > .card + .card, .plans > .card + .card { margin-top: 0; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-21 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }

/* Stat kartları */
.stat { padding: 18px; display: flex; gap: 14px; align-items: center; }
.stat .ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 22px; flex-shrink: 0; background: var(--primary-50); color: var(--primary); }
.stat .ico.green { background: var(--success-50); color: var(--success); }
.stat .ico.blue { background: var(--info-50); color: var(--info); }
.stat .ico.amber { background: var(--warning-50); color: var(--warning); }
.stat .num { font-size: 24px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.stat .lbl { font-size: 13px; color: var(--muted); }

/* ------------------------------ Badge / Alert ------------------------------ */
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--line-2); color: var(--ink-2); white-space: nowrap; }
.badge-success { background: var(--success-50); color: var(--success); }
.badge-warning { background: var(--warning-50); color: var(--warning); }
.badge-danger { background: var(--danger-50); color: var(--danger); }
.badge-info { background: var(--info-50); color: var(--info); }
.badge-primary { background: var(--primary-50); color: var(--primary-600); }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 14px; font-weight: 500; animation: slideDown .3s ease; }
.alert i { font-size: 20px; line-height: 1.1; }
.alert-success { background: var(--success-50); color: #166534; }
.alert-error { background: var(--danger-50); color: #991b1b; }
.alert-info { background: var(--info-50); color: #1e40af; }
.alert-warning { background: var(--warning-50); color: #92400e; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* ------------------------------ Tablo ------------------------------ */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 700; padding: 12px 16px; background: var(--line-2); white-space: nowrap; }
.table td { padding: 14px 16px; border-top: 1px solid var(--line-2); vertical-align: middle; }
.table tr:hover td { background: #fafbfc; }
.table .thumb { width: 48px; height: 48px; border-radius: 10px; object-fit: cover; background: var(--line-2); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }

/* Mobilde tablo -> kart görünümü */
@media (max-width: 760px) {
  .table.responsive thead { display: none; }
  .table.responsive, .table.responsive tbody, .table.responsive tr, .table.responsive td { display: block; width: 100%; }
  .table.responsive tr { padding: 12px 16px; border-top: 1px solid var(--line-2); }
  .table.responsive td { border: 0; padding: 4px 0; display: flex; justify-content: space-between; gap: 12px; text-align: right; }
  .table.responsive td::before { content: attr(data-label); font-weight: 600; color: var(--muted); font-size: 12px; text-align: left; }
  .table.responsive td.td-main { display: flex; justify-content: flex-start; text-align: left; font-size: 15px; }
  .table.responsive td.td-main::before { display: none; }
  .table.responsive .actions { justify-content: flex-end; padding-top: 6px; }
  .table.responsive td.actions-cell::before { display: none; }
}

/* ------------------------------ Boş durum ------------------------------ */
.empty { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty i { font-size: 48px; color: #cbd5e1; display: block; margin-bottom: 8px; }
.empty h4 { color: var(--ink); margin-bottom: 4px; }

/* ------------------------------ Modal ------------------------------ */
.modal { position: fixed; inset: 0; z-index: 1000; display: none; align-items: center; justify-content: center; padding: 16px; }
.modal.open { display: flex; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 23, 42, .55); backdrop-filter: blur(3px); animation: fade .2s; }
.modal-box { position: relative; background: #fff; border-radius: 20px; width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow: auto; box-shadow: var(--shadow-lg); animation: pop .25s cubic-bezier(.2, .9, .3, 1.2); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line-2); position: sticky; top: 0; background: #fff; z-index: 2; }
.modal-head h3 { margin: 0; font-size: 18px; }
.modal-body { padding: 20px; }
.modal-foot { padding: 16px 20px; border-top: 1px solid var(--line-2); display: flex; gap: 10px; justify-content: flex-end; position: sticky; bottom: 0; background: #fff; }
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: scale(.94) translateY(10px); } }
@media (max-width: 600px) {
  .modal { align-items: flex-end; padding: 0; }
  .modal-box { border-radius: 22px 22px 0 0; max-height: 92vh; animation: sheet .3s cubic-bezier(.2, .9, .3, 1); padding-bottom: var(--safe-bottom); }
  @keyframes sheet { from { transform: translateY(100%); } }
}

/* Toast */
.toast-wrap { position: fixed; left: 50%; bottom: calc(90px + var(--safe-bottom)); transform: translateX(-50%); z-index: 2000; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); animation: pop .25s; display: flex; gap: 8px; align-items: center; }
@media (min-width: 992px) { .toast-wrap { bottom: 30px; } }

/* ==========================================================================
   PANEL YERLEŞİMİ (işletme + süper admin)
   ========================================================================== */
.app { display: flex; min-height: 100vh; min-height: 100dvh; }
.sidebar {
  width: var(--sidebar-w); background: #fff; border-right: 1px solid var(--line);
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 900;
  display: flex; flex-direction: column; transition: transform .25s ease;
}
.admin-app .sidebar { background: var(--ink); border-color: #1e293b; }
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 20px 20px 16px; font-weight: 800; font-size: 18px; color: var(--ink); }
.admin-app .sidebar-brand { color: #fff; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: var(--primary); display: grid; place-items: center; color: #fff; font-size: 20px; flex-shrink: 0; }
.sidebar-biz { margin: 0 14px 10px; padding: 12px; border-radius: 12px; background: var(--line-2); display: flex; gap: 10px; align-items: center; }
.sidebar-biz img, .sidebar-biz .ph { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; background: var(--primary-100); display: grid; place-items: center; color: var(--primary); font-weight: 800; }
.sidebar-biz b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-biz small { font-size: 12px; }
.nav { flex: 1; overflow-y: auto; padding: 6px 12px 20px; }
.nav-label { font-size: 11px; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .08em; padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 14px; margin-bottom: 2px; transition: background .15s; }
.nav a i { font-size: 19px; color: #94a3b8; }
.nav a:hover { background: var(--line-2); }
.nav a.active { background: var(--primary-50); color: var(--primary-600); }
.nav a.active i { color: var(--primary); }
.nav a .count { margin-left: auto; background: var(--danger); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 7px; border-radius: 99px; }
.admin-app .nav a { color: #cbd5e1; }
.admin-app .nav a:hover { background: #1e293b; }
.admin-app .nav a.active { background: var(--primary); color: #fff; }
.admin-app .nav a.active i { color: #fff; }
.sidebar-foot { padding: 12px; border-top: 1px solid var(--line-2); }
.admin-app .sidebar-foot { border-color: #1e293b; }

.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 800; height: 64px; display: flex; align-items: center; gap: 12px;
  padding: 0 24px; background: rgba(246, 247, 251, .85); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { font-size: 20px; margin: 0; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .menu-toggle { display: none; }
.content { padding: 24px; flex: 1; width: 100%; max-width: 1400px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.page-actions .search { max-width: 320px; }
.sub-banner { display: flex; gap: 12px; align-items: center; padding: 12px 16px; background: linear-gradient(90deg, #fff7ed, #ffedd5); border: 1px solid #fed7aa; border-radius: 12px; margin-bottom: 20px; font-size: 14px; font-weight: 600; color: #9a3412; flex-wrap: wrap; }
.sub-banner .btn { margin-left: auto; }

/* Alt navigasyon (mobil) */
.bottom-nav { display: none; }
.overlay { display: none; }

@media (max-width: 991px) {
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .overlay.open { display: block; position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 850; animation: fade .2s; }
  .main { margin-left: 0; padding-bottom: calc(72px + var(--safe-bottom)); }
  .topbar { padding: 0 12px; height: 58px; padding-top: env(safe-area-inset-top, 0); }
  .topbar h1 { font-size: 17px; }
  .topbar .menu-toggle { display: inline-flex; }
  .topbar .hide-m { display: none; }
  .content { padding: 16px 12px; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .grid-3, .grid-2, .grid-21 { grid-template-columns: minmax(0, 1fr); }
  .stat { padding: 14px; gap: 10px; }
  .stat .ico { width: 40px; height: 40px; font-size: 19px; border-radius: 12px; }
  .stat .num { font-size: 20px; }
  .card-body { padding: 16px; }
  .card-head { padding: 14px 16px; }
  .page-actions .search { max-width: none; flex: 1; }
  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 800;
    background: rgba(255, 255, 255, .96); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--line); padding-bottom: var(--safe-bottom);
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 9px; font-size: 11px; font-weight: 600; color: var(--muted); position: relative; }
  .bottom-nav a i { font-size: 22px; }
  .bottom-nav a.active { color: var(--primary); }
  .bottom-nav a .dot { position: absolute; top: 4px; left: 50%; margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; display: grid; place-items: center; }
}

/* ------------------------------ Auth sayfaları ------------------------------ */
.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: 1fr 1fr; background: #fff; }
.auth-side { background: radial-gradient(1200px 600px at 0% 0%, #ff8a4c 0%, var(--primary) 40%, #c2410c 100%); color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden; }
.auth-side::after { content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .08); right: -140px; bottom: -140px; }
.auth-side h2 { font-size: 34px; max-width: 420px; }
.auth-side ul { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 12px; font-weight: 600; }
.auth-side li { display: flex; gap: 10px; align-items: center; }
.auth-side li i { width: 30px; height: 30px; border-radius: 9px; background: rgba(255, 255, 255, .18); display: grid; place-items: center; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 32px 20px; }
.auth-form .box { width: 100%; max-width: 420px; }
.auth-form h1 { font-size: 28px; margin-bottom: 6px; }
.auth-form .logo { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 20px; color: var(--ink); margin-bottom: 32px; }
.pass-wrap { position: relative; }
.pass-wrap .toggle-pass { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); background: none; border: 0; padding: 8px; color: var(--muted); font-size: 18px; cursor: pointer; }
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .auth-form { align-items: flex-start; padding-top: 40px; }
}
.admin-auth { background: var(--ink); }
.admin-auth .auth-form { min-height: 100vh; }
.admin-auth .box { background: #fff; padding: 32px; border-radius: 20px; box-shadow: var(--shadow-lg); }

/* ------------------------------ Panel parçaları ------------------------------ */
.list-item { display: flex; gap: 12px; align-items: center; padding: 12px 20px; border-top: 1px solid var(--line-2); }
.list-item:first-child { border-top: 0; }
.avatar { width: 40px; height: 40px; border-radius: 12px; background: var(--primary-50); color: var(--primary); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; object-fit: cover; }
.img-preview { width: 100%; max-width: 220px; aspect-ratio: 4/3; object-fit: cover; border-radius: 12px; background: var(--line-2); border: 1px dashed var(--line); margin-bottom: 8px; }
.img-preview.wide { max-width: 100%; aspect-ratio: 3/1; }
.file-drop { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1.5px dashed var(--line); border-radius: 12px; background: #fafbfc; cursor: pointer; }
.file-drop input { display: none; }
.file-drop i { font-size: 24px; color: var(--primary); }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; margin-bottom: 16px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a, .tabs button { flex-shrink: 0; padding: 9px 14px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--ink-2); background: #fff; border: 1px solid var(--line); cursor: pointer; font-family: var(--font); }
.tabs a.active, .tabs button.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

.drag-handle { cursor: grab; color: #94a3b8; font-size: 20px; touch-action: none; }
.sortable-ghost { opacity: .4; }

/* Canlı sipariş kartları */
.live-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.order-card { background: #fff; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow-sm); overflow: hidden; animation: pop .3s; display: flex; flex-direction: column; }
.order-card.new { border-color: var(--warning); box-shadow: 0 0 0 3px var(--warning-50); }
.order-card .oc-head { padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; background: var(--line-2); }
.order-card .oc-head b { font-size: 17px; }
.order-card .oc-body { padding: 12px 16px; flex: 1; }
.order-card .oc-item { display: flex; justify-content: space-between; gap: 8px; padding: 5px 0; font-size: 14px; border-bottom: 1px dashed var(--line-2); }
.order-card .oc-item .q { font-weight: 800; color: var(--primary); min-width: 28px; }
.order-card .oc-note { margin-top: 8px; padding: 8px 10px; border-radius: 8px; background: var(--warning-50); color: #92400e; font-size: 13px; }
.order-card .oc-foot { padding: 12px 16px; border-top: 1px solid var(--line-2); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.call-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 10px; animation: pop .3s; }
.call-card .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 22px; background: var(--info-50); color: var(--info); }
.call-card.bill .ico { background: var(--success-50); color: var(--success); }
.pulse { animation: pulse 1.6s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(217, 119, 6, .45); } 70% { box-shadow: 0 0 0 12px rgba(217, 119, 6, 0); } 100% { box-shadow: 0 0 0 0 rgba(217, 119, 6, 0); } }

/* QR kartları */
.qr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 16px; }
.qr-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; text-align: center; }
.qr-card .qr { width: 160px; height: 160px; margin: 8px auto 12px; }
.qr-card .qr canvas, .qr-card .qr img { width: 100% !important; height: 100% !important; }

/* Grafik */
.bars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.bars .bar span { width: 100%; max-width: 34px; background: linear-gradient(180deg, var(--primary), #ff9a6b); border-radius: 6px 6px 3px 3px; min-height: 3px; transition: height .5s; position: relative; }
.bars .bar small { font-size: 10px; white-space: nowrap; }
.bars .bar:hover span::after { content: attr(data-v); position: absolute; top: -24px; left: 50%; transform: translateX(-50%); background: var(--ink); color: #fff; font-size: 11px; padding: 2px 6px; border-radius: 6px; }

.progress { height: 8px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.progress span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }

/* Plan kartları (abonelik) */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.plan { position: relative; background: #fff; border: 2px solid var(--line); border-radius: 20px; padding: 24px; display: flex; flex-direction: column; }
.plan.popular { border-color: var(--primary); box-shadow: 0 20px 40px -20px rgba(255, 90, 31, .45); }
.plan .ribbon { position: absolute; top: -13px; left: 24px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 99px; }
.plan h3 { font-size: 20px; margin-bottom: 4px; }
.plan .price { font-size: 38px; font-weight: 800; letter-spacing: -.03em; margin: 14px 0 2px; }
.plan .price small { font-size: 15px; font-weight: 600; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 24px; display: grid; gap: 10px; flex: 1; }
.plan li { display: flex; gap: 8px; font-size: 14px; }
.plan li i { color: var(--success); font-size: 18px; }
.period-switch { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 99px; padding: 4px; gap: 4px; }
.period-switch button { border: 0; background: transparent; padding: 9px 18px; border-radius: 99px; font: 700 14px var(--font); color: var(--muted); cursor: pointer; }
.period-switch button.active { background: var(--ink); color: #fff; }
.period-switch .save { font-size: 11px; background: var(--success); color: #fff; padding: 2px 6px; border-radius: 99px; margin-left: 4px; }

.pagination { display: flex; gap: 6px; justify-content: center; padding: 16px; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; font-size: 14px; background: #fff; padding: 0 8px; }
.pagination .active { background: var(--ink); color: #fff; border-color: var(--ink); }

@media print {
  .sidebar, .topbar, .bottom-nav, .no-print, .page-actions { display: none !important; }
  .main { margin: 0; }
  .content { padding: 0; }
  body { background: #fff; }
  .qr-card { break-inside: avoid; border: 1px solid #000; }
}
.qrbox canvas, .qrbox img { width: 100% !important; height: 100% !important; }

/* ---------- Sipariş / çağrı alarmı ---------- */
.alarm-bar { position: fixed; z-index: 1500; left: 50%; transform: translateX(-50%); top: 10px; display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-radius: 14px; background: #dc2626; color: #fff; font-weight: 800; font-size: 15px; box-shadow: 0 12px 30px -8px rgba(220, 38, 38, .6); animation: alarmPulse 1s infinite; max-width: calc(100vw - 24px); }
.alarm-bar b { margin-left: 8px; padding: 6px 10px; border-radius: 9px; background: rgba(255, 255, 255, .2); white-space: nowrap; }
.alarm-bar i { font-size: 20px; }
@keyframes alarmPulse { 50% { background: #b91c1c; transform: translateX(-50%) scale(1.03); } }
.sound-gesture { position: fixed; z-index: 1600; left: 50%; bottom: calc(90px + var(--safe-bottom)); transform: translateX(-50%); border: 0; border-radius: 99px; padding: 14px 22px; background: var(--ink); color: #fff; font: 800 15px var(--font); box-shadow: var(--shadow-lg); cursor: pointer; animation: alarmPulse2 1.2s infinite; }
@keyframes alarmPulse2 { 50% { box-shadow: 0 0 0 10px rgba(15, 23, 42, .15); } }
.alert-panel { position: sticky; top: 72px; z-index: 700; margin-bottom: 18px; border-radius: 18px; background: #fff; border: 3px solid #dc2626; box-shadow: 0 0 0 0 rgba(220, 38, 38, .5); animation: apPulse 1.2s infinite; overflow: hidden; }
@keyframes apPulse { 70% { box-shadow: 0 0 0 14px rgba(220, 38, 38, 0); } 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } }
.ap-head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #dc2626; color: #fff; font-size: 16px; }
.ap-head i { font-size: 22px; animation: apShake .6s infinite; }
@keyframes apShake { 25% { transform: rotate(-14deg); } 75% { transform: rotate(14deg); } }
.ap-item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--line-2); }
.ap-item b { display: block; font-size: 16px; }
.ap-item small { color: var(--muted); font-size: 13px; }
.ap-item .btn { height: 52px; padding: 0 22px; font-size: 16px; }
.ap-ico { width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; font-size: 24px; flex-shrink: 0; background: var(--warning-50); color: var(--warning); }
.ap-item.bill .ap-ico { background: var(--success-50); color: var(--success); }
.ap-item.call .ap-ico { background: var(--info-50); color: var(--info); }
.sound-start { position: fixed; inset: 0; z-index: 1700; display: grid; place-items: center; padding: 24px; text-align: center; background: rgba(15, 23, 42, .92); color: #fff; backdrop-filter: blur(4px); }
.sound-start > div { max-width: 420px; }
.sound-start h2 { font-size: 26px; margin: 8px 0; }
.ss-ico { width: 84px; height: 84px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 42px; background: var(--primary); animation: alarmPulse2 1.2s infinite; }
@media (max-width: 991px) { .alert-panel { top: 66px; } .ap-item { flex-wrap: wrap; } .ap-item .btn { width: 100%; } }

/* ---------------------------- Destek talepleri ---------------------------- */
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.thread { display: flex; flex-direction: column; gap: 12px; max-height: 65vh; overflow-y: auto; background: var(--bg, #f8fafc); }
.msg { max-width: 82%; padding: 10px 14px; border-radius: 14px; background: #fff; border: 1px solid var(--line); align-self: flex-start; }
.msg.mine { align-self: flex-end; background: var(--primary-50); border-color: transparent; }
.msg.internal { background: var(--warning-50); border: 1px dashed var(--warning); }
.msg-head { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; margin-bottom: 4px; }
.msg-head small { color: var(--muted); margin-left: auto; }
.msg-body { font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.msg-att img { display: block; max-width: 100%; max-height: 260px; border-radius: 10px; margin-top: 8px; border: 1px solid var(--line); }
#replyForm.is-internal { border: 1.5px dashed var(--warning); background: var(--warning-50); }
.dep-pick { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.dep-opt { position: relative; cursor: pointer; }
.dep-opt input { position: absolute; opacity: 0; }
.dep-opt span { display: grid; grid-template-columns: 34px 1fr; gap: 2px 10px; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; height: 100%; background: #fff; }
.dep-opt span i { grid-row: span 2; font-size: 22px; color: var(--primary); align-self: center; }
.dep-opt span small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.dep-opt input:checked + span { border-color: var(--primary); background: var(--primary-50); }
.dep-opt input:focus-visible + span { box-shadow: 0 0 0 4px var(--primary-50); }
.log-list { max-height: 520px; overflow-y: auto; }
.log-item { display: flex; gap: 10px; padding: 10px 20px; border-top: 1px solid var(--line-2); font-size: 13px; }
.log-item:first-child { border-top: 0; }
.log-item > i { font-size: 17px; color: var(--muted); margin-top: 1px; }
@media (max-width: 760px) { .msg { max-width: 94%; } }
