:root {
  --paper: #F4F8F7; --card: #FFFFFF; --ink: #0B2A2F; --muted: #4F6B70;
  --teal: #0A7C86; --on-teal: #FFFFFF; --saffron: #FFB81C; --line: #D3E3E2;
  --tg: #1A7DB5; --danger: #B3261E; --danger-bg: #FBE9E7; --ok: #1B7F4B; --ok-bg: #E4F4EA;
  --radius: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0A1A1D; --card: #102629; --ink: #E8F3F2; --muted: #9DB8BB;
    --teal: #35B6C0; --on-teal: #062428; --line: #1F3B3F; --tg: #2A93CE;
    --danger: #FF9C93; --danger-bg: #3A1F1D; --ok: #7FD9A6; --ok-bg: #12301F;
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink); line-height: 1.55;
  font-family: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}
a { color: var(--teal); }
h1, h2, h3 { line-height: 1.1; letter-spacing: -0.03em; margin: 0; }
:focus-visible { outline: 3px solid var(--saffron); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 20px; }
.muted { color: var(--muted); }

/* sarlavha */
.bar { display: flex; align-items: center; justify-content: space-between; padding-top: 18px; padding-bottom: 18px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.4rem; letter-spacing: -0.03em; color: var(--ink); text-decoration: none; }
.mark, .finish {
  background: conic-gradient(var(--ink) 25%, var(--card) 0 50%, var(--ink) 0 75%, var(--card) 0) 0 0 / 50% 50%;
  border: 2px solid var(--ink);
}
.mark { width: 22px; height: 22px; display: inline-block; }

/* tugmalar */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px;
  border: 2px solid var(--teal); border-radius: 12px; background: var(--teal); color: var(--on-teal);
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer;
}
.btn:hover { filter: brightness(1.06); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-tg { background: var(--tg); border-color: var(--tg); color: #fff; }
.btn-small { min-height: 38px; padding: 0 14px; font-size: .95rem; }
.btn-block { width: 100%; }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--danger); }

/* bosh sahifa */
.hero { padding-top: 48px; padding-bottom: 24px; }
.hero h1 { font-size: clamp(2.3rem, 8vw, 4.4rem); font-weight: 800; letter-spacing: -0.045em; max-width: 15ch; line-height: .98; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 52ch; margin: 20px 0 28px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; }

.track { position: relative; height: 72px; margin-top: 56px; }
.lane { position: absolute; left: 0; right: 52px; top: 50%; border-top: 3px dashed var(--line); }
.runner {
  position: absolute; top: -13px; left: 0; width: 24px; height: 24px; margin-left: -12px; border-radius: 50%;
  background: var(--saffron); border: 3px solid var(--ink); transition: left 1.1s cubic-bezier(.2,.8,.2,1);
}
.finish { position: absolute; right: 0; top: 50%; width: 44px; height: 44px; margin-top: -22px; }
.track-note { margin: 6px 0 0; font-weight: 600; }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 32px; padding-top: 56px; padding-bottom: 56px; }
.feature { border-top: 3px solid var(--ink); padding-top: 16px; }
.feature h3 { font-size: 1.3rem; margin-bottom: 8px; }
.feature p { margin: 0 0 12px; color: var(--muted); }
.tag { display: inline-block; font-size: .85rem; font-weight: 700; padding: 2px 10px; border-radius: 99px; background: var(--saffron); color: #2A1D00; }
.foot { padding-bottom: 32px; color: var(--muted); font-size: .95rem; }
.foot::before { content: ""; display: block; border-top: 1px solid var(--line); margin-bottom: 24px; }

/* kirish */
.auth { padding-top: 24px; padding-bottom: 56px; }
.auth-card { max-width: 440px; margin: 0 auto; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.auth-card h1 { font-size: 2rem; margin-bottom: 6px; }
.sub { margin: 0 0 20px; color: var(--muted); }
.hint { margin: 10px 0 0; font-size: .92rem; color: var(--muted); }
.divider { display: flex; align-items: center; gap: 12px; margin: 22px 0; color: var(--muted); font-size: .92rem; }
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
form { display: grid; gap: 12px; }
label { font-weight: 600; }
input[type=email], input[type=text] {
  width: 100%; min-height: 48px; padding: 0 14px; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--paper); border: 2px solid var(--line); border-radius: 10px;
}
input.code { text-align: center; font-size: 1.7rem; font-weight: 700; letter-spacing: .4em; }
.msg { padding: 10px 14px; border-radius: 10px; margin-bottom: 16px; border-left: 4px solid; }
.msg.err { background: var(--danger-bg); border-color: var(--danger); color: var(--danger); }
.msg.ok { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); }
.linkbtn { background: none; border: 0; padding: 4px 0; font: inherit; color: var(--teal); text-decoration: underline; cursor: pointer; justify-self: start; }

/* kabinet va admin */
.dash, .admin { padding-top: 16px; padding-bottom: 64px; }
.profile { display: flex; align-items: center; gap: 16px; margin: 16px 0 36px; }
.profile h1 { font-size: clamp(1.7rem, 5vw, 2.4rem); }
.avatar { width: 60px; height: 60px; border-radius: 50%; object-fit: cover; flex: none; background: var(--teal); color: var(--on-teal); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; font-size: 1.4rem; }
.dash h2, .admin h2 { font-size: 1.3rem; margin: 32px 0 12px; }
.roadmap { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.roadmap li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; margin: 0; }
dt { color: var(--muted); }
dd { margin: 0; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 1.9rem; letter-spacing: -0.03em; }
.stat span { color: var(--muted); font-size: .92rem; }
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.bar-col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; gap: 4px; font-size: .85rem; }
.bar-fill { width: 100%; max-width: 44px; min-height: 3px; background: var(--teal); border-radius: 6px 6px 0 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table { width: 100%; border-collapse: collapse; min-width: 640px; font-size: .95rem; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
.pill { font-size: .8rem; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--line); }
.pill.bad { background: var(--danger-bg); color: var(--danger); }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
