/* ==========================================================================
   Fırın Masası (anne.html): telefonda kullanılan yönetim ekranı
   Aynı mutfak rafı dili: fayans, adaçayı yeşili, domates kırmızısı. Sade ve büyük.
   ========================================================================== */

:root {
  --cloth: #f6f8f6;
  --cloth-hi: #ffffff;
  --cloth-lo: #e8eeeb;
  --ink: #2f6650;
  --ink-deep: #3b2d24;
  --ink-soft: #6b5546;
  --ink-faint: rgba(47, 102, 80, 0.32);
  --stamp: #c63a24;
  --stamp-deep: #a42d1a;
  --ok: #0b6b4a;
  --butter: #f3cd55;
  --display: "Baloo 2", "Nunito", system-ui, sans-serif;
  --body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Betiklerin satır içi stilleri bu adları kullanıyor */
  --cream: var(--cloth-lo);
  --cream-soft: var(--cloth);
  --cream-deep: var(--cloth-lo);
  --wheat: var(--ink-faint);
  --tan: var(--ink-soft);
  --tan-dark: var(--ink-soft);
  --crust: var(--ink);
  --crust-dark: var(--ink-deep);
  --text: var(--ink-deep);
  --text-soft: var(--ink-soft);
  --white: var(--cloth-hi);
  --line: var(--ink-faint);
  --line-light: rgba(47, 102, 80, 0.14);
  --green: var(--ok);
  --red-text: var(--stamp-deep);
  --red-bg: #f8dcd6;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  min-height: 100vh;
  background-color: var(--cloth);
  background-image: url("data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 76 76%22%3E%3Crect width=%2276%22 height=%2276%22 fill=%22%23dfe8e4%22/%3E%3Crect x=%222%22 y=%222%22 width=%2272%22 height=%2272%22 rx=%226%22 fill=%22%23f6f8f6%22/%3E%3Cpath d=%22M9 10h16%22 stroke=%22%23fff%22 stroke-width=%223%22 stroke-linecap=%22round%22/%3E%3C/svg%3E");
  background-size: 76px 76px;
  color: var(--ink-deep);
  font-family: var(--body);
  font-size: 1rem;
  line-height: 1.5;
  caret-color: var(--ink);
  accent-color: var(--ink);
}
::selection { background: var(--ink); color: var(--cloth-hi); }
* { scrollbar-width: thin; scrollbar-color: var(--ink) var(--cloth-lo); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }

h1, h2, h3, h4 {
  font-family: var(--display); font-weight: 800;  line-height: 0.98; margin: 0 0 8px; color: var(--ink); text-wrap: balance;
}
h2 { font-size: 2.1rem; }
h3 { font-size: 1.6rem; }
h4 { font-size: 1.3rem; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--body); border: none; cursor: pointer; }

/* Kap */
.app-container { max-width: 680px; margin: 0 auto; padding: 0 16px 112px; min-height: 100vh; }

/* Üst çubuk */
.app-header {
  position: sticky; top: 0; z-index: 40;
  background-color: var(--cloth-hi);
  padding: 12px 2px 12px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}
.app-header::after { content: ""; position: absolute; left: 0; right: 0; bottom: -6px; height: 6px; background: #b68a5e; }
.brand-group { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-icon {
  width: 46px; height: 46px; border-radius: 22px; background: var(--ink); color: var(--cloth-hi);
  display: grid; place-items: center; flex: none;
}
.brand-icon svg { width: 30px; height: 30px; fill: none; stroke: currentColor; }
.brand-title { font-family: var(--display); font-weight: 800; font-size: 1.4rem; line-height: 1; color: var(--ink); white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.bell-test-btn {
  min-height: 46px; padding: 0 14px; border: 3px solid var(--ink); border-radius: 999px; white-space: nowrap; background: transparent; color: var(--ink);
  font-family: var(--display); font-weight: 800;  font-size: 1.05rem; display: inline-flex; align-items: center; gap: 8px;
}
.bell-test-btn:hover { background: var(--ink); color: var(--cloth-hi); }
.bell-test-btn:active { transform: translateY(1px); }
.bell-test-btn svg { width: 18px; height: 18px; stroke: currentColor; }

.live-pill {
  display: flex; align-items: center; gap: 7px; margin-top: 6px; width: fit-content;
  color: var(--ok); font-family: var(--body); font-weight: 800; font-size: 0.76rem; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); animation: pulse-dot 1.8s infinite; }
@keyframes pulse-dot {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(11, 107, 74, 0.45); }
  70% { transform: scale(1.15); box-shadow: 0 0 0 7px rgba(11, 107, 74, 0); }
  100% { transform: scale(1); }
}

/* Ses uyarısı */
.audio-banner {
  border: 2px dashed var(--stamp); border-radius: 22px; padding: 12px 14px; margin: 14px 0 6px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--cloth-hi);
}
.audio-banner p { margin: 0; font-size: 0.95rem; font-weight: 600; line-height: 1.35; color: var(--ink-deep); }
.audio-banner button {
  min-height: 46px; padding: 0 18px 2px; border-radius: 999px; flex: none; background: var(--stamp); color: var(--cloth-hi);
  font-family: var(--display); font-weight: 800;  font-size: 1.1rem; }

/* Alt çubuk */
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--ink); display: flex; justify-content: space-around; gap: 4px;
  padding: 8px 10px calc(8px + env(safe-area-inset-bottom, 0px));
}
.nav-item {
  position: relative; flex: 1; max-width: 160px; min-height: 58px; padding: 6px 4px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  background: transparent; color: var(--cloth-hi); border-radius: 16px;
  font-family: var(--display); font-weight: 800;  font-size: 0.98rem; line-height: 1;
  transition: background-color 0.2s, color 0.2s;
}
.nav-item svg { width: 24px; height: 24px; stroke-width: 2.2; }
.nav-item.active { background: var(--cloth); color: var(--ink); }
.nav-item:focus-visible { outline-color: var(--cloth-hi); }
.nav-badge {
  position: absolute; top: 2px; right: 10px; min-width: 22px; padding: 2px 6px; text-align: center;
  background: var(--stamp); color: var(--cloth-hi); border-radius: 11px; font-family: var(--body); font-weight: 800; font-size: 0.74rem;
}

/* Sekmeler */
.tab-pane { display: none; padding-top: 16px; animation: fadeIn 0.3s var(--ease); }
.tab-pane.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Kartlar */
.card {
  background: var(--cloth-hi); border: 2px solid var(--ink); border-radius: 22px; padding: 18px; margin-bottom: 16px;
}
.empty-state {
  text-align: center; padding: 40px 20px; border: 2px dashed var(--ink); border-radius: 22px; background: var(--cloth-hi);
}
.empty-state svg { display: block; margin: 0 auto 10px; stroke: var(--ink); }
.empty-state p { margin: 0 auto 16px; max-width: 34ch; color: var(--ink-soft); }
.empty-state .btn-primary { max-width: 240px; margin: 0 auto; }

/* Siparişler */
.order-card { position: relative; background: var(--cloth-hi); border: 2px solid var(--ink); border-radius: 22px; padding: 18px; margin-bottom: 18px; }
.order-card.status-yeni { border-color: var(--stamp); }
.order-card.status-yeni::before {
  content: "YENİ SİPARİŞ"; position: absolute; top: -14px; right: 14px; transform: rotate(2deg);
  background: var(--stamp); color: var(--cloth-hi); padding: 5px 10px 3px; border-radius: 12px;
  font-family: var(--display); font-weight: 800; font-size: 1.05rem; line-height: 1;
}
.order-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.customer-name { font-family: var(--display); font-weight: 800;  font-size: 1.7rem; line-height: 0.98; color: var(--ink-deep); overflow-wrap: anywhere; }
.order-time { font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; margin-top: 2px; }
.order-header > button { min-width: 44px; min-height: 44px; display: grid; place-items: center; background: transparent; color: var(--ink-soft); border-radius: 16px; }
.order-header > button:hover { background: var(--ink-faint); color: var(--stamp-deep); }
.order-items-box { background: var(--cloth-lo); border-radius: 16px; padding: 12px 14px; margin: 12px 0; font-size: 1rem; }
.order-item-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; font-weight: 700; }
.order-note { font-size: 0.92rem; color: var(--ink-deep); margin-top: 8px; padding-top: 8px; border-top: 2px dashed var(--ink-faint); overflow-wrap: anywhere; }
.order-total-bar { display: flex; justify-content: space-between; align-items: center; margin: 14px 0; padding: 10px 0; border-top: 2px dashed var(--ink-faint); border-bottom: 2px dashed var(--ink-faint); }
.order-total-label { font-weight: 800; font-size: 0.78rem; color: var(--ink-soft); }
.order-total-val { font-family: var(--display); font-weight: 800; font-size: 2.2rem; line-height: 1; color: var(--stamp-deep); }
.order-btn-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.btn-wa-call, .btn-tel {
  min-height: 52px; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--display); font-weight: 800;  font-size: 1.2rem; line-height: 1;
  border: 2px solid var(--ink);
}
.btn-wa-call { background: var(--ink); color: var(--cloth-hi); }
.btn-wa-call:hover { background: var(--ink-deep); border-color: var(--ink-deep); }
.btn-tel { background: transparent; color: var(--ink); }
.btn-tel:hover { background: var(--ink); color: var(--cloth-hi); }
.btn-wa-call svg, .btn-tel svg { width: 20px; height: 20px; }
.status-select-wrap { margin-top: 12px; display: flex; gap: 8px; }
.status-pill-btn {
  flex: 1; min-height: 48px; padding: 0 6px; border-radius: 16px; border: 2px solid var(--ink-faint); background: transparent; color: var(--ink-soft);
  font-family: var(--display); font-weight: 800;  font-size: 1.05rem; line-height: 1;
}
.status-pill-btn.active { background: var(--ink); color: var(--cloth-hi); border-color: var(--ink); }

/* Ekmekler */
.bread-card { background: var(--cloth-hi); border: 2px solid var(--ink); border-radius: 22px; padding: 14px; margin-bottom: 14px; display: flex; gap: 14px; align-items: flex-start; }
.bread-thumb { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; background: var(--cloth-lo); flex: none; border: 2px solid var(--ink); }
.bread-details { flex: 1; min-width: 0; }
.bread-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.bread-name { font-size: 1.6rem; margin: 0; line-height: 0.98; overflow-wrap: anywhere; }
.bread-price { font-family: var(--display); font-weight: 800; font-size: 1.7rem; color: var(--stamp-deep); line-height: 1; flex: none; }
.bread-meta { font-size: 0.9rem; color: var(--ink-soft); margin-top: 4px; }
.stock-toggle-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.stock-toggle-bar button { min-height: 44px; }
.toggle-stock-btn { padding: 0 14px; border-radius: 16px; border: 2px solid var(--ink); background: transparent; font-family: var(--display); font-weight: 800;  font-size: 1.05rem; line-height: 1; }
.toggle-stock-btn.in-stock { color: var(--ok); border-color: var(--ok); }
.toggle-stock-btn.out-stock { background: var(--stamp); color: var(--cloth-hi); border-color: var(--stamp); }

/* Formlar */
.form-group { margin-bottom: 18px; }
.form-group label { display: block; margin-bottom: 7px; font-weight: 700; font-size: 0.78rem; color: var(--ink); }
.form-control {
  width: 100%; min-height: 54px; padding: 12px 14px; font: inherit; font-size: 1rem; color: var(--ink-deep);
  background: var(--cloth-hi); border: 2px solid var(--ink); border-radius: 16px;
}
textarea.form-control { min-height: 96px; resize: vertical; }
.form-control::placeholder { color: var(--ink-soft); opacity: 1; }
.form-control:focus { outline: none; box-shadow: 0 0 0 4px var(--ink-faint); }

.photo-picker { border: 3px dashed var(--ink); border-radius: 22px; padding: 28px 16px; text-align: center; background: var(--cloth-hi); cursor: pointer; margin-bottom: 16px; }
.photo-picker:active { background: var(--cloth-lo); }
.photo-picker svg { width: 40px; height: 40px; stroke: var(--ink); margin-bottom: 8px; }
.photo-picker p { margin: 0; font-family: var(--display); font-weight: 800;  font-size: 1.5rem; color: var(--ink); line-height: 1; }
.photo-picker span { display: block; font-size: 0.9rem; color: var(--ink-soft); margin-top: 6px; }
#photoPreview { width: 100%; max-height: 240px; object-fit: cover; border-radius: 16px; display: none; margin-bottom: 14px; border: 2px solid var(--ink); }

/* Vitrin fotoğrafları */
.gallery-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: 14px; }
@media (min-width: 520px) { .gallery-grid { grid-template-columns: repeat(4, 1fr); } }
.gallery-slot { background: var(--cloth-lo); border: 2px dashed var(--ink-faint); border-radius: 16px; padding: 8px; display: flex; flex-direction: column; }
.gallery-slot-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; font-size: 0.78rem; font-weight: 800; color: var(--ink); }
.gallery-slot-thumb-wrap { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; background: var(--cloth-hi); border: 2px solid var(--ink-faint); overflow: hidden; display: flex; align-items: center; justify-content: center; position: relative; cursor: pointer; }
.gallery-slot-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-slot-placeholder { display: flex; flex-direction: column; align-items: center; gap: 4px; color: var(--ink-soft); font-size: 0.78rem; font-weight: 700; padding: 4px; text-align: center; }
.gallery-slot-placeholder svg { width: 24px; height: 24px; stroke: var(--ink); }
.gallery-slot-actions { margin-top: 8px; display: flex; gap: 6px; }
.gallery-upload-btn { flex: 1; min-height: 44px; background: var(--ink); color: var(--cloth-hi); border-radius: 16px; font-family: var(--display); font-weight: 800;  font-size: 1rem; }
.gallery-upload-btn:hover { background: var(--ink-deep); }
.gallery-clear-btn { min-width: 44px; min-height: 44px; padding: 0 10px; background: transparent; border: 2px solid var(--stamp); color: var(--stamp-deep); border-radius: 16px; font-family: var(--display); font-weight: 800;  font-size: 1rem; }
.gallery-clear-btn:hover { background: var(--red-bg); }
.gallery-slot.uploading .gallery-slot-thumb-wrap::after {
  content: "Yükleniyor..."; position: absolute; inset: 0; background: rgba(59, 45, 36, 0.78); color: var(--cloth-hi);
  font-size: 0.85rem; font-weight: 700; display: flex; align-items: center; justify-content: center;
}
.batch-btn { min-height: 44px; padding: 0 14px; border-radius: 16px; border: 2px solid var(--ink); background: transparent; color: var(--ink); font-family: var(--display); font-weight: 800;  font-size: 1.05rem; }
.batch-btn:hover { background: var(--ink); color: var(--cloth-hi); }
.refresh-btn, .link-btn { min-height: 48px; min-width: 72px; padding: 0 12px; justify-content: center; background: transparent; color: var(--ink); font-family: var(--display); font-weight: 800;  font-size: 1.1rem; display: inline-flex; align-items: center; gap: 6px; }
.refresh-btn:hover, .link-btn:hover { text-decoration: underline; text-underline-offset: 4px; }
.pane-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin: 4px 0 18px; }
.pane-head p { margin: 4px 0 0; color: var(--ink-soft); font-size: 0.95rem; }
.add-btn { min-height: 48px; padding: 0 16px; border-radius: 16px; background: var(--ink); color: var(--cloth-hi); font-family: var(--display); font-weight: 800;  font-size: 1.15rem; }
.logout-btn { width: 100%; min-height: 52px; background: transparent; border: 2px solid var(--stamp); color: var(--stamp-deep); border-radius: 16px; font-family: var(--display); font-weight: 800;  font-size: 1.2rem; margin-top: 8px; }
.logout-btn:hover { background: var(--stamp); color: var(--cloth-hi); }
.hint { font-size: 0.9rem; color: var(--ink-soft); margin: 14px 0 0; }
.fb { min-height: 1.4em; font-weight: 700; margin-bottom: 12px; font-size: 0.95rem; }

/* Büyük birincil düğme */
.btn-primary {
  width: 100%; min-height: 58px; padding: 0 18px 2px; background: var(--ink); color: var(--cloth-hi); border-radius: 999px;
  font-family: var(--display); font-weight: 800;  font-size: 1.5rem; line-height: 1;
  display: flex; align-items: center; justify-content: center; gap: 10px; transition: background-color 0.2s, transform 0.12s;
}
.btn-primary:hover { background: var(--ink-deep); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { opacity: 0.55; }

/* Yeni sipariş uyarısı */
.order-alert-overlay { position: fixed; inset: 0; background: rgba(59, 45, 36, 0.82); z-index: 100; display: none; align-items: center; justify-content: center; padding: 20px; }
.order-alert-overlay.show { display: flex; animation: alertPop 0.4s var(--ease); }
@keyframes alertPop { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.order-alert-box { background: var(--cloth); border: 3px solid var(--stamp); border-radius: 28px; padding: 28px 22px; width: 100%; max-width: 440px; text-align: center; max-height: calc(100svh - 40px); overflow-y: auto; }
.order-alert-box h2 { color: var(--stamp-deep); font-size: 2.4rem; }
.alert-icon-ring { width: 68px; height: 68px; border-radius: 50%; background: var(--stamp); display: grid; place-items: center; margin: 0 auto 14px; animation: bellShake 1.2s infinite; }
@keyframes bellShake { 0%, 100% { transform: rotate(0); } 20%, 60% { transform: rotate(14deg); } 40%, 80% { transform: rotate(-14deg); } }
.alert-icon-ring svg { width: 34px; height: 34px; stroke: var(--cloth-hi); }
#alertDetails { background: var(--cloth-hi); border: 2px dashed var(--ink-faint); border-radius: 16px; padding: 14px; margin: 14px 0; text-align: left; overflow-wrap: anywhere; }

/* Giriş */
.login-screen { position: fixed; inset: 0; background-color: var(--cloth); z-index: 90; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: var(--cloth-hi); border: 3px solid var(--ink); border-radius: 28px; padding: 34px 26px; width: 100%; max-width: 380px; text-align: center; }
.login-card h2 { margin-bottom: 4px; }
.login-card .sub { color: var(--ink-soft); margin: 0 0 18px; }
.pin-input {
  letter-spacing: 14px; font-family: var(--display); font-size: 2.4rem; text-align: center; font-weight: 800; padding: 8px 8px 8px 22px;
  border-radius: 16px; border: 2px solid var(--ink); width: 200px; margin: 12px auto 20px; background: var(--cloth-hi); color: var(--ink-deep);
}
.pin-input:focus { outline: none; box-shadow: 0 0 0 4px var(--ink-faint); }
.login-err { color: var(--stamp-deep); font-weight: 700; margin-bottom: 14px; display: none; }

@media (prefers-reduced-motion: reduce) {
  .tab-pane, .order-alert-overlay.show, .alert-icon-ring, .live-dot { animation: none; }
}
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.refresh-btn svg { width: 18px; height: 18px; flex: none; }
