:root {
  /* POS paleti — açık mavi (sky) + amber + canlı aksiyon renkleri */
  --primary: #0ea5e9;        /* sky-500 */
  --primary-dark: #0284c7;   /* sky-600 */
  --primary-light: #38bdf8;  /* sky-400 */
  --primary-bg: #e0f2fe;     /* sky-100 */
  --primary-text: #ffffff;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  --accent-bg: #fef3c7;
  --bg: #f1f5f9;
  --bg-2: #e2e8f0;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --success: #16a34a;
  --success-bg: #dcfce7;
  --success-dark: #15803d;
  --danger: #dc2626;
  --danger-bg: #fee2e2;
  --info: #6366f1;          /* indigo for kart secimi */
  --info-bg: #e0e7ff;
  --bahce: #16a34a;          /* yesil */
  --bahce-bg: #dcfce7;
  --salon: #d97706;          /* turuncu */
  --salon-bg: #fef3c7;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 10px 25px rgba(15, 23, 42, 0.12);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-size: 15px;
  line-height: 1.45;
}

/* Sticky üst bar her zaman Dynamic Island/notch'un altına oturur */
.topbar { padding-top: calc(10px + env(safe-area-inset-top, 0px)); }

/* ===== Topbar (sade, açık) ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 18px;
  background: #fff;
  color: var(--text);
  position: sticky; top: 0; z-index: 20;
  border-bottom: 1px solid var(--line);
  gap: 12px;
}
.topbar-right { display: flex; align-items: center; gap: 14px; }
.brand {
  display: flex; align-items: center; gap: 10px;
  background: transparent; border: 0; padding: 4px 8px;
  border-radius: 8px; cursor: pointer; min-height: 44px;
  text-align: left;
}
.brand:hover { background: var(--panel-2); }
.logo {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent);
  color: #1e293b; display: grid; place-items: center;
  font-weight: 800; font-size: 18px;
}
.brand-name { font-weight: 700; font-size: 16px; color: var(--text); letter-spacing: 0.3px; }
.brand-sub { font-size: 11px; color: var(--muted); }
.status { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.dot { width: 8px; height: 8px; border-radius: 999px; background: var(--danger); }
.dot.online { background: #22c55e; }
.dot.offline { background: var(--danger); }

/* ===== Bildirim menüsü (stok uyarıları) ===== */
.notif-menu { position: relative; }
.notif-trigger {
  position: relative;
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  padding: 6px 10px; border-radius: 999px;
  font-size: 14px; min-height: 36px;
  display: flex; align-items: center; justify-content: center;
  width: 36px;
}
.notif-trigger:hover { background: var(--bg-2); }
.notif-trigger .notif-icon { width: 18px; height: 18px; color: var(--text); display: block; }
.notif-trigger.has-alerts .notif-icon { color: var(--danger); }

/* Buton içindeki küçük SVG ikonlar */
.btn-icon { width: 14px; height: 14px; vertical-align: -2px; margin-right: 2px; }
.notif-trigger .notif-badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: #fff;
  border-radius: 999px; min-width: 18px; height: 18px;
  padding: 0 5px; font-size: 11px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  font-variant-numeric: tabular-nums; border: 2px solid #fff;
}
.notif-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); min-width: 300px;
  z-index: 30; display: none;
  max-height: 70vh; overflow-y: auto;
}
.notif-menu.open .notif-dropdown { display: block; }
.notif-head {
  padding: 12px 14px;
  font-size: 12px; font-weight: 800; color: var(--primary);
  text-transform: uppercase; letter-spacing: 1.5px;
  border-bottom: 1px solid var(--line);
}
.notif-item {
  display: grid; grid-template-columns: 1fr auto; gap: 10px;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  cursor: pointer; align-items: center;
}
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--panel-2); }
.notif-item .ni-name { font-size: 14px; font-weight: 700; }
.notif-item .ni-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.notif-item .ni-stock {
  font-size: 13px; font-weight: 800; padding: 4px 10px;
  border-radius: 999px; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.notif-item .ni-stock.out { background: var(--danger-bg); color: var(--danger); }
.notif-item .ni-stock.low { background: var(--accent-bg); color: var(--accent-dark); }
.notif-empty {
  padding: 24px 16px; text-align: center; color: var(--muted);
  font-size: 13px; font-style: italic;
}

/* ===== Kullanici menusu (sag ust) ===== */
.user-menu { position: relative; }
.user-trigger {
  background: var(--bg); color: var(--text); border: 1px solid var(--line);
  padding: 6px 12px; border-radius: 999px; font-weight: 600;
  font-size: 13px; min-height: 36px; display: flex; align-items: center; gap: 8px;
}
.user-trigger:hover { background: var(--bg-2); }
.user-trigger .uavatar {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 12px;
}
.user-trigger .uname { font-size: 14px; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-trigger .ucaret { opacity: 0.7; font-size: 11px; }
.user-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0;
  background: #fff; color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-lg); min-width: 240px;
  padding: 6px; z-index: 30;
  display: none;
}
.user-menu.open .user-dropdown { display: block; }
.user-dropdown .um-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 8px; cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--text); text-decoration: none;
}
.user-dropdown .um-item:hover { background: var(--primary-bg); }
.user-dropdown .um-item .icon { display: none; }
.form-label { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; }
.user-dropdown .um-sep { height: 1px; background: var(--line); margin: 6px 4px; }
.user-dropdown .um-info {
  padding: 10px 12px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px;
}
.user-dropdown .um-info .uname { color: var(--text); font-weight: 700; font-size: 14px; }
.um-item.active { background: var(--primary-bg); color: var(--primary); }
.um-item.danger { color: var(--danger); }
.um-item.danger:hover { background: var(--danger-bg); }

/* ===== Rol bazlı görünürlük ===== */
body.role-staff .admin-only { display: none !important; }
body.role-staff .admin-only-inline { display: none !important; }

.view { display: none; padding: 16px; }
.view.active { display: block; }

/* ===== Login / Setup overlay (tam ekran) ===== */
.auth-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 50%, var(--primary-dark) 100%);
  display: grid; place-items: center; padding: 18px;
}
.auth-overlay.hidden { display: none; }
.auth-card {
  background: #fff; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%; max-width: 380px;
  padding: 28px 22px;
}
.auth-card .auth-brand {
  display: flex; align-items: center; gap: 12px; margin-bottom: 18px;
}
.auth-card .auth-brand .logo {
  width: 48px; height: 48px;
}
.auth-card h1 { font-size: 22px; margin: 0 0 4px; color: var(--text); }
.auth-card .auth-sub { font-size: 13px; color: var(--muted); margin-bottom: 18px; }
.auth-card label { font-size: 12px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px; display: block; }
.auth-card input { width: 100%; margin-bottom: 14px; }
.auth-card .auth-actions { display: flex; gap: 8px; margin-top: 4px; }
.auth-card .auth-actions button { flex: 1; }
.auth-card .auth-err { color: var(--danger); font-size: 13px; padding: 8px; background: var(--danger-bg); border-radius: 8px; margin-top: 8px; }
.auth-card .auth-err.hidden { display: none; }
.auth-card .auth-foot { font-size: 12px; color: var(--muted); margin-top: 12px; text-align: center; }

/* ===== Toolbar / forms ===== */
.toolbar { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.meta {
  color: var(--muted); font-size: 13px;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 10px 14px; background: var(--panel); border-radius: var(--radius);
  border: 1px solid var(--line);
}
.meta b { color: var(--text); }

input[type="text"], input[type="number"], input[type="password"], input[type="date"] {
  flex: 1; min-width: 0;
  background: #fff; color: var(--text);
  border: 1.5px solid var(--line-2); border-radius: 8px;
  padding: 11px 13px; font-size: 15px; outline: none;
  transition: border-color .12s ease, box-shadow .12s ease;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-bg); }
input::placeholder { color: var(--muted); opacity: 0.6; }

button {
  background: #fff; color: var(--text); border: 1.5px solid var(--line-2);
  border-radius: 8px; padding: 10px 14px; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: background .1s ease, transform .05s ease;
  min-height: 42px;
}
button:hover { background: var(--panel-2); }
button:active { transform: translateY(1px); }
button.primary { background: var(--primary); color: #fff; border: 0; box-shadow: 0 1px 3px rgba(14,165,233,0.3); }
button.primary:hover { background: var(--primary-dark); }
button.accent { background: var(--accent); color: #1e293b; border: 0; box-shadow: 0 1px 3px rgba(245,158,11,0.3); }
button.accent:hover { background: var(--accent-dark); color: #fff; }
button.ghost { background: transparent; border-color: var(--line-2); }
button.danger { background: var(--danger); color: #fff; border: 0; box-shadow: 0 1px 3px rgba(220,38,38,0.3); }
button.danger:hover { background: #b91c1c; }
button.danger-soft { background: var(--danger-bg); color: var(--danger); border-color: transparent; }
button.danger-soft:hover { background: #fecaca; }
button.success { background: var(--success); color: #fff; border: 0; box-shadow: 0 1px 3px rgba(22,163,74,0.3); }
button.success:hover { background: var(--success-dark); }
button.info { background: var(--info); color: #fff; border: 0; }
button[disabled] { opacity: 0.4; cursor: not-allowed; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }

/* Eski split-pane kaldirildi — ana sayfa tek panel */

/* Section filter chips */
.section-filter {
  display: flex; gap: 4px; padding: 4px; background: var(--bg-2); border-radius: 999px;
  width: fit-content; margin-bottom: 12px;
}
.section-filter button {
  background: transparent; border: 0; padding: 8px 16px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  border-radius: 999px; min-height: 36px;
}
.section-filter button.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.section-filter button:hover:not(.active) { color: var(--text); }

/* Müşteri ekleme — section seçici */
.section-picker {
  display: flex; gap: 4px; padding: 4px;
  background: var(--bg-2); border-radius: 8px; align-items: center;
}
.section-picker button {
  background: transparent; border: 0; padding: 6px 12px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  border-radius: 6px; min-height: 32px;
}
.section-picker button.active { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.section-picker button[data-section="Bahçe"].active { color: var(--bahce); }
.section-picker button[data-section="Salon"].active  { color: var(--salon); }

/* ===== Müşteri tile grid ===== */
.tile-grid {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  margin-top: 8px;
}
.cust-tile {
  background: var(--panel); border: 1.5px solid var(--line);
  border-left: 4px solid var(--line-2);
  border-radius: var(--radius); padding: 14px;
  display: flex; flex-direction: column; gap: 4px;
  cursor: pointer; box-shadow: var(--shadow);
  text-align: left; min-height: 96px;
  transition: transform .08s ease, box-shadow .12s ease, border-color .12s ease;
  position: relative;
}
.cust-tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-1px); }
.cust-tile:active { transform: translateY(0); }
.cust-tile.empty-tab { opacity: 0.85; }
.cust-tile.active-tile { border-left-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--shadow-lg); }
.cust-tile.bahce { border-left-color: var(--bahce); }
.cust-tile.salon { border-left-color: var(--salon); }
.cust-tile .tile-name { font-size: 16px; font-weight: 700; color: var(--text); padding-right: 56px; }
.cust-tile .tile-total {
  font-size: 22px; font-weight: 800; color: var(--text);
  font-variant-numeric: tabular-nums; margin-top: 2px;
}
.cust-tile .tile-sub { font-size: 12px; color: var(--muted); }
.cust-tile.empty-tab .tile-total { color: var(--muted); }
.section-badge {
  position: absolute; top: 10px; right: 10px;
  font-size: 10px; font-weight: 700; padding: 3px 8px;
  border-radius: 999px; text-transform: uppercase; letter-spacing: 0.5px;
}
.section-badge.bahce { background: var(--bahce-bg); color: var(--bahce); }
.section-badge.salon { background: var(--salon-bg); color: var(--salon); }

.empty { color: var(--muted); text-align: center; padding: 50px 10px; font-style: italic; font-size: 14px; }
.empty.hidden { display: none; }

/* ===== Detay (sol panelin alternatif görünümü — seçili müşteri) ===== */
.detail-header {
  display: flex; align-items: center; gap: 12px; padding-bottom: 12px;
  border-bottom: 1.5px solid var(--line); margin-bottom: 12px;
}
.detail-header .back { background: var(--bg-2); border: 0; padding: 8px 12px; border-radius: 8px; font-size: 18px; min-height: 38px; }
.detail-header .back:hover { background: var(--line); }
.detail-header .det-name { font-size: 18px; font-weight: 700; flex: 1; }
.detail-header .det-sub { font-size: 12px; color: var(--muted); }
.detail-items { display: flex; flex-direction: column; gap: 0; }
.item-row {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 8px; align-items: center;
  padding: 10px 4px; border-bottom: 1px solid var(--line);
}
.item-row:last-child { border-bottom: 0; }
.item-name { font-size: 15px; font-weight: 600; }
.item-price { font-size: 12px; color: var(--muted); margin-top: 2px; }
.qty-ctl { display: inline-flex; align-items: center; gap: 4px; }
.qty-ctl button {
  padding: 6px 10px; min-width: 38px; min-height: 38px; border-radius: 8px;
  font-size: 18px; font-weight: 700; background: var(--primary-bg); color: var(--primary); border-color: var(--primary-light);
}
.qty-ctl button:hover { background: var(--primary); color: #fff; }
.qty-ctl .qty { min-width: 28px; text-align: center; font-weight: 700; font-size: 16px; }
.line-total { font-weight: 700; min-width: 80px; text-align: right; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--text); }
.item-x { background: transparent; color: var(--muted); border: 0; padding: 6px 8px; min-height: auto; font-size: 18px; }
.item-x:hover { color: var(--danger); background: var(--danger-bg); }
.detail-empty { padding: 20px 10px; text-align: center; color: var(--muted); font-style: italic; }

.detail-total-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 4px 10px; border-top: 2px solid var(--line); margin-top: 8px;
}
.detail-total-row .lbl { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; }
.detail-total { font-size: 28px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }

.detail-actions {
  display: flex; gap: 8px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px;
}
.detail-actions button { flex: 1; min-width: 100px; }

/* ===== Detay modali (sadece kalemler) ===== */
.det-add-row {
  padding: 10px 16px; border-top: 1px solid var(--line);
  background: var(--panel-2);
  display: flex; justify-content: center;
}
.det-add-row button {
  width: 100%; max-width: 320px;
  font-size: 16px; padding: 14px 18px; min-height: 50px;
}

/* ===== Müşteri otomatik tamamlama listesi (inline, modal aşağı büyür) ===== */
.ac-wrap { position: relative; flex: 1; min-width: 0; }
.ac-list {
  margin-top: 8px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 10px;
  max-height: 320px; overflow-y: auto;
  display: none;
}
.ac-list.open { display: block; }
.ac-item {
  display: grid; grid-template-columns: 1fr auto; gap: 8px;
  padding: 10px 12px; cursor: pointer; align-items: center;
  border-bottom: 1px solid var(--line);
}
.ac-item:last-child { border-bottom: 0; }
.ac-item:hover, .ac-item.focused { background: var(--primary-bg); }
.ac-item .ac-name { font-size: 14px; font-weight: 700; color: var(--text); }
.ac-item .ac-sub { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ac-item .ac-right { font-size: 11px; color: var(--muted); text-align: right; }
.ac-item .ac-right .ac-veresiye { color: var(--danger); font-weight: 700; }
.ac-hint { padding: 8px 12px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); background: var(--panel-2); }

/* ===== (Eski sag menu paneli — artik kullanilmiyor ama selectorlari koruyalim) ===== */
.menu-head {
  padding: 12px 14px 0; border-bottom: 0;
}
.menu-head h3 {
  margin: 0 0 10px; color: var(--text); font-size: 13px;
  text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700;
}
.menu-head .menu-hint { font-size: 12px; color: var(--muted); margin-bottom: 6px; min-height: 16px; }

.menu-cat-tabs {
  display: flex; gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch;
  border-bottom: 1px solid var(--line);
  padding: 0 14px;
}
.menu-cat-tabs button {
  background: transparent; border: 0; padding: 10px 14px;
  font-size: 13px; font-weight: 700; color: var(--muted);
  border-radius: 0; border-bottom: 3px solid transparent;
  min-width: max-content; min-height: 42px;
}
.menu-cat-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.menu-cat-tabs button:hover:not(.active) { color: var(--text); background: var(--panel-2); }

.menu-products {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  padding: 12px 14px; flex: 1; overflow-y: auto; max-height: 60vh;
}
.menu-product {
  background: #fff; border: 1.5px solid var(--line); border-radius: 8px;
  padding: 10px 12px; text-align: left; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between;
  min-height: 70px; transition: border-color .1s, box-shadow .1s, transform .06s;
  border-top: 3px solid var(--primary);
}
.menu-product:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.menu-product:active { transform: scale(0.97); }
.menu-product .mp-name { font-weight: 700; font-size: 13px; line-height: 1.25; }
.menu-product .mp-price { color: var(--primary); font-size: 14px; font-weight: 800; margin-top: 6px; font-variant-numeric: tabular-nums; }

.menu-foot {
  border-top: 1px solid var(--line); padding: 10px 14px; background: var(--panel-2);
}
.menu-foot summary { font-size: 12px; font-weight: 700; color: var(--muted); cursor: pointer; padding: 4px 0; text-transform: uppercase; letter-spacing: 1px; }
.menu-foot .row { margin-top: 8px; }
.menu-foot input { padding: 8px 10px; font-size: 14px; }

/* ===== Menü yönetim (ayrı tab) ===== */
.menu-mgmt-tabs {
  display: flex; gap: 4px; padding: 0 0 0; overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  margin-bottom: 14px; padding: 4px;
}
.menu-mgmt-tabs button {
  background: transparent; border: 0; padding: 8px 14px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  border-radius: 8px; min-height: 38px; min-width: max-content;
}
.menu-mgmt-tabs button:hover { background: var(--bg); color: var(--text); }
.menu-mgmt-tabs button.active { background: var(--primary); color: #fff; }
.menu-list { display: flex; flex-direction: column; gap: 14px; }
.menu-cat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; box-shadow: var(--shadow);
}
.menu-cat h3 {
  margin: 4px 4px 10px; color: var(--primary); font-size: 12px;
  text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700;
  padding-bottom: 8px; border-bottom: 2px solid var(--primary-bg);
}
.menu-row {
  display: grid; grid-template-columns: 2fr 1.5fr 110px auto auto auto; gap: 8px; align-items: center;
  padding: 8px 4px; border-bottom: 1px solid var(--line);
}
.menu-row:last-child { border-bottom: 0; }
.menu-row input { padding: 9px 11px; font-size: 14px; }
.menu-row.inactive { opacity: 0.45; }
.menu-row .stock-btn {
  white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 13px;
  background: var(--bg); border-color: var(--line);
}
.menu-row .stock-btn.low { background: var(--accent-bg); color: var(--accent-dark); border-color: #fcd34d; }
.menu-row .stock-btn.out { background: var(--danger-bg); color: var(--danger); border-color: #fca5a5; }
.menu-row .stock-btn.untracked { color: var(--muted); }

/* Ürün kartlarında stok rozet/etiket */
.menu-product .mp-stock {
  font-size: 11px; color: var(--muted); margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.menu-product.low-stock { border-color: var(--accent); }
.menu-product.low-stock .mp-stock { color: var(--accent-dark); font-weight: 700; }
.menu-product.out-stock {
  border-color: var(--danger); opacity: 0.75;
  background: var(--danger-bg);
}
.menu-product.out-stock .mp-stock { color: var(--danger); font-weight: 700; }

/* ===== Modals ===== */
.modal {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
  display: grid; place-items: center; z-index: 50; padding: 14px;
  animation: fadeIn .12s ease;
}
.modal.hidden { display: none; }
.modal-card {
  background: var(--panel); border-radius: var(--radius-lg);
  width: 100%; max-width: 480px;
  box-shadow: var(--shadow-lg);
  max-height: 92vh; display: flex; flex-direction: column;
  overflow: hidden;
}
.modal-card.sm { max-width: 420px; }
.modal-card.lg { max-width: 680px; }
.modal-card.xl { max-width: 920px; }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  background: var(--panel-2);
}
.modal-title { font-weight: 700; font-size: 17px; }
.modal-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.icon-btn { background: transparent; border: 0; color: var(--muted); font-size: 22px; padding: 4px 10px; min-height: auto; border-radius: 8px; }
.icon-btn:hover { background: var(--bg); color: var(--text); }
.modal-body { padding: 16px; overflow: auto; flex: 1; }
.modal-foot {
  display: flex; gap: 8px; padding: 12px 14px;
  border-top: 1px solid var(--line); background: var(--panel-2);
  flex-wrap: wrap;
}
.modal-foot button { flex: 1; min-width: 110px; }
.modal-foot .danger, .modal-foot .danger-soft { flex: 0 0 auto; min-width: 80px; }
.modal-foot .ghost { flex: 0 0 auto; min-width: 110px; }

.divider { color: var(--muted); text-align: center; margin: 14px 0; font-size: 11px; text-transform: uppercase; letter-spacing: 2px; font-weight: 700; }

.big-total { font-size: 44px; font-weight: 800; color: var(--primary); text-align: center; margin: 12px 0 20px; }
.payment-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pay { padding: 18px; font-weight: 700; font-size: 16px; border-radius: var(--radius); min-height: 60px; }
.pay[data-payment="nakit"]    { background: var(--success); color: #fff; border: 0; }
.pay[data-payment="kart"]     { background: var(--info);    color: #fff; border: 0; }
.pay[data-payment="havale"]   { background: var(--accent);  color: #1e293b; border: 0; }
.pay[data-payment="veresiye"] { background: #fff; color: var(--muted); border: 1.5px dashed var(--line-2); }
.pay[data-payment="bakiye"]   { background: var(--primary); color: #fff; border: 0; }
.pay[data-payment="bakiye"]:hover { background: var(--primary-dark); }

/* İKRAM bar (menü modali) */
.ikram-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 8px 16px;
  background: var(--panel-2); border-bottom: 1px solid var(--line);
}
.ikram-bar-label { font-size: 12px; color: var(--muted); font-weight: 600; }
.ikram-toggle {
  background: #fff; border: 1.5px solid var(--line-2);
  color: var(--text); padding: 6px 14px;
  border-radius: 999px; font-weight: 700; font-size: 13px;
  min-height: 34px; letter-spacing: 0.3px;
}
.ikram-toggle:hover { background: var(--bg-2); }
.ikram-toggle.active {
  background: var(--accent); border-color: var(--accent);
  color: #1e293b;
  box-shadow: 0 0 0 3px var(--accent-bg);
}

/* Menü ürünü ikram modunda flash */
.menu-modal-ikram-mode .menu-product {
  border-color: var(--accent);
}
.menu-modal-ikram-mode .menu-product .mp-price {
  text-decoration: line-through; opacity: 0.5;
}
.menu-modal-ikram-mode .menu-product::after {
  content: "İKRAM"; position: absolute; top: 4px; right: 6px;
  font-size: 9px; font-weight: 800; color: var(--accent-dark);
  background: var(--accent-bg); padding: 2px 6px; border-radius: 999px;
  letter-spacing: 0.5px;
}
.menu-product { position: relative; }

/* Kalem listesinde İKRAM rozeti */
.item-row.ikram-row .item-name::after {
  content: "İKRAM"; display: inline-block;
  font-size: 9px; font-weight: 800; color: var(--accent-dark);
  background: var(--accent-bg); padding: 2px 6px; border-radius: 999px;
  margin-left: 8px; vertical-align: middle; letter-spacing: 0.5px;
}
.item-row.ikram-row .item-price { color: var(--accent-dark); font-weight: 700; }
.item-row.ikram-row .line-total { color: var(--accent-dark); }

/* Müşteri bilgi şeridi (detay/menü modali altı) */
.info-strip {
  display: flex; gap: 8px; flex-wrap: wrap;
  padding: 10px 16px; background: var(--panel-2);
  border-bottom: 1px solid var(--line);
  align-items: center;
}
.info-strip .ist-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.info-strip .ist-chip.balance { background: var(--success-bg); color: var(--success-dark); }
.info-strip .ist-chip.veresiye { background: var(--danger-bg); color: var(--danger); }
.info-strip .ist-chip .ist-lbl { font-size: 10px; text-transform: uppercase; letter-spacing: 0.5px; opacity: 0.8; }

.existing-info {
  margin-top: 16px; padding: 14px 16px;
  background: var(--primary-bg);
  border: 1.5px solid var(--primary-light);
  border-radius: var(--radius);
  animation: existingIn .2s ease;
}
.existing-info .ei-title {
  font-size: 11px; font-weight: 800; color: var(--primary-dark);
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 10px;
}
.existing-info .ei-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.existing-info .ei-stat .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.8px; font-weight: 600; }
.existing-info .ei-stat .val { font-size: 16px; font-weight: 800; color: var(--text); margin-top: 2px; font-variant-numeric: tabular-nums; }
.existing-info .ei-stat.veresiye .val { color: var(--danger); }
.existing-info .ei-stat.balance .val { color: var(--success); }
@keyframes existingIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

.balance-info-line {
  padding: 10px 14px; background: var(--primary-bg);
  border: 1px solid var(--primary-light); border-radius: var(--radius);
  margin-bottom: 12px; font-size: 13px; color: var(--primary-dark);
  text-align: center; font-weight: 600;
}
.balance-info-line b { font-weight: 800; }

.print-checkbox {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; background: var(--accent-bg); border-radius: var(--radius);
  margin-top: 12px; font-size: 14px; cursor: pointer;
  border: 1px solid #fde68a;
}
.print-checkbox input { width: 18px; height: 18px; }

/* ===== Reports ===== */
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.card h3 {
  margin: 4px 4px 10px; color: var(--primary); font-size: 12px;
  text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700;
  padding-bottom: 8px; border-bottom: 2px solid var(--primary-bg);
}
.span-2 { grid-column: span 2; }
.recent-list, .product-list, .closed-list { display: flex; flex-direction: column; gap: 0; }
.rep-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; padding: 10px 4px;
  border-bottom: 1px solid var(--line); align-items: center;
}
.rep-row:last-child { border-bottom: 0; }
.rep-name { font-size: 14px; font-weight: 600; }
.rep-sub { font-size: 12px; color: var(--muted); }
.rep-total { font-weight: 800; color: var(--primary); font-size: 15px; font-variant-numeric: tabular-nums; }
.rep-row.clickable { cursor: pointer; border-radius: 6px; transition: background .1s ease; }
.rep-row.clickable:hover { background: var(--primary-bg); }

/* Closed-tab edit modal */
.cte-form { display: flex; flex-direction: column; gap: 12px; }
.cte-form label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; }
.cte-payment-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 6px; }
.cte-payment-row button { padding: 10px 6px; font-size: 13px; min-height: 42px; }
.cte-payment-row button.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.cte-items { border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; }
.cte-item-row { display: grid; grid-template-columns: 1fr 90px 70px 90px auto; gap: 6px; align-items: center; padding: 8px 8px; border-bottom: 1px solid var(--line); }
.cte-item-row:last-child { border-bottom: 0; }
.cte-item-row input { padding: 8px 10px; font-size: 14px; }
.cte-item-row .cte-line { text-align: right; font-weight: 700; color: var(--primary); font-variant-numeric: tabular-nums; }
.cte-item-add { display: grid; grid-template-columns: 1fr 90px 70px auto; gap: 6px; padding: 10px 8px; background: var(--panel-2); border-top: 1px solid var(--line); }
.cte-item-add input { padding: 8px 10px; font-size: 14px; }
.cte-total { display: flex; justify-content: space-between; align-items: center; padding: 12px 4px 4px; border-top: 2px solid var(--line); }
.cte-total .lbl { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 1.5px; font-weight: 700; }
.cte-total .val { font-size: 26px; font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }

/* ===== Müşteriler (history) sayfası ===== */
.history-list { display: flex; flex-direction: column; gap: 8px; }
.history-row {
  display: grid; grid-template-columns: 1fr auto auto auto; gap: 14px;
  align-items: center; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius); cursor: pointer; box-shadow: var(--shadow);
  transition: box-shadow .1s, transform .06s;
}
.history-row:hover { box-shadow: var(--shadow-lg); }
.history-row.has-veresiye { border-left-color: var(--danger); background: linear-gradient(90deg, var(--danger-bg) 0%, var(--panel) 30%); }
.history-row.is-open { border-left-color: var(--accent); }
.history-row .h-name { font-size: 16px; font-weight: 700; }
.history-row .h-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.history-row .h-stat { text-align: right; font-size: 12px; color: var(--muted); min-width: 80px; }
.history-row .h-stat b { display: block; font-size: 15px; color: var(--text); font-weight: 800; }
.history-row .h-veresiye { color: var(--danger); }
.history-row .h-veresiye b { color: var(--danger); }
.history-row .h-arrow { color: var(--muted); font-size: 20px; }

.history-empty { padding: 40px; text-align: center; color: var(--muted); font-style: italic; }

/* Müşteri detay modal */
.hd-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.hd-stat { background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.hd-stat .lbl { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.hd-stat .val { font-size: 18px; font-weight: 800; color: var(--text); margin-top: 4px; font-variant-numeric: tabular-nums; }
.hd-stat.veresiye .val { color: var(--danger); }
.hd-stat.balance .val { color: var(--success); }
.hd-stat.balance .val.neg { color: var(--danger); }

@media (max-width: 640px) {
  .hd-summary { grid-template-columns: 1fr 1fr; }
}

/* Bakiye hareket listesi */
.bal-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  padding: 10px 8px; border-bottom: 1px solid var(--line);
}
.bal-row:last-child { border-bottom: 0; }
.bal-row .b-name { font-size: 14px; font-weight: 600; }
.bal-row .b-sub { font-size: 12px; color: var(--muted); }
.bal-row .b-amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.bal-row .b-amt.pos { color: var(--success); }
.bal-row .b-amt.neg { color: var(--danger); }
.bal-row .b-del { background: transparent; border: 0; color: var(--muted); padding: 4px 8px; min-height: auto; font-size: 16px; }
.bal-row .b-del:hover { color: var(--danger); }

/* Hesap kapat — bakiye satırı */
.balance-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; background: var(--success-bg); border: 1.5px solid var(--success);
  border-radius: var(--radius); margin-bottom: 14px;
}
.balance-row .balance-info { display: flex; flex-direction: column; gap: 2px; }
.balance-row .lbl { font-size: 11px; color: var(--success-dark); text-transform: uppercase; letter-spacing: 1px; font-weight: 700; }
.balance-row .val { font-size: 22px; font-weight: 800; color: var(--success-dark); font-variant-numeric: tabular-nums; }
.balance-row button { white-space: nowrap; }
.balance-row.insufficient { background: var(--danger-bg); border-color: var(--danger); }
.balance-row.insufficient .lbl, .balance-row.insufficient .val { color: var(--danger); }
.balance-row.insufficient button { background: transparent; color: var(--danger); border: 1px solid var(--danger); }

/* Fazla ödeme alanı */
.overpay-row { padding: 0; margin-top: 4px; }
.overpay-row .row { gap: 6px; }
.overpay-row input { flex: 1; }
.hd-section { margin-top: 12px; }
.hd-section h4 { font-size: 12px; color: var(--primary); text-transform: uppercase; letter-spacing: 1px; margin: 0 0 8px; font-weight: 700; }
.hd-tab-row {
  display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center;
  padding: 10px 8px; border-bottom: 1px solid var(--line);
}
.hd-tab-row:last-child { border-bottom: 0; }
.hd-tab-row.veresiye { background: var(--danger-bg); border-radius: 6px; }
.hd-tab-row .ttab-name { font-size: 14px; font-weight: 600; }
.hd-tab-row .ttab-items { font-size: 12px; color: var(--muted); }
.hd-tab-row .ttab-pay { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--bg-2); color: var(--text); font-weight: 600; }
.hd-tab-row .ttab-pay.veresiye { background: var(--danger); color: #fff; }
.hd-tab-row .ttab-pay.nakit { background: var(--success-bg); color: var(--success); }
.hd-tab-row .ttab-pay.kart { background: var(--info-bg); color: var(--info); }
.hd-tab-row .ttab-pay.havale { background: var(--accent-bg); color: var(--accent-dark); }
.hd-tab-row .ttab-total { font-weight: 800; color: var(--primary); font-variant-numeric: tabular-nums; }
.hd-tab-row.clickable { cursor: pointer; border-radius: 6px; }
.hd-tab-row.clickable:hover { background: var(--primary-bg); }

/* ===== Kullanıcı yönetimi ===== */
.users-table { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.users-row {
  display: grid; grid-template-columns: 1fr 110px 1fr auto; gap: 10px; align-items: center;
  padding: 10px 4px; border-bottom: 1px solid var(--line);
}
.users-row:last-child { border-bottom: 0; }
.users-row .uname { font-weight: 700; font-size: 15px; }
.users-row .urole { font-size: 12px; padding: 3px 10px; border-radius: 999px; background: var(--bg-2); color: var(--muted); font-weight: 700; text-align: center; min-width: 80px; text-transform: uppercase; letter-spacing: 0.5px; }
.users-row .urole.admin { background: var(--accent-bg); color: var(--accent-dark); }
.users-row .ucreated { font-size: 12px; color: var(--muted); }
.users-row .uactions { display: flex; gap: 6px; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff;
  padding: 12px 22px; border-radius: 8px;
  z-index: 60; box-shadow: var(--shadow-lg); font-size: 14px; font-weight: 500;
  animation: toastIn .2s ease;
}
.toast.hidden { display: none; }
.error { color: var(--danger); font-size: 14px; margin-top: 10px; padding: 10px; background: var(--danger-bg); border-radius: 8px; }
.error.hidden { display: none; }

/* ============================================================
   RESPONSIVE — Tablet & Telefon
   Breakpoint'ler:
   - <= 1024px: tablet (yatay)
   - <= 820px:  tablet (dikey)
   - <= 640px:  telefon (büyük)
   - <= 420px:  telefon (küçük)
   ============================================================ */

/* Tablet yatay */
@media (max-width: 1024px) {
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .report-grid { grid-template-columns: 1fr 1fr; }
  .menu-products { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}

/* Tablet dikey & küçük tablet */
@media (max-width: 820px) {
  .view { padding: 14px; }
  .tile-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
  .menu-products { grid-template-columns: 1fr 1fr; }
  .report-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .hd-summary { grid-template-columns: 1fr 1fr; }
}

/* Telefon büyük (≤640px) — tam mobil modu */
@media (max-width: 640px) {
  body { font-size: 15px; line-height: 1.45; }
  .view { padding: 12px 12px 80px; /* alt aksiyon barı için yer */ }

  /* Topbar — kompakt ama dokunulabilir */
  .topbar { padding: 8px 12px; gap: 8px; min-height: 56px; }
  .topbar-right { gap: 8px; }
  .brand { padding: 4px 6px; }
  .brand-sub { display: none; }
  .brand-name { font-size: 15px; }
  .logo { width: 34px; height: 34px; font-size: 16px; }
  .user-trigger .uname { max-width: 80px; font-size: 12px; }
  .user-trigger { padding: 6px 10px; min-height: 38px; }
  .user-trigger .uavatar { width: 22px; height: 22px; font-size: 11px; }
  .status { font-size: 11px; }
  .status .dot { width: 8px; height: 8px; }
  .notif-trigger { min-height: 38px; width: 38px; }

  /* Müşteri tile — büyük, kolay tıklanabilir */
  .tile-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cust-tile {
    padding: 14px; min-height: 96px;
    border-left-width: 6px;
  }
  .cust-tile .tile-name { font-size: 15px; padding-right: 0; }
  .cust-tile .tile-total { font-size: 22px; }
  .cust-tile .tile-sub { font-size: 11px; }

  /* Formlar — iOS zoom önleyici 16px */
  input[type="text"], input[type="number"], input[type="password"], input[type="date"],
  select {
    padding: 13px 14px; font-size: 16px;
  }
  button { padding: 11px 14px; font-size: 14px; min-height: 44px; }
  button.primary, button.success, button.accent, button.danger,
  button.danger-soft, button.ghost { min-height: 46px; }

  /* Meta bar */
  .meta { padding: 10px 12px; font-size: 13px; gap: 8px; }
  .meta button { padding: 10px 14px; font-size: 14px; min-height: 40px; }

  /* ========== TAM EKRAN MODAL (mobil) ========== */
  .modal { padding: 0; align-items: stretch; }
  .modal-card,
  .modal-card.sm,
  .modal-card.lg,
  .modal-card.xl {
    max-width: 100%; width: 100%;
    /* Dynamic viewport: iOS adres çubuğu kayınca da düzgün çalışır */
    height: 100vh; height: 100dvh;
    max-height: 100vh; max-height: 100dvh;
    border-radius: 0;
    display: flex; flex-direction: column;
    overflow: hidden;
  }
  .modal-head {
    padding: 14px 14px;
    padding-top: calc(14px + env(safe-area-inset-top, 0px));
    flex-shrink: 0;
    background: var(--panel-2);
  }
  .modal-title { font-size: 17px; }
  .modal-sub { font-size: 12px; }
  .icon-btn { min-height: 44px; min-width: 44px; padding: 8px; }
  .modal-body {
    padding: 14px;
    flex: 1 1 auto; overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Det-add-row (+ Ürün Ekle butonu) sticky değil, doğal akışta alt */
  .det-add-row {
    flex-shrink: 0;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    background: var(--panel);
  }
  .det-add-row button {
    width: 100%; max-width: none; min-height: 52px; font-size: 16px; font-weight: 700;
  }

  /* Alt aksiyon bar — her buton tam genişlik, çok büyük */
  .modal-foot {
    flex-shrink: 0;
    padding: 10px 12px;
    /* iOS home indicator için ekstra alt padding */
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line);
    background: var(--panel);
    box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.06);
    gap: 8px;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .modal-foot button {
    width: 100%; min-width: 0;
    padding: 14px 10px; font-size: 15px; font-weight: 700;
    min-height: 52px;
  }
  /* Hesap Kapat / Yazdır gibi başlıca aksiyonlar tam satır */
  .modal-foot button.success,
  .modal-foot button.primary {
    grid-column: 1 / -1;
  }

  /* Detay modal'da kalemler — büyük dokunma alanları */
  .item-row {
    padding: 12px 4px; gap: 8px;
    grid-template-columns: 1fr auto auto auto;
  }
  .item-name { font-size: 15px; }
  .item-price { font-size: 12px; }
  .qty-ctl button {
    min-width: 42px; min-height: 42px; padding: 6px 10px;
    font-size: 18px; font-weight: 800;
  }
  .qty-ctl .qty { min-width: 30px; font-size: 17px; }
  .line-total { min-width: 70px; font-size: 14px; }
  .item-x { font-size: 18px; padding: 8px 10px; min-width: 38px; min-height: 38px; }

  /* Ödeme tuşları — bol bol yer */
  .pay { padding: 18px 10px; font-size: 16px; min-height: 64px; }
  .big-total { font-size: 40px; margin: 12px 0 18px; }

  /* Menü kategori tabları */
  .menu-cat-tabs button { padding: 12px 14px; font-size: 14px; min-height: 44px; }
  .menu-mgmt-tabs button { padding: 10px 14px; font-size: 13px; min-height: 40px; }

  /* Menü ürünleri — 2 sütun, geniş kartlar */
  .menu-products { grid-template-columns: 1fr 1fr; gap: 8px; padding: 12px; }
  .menu-product { min-height: 84px; padding: 12px; }
  .menu-product .mp-name { font-size: 14px; }
  .menu-product .mp-price { font-size: 15px; }

  /* Menü yönetim satırları — telefon stack */
  .menu-row {
    grid-template-columns: 1fr 110px;
    grid-template-rows: auto auto auto;
    gap: 6px; padding: 10px 6px;
  }
  .menu-row > :nth-child(1) { grid-column: 1 / -1; }
  .menu-row > :nth-child(2) { grid-column: 1 / 2; }
  .menu-row > :nth-child(3) { grid-column: 2 / 3; }
  .menu-row > :nth-child(4) { grid-column: 1 / 2; }
  .menu-row > :nth-child(5) { grid-column: 2 / 3; }
  .menu-row > :nth-child(6) { grid-column: 1 / -1; }
  .menu-row button { width: 100%; }

  /* Müşteriler listesi */
  .history-row {
    grid-template-columns: 1fr auto auto;
    gap: 8px; padding: 14px;
    min-height: 60px;
  }
  .history-row .h-arrow { display: none; }
  .history-row .h-name { font-size: 15px; }
  .history-row .h-sub { font-size: 11px; }
  .history-row .h-stat { min-width: 64px; }
  .history-row .h-stat b { font-size: 14px; }

  .hd-summary { grid-template-columns: 1fr 1fr; }
  .hd-stat .val { font-size: 17px; }
  .hd-tab-row { padding: 12px 8px; gap: 8px; }

  /* Kullanıcı dropdown — full mobile width */
  .user-dropdown { min-width: 240px; right: -8px; }
  .um-item { padding: 14px 16px; font-size: 15px; min-height: 48px; }

  /* Bildirim dropdown */
  .notif-dropdown { min-width: 280px; right: -8px; }
  .notif-item { padding: 12px 14px; min-height: 56px; }

  /* Kapanan adisyon kalem satırı */
  .cte-payment-row { grid-template-columns: 1fr 1fr; }
  .cte-payment-row button { min-height: 46px; }
  .cte-item-row {
    grid-template-columns: 1fr 80px auto;
    grid-template-rows: auto auto;
    gap: 6px; padding: 10px 8px;
  }
  .cte-item-row > :nth-child(1) { grid-column: 1 / -1; }
  .cte-item-row > :nth-child(2) { grid-column: 1 / 2; }
  .cte-item-row > :nth-child(3) { grid-column: 2 / 3; }
  .cte-item-row > :nth-child(4) { grid-column: 3 / -1; text-align: right; }
  .cte-item-row > :nth-child(5) { grid-column: 3 / -1; grid-row: 1; justify-self: end; align-self: start; }

  /* Kullanıcı yönetim satırı */
  .users-row { grid-template-columns: 1fr auto; gap: 8px; padding: 12px 4px; }
  .users-row .urole { grid-column: 2 / 3; }
  .users-row .ucreated { grid-column: 1 / -1; font-size: 11px; }
  .users-row .uactions { grid-column: 1 / -1; gap: 8px; }
  .users-row .uactions button { flex: 1; }

  /* Info strip */
  .info-strip { padding: 10px 14px; gap: 6px; }
  .info-strip .ist-chip { padding: 5px 12px; font-size: 12px; }

  /* Section/section picker — temizlik */
  .section-picker button { min-height: 38px; padding: 8px 14px; }

  /* İkram bar */
  .ikram-bar { padding: 10px 14px; }
  .ikram-toggle { min-height: 38px; padding: 8px 16px; }

  /* Detay popup header'ında müşteri adı uzunsa kaymasın */
  .modal-head > div:first-child { min-width: 0; }
  .modal-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* Telefon küçük (≤420px) — iPhone SE vb. */
@media (max-width: 420px) {
  .topbar { padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  .brand-name { font-size: 14px; }
  .user-trigger .uname { max-width: 60px; }
  .tile-grid { grid-template-columns: 1fr; }
  .cust-tile { min-height: 84px; }
  .menu-products { grid-template-columns: 1fr; gap: 8px; }
  .payment-grid { grid-template-columns: 1fr; gap: 10px; }
  .meta { flex-direction: column; align-items: stretch; gap: 8px; }
  .meta > span { width: 100%; }
  .meta button { width: 100%; }
  /* En küçük ekranda tüm modal-foot butonları tam satır */
  .modal-foot { grid-template-columns: 1fr; }
  .modal-foot button { grid-column: 1 / -1; }
}

/* Yatay telefon — modal'ı çok kısa yapma */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
  .modal-card { max-height: 98vh; }
  .modal-body { padding: 10px 14px; }
  .big-total { font-size: 26px; margin: 4px 0 10px; }
  .pay { padding: 12px 8px; font-size: 14px; min-height: 48px; }
}

@keyframes fadeIn { from { opacity: 0 } to { opacity: 1 } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===== Yazdirma fisi ===== */
.receipt { position: absolute; left: -9999px; top: 0; }
@media print {
  body * { visibility: hidden; }
  .receipt, .receipt * { visibility: visible; }
  .receipt {
    position: absolute; left: 0; top: 0; width: 100%;
    color: #000; background: #fff;
    font-family: "Courier New", "Menlo", monospace;
  }
  @page { margin: 8mm; }
}
.r-wrap { width: 72mm; margin: 0 auto; padding: 6mm 4mm; font-family: "Courier New", "Menlo", monospace; font-size: 12px; color: #000; }
.r-center { text-align: center; }
.r-big { font-size: 18px; font-weight: 800; letter-spacing: 2px; }
.r-mid { font-size: 13px; font-weight: 700; }
.r-sm { font-size: 11px; }
.r-line { border-top: 1px dashed #000; margin: 6px 0; }
.r-line.solid { border-top: 1px solid #000; }
.r-row { display: flex; justify-content: space-between; gap: 6px; padding: 1px 0; }
.r-row .ln { white-space: nowrap; }
.r-row .rn { white-space: nowrap; font-variant-numeric: tabular-nums; }
.r-total { font-size: 16px; font-weight: 800; }
.r-foot { text-align: center; margin-top: 8px; font-size: 11px; }
