:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --text: #14211b;
  --text-soft: #5d6b64;
  --text-mute: #8b9791;
  --border: #e4eae7;
  --primary: #16a34a;
  --primary-dark: #0f7d38;
  --primary-soft: #e8f6ed;
  --accent: #f59e0b;
  --accent-soft: #fef3e2;
  --danger: #dc2626;
  --danger-soft: #fdeaea;
  --info: #0ea5e9;
  --info-soft: #e6f5fd;
  --shadow-sm: 0 1px 2px rgba(16, 32, 24, 0.05);
  --shadow-md: 0 6px 18px rgba(16, 32, 24, 0.08);
  --shadow-lg: 0 12px 34px rgba(16, 32, 24, 0.14);
  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 22px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --tabbar-h: 64px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1512;
    --surface: #17201c;
    --surface-2: #1d2723;
    --text: #e9f1ec;
    --text-soft: #a6b5ad;
    --text-mute: #7b8a83;
    --border: #26332d;
    --primary: #34c76a;
    --primary-dark: #22a955;
    --primary-soft: #16301f;
    --accent: #fbbf24;
    --accent-soft: #33280d;
    --danger: #f87171;
    --danger-soft: #331717;
    --info: #38bdf8;
    --info-soft: #0f2836;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 12px 34px rgba(0, 0, 0, 0.5);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body { min-height: 100vh; min-height: 100dvh; }

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; padding: 0; }
a { color: var(--primary-dark); }

/* ------------------------------- Genel ------------------------------- */
.app { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }

.appbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: calc(var(--safe-top) + 10px) 16px 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-md);
}

.appbar-top { display: flex; align-items: center; gap: 10px; }
.appbar-logo { width: 34px; height: 34px; border-radius: 10px; background: rgba(255,255,255,0.18); display: grid; place-items: center; flex: none; }
.appbar-logo img { width: 24px; height: 24px; display: block; }
.appbar-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; margin: 0; flex: 1; }
.appbar-sub { font-size: 0.74rem; opacity: 0.85; margin: 1px 0 0; font-weight: 500; }

.live-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.2);
  padding: 4px 9px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em;
}
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74,222,128,0.7); animation: pulse 2s infinite; }
.live-badge.offline .live-dot { background: #fbbf24; animation: none; }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.6); }
  70% { box-shadow: 0 0 0 7px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

.icon-btn {
  width: 36px; height: 36px; border-radius: 10px;
  display: grid; place-items: center;
  background: rgba(255,255,255,0.18); color: #fff;
  transition: background 0.15s;
}
.icon-btn:active { background: rgba(255,255,255,0.32); }
.icon-btn svg { width: 19px; height: 19px; }

.content {
  flex: 1;
  padding: 14px 14px calc(var(--tabbar-h) + var(--safe-bottom) + 22px);
  max-width: 760px;
  width: 100%;
  margin: 0 auto;
}

/* ------------------------------- Tablar ------------------------------ */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: flex;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-bottom: var(--safe-bottom);
  box-shadow: 0 -2px 14px rgba(16,32,24,0.06);
}
.tab {
  flex: 1; padding: 8px 4px 7px;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: var(--text-mute); font-size: 0.68rem; font-weight: 600;
  transition: color 0.15s;
}
.tab svg { width: 22px; height: 22px; }
.tab.active { color: var(--primary); }
.tab .tab-dot { position: absolute; }

/* ------------------------------- Kartlar ----------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
  overflow: hidden;
}
.card-head {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 0.92rem;
}
.card-head .count { margin-left: auto; font-size: 0.75rem; font-weight: 600; color: var(--text-mute); }
.card-body { padding: 14px 15px; }

.section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-mute);
  margin: 18px 4px 9px;
}

/* ------------------------------- Formlar ----------------------------- */
.input, .select, .textarea {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 13px;
  color: var(--text);
  outline: none;
  transition: border-color 0.15s, background 0.15s;
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--primary); background: var(--surface); }
.input::placeholder { color: var(--text-mute); }
.textarea { resize: vertical; min-height: 74px; }
.select { appearance: none; background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b9791' stroke-width='2.4' stroke-linecap='round'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat: no-repeat; background-position: right 11px center; background-size: 17px; padding-right: 34px; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 0.76rem; font-weight: 700; color: var(--text-soft); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.04em; }
.row { display: flex; gap: 9px; }
.row > * { flex: 1; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 17px; border-radius: var(--radius-sm);
  background: var(--primary); color: #fff;
  font-weight: 700; font-size: 0.92rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s, opacity 0.15s;
}
.btn:active { transform: scale(0.975); }
.btn:disabled { opacity: 0.55; }
.btn.block { width: 100%; }
.btn.secondary { background: var(--surface-2); color: var(--text); border: 1.5px solid var(--border); }
.btn.ghost { background: transparent; color: var(--primary-dark); }
.btn.danger { background: var(--danger-soft); color: var(--danger); border: 1.5px solid transparent; }
.btn.small { padding: 8px 12px; font-size: 0.82rem; border-radius: 9px; }
.btn svg { width: 17px; height: 17px; }

/* --------------------------- Hızlı ekleme --------------------------- */
.quick-add {
  display: flex; gap: 8px; align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 12px;
}
.quick-add .input { background: var(--surface-2); }
.quick-add .price-input { max-width: 88px; text-align: right; font-variant-numeric: tabular-nums; }
.quick-add .add-btn {
  width: 44px; height: 44px; flex: none;
  border-radius: 12px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 3px 10px rgba(22,163,74,0.32);
}
.quick-add .add-btn:active { transform: scale(0.94); }
.quick-add .add-btn svg { width: 21px; height: 21px; }

/* ------------------------------- Filtreler --------------------------- */
.chips { display: flex; gap: 7px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 7px 13px; border-radius: 999px;
  background: var(--surface); border: 1.5px solid var(--border);
  font-size: 0.8rem; font-weight: 600; color: var(--text-soft);
  white-space: nowrap;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ------------------------------- Liste -------------------------------- */
.item-row {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}
.item-row:last-child { border-bottom: none; }
.item-row:active { background: var(--surface-2); }

.check {
  width: 25px; height: 25px; flex: none;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: grid; place-items: center;
  transition: all 0.18s;
  background: transparent;
}
.check.checked { background: var(--primary); border-color: var(--primary); }
.check svg { width: 14px; height: 14px; color: #fff; opacity: 0; transition: opacity 0.15s; }
.check.checked svg { opacity: 1; }

/* Tik butonunun altinda kucuk ekleyen avatari */
.item-lead {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  flex: none;
}
.item-avatar { display: block; }
.market-badge { background: transparent; }

.item-main { flex: 1; min-width: 0; }
.item-name { font-weight: 600; font-size: 0.94rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-meta { font-size: 0.74rem; color: var(--text-mute); margin-top: 2px; display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.item-price { font-weight: 700; font-size: 0.9rem; color: var(--accent); font-variant-numeric: tabular-nums; white-space: nowrap; }
.item-row.bought .item-name { text-decoration: line-through; color: var(--text-mute); }
.item-row.bought .item-price { color: var(--text-mute); }

.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2.5px 8px; border-radius: 999px;
  font-size: 0.68rem; font-weight: 700;
}
.badge.green { background: var(--primary-soft); color: var(--primary-dark); }
.badge.amber { background: var(--accent-soft); color: #b45309; }
.badge.blue { background: var(--info-soft); color: #0369a1; }
.badge.gray { background: var(--surface-2); color: var(--text-mute); }
.badge.red { background: var(--danger-soft); color: var(--danger); }
@media (prefers-color-scheme: dark) {
  .badge.amber { color: var(--accent); }
  .badge.blue { color: var(--info); }
}

.avatar {
  width: 27px; height: 27px; border-radius: 50%;
  background: var(--info-soft); color: var(--info);
  display: grid; place-items: center;
  font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
  flex: none;
}

.empty {
  text-align: center; padding: 34px 18px; color: var(--text-mute);
}
.empty .emoji { font-size: 2.3rem; display: block; margin-bottom: 8px; }
.empty .t { font-weight: 700; color: var(--text-soft); margin-bottom: 3px; font-size: 0.95rem; }
.empty .d { font-size: 0.83rem; }

/* ------------------------------- Özet -------------------------------- */
.summary { display: flex; gap: 10px; margin-bottom: 14px; }
.summary .card { flex: 1; margin-bottom: 0; padding: 13px 14px; }
.summary .lbl { font-size: 0.7rem; font-weight: 700; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.05em; }
.summary .val { font-size: 1.22rem; font-weight: 800; margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.summary .val.green { color: var(--primary); }
.summary .val.amber { color: var(--accent); }

/* ------------------------------- Sheet ------------------------------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 16, 12, 0.45);
  backdrop-filter: blur(2px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fade 0.2s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%; max-width: 560px;
  background: var(--surface);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  max-height: 88vh; max-height: 88dvh;
  display: flex; flex-direction: column;
  padding-bottom: var(--safe-bottom);
  animation: slideUp 0.26s cubic-bezier(0.22, 1, 0.36, 1);
  box-shadow: var(--shadow-lg);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.sheet-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--border); margin: 9px auto 0; flex: none; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 12px 17px 10px; flex: none; }
.sheet-head h3 { margin: 0; font-size: 1.02rem; font-weight: 700; flex: 1; }
.sheet-body { padding: 4px 17px 17px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.sheet-actions { display: flex; gap: 9px; padding: 12px 17px calc(16px + var(--safe-bottom)); border-top: 1px solid var(--border); flex: none; }
.sheet-actions .btn { flex: 1; }

/* ------------------------------- Toast ------------------------------- */
.toast-wrap { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 14px); z-index: 200; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  background: #14211b; color: #fff;
  padding: 11px 17px; border-radius: 999px;
  font-size: 0.86rem; font-weight: 600;
  box-shadow: var(--shadow-lg);
  animation: toastIn 0.25s cubic-bezier(0.22, 1, 0.36, 1);
  max-width: 100%;
}
.toast.err { background: var(--danger); }
.toast.ok { background: var(--primary-dark); }
@keyframes toastIn { from { transform: translateY(14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ------------------------------- Login ------------------------------- */
.login-wrap {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; justify-content: center;
  padding: 26px 22px calc(26px + var(--safe-bottom));
  background: linear-gradient(165deg, #16a34a 0%, #0d7a3c 55%, #0b5c2e 100%);
}
.login-card { width: 100%; max-width: 400px; margin: 0 auto; }
.login-logo { width: 92px; height: 92px; margin: 0 auto 18px; border-radius: 24px; background: rgba(255,255,255,0.14); display: grid; place-items: center; box-shadow: var(--shadow-lg); }
.login-logo img { width: 62px; height: 62px; }
.login-title { text-align: center; color: #fff; margin: 0 0 4px; font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; }
.login-sub { text-align: center; color: rgba(255,255,255,0.82); margin: 0 0 24px; font-size: 0.88rem; }
.login-box { background: var(--surface); border-radius: var(--radius-lg); padding: 20px; box-shadow: var(--shadow-lg); }
.login-err { background: var(--danger-soft); color: var(--danger); padding: 10px 13px; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; margin-bottom: 12px; display: none; }
.login-err.show { display: block; }
.login-foot { text-align: center; color: rgba(255,255,255,0.7); font-size: 0.78rem; margin-top: 18px; }

/* ------------------------------ Tarifler ----------------------------- */
.recipe-card { padding: 14px 15px; border-bottom: 1px solid var(--border); }
.recipe-card:last-child { border-bottom: none; }
.recipe-head { display: flex; align-items: flex-start; gap: 10px; }
.recipe-title { font-weight: 700; font-size: 1rem; flex: 1; letter-spacing: -0.01em; }
.recipe-desc { font-size: 0.83rem; color: var(--text-soft); margin-top: 4px; line-height: 1.45; }
.recipe-meta { display: flex; gap: 12px; margin-top: 8px; font-size: 0.75rem; color: var(--text-mute); flex-wrap: wrap; }
.recipe-meta span { display: inline-flex; align-items: center; gap: 4px; }

.ing-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.ing-row:last-child { border-bottom: none; }
.ing-check { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; flex: none; }
.ing-check.ok { background: var(--primary); border-color: var(--primary); }
.ing-check.ok svg { width: 11px; height: 11px; color: #fff; }
.ing-check.miss { border-color: var(--danger); }
.ing-name { flex: 1; font-size: 0.9rem; }
.ing-name.ok { color: var(--text-mute); }
.ing-name.miss { color: var(--text); font-weight: 600; }
.ing-qty { font-size: 0.78rem; color: var(--text-mute); font-variant-numeric: tabular-nums; }

.ing-editor-row { display: flex; gap: 7px; margin-bottom: 8px; align-items: center; }
.ing-editor-row .input { padding: 9px 11px; }
.ing-editor-row .qty { max-width: 78px; }
.ing-editor-row .unit { max-width: 92px; }
.icon-btn-ghost { width: 36px; height: 36px; flex: none; border-radius: 10px; display: grid; place-items: center; color: var(--text-mute); background: var(--surface-2); }
.icon-btn-ghost:active { background: var(--border); }

/* ------------------------------ Kullanıcılar ------------------------- */
.user-row { display: flex; align-items: center; gap: 11px; padding: 12px 15px; border-bottom: 1px solid var(--border); }
.user-row:last-child { border-bottom: none; }
.user-name { font-weight: 600; }
.user-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.user-actions .btn { padding: 6px 10px; font-size: 0.74rem; border-radius: 8px; }

.install-banner {
  display: flex; align-items: center; gap: 11px;
  background: var(--info-soft); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 14px; margin-bottom: 14px;
}
.install-banner .txt { flex: 1; font-size: 0.83rem; font-weight: 600; }
.install-banner .txt small { display: block; font-weight: 500; color: var(--text-soft); font-size: 0.74rem; }

/* --------------------------- Header & rozetler ------------------------- */
.appbar-title-wrap { flex: 1; min-width: 0; }
.appbar-title { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.01em; margin: 0; }
.appbar-sub {
  font-size: 0.74rem; opacity: 0.85; margin: 1px 0 0; font-weight: 500;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.appbar-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  background: transparent; border: none; overflow: visible;
  flex: none;
}
.appbar-avatar .avatar {
  border: none;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.55);
}
.appbar-avatar .avatar-img-wrap { background: var(--info-soft); }

.live-badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,0.2);
  padding: 4px 9px; border-radius: 999px;
  font-size: 0.7rem; font-weight: 700; letter-spacing: 0.02em;
  white-space: nowrap;
}
.live-badge.online { padding: 7px; background: transparent; }
.live-badge .live-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; }
.live-badge.online .live-dot { animation: pulse 2.4s infinite; }
.live-badge.connecting .live-dot { background: #fbbf24; animation: none; }
.live-badge.offline .live-dot { background: #f87171; animation: none; }
.live-badge.connecting, .live-badge.offline { background: rgba(0,0,0,0.22); }
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(74,222,128,0.7); }
  70% { box-shadow: 0 0 0 7px rgba(74,222,128,0); }
  100% { box-shadow: 0 0 0 0 rgba(74,222,128,0); }
}

/* ------------------------------- Avatar -------------------------------- */
.avatar {
  display: inline-grid; place-items: center;
  border-radius: 50%; flex: none; overflow: hidden;
  color: #fff; font-weight: 800; text-transform: uppercase;
  line-height: 1;
}
.avatar-img-wrap { background: var(--info-soft); }
.avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }

.user-chip {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--text-mute); font-weight: 600; font-size: 0.74rem;
}

/* ------------------------------ Marka --------------------------------- */
.brand-tag {
  display: inline-flex; align-items: center;
  font-size: 0.7rem; font-weight: 600; font-style: italic;
  color: var(--text-mute); opacity: 0.85;
}
.brand-tag::before {
  content: ""; width: 3px; height: 3px; border-radius: 50%;
  background: currentColor; margin-right: 5px; opacity: 0.6;
}

/* ---------------------------- Ürün kataloğu ---------------------------- */
.product-row {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 14px; border-bottom: 1px solid var(--border);
}
.product-row:last-child { border-bottom: none; }
.product-add {
  width: 34px; height: 34px; flex: none; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--primary-soft); color: var(--primary-dark);
  transition: all 0.18s;
}
.product-add:active { transform: scale(0.9); }
.product-add.added { background: var(--primary); color: #fff; }

/* ------------------------------ Admin form ----------------------------- */
.admin-form { display: flex; flex-direction: column; gap: 9px; }
.admin-form .row { align-items: center; }
.admin-form .add-btn { width: 44px; height: 44px; flex: none; }
.admin-form .row > .add-btn { flex: none; }

/* Market ve birim yonetimi */
.market-row {
  display: flex; flex-direction: column; gap: 8px;
  padding: 11px 15px; border-bottom: 1px solid var(--border);
}
.market-row:last-child { border-bottom: none; }
.market-row-top { display: flex; gap: 8px; }
.market-row-top > .input { flex: 1; min-width: 0; }
.market-row-bottom { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.market-colors { display: flex; align-items: center; gap: 6px; flex: none; }
.color-input {
  width: 42px; height: 38px; padding: 2px; flex: none;
  border-radius: 10px; border: 1px solid var(--border); background: var(--surface);
  cursor: pointer;
}
.hex-input { width: 104px; flex: none; text-transform: uppercase; font-size: 0.76rem; }
.market-row .btn { padding: 7px 11px; font-size: 0.74rem; flex: none; }

.unit-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 13px 15px; }
.unit-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 6px 5px 11px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-soft);
  font-size: 0.78rem; font-weight: 600;
}
.unit-chip-x {
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  color: var(--text-mute); background: transparent;
}
.unit-chip-x:active { background: var(--border); }

.user-username { font-size: 0.74rem; color: var(--text-mute); margin-top: 1px; }

/* Ipucu metinleri: form kutusunun biraz altinda, boluklu */
.admin-hint {
  font-size: 0.76rem; color: var(--text-mute);
  margin: 10px 4px 16px; line-height: 1.45;
}

/* Yonetici panelinde katlanabilir bolumler (marketler / birimler) */
.section-block { margin-bottom: 6px; }
.section-toggle {
  display: flex; align-items: center; gap: 8px;
  width: 100%; padding: 12px 4px; text-align: left;
}
.section-toggle-title {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-mute);
}
.section-toggle-sub { flex: 1; font-size: 0.74rem; color: var(--text-mute); }
.section-chevron {
  color: var(--text-mute); transition: transform 0.2s;
  display: inline-flex; align-items: center; justify-content: center;
}
.section-toggle[aria-expanded="false"] .section-chevron { transform: rotate(-90deg); }

/* ------------------------------ Profil --------------------------------- */
.profile-head { display: flex; align-items: center; gap: 13px; margin-bottom: 16px; }
.profile-avatar-wrap { flex: none; }
.profile-name { font-weight: 700; font-size: 1rem; }
.profile-username { font-size: 0.78rem; color: var(--text-mute); }
.profile-hint { font-size: 0.72rem; color: var(--text-mute); margin-top: 3px; }

/* Dosya secici butonun uzerine acik sekilde durur (gizli input calismiyordu). */
.file-input-wrap { position: relative; flex: 1; display: inline-block; }
.file-input-wrap .btn { justify-content: center; }
.file-input-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* ---------------------------- Fiyat gecmisi ---------------------------- */
.price-block { border-bottom: 1px solid var(--border); }
.price-block:last-child { border-bottom: none; }
.price-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 15px; cursor: pointer;
}
.price-head:active { background: var(--surface-2); }
.price-caret { color: var(--text-mute); display: flex; flex: none; }
.price-caret svg { transition: transform .18s ease; }
.price-caret.open svg { transform: rotate(180deg); }
.price-delta { font-size: 0.72rem; font-weight: 700; margin-top: 2px; }
.price-body { padding: 0 15px 15px; }

.chart-wrap { margin: 4px 0 12px; }
.price-chart { width: 100%; height: 120px; display: block; overflow: visible; }
.chart-area { fill: var(--primary); opacity: 0.12; }
.chart-line { fill: none; stroke: var(--primary); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
.chart-dot { fill: var(--surface); stroke: var(--primary); stroke-width: 1.8; }
.chart-dot.last { fill: var(--primary); stroke: var(--surface); stroke-width: 2; }
.empty-chart { display: grid; place-items: center; color: var(--text-mute); font-size: 0.82rem; }

.chart-axis {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.68rem; color: var(--text-mute); margin-top: 2px;
}
.chart-axis-max { font-weight: 700; color: var(--text-soft); }

.price-stats { display: flex; gap: 9px; margin-bottom: 12px; }
.price-stat { flex: 1; background: var(--surface-2); border-radius: var(--radius-sm); padding: 9px 11px; }
.price-stat .lbl { font-size: 0.65rem; font-weight: 700; color: var(--text-mute); text-transform: uppercase; letter-spacing: 0.04em; }
.price-stat .val { font-size: 0.92rem; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }

.price-records { border-top: 1px solid var(--border); padding-top: 6px; }
.price-record {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; font-size: 0.78rem; color: var(--text-soft);
}
.price-record-date { flex: none; font-variant-numeric: tabular-nums; color: var(--text-soft); }
.price-record-qty { flex: none; color: var(--text-mute); font-size: 0.74rem; min-width: 56px; }
.price-record-market { flex: 1; color: var(--text-mute); font-size: 0.74rem; min-width: 0; }
.price-record-value { font-weight: 700; color: var(--text); font-variant-numeric: tabular-nums; flex: none; }

/* Yonetici icin kayit duzenle / sil butonlari */
.price-record-actions { display: flex; gap: 2px; flex: none; margin-left: 2px; }
.price-record-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0;
  border: none; background: transparent; color: var(--text-mute);
  border-radius: 7px; cursor: pointer;
}
.price-record-btn:hover { background: var(--primary-soft); color: var(--primary-dark); }
.price-record-btn.danger:hover { background: var(--danger-soft); color: var(--danger); }

/* Birim etiketi (₺/kg, ₺/lt, ₺/adet) */
.price-unit-tag {
  font-weight: 700; color: var(--primary-dark);
  background: var(--primary-soft); border-radius: 6px;
  padding: 1px 6px; font-size: 0.7rem;
}

/* ----------------------------- Akakce ---------------------------------- */
.btn.akakce-btn {
  text-decoration: none; font-size: 0.8rem; padding: 9px 14px;
  color: #1264a0;
  background: transparent;
  border: 1px solid #1264a0;
  box-shadow: none;
}
.btn.akakce-btn:active { background: rgba(18,100,160,0.08); }
@media (prefers-color-scheme: dark) {
  .btn.akakce-btn { color: #56a8de; border-color: #56a8de; }
  .btn.akakce-btn:active { background: rgba(86,168,222,0.12); }
}

/* --------------------------- 6 sekmeli bar ----------------------------- */
.tab-label { font-size: 0.62rem; letter-spacing: -0.01em; }
.tab { padding: 7px 2px 6px; }


.spinner { width: 17px; height: 17px; border: 2.2px solid rgba(255,255,255,0.35); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.fab {
  position: fixed; right: 16px;
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 16px);
  z-index: 45;
  width: 54px; height: 54px; border-radius: 18px;
  background: var(--primary); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 8px 22px rgba(22,163,74,0.42);
}
.fab:active { transform: scale(0.93); }
.fab svg { width: 25px; height: 25px; }

.list-toggle { display: flex; gap: 6px; align-items: center; font-size: 0.8rem; color: var(--text-soft); font-weight: 600; }
.switch { width: 42px; height: 24px; border-radius: 999px; background: var(--border); position: relative; transition: background 0.2s; flex: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; transition: transform 0.2s; box-shadow: var(--shadow-sm); }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }
