/* ═══════════════════════════════════════════════════════════════════
   SAMD — Liquid Glass dizayn sistemi (iOS 26 materialı əsasında)
   Qatlar: rəngli canlı fon → şüşə (blur + saturasiya + parlaqlıq)
           → kənar işıq (rim) → spekulyar parıltı → məzmun
   ═══════════════════════════════════════════════════════════════════ */

:root {
  --g: #97c04a;  --g-d: #4a7a14;  --g-dd: #2f520a;
  --o: #f17432;  --o-d: #d4561a;
  --red: #e5484d; --blue: #3e8ef7;

  --ink: #0e1a06;
  --ink-2: rgba(14, 26, 6, 0.62);
  --ink-3: rgba(14, 26, 6, 0.38);
  --sep: rgba(14, 26, 6, 0.08);
  --bg: #e9efe0;

  /* Şüşə materialı */
  --glass-a: rgba(255, 255, 255, 0.34);
  --glass-b: rgba(255, 255, 255, 0.10);
  --glass-strong-a: rgba(255, 255, 255, 0.62);
  --glass-strong-b: rgba(255, 255, 255, 0.36);
  --rim-hi: rgba(255, 255, 255, 1);
  --rim-lo: rgba(255, 255, 255, 0.18);
  --spec: rgba(255, 255, 255, 0.55);
  --blur: blur(18px) saturate(210%) brightness(1.08);
  --blur-strong: blur(30px) saturate(220%) brightness(1.1);
  --shadow:
    0 0.5px 1px rgba(20, 40, 5, 0.06),
    0 6px 16px rgba(20, 40, 5, 0.07),
    0 22px 48px rgba(20, 40, 5, 0.10);
  --inner:
    inset 0 1px 1px rgba(255, 255, 255, 0.65),
    inset 0 -1px 1px rgba(255, 255, 255, 0.20),
    inset 0 0 18px rgba(255, 255, 255, 0.10);

  --r-xl: 34px; --r-lg: 26px; --r-md: 18px; --r-sm: 12px;
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --soft: cubic-bezier(0.22, 1, 0.36, 1);

  --safe-t: env(safe-area-inset-top);
  --safe-b: env(safe-area-inset-bottom);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f1f6ea;
    --ink-2: rgba(241, 246, 234, 0.66);
    --ink-3: rgba(241, 246, 234, 0.40);
    --sep: rgba(255, 255, 255, 0.09);
    --bg: #070b04;
    --g-d: #a6d35a; --g-dd: #c4ea85; --o-d: #ff9a62;
    --glass-a: rgba(255, 255, 255, 0.13);
    --glass-b: rgba(255, 255, 255, 0.03);
    --glass-strong-a: rgba(60, 70, 50, 0.62);
    --glass-strong-b: rgba(30, 36, 24, 0.50);
    --rim-hi: rgba(255, 255, 255, 0.55);
    --rim-lo: rgba(255, 255, 255, 0.05);
    --spec: rgba(255, 255, 255, 0.22);
    --blur: blur(18px) saturate(180%) brightness(0.95);
    --blur-strong: blur(30px) saturate(190%) brightness(0.9);
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 30px rgba(0, 0, 0, 0.45), 0 30px 60px rgba(0, 0, 0, 0.35);
    --inner: inset 0 1px 1px rgba(255, 255, 255, 0.22), inset 0 -1px 1px rgba(255, 255, 255, 0.05), inset 0 0 20px rgba(255, 255, 255, 0.04);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; min-height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Inter", system-ui, sans-serif;
  font-size: 17px; line-height: 1.35; letter-spacing: -0.012em;
  color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
svg { display: block; flex: none; }
.hidden { display: none !important; }

/* ───────── Canlı fon: şüşənin sındırdığı rənglər ───────── */
.scene { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.scene::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 45% at 10% 0%, rgba(151, 192, 74, 0.55), transparent 70%),
    radial-gradient(50% 40% at 100% 30%, rgba(241, 116, 50, 0.38), transparent 70%),
    radial-gradient(70% 50% at 50% 110%, rgba(151, 192, 74, 0.45), transparent 70%),
    var(--bg);
}
.orb { position: absolute; border-radius: 50%; filter: blur(52px); opacity: 0.62; will-change: transform; }
.orb.o1 { width: 62vmax; height: 62vmax; left: -22vmax; top: -18vmax; background: radial-gradient(circle at 35% 35%, #b6dc6c, #6fa22c 60%, transparent 72%); animation: drift1 26s ease-in-out infinite alternate; }
.orb.o2 { width: 48vmax; height: 48vmax; right: -18vmax; top: 18vh; background: radial-gradient(circle at 40% 40%, #ffb27f, #f17432 55%, transparent 72%); animation: drift2 30s ease-in-out infinite alternate; }
.orb.o3 { width: 56vmax; height: 56vmax; left: 10vw; bottom: -30vmax; background: radial-gradient(circle at 50% 40%, #d9f0a8, #97c04a 55%, transparent 72%); animation: drift3 34s ease-in-out infinite alternate; }
.orb.o4 { width: 26vmax; height: 26vmax; left: 55vw; top: 55vh; background: radial-gradient(circle, #ffd8b8, #f59a5e 60%, transparent 72%); animation: drift2 22s ease-in-out infinite alternate-reverse; opacity: 0.6; }
@media (prefers-color-scheme: dark) {
  .scene::before { background: radial-gradient(60% 45% at 10% 0%, rgba(80, 120, 30, 0.45), transparent 70%), radial-gradient(50% 40% at 100% 30%, rgba(200, 80, 20, 0.30), transparent 70%), var(--bg); }
  .orb { opacity: 0.55; }
}
@keyframes drift1 { to { transform: translate(10vw, 12vh) scale(1.08); } }
@keyframes drift2 { to { transform: translate(-12vw, 8vh) scale(0.92); } }
@keyframes drift3 { to { transform: translate(-8vw, -10vh) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .orb { animation: none; } }

/* ───────── LIQUID GLASS materialı ───────── */
.glass {
  position: relative; isolation: isolate;
  background: linear-gradient(155deg, var(--glass-a), var(--glass-b));
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: var(--shadow), var(--inner);
}
/* Kənar işıq: işığın şüşənin qalınlığında sınması */
.glass::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  padding: 1.25px;
  background: linear-gradient(var(--rim-angle, 140deg),
    var(--rim-hi) 0%, var(--rim-lo) 28%, transparent 46%, transparent 58%, var(--rim-lo) 74%, var(--rim-hi) 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
}
/* Spekulyar parıltı: barmağın/işığın yerinə görə hərəkət edir */
.glass::after {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background:
    radial-gradient(90% 70% at var(--mx, 25%) var(--my, -10%), var(--spec), transparent 55%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.10), transparent 40%);
  mix-blend-mode: overlay;
  transition: background-position 0.4s var(--soft);
}
.glass.strong {
  background: linear-gradient(155deg, var(--glass-strong-a), var(--glass-strong-b));
  -webkit-backdrop-filter: var(--blur-strong);
  backdrop-filter: var(--blur-strong);
}
/* Rəngli (tinted) şüşə */
.glass.tint-g {
  --glass-a: rgba(140, 196, 62, 0.82); --glass-b: rgba(66, 120, 16, 0.78);
  --spec: rgba(255, 255, 255, 0.7); color: #fff;
  box-shadow: 0 10px 28px rgba(74, 122, 20, 0.40), var(--inner);
}
.glass.tint-o {
  --glass-a: rgba(255, 150, 92, 0.86); --glass-b: rgba(222, 86, 26, 0.82);
  --spec: rgba(255, 255, 255, 0.75); color: #fff;
  box-shadow: 0 12px 32px rgba(212, 86, 26, 0.42), var(--inner);
}
.glass.tint-r { --glass-a: rgba(229, 72, 77, 0.16); --glass-b: rgba(229, 72, 77, 0.06); color: var(--red); }

/* Toxunuşda "maye" sıxılma */
.press { transition: transform 0.45s var(--spring), filter 0.2s; cursor: pointer; user-select: none; -webkit-user-select: none; }
.press:active { transform: scale(0.955); filter: brightness(1.04); transition-duration: 0.12s; }

/* ───────── Tipografiya ───────── */
.large-title { font-size: 34px; line-height: 1.12; font-weight: 700; letter-spacing: -0.03em; margin: 0; }
.title-2 { font-size: 22px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.title-3 { font-size: 19px; font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.headline { font-size: 17px; font-weight: 600; }
.sub { font-size: 15px; color: var(--ink-2); }
.foot { font-size: 13px; color: var(--ink-2); }
.caps { font-size: 12.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-3); }
.num { font-variant-numeric: tabular-nums; }
.big-num { font-size: 34px; font-weight: 700; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; line-height: 1; }

/* ───────── Səhifə quruluşu ───────── */
.page { max-width: 760px; margin: 0 auto; padding: calc(var(--safe-t) + 76px) 18px calc(var(--safe-b) + 120px); }
.stack > * + * { margin-top: 14px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.section-label { padding: 18px 6px 8px; }

/* Üzən üst panel */
.navbar {
  position: fixed; z-index: 30; left: 12px; right: 12px; top: calc(var(--safe-t) + 8px);
  max-width: 736px; margin: 0 auto; height: 56px; padding: 0 8px 0 10px;
  display: flex; align-items: center; gap: 10px; border-radius: 999px;
}
.navbar .logo { width: 38px; height: 38px; border-radius: 50%; background: #fff; padding: 2px; object-fit: contain; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.navbar .t { flex: 1; min-width: 0; }
.navbar .t b { display: block; font-size: 15px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.navbar .t span { display: block; font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.icon-btn { width: 42px; height: 42px; border-radius: 50%; border: 0; display: grid; place-items: center; background: transparent; color: var(--ink); }
.icon-btn.glass { background: linear-gradient(155deg, var(--glass-a), var(--glass-b)); }

/* ───────── Kartlar ───────── */
.card { border-radius: var(--r-lg); padding: 18px; }
.card.xl { border-radius: var(--r-xl); padding: 24px; }
.stat { border-radius: var(--r-lg); padding: 16px 14px; }
.stat .l { font-size: 13px; color: var(--ink-2); margin-top: 6px; font-weight: 500; }
.stat .ic { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 12px; }
.ic.g { background: rgba(151, 192, 74, 0.25); color: var(--g-d); }
.ic.o { background: rgba(241, 116, 50, 0.20); color: var(--o-d); }
.ic.r { background: rgba(229, 72, 77, 0.16); color: var(--red); }
.ic.b { background: rgba(62, 142, 247, 0.16); color: var(--blue); }
.ic.n { background: rgba(127, 127, 127, 0.14); color: var(--ink-2); }

/* iOS üslubunda qruplaşdırılmış siyahı */
.list { border-radius: var(--r-lg); overflow: hidden; }
.list .li { display: flex; align-items: center; gap: 12px; padding: 13px 16px; min-height: 58px; position: relative; }
.list .li + .li::before { content: ""; position: absolute; top: 0; right: 0; left: 58px; height: 0.5px; background: var(--sep); }
.list .li.no-ic + .li.no-ic::before, .list .li.no-ic::before { left: 16px; }
.list .li .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; }
.list .li .main { flex: 1; min-width: 0; }
.list .li .main b { display: block; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list .li .main span { display: block; font-size: 13.5px; color: var(--ink-2); margin-top: 1px; }
.list .li .trail { text-align: right; font-size: 15px; color: var(--ink-2); }
.list .li.tap { cursor: pointer; transition: background 0.2s; }
.list .li.tap:active { background: rgba(127, 127, 127, 0.12); }
.empty { padding: 26px 16px; text-align: center; color: var(--ink-2); font-size: 15px; }

/* Nişan (pill) */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pill.g { background: rgba(151, 192, 74, 0.24); color: var(--g-d); }
.pill.o { background: rgba(241, 116, 50, 0.18); color: var(--o-d); }
.pill.r { background: rgba(229, 72, 77, 0.15); color: var(--red); }
.pill.b { background: rgba(62, 142, 247, 0.15); color: var(--blue); }
.pill.n { background: rgba(127, 127, 127, 0.15); color: var(--ink-2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.dot.g { background: #5fb30f; box-shadow: 0 0 0 3px rgba(95, 179, 15, 0.2); }
.dot.o { background: var(--o); }
.dot.r { background: var(--red); }
.dot.n { background: var(--ink-3); }

/* ───────── Düymələr ───────── */
.btn {
  height: 54px; padding: 0 22px; border: 0; border-radius: 999px; width: 100%;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 17px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink);
}
.btn.sm { height: 38px; padding: 0 14px; font-size: 15px; width: auto; }
.btn.md { height: 46px; font-size: 16px; }
.btn.danger { color: var(--red); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }

/* ───────── Form ───────── */
.field { display: block; }
.field > span { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); margin: 0 4px 6px; }
.input {
  width: 100%; height: 52px; padding: 0 16px; border-radius: 16px; outline: none; font-size: 17px;
  border: 0; color: var(--ink);
  background: rgba(255, 255, 255, 0.40);
  box-shadow: inset 0 1px 3px rgba(20, 40, 5, 0.10), inset 0 0 0 0.5px rgba(20, 40, 5, 0.10), 0 1px 0 rgba(255, 255, 255, 0.7);
  -webkit-appearance: none; appearance: none;
  transition: box-shadow 0.25s, background 0.25s;
}
@media (prefers-color-scheme: dark) { .input { background: rgba(0, 0, 0, 0.25); box-shadow: inset 0 1px 3px rgba(0,0,0,0.4), inset 0 0 0 0.5px rgba(255,255,255,0.12); } }
.input:focus { background: rgba(255, 255, 255, 0.62); box-shadow: inset 0 0 0 2px rgba(151, 192, 74, 0.85), 0 0 0 5px rgba(151, 192, 74, 0.18); }
@media (prefers-color-scheme: dark) { .input:focus { background: rgba(0, 0, 0, 0.35); } }
select.input { background-image: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
[data-days].chips { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
[data-days] .chip { min-width: 0; padding: 0; font-size: 13px; }
.chip { height: 36px; min-width: 44px; padding: 0 12px; border-radius: 999px; border: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); background: rgba(127, 127, 127, 0.12); transition: all 0.3s var(--spring); }
.chip.on { color: #fff; background: linear-gradient(155deg, #8cc43e, #4a7a14); box-shadow: 0 4px 12px rgba(74, 122, 20, 0.35), inset 0 1px 0 rgba(255,255,255,0.4); }

/* ───────── Seqmentli idarə ───────── */
.segmented { position: relative; display: flex; padding: 4px; border-radius: 999px; }
.segmented button { position: relative; z-index: 1; flex: 1; height: 38px; border: 0; background: none; border-radius: 999px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); transition: color 0.3s; }
.segmented button.on { color: var(--ink); }
.segmented .thumb {
  position: absolute; z-index: 0; top: 4px; bottom: 4px; border-radius: 999px;
  background: linear-gradient(155deg, rgba(255,255,255,0.95), rgba(255,255,255,0.7));
  box-shadow: 0 3px 10px rgba(20, 40, 5, 0.14), inset 0 1px 0 #fff;
  transition: left 0.5s var(--spring), width 0.5s var(--spring);
}
@media (prefers-color-scheme: dark) { .segmented .thumb { background: linear-gradient(155deg, rgba(255,255,255,0.28), rgba(255,255,255,0.14)); box-shadow: inset 0 1px 0 rgba(255,255,255,0.3); } }

/* ───────── Üzən tab bar (iOS 26) ───────── */
.tabbar {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--safe-b) + 14px);
  display: flex; padding: 5px; border-radius: 999px; max-width: calc(100vw - 24px);
}
.tabbar button {
  position: relative; z-index: 1; border: 0; background: none; color: var(--ink);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  min-width: 70px; height: 56px; padding: 0 10px; border-radius: 999px;
  font-size: 10.5px; font-weight: 600; transition: color 0.3s;
}
.tabbar button.on { color: var(--g-d); }
.tabbar .lens {
  position: absolute; z-index: 0; top: 5px; bottom: 5px; border-radius: 999px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.75), rgba(255, 255, 255, 0.35));
  box-shadow: inset 0 1px 1px #fff, inset 0 -1px 1px rgba(255,255,255,0.4), 0 2px 10px rgba(20, 40, 5, 0.12);
  transition: left 0.55s var(--spring), width 0.55s var(--spring), transform 0.3s var(--spring);
}
@media (prefers-color-scheme: dark) { .tabbar .lens { background: linear-gradient(155deg, rgba(255,255,255,0.22), rgba(255,255,255,0.08)); box-shadow: inset 0 1px 1px rgba(255,255,255,0.35); } }
.tabbar:active .lens { transform: scale(1.06); }

/* ───────── Alt vərəq (sheet) ───────── */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.28); opacity: 0; transition: opacity 0.35s; pointer-events: none; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 41; left: 8px; right: 8px; bottom: calc(var(--safe-b) + 8px);
  max-width: 600px; margin: 0 auto; max-height: calc(100vh - var(--safe-t) - 40px); overflow: auto;
  border-radius: 38px; padding: 10px 20px 22px;
  transform: translateY(calc(100% + 40px)); transition: transform 0.55s var(--spring);
}
.sheet.on { transform: translateY(0); }
.sheet .grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--ink-3); margin: 0 auto 12px; opacity: 0.6; }

/* ───────── Bildiriş (Dynamic Island üslubu) ───────── */
.toast {
  position: fixed; z-index: 60; left: 50%; top: calc(var(--safe-t) + 10px);
  transform: translate(-50%, -140%) scale(0.9); opacity: 0;
  display: flex; align-items: center; gap: 10px; min-height: 48px; max-width: calc(100vw - 32px);
  padding: 10px 18px 10px 12px; border-radius: 999px; font-size: 15px; font-weight: 600;
  transition: transform 0.6s var(--spring), opacity 0.3s;
}
.toast.on { transform: translate(-50%, 0) scale(1); opacity: 1; }
.toast .ti { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; color: #fff; flex: none; }
.toast.ok .ti { background: #5fb30f; }
.toast.err .ti { background: var(--red); }
.toast.info .ti { background: var(--blue); }

/* ───────── Yükləmə ───────── */
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid rgba(127,127,127,0.25); border-top-color: var(--g-d); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.splash { min-height: 100vh; display: grid; place-items: center; }

/* Görünmə animasiyası */
.rise { animation: rise 0.6s var(--soft) both; }
.rise:nth-child(2) { animation-delay: 0.04s; } .rise:nth-child(3) { animation-delay: 0.08s; }
.rise:nth-child(4) { animation-delay: 0.12s; } .rise:nth-child(5) { animation-delay: 0.16s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(0.98); } }

/* Loqo nişanı */
.app-mark { width: 92px; height: 92px; border-radius: 28px; display: grid; place-items: center; margin: 0 auto; }
.app-mark img { width: 72px; height: 72px; border-radius: 20px; }

/* Masaüstü (admin) */
@media (min-width: 900px) {
  .page { max-width: 1040px; }
  .grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
}

/* ───────── Çap: yalnız QR plakatı ───────── */
#print-area { display: none; }
@media print {
  .scene, #app, .toast, .sheet, .scrim { display: none !important; }
  body { background: #fff; color: #000; }
  #print-area { display: block; text-align: center; padding-top: 1.5cm; font-family: -apple-system, system-ui, sans-serif; }
  #print-area .plogo { width: 4cm; height: 4cm; }
  #print-area h1 { font-size: 28pt; color: #f17432; margin: 0.4cm 0 0.2cm; }
  #print-area p { font-size: 16pt; margin: 0 0 0.6cm; }
  #print-area .pqr { width: 12cm; height: 12cm; image-rendering: pixelated; }
}
