/* ==========================================================================
   TARBIYACHI KABINETI (/tarbiyachi/) — sahifaga xos uslublar.

   Bu fayl ATAYLAB `ui.css` ga qo'shilmadi: `ui.css` uchala CRM'da
   (lid tizimi, maktab, bog'cha) bayt-bayt bir xil turishi kerak, bu
   yerdagi selektorlar esa faqat shu kabinetda uchraydi (maktab
   CRM'idagi `teacher.css` bilan bir xil qoida).

   Ranglar, o'lchamlar, radiuslar va davomiylik FAQAT `ui.css`
   tokenlaridan olinadi (§1 brend tokenlari + §28 v3 shkalalari) —
   bu yerda yangi rang, shrift yoki radius IXTIRO QILINMAYDI. Holat
   ohanglari `--dv-tone` orqali semantik tokenlarga bog'lanadi
   (ok → emerald, warn → amber, err → red, info → cyan), ya'ni
   `selectors.STATUS_UI` dagi nomlar bilan bir xil.

   Prefikslar:
     .tc-*  — kabinet karkasi (maktabdagi `teacher/base.html` bilan
              bir xil nomlar: tc-body / tc-shell / tc-side / tc-top ...);
     .dv-*  — davomat sahifalari (bosh sahifa, guruhlar, kun, tarix).
   ========================================================================== */

/* ==========================================================================
   1. KABINET KARKASI — CRM'ning sidebar/topbar'idan MUSTAQIL
   ========================================================================== */
.tc-body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    min-height: 100vh;
    min-height: 100dvh;
}

.tc-shell { display: flex; min-height: 100vh; min-height: 100dvh; }

/* --- Yon menyu (desktop) --- */
.tc-side {
    width: 260px;
    flex: none;
    background: var(--sb-bg);
    color: #fff;
    padding: var(--sp-5) var(--sp-4);
    display: none;
    flex-direction: column;
    gap: var(--sp-1);
    position: sticky;
    top: 0;
    height: 100vh;
    height: 100dvh;
}

.tc-brand {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    color: #fff;
    text-decoration: none;
    margin-bottom: var(--sp-5);
}

.tc-brand:hover { color: #fff; }

.tc-brand__mark {
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.16);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.tc-brand__mark img { width: 24px; height: 24px; object-fit: contain; }
.tc-brand__name { font-family: var(--font-display); font-weight: var(--fw-b); letter-spacing: .02em; }
.tc-brand__sub { font-size: var(--fs-xs); opacity: .75; }

.tc-link {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: 0 var(--sp-3);
    height: var(--ctl-lg);
    border-radius: var(--radius-sm);
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    font-size: var(--fs-md);
    font-weight: var(--fw-md);
    border: 0;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: inherit;
    transition: background var(--dur-fast) var(--ease), color var(--dur-fast) var(--ease);
}

.tc-link .i { width: 18px; height: 18px; stroke: currentColor; flex: none; }
.tc-link:hover { background: rgba(255, 255, 255, 0.10); color: #fff; }
.tc-link.is-active { background: rgba(255, 255, 255, 0.18); color: #fff; font-weight: var(--fw-sb); }
.tc-link.is-active .i { color: var(--gold-3); }
.tc-link--main { font-weight: var(--fw-sb); }

.tc-side__foot { margin-top: auto; display: flex; flex-direction: column; gap: var(--sp-2); }
.tc-side__foot form { margin: 0; }

.tc-side__who {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    padding: var(--sp-2) var(--sp-3);
    border-radius: var(--radius-sm);
    background: rgba(255, 255, 255, 0.08);
    min-width: 0;
}

.tc-side__avatar {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-xs);
    background: var(--gold-grad);
    color: #fff;
    font-weight: var(--fw-b);
    font-size: var(--fs-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.tc-side__meta { display: flex; flex-direction: column; min-width: 0; line-height: var(--lh-tight); }
.tc-side__meta b { font-size: var(--fs-sm); font-weight: var(--fw-sb); }
.tc-side__meta small { font-size: var(--fs-2xs); opacity: .7; }

/* --- Kontent ustuni --- */
.tc-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }

.tc-top {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: var(--sp-3) var(--sp-4);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    position: sticky;
    top: 0;
    z-index: var(--z-header);
}

.tc-top__title {
    font-family: var(--font-display);
    font-weight: var(--fw-b);
    font-size: var(--fs-lg);
    color: var(--heading);
    min-width: 0;
}

.tc-top__spacer { flex: 1 1 auto; }

.tc-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    text-decoration: none;
    font-size: var(--fs-sm);
    flex: none;
}

.tc-back .i { width: 16px; height: 16px; }
.tc-back:hover { color: var(--royal); }

.tc-main {
    flex: 1 1 auto;
    padding: var(--sp-4);
    /* Telefonda pastki panel kontentni yopib qo'ymasin */
    padding-bottom: calc(var(--sp-4) + 76px);
    max-width: 1280px;
    width: 100%;
}

.tc-who {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--fs-sm);
    color: var(--muted);
    white-space: nowrap;
}

/* --- Pastki panel (telefon) --- */
.tc-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 68px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    display: grid;
    grid-auto-flow: column;
    z-index: var(--z-sticky);
    padding-bottom: env(safe-area-inset-bottom);
}

.tc-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: var(--muted);
    text-decoration: none;
    font-size: var(--fs-2xs);
    text-align: center;
    padding: 0 4px;
}

.tc-tab .i { width: 20px; height: 20px; stroke: currentColor; }
.tc-tab:hover { color: var(--heading); }
.tc-tab.is-active { color: var(--royal); font-weight: var(--fw-sb); }

.tc-tab span {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 992px) {
    .tc-side { display: flex; }
    .tc-tabs { display: none; }
    .tc-main { padding: var(--sp-5) var(--sp-6) var(--sp-8); }
}

/* --- Kirish sahifasi (karkassiz) --- */
.tc-auth {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sp-10) var(--sp-4) var(--sp-5);
    background: var(--sb-bg);
}

.tc-auth__controls {
    position: absolute;
    top: var(--sp-4);
    right: var(--sp-4);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    z-index: var(--z-sticky);
}

.tc-auth__sheet {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: var(--sp-8) var(--sp-6);
    width: min(440px, 100%);
    box-shadow: var(--shadow-lg);
}

.tc-auth__logo {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-sm);
    background: var(--royal-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tc-auth__logo img { width: 34px; height: 34px; object-fit: contain; }

.tc-auth__title {
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    font-weight: var(--fw-b);
    color: var(--heading);
    margin: var(--sp-3) 0 var(--sp-1);
    letter-spacing: -0.01em;
}

.tc-auth__hint { font-size: var(--fs-sm); color: var(--muted); margin: 0; line-height: var(--lh); }
.tc-auth__alt { display: flex; flex-direction: column; gap: var(--sp-2); }

.tc-auth__sep {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    margin: var(--sp-5) 0 var(--sp-4);
    color: var(--muted);
    font-size: var(--fs-xs);
}

.tc-auth__sep::before,
.tc-auth__sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }

/* Parolni ko'rsatish tugmasi — input ichida, o'ng tomonda */
.tc-pw { position: relative; }
.tc-pw input { padding-right: 44px !important; }

.tc-pw__eye {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: var(--radius-xs);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
}

.tc-pw__eye .i { width: 17px; height: 17px; }
.tc-pw__eye:hover { color: var(--heading); background: var(--hover); }

/* Matematik captcha: savol chipi + javob maydoni */
.tc-captcha { display: flex; align-items: center; gap: var(--sp-2); }

.tc-captcha__q {
    flex: none;
    min-width: 92px;
    height: var(--ctl-lg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 var(--sp-3);
    background: var(--surface-2);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    font-family: var(--font-display);
    font-weight: var(--fw-b);
    font-size: var(--fs-lg);
    color: var(--heading);
    white-space: nowrap;
    user-select: none;
}

.tc-captcha input { flex: 1 1 auto; min-width: 0; }

/* ==========================================================================
   2. SAHIFA BOSHI, KPI VA GURUH KARTALARI
   ========================================================================== */
.dv-page-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: var(--sp-3);
    flex-wrap: wrap;
    margin-bottom: var(--sp-4);
}

.dv-title {
    font-family: var(--font-display);
    font-size: var(--fs-xl);
    font-weight: var(--fw-b);
    color: var(--heading);
    margin: 0;
    line-height: var(--lh-tight);
    letter-spacing: -0.01em;
}

.dv-subtitle { margin: var(--sp-1) 0 0; color: var(--muted); font-size: var(--fs-sm); }
.dv-subtitle::first-letter { text-transform: uppercase; }
.dv-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.dv-day-head__title { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }

/* --- KPI kartalari --- */
.dv-kpis {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: var(--sp-3);
    margin-bottom: var(--sp-4);
}

.dv-kpi {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-1);
    box-shadow: var(--shadow-xs);
}

.dv-kpi__label {
    font-size: var(--fs-2xs);
    text-transform: uppercase;
    letter-spacing: var(--caps);
    color: var(--muted);
    font-weight: var(--fw-sb);
}

.dv-kpi__value {
    font-family: var(--font-display);
    font-size: var(--fs-2xl);
    font-weight: var(--fw-b);
    line-height: 1.1;
    color: var(--heading);
    font-variant-numeric: tabular-nums;
}

.dv-kpi__hint { font-size: var(--fs-xs); color: var(--muted); }
.dv-kpi--ok .dv-kpi__value { color: var(--emerald-text); }
.dv-kpi--warn .dv-kpi__value { color: var(--amber-text); }
.dv-kpi--err .dv-kpi__value { color: var(--red-text); }

/* --- Guruh kartalari --- */
.dv-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--sp-3);
}

.dv-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--sp-4);
    display: flex;
    flex-direction: column;
    gap: var(--sp-2);
    box-shadow: var(--shadow-xs);
    transition: box-shadow var(--dur) var(--ease);
}

.dv-card:hover { box-shadow: var(--shadow); }
.dv-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--sp-2); }

.dv-card__title {
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: var(--fw-b);
    color: var(--heading);
}

.dv-card__meta { font-size: var(--fs-xs); color: var(--muted); }

.dv-card__stats {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-1) var(--sp-4);
    font-size: var(--fs-sm);
    color: var(--muted);
}

.dv-card__stats b { color: var(--heading); font-variant-numeric: tabular-nums; }

.dv-card__foot {
    margin-top: auto;
    display: flex;
    gap: var(--sp-2);
    flex-wrap: wrap;
    padding-top: var(--sp-2);
}

/* Ohangli sonlar — karta va jadval yakunlarida */
.dv-stat--ok, .dv-stat--ok b { color: var(--emerald-text); }
.dv-stat--warn, .dv-stat--warn b { color: var(--amber-text); }
.dv-stat--err, .dv-stat--err b { color: var(--red-text); }

/* --- Belgilash ulushi --- */
.dv-progress {
    height: 8px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    overflow: hidden;
}

.dv-progress > span {
    display: block;
    height: 100%;
    background: var(--royal);
    border-radius: inherit;
    transition: width var(--dur-slow) var(--ease);
}

.dv-progress > span.is-complete { background: var(--emerald); }

/* ==========================================================================
   3. DAVOMAT BELGILASH (kun sahifasi)
   ========================================================================== */
/* --- Sana navigatsiyasi --- */
.dv-datenav {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    flex-wrap: wrap;
    margin-bottom: var(--sp-3);
}

.dv-datenav__date {
    display: inline-flex;
    flex-direction: column;
    min-width: 116px;
    line-height: var(--lh-tight);
    padding: 0 var(--sp-2);
}

.dv-datenav__date b {
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    color: var(--heading);
    font-variant-numeric: tabular-nums;
}

.dv-datenav__date small { font-size: var(--fs-xs); color: var(--muted); }
.dv-datenav__date small::first-letter { text-transform: uppercase; }

.dv-datenav__jump { display: flex; gap: var(--sp-2); align-items: center; margin-left: auto; }

.dv-datenav__jump input[type="date"] {
    height: var(--ctl-sm);
    padding: 0 var(--sp-3);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-xs);
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    font-size: var(--fs-sm);
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.dv-datenav__jump input[type="date"]:focus { outline: none; border-color: var(--royal); box-shadow: var(--ring); }

.icon-btn.is-disabled { opacity: .4; pointer-events: none; }

/* --- Xulosa chiplari (legenda + sonlar) --- */
.dv-chips { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-bottom: var(--sp-3); }

.dv-chip {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    height: var(--ctl-sm);
    padding: 0 var(--sp-3);
    border-radius: var(--radius-pill);
    background: var(--surface);
    border: 1px solid var(--border);
    font-size: var(--fs-sm);
    color: var(--label);
    white-space: nowrap;
}

.dv-chip::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--dv-tone, var(--muted));
    flex: none;
}

.dv-chip b { color: var(--heading); font-variant-numeric: tabular-nums; }
.dv-chip--marked { --dv-tone: var(--royal); }
.dv-chip--ok { --dv-tone: var(--emerald); }
.dv-chip--warn { --dv-tone: var(--amber); }
.dv-chip--err { --dv-tone: var(--red); }
.dv-chip--info { --dv-tone: var(--cyan); }
.dv-chip--none { --dv-tone: var(--muted); }

/* --- Ro'yxat kartasi ---
   `.card` ishlatilmaydi: uning 22px padding'i va `overflow` i yopishqoq
   saqlash panelini buzardi. Burchaklar bolalar qatorlariga emas,
   sarlavha va pastki panelga beriladi. */
.dv-roster-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    margin: 0;
}

.dv-roster-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--sp-2);
    flex-wrap: wrap;
    padding: var(--sp-3) var(--sp-4);
    border-bottom: 1px solid var(--border-2);
}

.dv-roster-head h2 {
    margin: 0;
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    font-weight: var(--fw-b);
    color: var(--heading);
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.dv-roster-head h2 .i { width: 17px; height: 17px; color: var(--gold); }
.dv-roster-head h2 .cnt { font-size: var(--fs-xs); color: var(--muted); font-weight: var(--fw-sb); }
.dv-roster-head__hint { font-size: var(--fs-xs); }

.dv-roster { display: flex; flex-direction: column; }

.dv-row {
    position: relative;
    display: grid;
    grid-template-columns: 24px 36px minmax(0, 1fr) auto minmax(120px, 200px);
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-4);
    border-bottom: 1px solid var(--border-2);
    transition: background var(--dur-fast) var(--ease);
}

.dv-row:last-child { border-bottom: 0; }
.dv-row:hover { background: var(--hover); }

/* Belgilanmagan bola chap chetida sariq chiziq bilan ajralib turadi —
   tarbiyachi ro'yxatni ko'z bilan yugurtirganda qolib ketganini topadi. */
.dv-row::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: var(--amber);
    border-radius: 0 3px 3px 0;
}

.dv-row.is-marked::before { background: transparent; }

.dv-row__num {
    color: var(--muted);
    font-size: var(--fs-xs);
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.dv-row__name { min-width: 0; display: flex; flex-direction: column; line-height: var(--lh-tight); }

.dv-row__name b {
    color: var(--heading);
    font-weight: var(--fw-sb);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dv-row__name small { color: var(--muted); font-size: var(--fs-xs); }

.dv-avatar {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-xs);
    background: var(--royal-soft);
    color: var(--royal);
    font-weight: var(--fw-b);
    font-size: var(--fs-xs);
    letter-spacing: .02em;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex: none;
}

.dv-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dv-avatar--lg { width: 56px; height: 56px; font-size: var(--fs-lg); border-radius: var(--radius-sm); }

.dv-marks { display: flex; gap: var(--sp-1); flex-wrap: wrap; }

/* Tugmalar aslida yashirin `<input type="radio">` ustidagi `<label>` lar:
   JavaScript'siz ham ishlaydi, klaviatura bilan yuriladi va skrinrider
   ularni to'g'ri o'qiydi. Tanlangan holat radio'ning `:checked` idan
   keladi, ya'ni ikkinchi (JS bilan boshqariladigan) holat yo'q. */
.dv-radio {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}

/* Teginish maydoni WCAG 2.5.5 bo'yicha kamida 44px (telefonda) */
.dv-btn {
    min-width: 44px;
    height: var(--ctl);
    padding: 0 var(--sp-3);
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--label);
    font-size: var(--fs-xs);
    font-weight: var(--fw-sb);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    user-select: none;
    margin: 0;
    transition: background var(--dur-fast) var(--ease),
                border-color var(--dur-fast) var(--ease),
                color var(--dur-fast) var(--ease),
                box-shadow var(--dur-fast) var(--ease);
}

/* Holat nuqtasi — rang ko'rligida ham matn bilan birga o'qiladi */
.dv-btn::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--dv-tone, var(--muted));
    flex: none;
}

.dv-btn:hover { border-color: var(--dv-tone, var(--royal)); background: var(--hover); }

.dv-btn--ok { --dv-tone: var(--emerald); }
.dv-btn--warn { --dv-tone: var(--amber); }
.dv-btn--err { --dv-tone: var(--red); }
.dv-btn--info { --dv-tone: var(--cyan); }

/* Tanlangan: yumshoq fon + ohang matni + ohang chegarasi (`.status.*`
   badge'lari bilan bir xil juftliklar — ikkala temada ham o'qiladi). */
.dv-radio:checked + .dv-btn {
    box-shadow: inset 0 0 0 1px var(--dv-tone, var(--royal));
    border-color: var(--dv-tone, var(--royal));
    font-weight: var(--fw-b);
}

.dv-radio:checked + .dv-btn--ok { background: var(--emerald-soft); color: var(--emerald-text); }
.dv-radio:checked + .dv-btn--warn { background: var(--amber-soft); color: var(--amber-text); }
.dv-radio:checked + .dv-btn--err { background: var(--red-soft); color: var(--red-text); }
.dv-radio:checked + .dv-btn--info { background: var(--cyan-soft); color: var(--cyan-text); }

.dv-radio:focus-visible + .dv-btn { box-shadow: var(--ring); border-color: var(--royal); }
.dv-radio:disabled + .dv-btn { opacity: .55; cursor: not-allowed; }
.dv-radio:disabled + .dv-btn:hover { background: var(--surface); border-color: var(--border); }
.dv-radio:checked:disabled + .dv-btn { opacity: .85; }

.dv-note {
    height: var(--ctl);
    padding: 0 var(--sp-3);
    border: 1px solid var(--input-border);
    border-radius: var(--radius-sm);
    background: var(--input-bg);
    color: var(--text);
    font-family: inherit;
    font-size: var(--fs-sm);
    min-width: 0;
    width: 100%;
    transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.dv-note::placeholder { color: var(--muted); }
.dv-note:focus { outline: none; border-color: var(--royal); box-shadow: var(--ring); }
.dv-note:disabled { background: var(--surface-2); color: var(--muted); cursor: not-allowed; }

/* Yopishqoq saqlash paneli — telefonda pastki menyu ustida turadi */
.dv-sticky-save {
    position: sticky;
    bottom: calc(68px + env(safe-area-inset-bottom));
    z-index: var(--z-sticky);
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-radius: 0 0 var(--radius) var(--radius);
    padding: var(--sp-3) var(--sp-4);
    display: flex;
    gap: var(--sp-2);
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
}

.dv-sticky-save__summary {
    margin-right: auto;
    font-size: var(--fs-sm);
    color: var(--muted);
    font-variant-numeric: tabular-nums;
}

@media (min-width: 992px) {
    .dv-sticky-save { bottom: 0; }
}

/* --- Telefon: qatorni ustunga aylantiramiz --- */
@media (max-width: 720px) {
    .dv-row {
        grid-template-columns: 20px 36px minmax(0, 1fr);
        row-gap: var(--sp-2);
        padding-left: var(--sp-3);
        padding-right: var(--sp-3);
    }
    .dv-marks,
    .dv-note { grid-column: 1 / -1; }
    .dv-btn { flex: 1 1 auto; }
    .dv-datenav__jump { margin-left: 0; width: 100%; }
    .dv-datenav__jump input[type="date"] { flex: 1 1 auto; min-width: 0; }
    .dv-sticky-save .btn { flex: 1 1 auto; }
    .dv-sticky-save__summary { width: 100%; text-align: center; margin-right: 0; }
}

/* ==========================================================================
   4. TARIX JADVALI (bolalar × kunlar)
   ========================================================================== */
.dv-period { display: flex; align-items: center; gap: var(--sp-2); }

.dv-period__label {
    font-weight: var(--fw-sb);
    color: var(--heading);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    padding: 0 var(--sp-1);
}

.dv-legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    align-items: center;
    margin-bottom: var(--sp-3);
    font-size: var(--fs-xs);
    color: var(--muted);
}

table.dv-hist th.dv-hist__name,
table.dv-hist td.dv-hist__name { min-width: 180px; max-width: 260px; }

table.dv-hist td.dv-hist__name b {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

table.dv-hist th.dv-hist__day {
    text-align: center;
    padding-left: var(--sp-1);
    padding-right: var(--sp-1);
    min-width: 44px;
}

table.dv-hist th.dv-hist__day a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
    color: inherit;
    text-decoration: none;
    line-height: 1.1;
}

table.dv-hist th.dv-hist__day a:hover { color: var(--royal); }
table.dv-hist th.dv-hist__day b { font-size: var(--fs-sm); color: var(--heading); }
table.dv-hist th.dv-hist__day.is-today b { color: var(--royal); }

table.dv-hist th.dv-hist__day.is-today,
table.dv-hist td.is-today { background: var(--royal-soft); }

table.dv-hist td.dv-hist__cell {
    text-align: center;
    padding-left: var(--sp-1);
    padding-right: var(--sp-1);
    font-variant-numeric: tabular-nums;
}

table.dv-hist td.dv-hist__cell small { color: var(--muted); font-size: var(--fs-2xs); }

/* Jadval katagidagi ixcham holat belgisi (`.status` ning kichik varianti) */
.dv-mark {
    height: 22px;
    min-width: 30px;
    padding: 0 var(--sp-2);
    justify-content: center;
    gap: 4px;
}

.dv-hist__none { color: var(--border); font-weight: var(--fw-b); }

/* `.dg--sticky-first` faqat thead/tbody'ni qamraydi — yakun qatori ham */
table.dv-hist > tfoot > tr > td:first-child {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--surface-2);
    box-shadow: 1px 0 0 var(--border-2);
}

/* ==========================================================================
   5. PROFIL
   ========================================================================== */
.dv-profile__head { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-3); }

.dv-profile__head b {
    display: block;
    font-family: var(--font-display);
    font-size: var(--fs-lg);
    color: var(--heading);
}

.dv-profile__head small { color: var(--muted); font-size: var(--fs-sm); }
.dv-profile__actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; margin-top: var(--sp-4); }
.dv-profile__actions form { margin: 0; }
.info-row .v a { color: var(--royal); text-decoration: none; }
.info-row .v a:hover { text-decoration: underline; }

.dv-list { display: flex; flex-direction: column; }

.dv-list-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3) 0;
    border-bottom: 1px solid var(--border-2);
    color: inherit;
    text-decoration: none;
}

.dv-list-item:last-child { border-bottom: 0; }
.dv-list-item:hover { color: inherit; }
.dv-list-item:hover .dv-list-item__title { color: var(--royal); }
.dv-list-item__main { flex: 1 1 auto; min-width: 0; }
.dv-list-item__title { font-weight: var(--fw-sb); color: var(--heading); display: block; }
.dv-list-item__meta { font-size: var(--fs-xs); color: var(--muted); }
.dv-list-item > .i { color: var(--muted); width: 16px; height: 16px; }

/* ==========================================================================
   6. CHOP ETISH — faqat ro'yxat/jadval
   ========================================================================== */
@media print {
    .tc-side, .tc-top, .tc-tabs, .impersonate-bar,
    .dv-sticky-save, .dv-datenav__jump, .dv-actions, .dv-card__foot, .toolbar { display: none !important; }
    .tc-main { padding: 0; max-width: none; }
    .dv-roster-card, .dv-card, .dv-kpi { box-shadow: none; }
    .dv-row::before { display: none; }
}
