/* Premium katman: Apple tarzı cam yüzeyler, yaylı geçişler, sakin ama pırıl pırıl bir görünüm.
 * app.css'in üstüne biner; kaldırılırsa uygulama eskisi gibi çalışır. */
:root {
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Inter', 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --paper: #f5f5f7;
  --blue: #0a64e0;
  --r: 20px;
  --r-sm: 12px;
  --glass: rgba(255, 255, 255, 0.72);
  --glass-line: rgba(255, 255, 255, 0.6);
  --hair: rgba(18, 35, 59, 0.08);
  --shadow: 0 1px 1px rgba(18, 35, 59, 0.04), 0 8px 24px -10px rgba(18, 35, 59, 0.16), 0 24px 48px -28px rgba(18, 35, 59, 0.18);
  --spring: cubic-bezier(0.32, 0.72, 0, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --paper: #000;
    --card: #1c1c1e;
    --line: rgba(255, 255, 255, 0.09);
    --line-2: rgba(255, 255, 255, 0.05);
    --glass: rgba(28, 28, 30, 0.72);
    --glass-line: rgba(255, 255, 255, 0.08);
    --hair: rgba(255, 255, 255, 0.08);
    --shadow: 0 1px 1px rgba(0, 0, 0, 0.4), 0 12px 32px -12px rgba(0, 0, 0, 0.7);
  }
}
body { letter-spacing: -0.011em; background: var(--paper); }
h1, h2 { letter-spacing: -0.03em; }
.page-head h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.035em; }

/* Alt menü yüzdüğü için sabit öğeler onun üstünde durur */
.cartbar { bottom: calc(88px + var(--safe-b)); }
.fab { bottom: calc(100px + var(--safe-b)); }
.toasts { bottom: calc(104px + var(--safe-b)); }
@media (min-width: 900px) { .shell-admin .cartbar { bottom: 20px; } .fab { bottom: 28px; } .toasts { bottom: 24px; } }

/* Kartlar */
.card { border: 1px solid var(--hair); border-radius: var(--r); background: var(--card); transition: transform 0.35s var(--spring), box-shadow 0.35s var(--spring); }
.kpi { padding: 18px; }
.kpi .value { font-size: 28px; font-weight: 800; letter-spacing: -0.04em; }
.kpi .label { font-size: 13px; letter-spacing: -0.005em; }
@media (hover: hover) { .kpi:hover, .lr-btn:hover { transform: translateY(-2px); } }

/* Düğmeler: basınca yaylanır */
.btn { border-radius: 14px; font-weight: 650; transition: transform 0.25s var(--spring), filter 0.2s, background 0.2s, box-shadow 0.25s; }
.btn:active { transform: scale(0.96); }
.btn.primary { background: linear-gradient(180deg, #2b7cf0, var(--blue)); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 6px 16px -6px rgba(10, 100, 224, 0.55); }
.btn.primary:hover { filter: brightness(1.06); }
.input, select.input, textarea.input { border-radius: 12px; transition: box-shadow 0.2s, border-color 0.2s; }
.input:focus { box-shadow: 0 0 0 4px rgba(10, 100, 224, 0.18); }

/* Üst çubuk ve alt menü: buzlu cam */
.topbar { background: linear-gradient(180deg, rgba(14, 28, 52, 0.92), rgba(10, 20, 40, 0.88)); -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); position: sticky; top: 0; z-index: 40; border: 0; }
.topbar .brandmark { display: flex; align-items: center; gap: 10px; }
.tabbar { margin: 0 10px calc(8px + var(--safe-b)); padding: 0; border: 1px solid var(--glass-line); border-radius: 26px; background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); box-shadow: 0 10px 40px -10px rgba(10, 20, 40, 0.35); overflow: hidden; }
.tabbar button { transition: color 0.25s, transform 0.25s var(--spring); }
.tabbar button:active { transform: scale(0.9); }
.tabbar button[aria-current='page']::before { top: 6px; height: 4px; left: 36%; right: 36%; border-radius: 4px; }
.main { padding-bottom: calc(110px + var(--safe-b)); }

/* Yan menü (masaüstü): cam */
@media (min-width: 900px) {
  .side { background: var(--glass); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px); border-right: 1px solid var(--hair); padding: 20px 12px; }
  .side .brand { display: flex; align-items: center; gap: 10px; font-size: 17px; padding: 2px 8px 18px; }
  .side button { border-radius: 12px; min-height: 42px; transition: background 0.2s, color 0.2s, transform 0.25s var(--spring); }
  .side button:active { transform: scale(0.97); }
  .side button[aria-current='page'] { background: linear-gradient(180deg, #2b7cf0, var(--blue)); color: #fff; box-shadow: 0 6px 16px -8px rgba(10, 100, 224, 0.7); }
  .main { max-width: 1040px; padding: 28px 32px 48px; }
}

/* Logo */
.logo { display: block; border-radius: 22%; box-shadow: 0 6px 18px -6px rgba(7, 26, 61, 0.55); flex: none; }

/* Pencere (sheet): aşağıdan yaylı çıkış */
.sheet-back { background: rgba(0, 0, 0, 0.38); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: fade 0.3s ease; }
.sheet { border-radius: 28px 28px 0 0; animation: spring-up 0.5s var(--spring); background: var(--paper); box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, 0.4); }
.sheet-back.out .sheet { transform: translateY(40px) scale(0.98); opacity: 0; transition: transform 0.2s ease-in, opacity 0.2s; }
.sheet-foot { background: var(--glass); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
@media (min-width: 700px) { .sheet { border-radius: 24px; animation: spring-pop 0.45s var(--spring); } }
@keyframes spring-up { from { transform: translateY(100%); } to { transform: none; } }
@keyframes spring-pop { from { transform: translateY(24px) scale(0.94); opacity: 0; } to { transform: none; opacity: 1; } }

/* Sayfa geçişi: yalnızca belirme. transform kullanılmaz; yoksa içindeki sabit (fixed) öğeler,
 * örneğin sepet çubuğu, animasyon boyunca yerinden oynar. */
.main > * { animation: page-in 0.45s ease both; }
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
::view-transition-old(root) { animation: 0.18s ease both vt-out; }
::view-transition-new(root) { animation: 0.45s var(--spring) both vt-in; }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }

/* Giriş ekranı: yavaşça kayan renk ışıkları */
.auth { position: relative; overflow: hidden; background: #060d1c; }
.auth::before, .auth::after { content: ''; position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; filter: blur(80px); opacity: 0.55; animation: aurora 18s ease-in-out infinite alternate; }
.auth::before { background: radial-gradient(circle, #1d6fe8, transparent 65%); top: -35vmax; left: -20vmax; }
.auth::after { background: radial-gradient(circle, #ffc21a, transparent 62%); bottom: -42vmax; right: -25vmax; opacity: 0.32; animation-delay: -9s; }
@keyframes aurora { to { transform: translate(8vmax, 6vmax) scale(1.15); } }
.auth-card { position: relative; z-index: 1; animation: spring-pop 0.8s var(--spring) both; }
.auth-brand { align-items: center; text-align: center; color: #fff; }
.auth-brand h1 { color: #fff; font-size: 32px; letter-spacing: -0.04em; }
.auth-brand p { color: rgba(255, 255, 255, 0.7); }
.auth-brand .logo { animation: logo-in 1s var(--spring) both; }
@keyframes logo-in { from { transform: scale(0.6) rotate(-10deg); opacity: 0; } to { transform: none; opacity: 1; } }
.auth-brand .shopname { font-size: 15px; font-weight: 650; color: rgba(255, 255, 255, 0.8); }
.auth form { background: rgba(255, 255, 255, 0.86); -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px); border: 1px solid rgba(255, 255, 255, 0.5); border-radius: 26px; padding: 24px; box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .auth form { background: rgba(28, 28, 30, 0.8); border-color: rgba(255, 255, 255, 0.1); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0s !important; transition-duration: 0.01ms !important; }
}

/* 6 sekmeli alt menü (çalışan): sığsın */
.tabbar:has(button:nth-child(6)) button { font-size: 10.5px; padding-inline: 2px; }
.tabbar:has(button:nth-child(6)) button svg { width: 22px; height: 22px; }

/* Hedef çubuğu ve kâr halkaları */
.big-num { font-size: 32px; font-weight: 800; letter-spacing: -0.04em; }
.goal-bar { position: relative; height: 12px; border-radius: 8px; background: var(--line-2, rgba(0,0,0,.06)); margin-top: 14px; overflow: hidden; }
.goal-bar span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 8px; transition: width 0.9s var(--spring); }
.goal-bar .fc { background: rgba(10, 100, 224, 0.28); }
.goal-bar .now { background: linear-gradient(90deg, #2b7cf0, #0a64e0); }
.rings { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.ring-card { text-align: center; padding: 16px 10px; }
.ring-card svg { width: 112px; height: 112px; display: block; margin: 0 auto 8px; }
.ring-card .ring-bg { fill: none; stroke: var(--line-2, rgba(0,0,0,.07)); stroke-width: 11; }
.ring-card .ring-fg { fill: none; stroke-width: 11; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset 1.1s var(--spring); }
.ring-card .ring-pct { font-size: 22px; font-weight: 800; }
.ring-card.best { box-shadow: 0 0 0 2px #ffc21a inset, var(--shadow); }
.mix-bar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; background: var(--line-2, rgba(0,0,0,.07)); }
.hist { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; margin: 14px 0 8px; align-items: end; }
.hist-col { text-align: center; }
.hist-bars { height: 110px; display: flex; align-items: flex-end; justify-content: center; gap: 4px; }
.hb { width: 14px; border-radius: 5px 5px 2px 2px; }
.hb.real { background: linear-gradient(180deg, #2b7cf0, #0a64e0); }
.hb.tgt { background: rgba(120, 130, 150, 0.35); }
