/* Рангҳо аз APK гирифта шудаанд: градиент #7965ac→#376bfc, корт #24263d, тугма #4073fd, профил #220031 */
:root {
  --bg1: #7965ac; --bg2: #376bfc;
  --card: #24263d; --deep: #220031; --btn: #4073fd; --sel: #5e1263;
  --white: #fff; --muted: #aaaaaa; --rating: #747475; --line: rgba(255,255,255,.18);
  --ok: #3ddc84; --warn: #ffb84d; --bad: #ff6b6b;
  --nav-h: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: Roboto, "Segoe UI", system-ui, -apple-system, "Noto Sans", Arial, sans-serif;
  color: var(--white); background: #376bfc;
  background: linear-gradient(45deg, var(--bg1), var(--bg2) 60%, var(--bg2)) fixed;
  min-height: 100vh; font-size: 16px; line-height: 1.4;
}
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input { font: inherit; }
a { color: inherit; }
.hidden { display: none !important; }

/* ---------- Логин ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 24px 16px; }
.login-box { width: 100%; max-width: 420px; min-width: 0; text-align: center; }
.login-logo { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 8px 28px rgba(0,0,0,.3); margin-bottom: 18px; }
.login h1 { margin: 0 0 4px; font-size: 28px; letter-spacing: .2em; text-transform: uppercase; font-weight: 700; }
.login .uni { margin: 0 0 28px; font-size: 13px; opacity: .85; }
.field { display: flex; align-items: center; gap: 10px; border-bottom: 2px solid rgba(255,255,255,.7); padding: 6px 8px; margin: 14px 0; }
.field svg { flex: none; width: 24px; height: 24px; opacity: .9; }
.field input { flex: 1; min-width: 0; width: 100%; background: transparent; border: 0; outline: 0; color: #fff; font-size: 19px; padding: 8px 0; }
.field input::placeholder { color: rgba(255,255,255,.75); }
.field:focus-within { border-bottom-color: #fff; }
.field .eye { padding: 4px; opacity: .85; }
.btn-login { margin-top: 26px; background: var(--btn); color: #fff; border-radius: 200px; padding: 12px 44px; font-size: 20px; font-weight: 700; letter-spacing: .06em; transition: transform .1s, opacity .2s; }
.btn-login:hover { filter: brightness(1.1); }
.btn-login:active { transform: scale(.97); }
.btn-login[disabled] { opacity: .6; cursor: progress; }
.login-err { min-height: 22px; margin-top: 14px; color: #ffd1d1; font-size: 15px; }
.login .lang-row { margin-top: 24px; display: flex; gap: 8px; justify-content: center; }

.spinner { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: spin .8s linear infinite; margin: 36px auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Қолаби асосӣ ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 14px 16px calc(var(--nav-h) + 28px); }
.nav { position: fixed; left: 0; right: 0; bottom: 0; height: var(--nav-h); background: var(--card); display: flex; justify-content: space-around; z-index: 20; padding-bottom: env(safe-area-inset-bottom); box-sizing: content-box; box-shadow: 0 -4px 18px rgba(0,0,0,.25); }
.nav button { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 12px; color: rgba(255,255,255,.55); transition: color .15s; }
.nav button svg { width: 26px; height: 26px; }
.nav button.on { color: #fff; }
.nav button.on svg { filter: drop-shadow(0 0 6px rgba(120,150,255,.9)); }
.brand { display: none; }

@media (min-width: 900px) {
  .shell { flex-direction: row; }
  .nav { position: sticky; top: 0; height: 100vh; width: 250px; flex-direction: column; justify-content: flex-start; gap: 6px; padding: 22px 14px; box-sizing: border-box; box-shadow: 4px 0 24px rgba(0,0,0,.25); }
  .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 22px; font-weight: 700; letter-spacing: .12em; font-size: 15px; }
  .brand img { width: 40px; height: 40px; border-radius: 10px; }
  .nav button { flex: none; flex-direction: row; justify-content: flex-start; gap: 14px; padding: 13px 14px; border-radius: 12px; font-size: 16px; }
  .nav button.on { background: rgba(255,255,255,.1); }
  .nav .spacer { flex: 1; }
  .main { padding: 28px 32px 40px; max-width: 860px; }
}
.nav .spacer { display: none; }
@media (min-width: 900px) { .nav .spacer { display: block; flex: 1; } }

/* ---------- Сарлавҳа ва блокҳо ---------- */
.top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 6px 0 16px; }
.top h2 { margin: 0; font-size: 30px; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; }
.top .tools { display: flex; align-items: center; gap: 8px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.12); transition: background .15s; }
.icon-btn:hover { background: rgba(255,255,255,.22); }
.icon-btn svg { width: 24px; height: 24px; }
.flag { width: 30px; height: 20px; border-radius: 3px; display: block; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.sem-chip { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.12); border-radius: 999px; padding: 8px 14px; font-size: 14px; margin-bottom: 14px; }

.list { display: grid; gap: 12px; }
.item { width: 100%; text-align: left; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: var(--card); border-radius: 12px; padding: 14px 18px; transition: transform .12s, opacity .12s, box-shadow .12s; }
.item:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(0,0,0,.25); }
.item:active { opacity: .45; }
.item .t { font-size: 19px; }
.item .s { color: var(--rating); margin-top: 3px; font-size: 15px; }
.item .l { min-width: 0; }
.badge { flex: none; min-width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-size: 19px; font-weight: 700; background: rgba(255,255,255,.1); }

.ring { position: relative; width: 70px; height: 70px; flex: none; }
.ring svg { width: 70px; height: 70px; transform: rotate(-90deg); }
.ring .bg { stroke: rgba(255,255,255,.12); }
.ring .fg { stroke: url(#ringGrad); stroke-linecap: round; transition: stroke-dashoffset .8s ease; }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 19px; }

.empty { text-align: center; padding: 70px 10px; font-size: 20px; opacity: .9; }

/* ---------- Тафсилот ---------- */
.detail-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.detail-top h2 { margin: 0; font-size: 22px; line-height: 1.25; }
.panel { background: var(--deep); border-radius: 15px; padding: 6px 0; margin-bottom: 16px; overflow: hidden; }
.panel .head { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px 10px; font-size: 18px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.panel .head .v { color: #fff; font-size: 22px; }
.row { display: flex; justify-content: space-between; align-items: center; padding: 11px 20px; border-top: 1px solid var(--line); font-size: 17px; }
.row .v { color: var(--muted); font-size: 16px; }
.row.max .v b { color: #fff; }
.summary { background: var(--card); border-radius: 15px; padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; font-size: 19px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.summary + .summary { margin-top: 12px; }
.summary .v { font-size: 26px; }
.mark { display: inline-grid; place-items: center; min-width: 36px; height: 36px; padding: 0 8px; border-radius: 10px; background: var(--btn); margin-left: 8px; font-size: 20px; }

/* Давомот */
.absent-total { background: var(--card); border-radius: 15px; padding: 16px 20px; margin-bottom: 14px; }
.absent-total .top-l { display: flex; justify-content: space-between; align-items: baseline; font-size: 17px; }
.absent-total .top-l b { font-size: 28px; }
.bar { height: 10px; border-radius: 6px; background: rgba(255,255,255,.12); margin-top: 12px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, #3769f5, #8f7cff); transition: width .6s ease; }
.bar i.warn { background: linear-gradient(90deg, #ffb84d, #ff8a4d); }
.bar i.bad { background: linear-gradient(90deg, #ff8a4d, #ff4d6a); }
.legend { display: flex; gap: 14px; padding: 4px 20px 10px; font-size: 13px; color: var(--muted); }

/* Профил */
.profile-head { background: var(--deep); border-radius: 12px; padding: 20px; display: flex; gap: 14px; align-items: flex-start; margin-bottom: 16px; }
.avatar { width: 64px; height: 64px; flex: none; border-radius: 50%; background: linear-gradient(135deg, #7965ac, #376bfc); display: grid; place-items: center; font-size: 26px; font-weight: 700; }
.profile-head .n { font-size: 20px; }
.profile-head .r { color: var(--rating); margin-top: 8px; }
.facts { background: var(--deep); border-radius: 12px; padding: 4px 20px 20px; }
.fact { margin-top: 18px; }
.fact small { display: block; color: var(--rating); font-size: 14px; }
.fact span { font-size: 17px; }
.logout { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; padding: 8px 10px; border-radius: 10px; }
.logout:hover { background: rgba(255,255,255,.12); }
.logout svg { width: 22px; height: 22px; }
.profile-top { display: flex; justify-content: space-between; align-items: center; margin: 6px 0 16px; }
.profile-top h2 { margin: 0; font-size: 28px; }

/* Диалог */
.modal { position: fixed; inset: 0; background: rgba(10,10,30,.55); display: grid; place-items: center; padding: 20px; z-index: 50; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.dialog { width: 100%; max-width: 380px; max-height: 80vh; overflow: auto; background: linear-gradient(0deg, #220031, #220031); border-radius: 8px; padding: 6px 20px 14px; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.dialog .opt { width: 100%; display: block; text-align: center; padding: 16px 6px; font-size: 17px; border-bottom: .5px solid var(--line); }
.dialog .opt.sel { color: #e9a9ee; font-weight: 700; }
.dialog .opt.lang { display: flex; align-items: center; justify-content: center; gap: 12px; }
.dialog .cancel { display: block; margin: 12px auto 4px; color: rgba(255,255,255,.7); padding: 8px 16px; }
.dialog h3 { margin: 16px 0 6px; font-size: 16px; text-align: center; font-weight: 500; opacity: .8; }

#toast { position: fixed; left: 50%; bottom: 90px; transform: translate(-50%, 20px); background: rgba(20,20,40,.95); padding: 11px 18px; border-radius: 12px; font-size: 15px; opacity: 0; pointer-events: none; transition: .25s; z-index: 80; max-width: 90vw; text-align: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
@media (min-width: 900px) { #toast { bottom: 30px; } }

@media (max-width: 420px) {
  .top h2 { font-size: 24px; letter-spacing: .12em; }
  .item .t { font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
