/* Ranglar qizlar.raqamliavlod.uz saytidan: pushti → binafsha → moviy gradient, och lilac fon, qora tugmalar */
:root {
  --pink: #ec4899;
  --magenta: #d946ef;
  --purple: #a855f7;
  --violet: #8b5cf6;
  --cyan: #06b6d4;
  --sky: #38bdf8;
  --ink: #111827;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #ece7f5;
  --card: rgba(255, 255, 255, .86);
  --bg: #fbf7ff;
  --grad: linear-gradient(90deg, #ec4899 0%, #a855f7 50%, #06b6d4 100%);
  --grad-soft: linear-gradient(135deg, #fde7f3 0%, #f3e8ff 50%, #e0f7fd 100%);
  --radius: 18px;
  --shadow: 0 10px 30px -12px rgba(168, 85, 247, .25), 0 2px 6px rgba(17, 24, 39, .04);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  background-image:
    linear-gradient(rgba(168, 85, 247, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(168, 85, 247, .05) 1px, transparent 1px);
  background-size: 34px 34px;
  min-height: 100vh;
  display: flex; flex-direction: column;
  font-size: 15px; line-height: 1.5;
}
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-blobs span { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55; }
.bg-blobs .b1 { width: 420px; height: 420px; background: #93c5fd; left: -140px; top: -120px; }
.bg-blobs .b2 { width: 520px; height: 520px; background: #fbcfe8; right: -160px; top: 25%; }
.bg-blobs .b3 { width: 460px; height: 460px; background: #a5f3fc; left: 30%; bottom: -260px; opacity: .45; }

a { color: var(--violet); text-decoration: none; }
a:hover { color: var(--pink); }

/* ---- Topbar ---- */
.topbar {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 32px; position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .72); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: flex-end; gap: 6px; color: var(--ink); font-weight: 800; line-height: .95; letter-spacing: -.02em; }
.brand-cloud { font-size: 15px; padding: 6px 10px 5px; border-radius: 14px; background: linear-gradient(135deg, #dbeafe, #fce7f3); }
.brand-tag { background: var(--pink); color: #fff; font-family: ui-monospace, Menlo, monospace; font-size: 12px; font-weight: 600; padding: 2px 6px; margin-bottom: 2px; }
.mainnav { display: flex; gap: 4px; flex-wrap: wrap; }
.mainnav a { color: var(--text); font-weight: 500; padding: 8px 14px; border-radius: 999px; font-size: 14px; }
.mainnav a:hover { background: #f5f0ff; color: var(--violet); }
.mainnav a.active { background: var(--ink); color: #fff; }
.userbox { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; font-size: 14px; }
.who small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 700; }

.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 28px 24px 48px; flex: 1; }
.footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 18px 32px; color: var(--muted); font-size: 13px; border-top: 1px solid var(--line); background: rgba(255,255,255,.6); }

/* ---- Typography ---- */
h1, h2, h3 { color: var(--ink); letter-spacing: -.02em; margin: 0 0 12px; }
h1 { font-size: 30px; font-weight: 800; }
h2 { font-size: 21px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }

/* ---- Hero (public) ---- */
.hero { text-align: center; padding: 26px 0 30px; }
.hero h1 { font-size: clamp(34px, 6vw, 60px); font-weight: 900; line-height: 1.02; margin: 0; }
.hero h1 .l1 { background: linear-gradient(90deg, #c084fc, #7dd3fc); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero h1 .l2 { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero .bar { width: 160px; height: 4px; border-radius: 4px; background: var(--grad); margin: 14px auto; }
.hero .tagline { color: var(--purple); letter-spacing: .14em; font-size: 18px; font-weight: 400; margin: 0; }
.hero .sub { color: var(--muted); margin: 10px 0 0; font-weight: 600; }

/* ---- Cards ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px; backdrop-filter: blur(6px); }
.card > h2:first-child, .card > h3:first-child { margin-top: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.stat::before { content: ''; position: absolute; left: 0; top: 0; height: 4px; width: 100%; background: var(--grad); }
.stat .num { font-size: 30px; font-weight: 800; color: var(--ink); }
.stat .lbl { color: var(--muted); font-size: 13px; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: 14px;
  padding: 10px 18px; border-radius: 12px; background: #fff; color: var(--ink); border: 1px solid var(--line); transition: .15s; white-space: nowrap; }
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(17,24,39,.35); color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-dark:hover { color: #fff; }
.btn-grad { background: var(--grad); color: #fff; border: 0; border-radius: 999px; padding: 12px 24px; box-shadow: 0 10px 26px -10px rgba(217, 70, 239, .7); }
.btn-grad:hover { color: #fff; }
.btn-danger { background: #fff1f3; color: #be123c; border-color: #fecdd3; }
.btn-danger:hover { color: #be123c; }
.btn-sm { padding: 6px 12px; font-size: 13px; border-radius: 10px; }
.btn-xs { padding: 3px 9px; font-size: 12px; border-radius: 8px; }
.actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---- Forms ---- */
label { font-weight: 600; font-size: 13px; color: var(--text); display: block; margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #e5def3; border-radius: 12px; background: #fff; color: var(--text); outline: none; transition: .15s; }
input:focus, select:focus, textarea:focus { border-color: var(--purple); box-shadow: 0 0 0 4px rgba(168, 85, 247, .14); }
textarea { min-height: 90px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; }
.form-row { margin-bottom: 14px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 16px; }
.filters > div { min-width: 170px; }
.filters input[type=search] { min-width: 240px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.help { color: var(--muted); font-size: 12px; margin-top: 4px; }

/* ---- Tables ---- */
.table-wrap { overflow-x: auto; border-radius: 14px; border: 1px solid var(--line); background: #fff; }
table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
.t th { text-align: left; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: #faf7ff; padding: 11px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.t td { padding: 10px 12px; border-bottom: 1px solid #f3eff9; vertical-align: middle; }
.t tr:last-child td { border-bottom: 0; }
.t tr:hover td { background: #fdfbff; }
.t .num { text-align: center; font-variant-numeric: tabular-nums; }
.t .total { font-weight: 800; color: var(--ink); font-size: 15px; }
.nowrap { white-space: nowrap; }

.rank { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 800; background: #f3f0fa; color: var(--ink); }
.rank.r1 { background: linear-gradient(135deg, #fde68a, #f59e0b); color: #fff; }
.rank.r2 { background: linear-gradient(135deg, #e5e7eb, #9ca3af); color: #fff; }
.rank.r3 { background: linear-gradient(135deg, #fed7aa, #ea580c); color: #fff; }
.rank.top { background: var(--grad); color: #fff; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #f3f0fa; color: var(--violet); white-space: nowrap; }
.badge.d1 { background: #fce7f3; color: #be185d; }
.badge.d2 { background: #ede9fe; color: #6d28d9; }
.badge.d3 { background: #dcfce7; color: #15803d; }
.badge.d4 { background: #cffafe; color: #0e7490; }
.badge.ok { background: #dcfce7; color: #15803d; }
.badge.wait { background: #fef3c7; color: #a16207; }
.badge.lock { background: #111827; color: #fff; }
.badge.off { background: #f3f4f6; color: #6b7280; }

.progress { height: 8px; background: #f1ecf9; border-radius: 99px; overflow: hidden; min-width: 70px; }
.progress span { display: block; height: 100%; background: var(--grad); border-radius: 99px; }

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.tabs a { padding: 8px 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: 14px; }
.tabs a.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---- Alerts ---- */
.alert { padding: 12px 16px; border-radius: 14px; margin-bottom: 16px; font-weight: 500; border: 1px solid; }
.alert-ok { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.alert-err { background: #fff1f2; border-color: #fecdd3; color: #9f1239; }
.alert-info { background: #f5f3ff; border-color: #ddd6fe; color: #5b21b6; }

/* ---- Login ---- */
.login-wrap { min-height: calc(100vh - 220px); display: grid; place-items: center; }
.login-card { width: 100%; max-width: 420px; }
.login-card h1 { text-align: center; }

/* ---- Scoring form ---- */
.p-head { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.p-head .info { flex: 1; min-width: 260px; }
.p-head .meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.project { background: var(--grad-soft); border-radius: 14px; padding: 14px 16px; margin-top: 14px; white-space: pre-line; max-height: 220px; overflow: auto; font-size: 14px; }
.crit { border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 14px; background: #fff; display: grid; grid-template-columns: 1fr 210px; gap: 18px; }
.crit h3 { display: flex; gap: 10px; align-items: baseline; }
.crit h3 .n { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center; font-size: 13px; }
.crit .desc { color: var(--muted); font-size: 13px; margin: 0 0 10px; }
.levels { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.levels li { font-size: 13px; padding: 8px 10px; border-radius: 10px; background: #faf7ff; border-left: 3px solid var(--purple); cursor: pointer; }
.levels li:hover { background: #f3ecff; }
.levels li b { color: var(--ink); }
.score-box { background: var(--grad-soft); border-radius: 14px; padding: 14px; align-self: start; position: sticky; top: 90px; }
.score-box input[type=number] { font-size: 28px; font-weight: 800; text-align: center; padding: 8px; }
.score-box .max { text-align: center; color: var(--muted); font-size: 13px; margin-top: 6px; }
.score-box textarea { min-height: 60px; font-size: 13px; margin-top: 10px; }
.sumbar { position: sticky; bottom: 0; background: rgba(255,255,255,.95); backdrop-filter: blur(10px); border: 1px solid var(--line); border-radius: 16px; padding: 14px 18px; display: flex; justify-content: space-between; align-items: center; gap: 12px; box-shadow: var(--shadow); flex-wrap: wrap; }
.sumbar .sum { font-size: 22px; font-weight: 800; color: var(--ink); }
.locked-note { display: flex; gap: 10px; align-items: center; }

@media (max-width: 860px) {
  .topbar { flex-wrap: wrap; padding: 12px 16px; gap: 12px; }
  .mainnav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .crit { grid-template-columns: 1fr; }
  .score-box { position: static; }
  .container { padding: 20px 14px 40px; }
}

/* Toifa statistikasi */
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(92px, 1fr)); gap: 10px; }
.mini-stats div { background: var(--grad-soft); border-radius: 12px; padding: 10px 12px; }
.mini-stats b { display: block; font-size: 22px; font-weight: 800; color: var(--ink); line-height: 1.1; }
.mini-stats span { font-size: 12px; color: var(--muted); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 480px), 1fr)); gap: 20px; margin-bottom: 20px; }
.cat-grid .card { margin-bottom: 0; min-width: 0; }
.cat-card .mini-stats { grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
.cat-card .t th, .cat-card .t td { padding: 8px 10px; }
.cat-card .t th { font-size: 11px; }
.danger-zone { border-color: #fecdd3; background: #fffafb; }
.danger-zone h2 { color: #be123c; }

/* Ta'lim muassasasi — o'sha joyda tahrirlash */
.school-edit { cursor: pointer; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; display: inline-flex; align-items: center; gap: 6px; transition: background .15s; }
.school-edit:hover { background: #f3ecff; }
.school-edit .pen { opacity: 0; color: var(--purple); font-size: 12px; transition: opacity .15s; }
.school-edit:hover .pen { opacity: 1; }
.school-edit.saved { background: #dcfce7; }
.school-edit.need { background: #fff7ed; outline: 1px dashed #f59e0b; }
.school-edit.need .pen { opacity: 1; }
.school-edit.editing { cursor: default; background: transparent; }
.school-form { display: inline-flex; gap: 4px; align-items: center; }
.school-form input { width: 230px; padding: 5px 8px; font-size: 13px; border-radius: 8px; }
.school-form button { border: 0; border-radius: 8px; width: 30px; height: 30px; cursor: pointer; font-size: 15px; font-weight: 700; }
.school-form .ok { background: #16a34a; color: #fff; }
.school-form .no { background: #f3f4f6; color: #6b7280; }
.school-form.busy { opacity: .5; pointer-events: none; }

/* Maktablar statistikasi */
.school-t details summary { cursor: pointer; list-style: none; }
.school-t details summary::-webkit-details-marker { display: none; }
.school-t details summary::before { content: '▸'; display: inline-block; width: 14px; color: var(--muted); transition: transform .15s; }
.school-t details[open] summary::before { transform: rotate(90deg); }
.school-list { margin: 8px 0 4px 14px; padding: 0; list-style: none; font-size: 13px; }
.school-list li { padding: 3px 0; border-bottom: 1px dashed var(--line); }
.school-list li:last-child { border-bottom: 0; }
.others-row td { background: #fafafa; }
.others-row td:first-child { border-left: 3px solid #d1d5db; }

/* Bahoni o'zgartirish so'rovlari */
.nav-count { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 999px; background: #e11d48; color: #fff; font-size: 11px; font-weight: 700; line-height: 18px; text-align: center; }
.req-card textarea { width: 100%; min-height: 70px; }

/* Qatnashuv (davomat) belgisi */
.attend { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; padding: 3px 9px 3px 5px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font-size: 12px; font-weight: 600; color: #6b7280; transition: background .15s, border-color .15s, color .15s; }
.attend:hover { border-color: #c4b5fd; }
.attend input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.attend .att-box { width: 18px; height: 18px; border-radius: 5px; border: 2px solid #d1d5db; background: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; transition: all .15s; }
.attend.on { background: #dcfce7; border-color: #86efac; color: #15803d; }
.attend.on .att-box { background: #16a34a; border-color: #16a34a; }
.attend.on .att-box::after { content: '✓'; color: #fff; font-size: 12px; font-weight: 800; line-height: 1; }
.attend input:focus-visible + .att-box { outline: 2px solid var(--purple); outline-offset: 2px; }
.attend.busy { opacity: .55; pointer-events: none; }
