:root {
  --primary: #1d6ff2;
  --primary-dark: #155bd0;
  --primary-soft: #e8f0fe;
  --side-1: #0f2a5c;
  --side-2: #0b2150;
  --text: #13213d;
  --muted: #5d6b85;
  --border: #e3e8f2;
  --bg: #f3f6fb;
  --card: #ffffff;
  --soft: #f5f7fb;
  --ok: #16a34a;
  --ok-soft: #e3f6ea;
  --warn: #c2790a;
  --warn-soft: #fdf1dc;
  --bad: #dc2626;
  --bad-soft: #fde7e7;
  --info: #2563eb;
  --info-soft: #e7efff;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(16, 33, 70, .04), 0 4px 16px rgba(16, 33, 70, .06);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.3rem; margin: 0 0 .8rem; }
h2 { font-size: 1.02rem; margin: 0 0 .6rem; }
.ico { flex: 0 0 auto; vertical-align: middle; }

/* ---------- Maket ---------- */
.layout { display: flex; min-height: 100vh; }

.sidebar {
  position: sticky; top: 0;
  width: 210px; height: 100vh; flex: 0 0 210px;
  display: flex; flex-direction: column;
  padding: .8rem .6rem;
  background: linear-gradient(180deg, var(--side-1), var(--side-2));
  color: #dbe6ff;
  overflow-y: auto;
}
.logo { display: flex; align-items: center; gap: .6rem; padding: .2rem .5rem 1rem; color: #fff; }
.logo:hover { text-decoration: none; }
.logo b { display: block; font-size: .95rem; }
.logo small { display: block; color: #9fb3d9; font-size: .72rem; }
.logo-icon { color: #4c9bff; display: inline-flex; }
.logo-icon .ico { width: 22px; height: 22px; }
.logo-mark { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; flex: 0 0 auto; border-radius: 12px; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .25); }
.logo-mark img { width: 40px; height: 40px; }
.logo b { white-space: nowrap; letter-spacing: -.01em; }
.ai-badge { display: inline-block; margin-left: .15rem; padding: 0 .3rem; border-radius: 5px; background: linear-gradient(135deg, #2f8bff, #1d5fe0); color: #fff; font-style: normal; font-size: .78rem; font-weight: 800; line-height: 1.35; vertical-align: 1px; }

.side-nav { display: flex; flex-direction: column; gap: .15rem; }
.side-nav a {
  display: flex; align-items: center; gap: .65rem;
  padding: .5rem .7rem; border-radius: 8px;
  color: #dbe6ff; font-weight: 500;
}
.side-nav .ico { width: 18px; height: 18px; }
.side-nav a:hover { background: rgba(255, 255, 255, .07); text-decoration: none; }
.side-nav a.active { background: var(--primary); color: #fff; box-shadow: 0 4px 14px rgba(29, 111, 242, .45); }

.school-card {
  margin-top: auto;
  display: flex; align-items: center; gap: .6rem;
  padding: .6rem .7rem; border-radius: 10px;
  background: rgba(255, 255, 255, .08);
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.school-card b { display: block; color: #fff; font-size: .85rem; }
.school-card small { display: block; color: #9fb3d9; font-size: .72rem; }
.school-icon { color: #c9d6f2; display: inline-flex; }
.school-icon .ico { width: 20px; height: 20px; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; gap: .8rem;
  padding: .45rem 1.25rem;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
.topbar-title { font-size: 1.08rem; font-weight: 700; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-right { display: flex; align-items: center; gap: .8rem; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 0; border-radius: 10px; background: var(--soft); color: var(--text); cursor: pointer; }

.pill { display: inline-flex; align-items: center; gap: .4rem; padding: .25rem .7rem; border-radius: 999px; font-size: .82rem; font-weight: 600; white-space: nowrap; }
.pill .dot { width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; }
.pill-ok { background: var(--ok-soft); color: var(--ok); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-plain { background: var(--soft); color: var(--text); border: 1px solid var(--border); }

.user-menu { position: relative; }
.user-menu summary { list-style: none; display: flex; align-items: center; gap: .5rem; cursor: pointer; padding: .25rem .4rem; border-radius: 10px; font-weight: 600; }
.user-menu summary::-webkit-details-marker { display: none; }
.user-menu summary:hover { background: var(--soft); }
.pill .ico { width: 15px; height: 15px; }
.avatar-sm { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); }
.dropdown { position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; padding: .6rem; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.dropdown form { margin: .4rem 0 0; }
.dropdown-item { display: flex; align-items: center; gap: .5rem; width: 100%; padding: .5rem .6rem; border: 0; border-radius: 8px; background: none; font: inherit; color: var(--bad); cursor: pointer; text-align: left; }
.dropdown-item:hover { background: var(--bad-soft); text-decoration: none; }
.dropdown-item.neutral { color: var(--text); margin-top: .3rem; }
.dropdown-item.neutral:hover { background: var(--soft); }
.badge.b-admin { background: var(--primary-soft); color: var(--primary); }
.grid-2.users-grid { grid-template-columns: minmax(0, 1fr) 330px; }
@media (max-width: 960px) { .grid-2.users-grid { grid-template-columns: minmax(0, 1fr); } }
.panel > h2 { display: flex; align-items: center; gap: .5rem; }

.icon-btn.menu-btn { display: none; }
.content { padding: .9rem 1.25rem 1.5rem; max-width: 1600px; width: 100%; margin: 0 auto; }
/* keng jadvalli sahifalar (dars jadvali, hisobot) katta ekranda butun kenglikni egallaydi */
.content.wide { max-width: none; }
.overlay { display: none; }

/* ---------- Umumiy elementlar ---------- */
.card, .panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: .85rem 1rem;
  box-shadow: var(--shadow);
}
.panel { margin-bottom: 1rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .65rem; }
.panel-head h2 { display: flex; align-items: center; gap: .5rem; margin: 0; }
.panel-icon { display: inline-flex; color: var(--primary); }
.panel-icon .ico { width: 18px; height: 18px; }
.link-more { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; font-size: .85rem; }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.txt-ok { color: var(--ok); }
.txt-warn { color: var(--warn); }
.txt-bad { color: var(--bad); }
.page-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: 1rem; }

.alert { padding: .7rem .9rem; border-radius: 10px; background: var(--bad-soft); color: var(--bad); margin-bottom: 1rem; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }

label { display: block; margin-bottom: .85rem; font-weight: 500; }
input, select, textarea {
  display: block; width: 100%; margin-top: .3rem;
  padding: .55rem .7rem; font: inherit; color: var(--text);
  background: #fff; border: 1px solid var(--border); border-radius: 10px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--primary); outline-offset: -1px; }
label.check { display: flex; gap: .5rem; align-items: flex-start; font-weight: 400; }
label.check input { width: auto; margin-top: .3rem; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .55rem 1.1rem; font: inherit; font-weight: 600; color: #fff;
  background: var(--primary); border: 0; border-radius: 10px; cursor: pointer;
}
.btn:hover { background: var(--primary-dark); text-decoration: none; }
.btn-block { width: 100%; }
.btn-light { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-light:hover { background: var(--soft); }
.btn-danger { background: var(--bad); }
.btn-danger:hover { background: #b91c1c; }
.btn-link { background: none; border: 0; padding: 0; font: inherit; color: var(--primary); cursor: pointer; }
.danger { color: var(--bad); }
.small-btn { padding: .35rem .8rem; font-size: .9rem; }

.inline-form { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-bottom: 1rem; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 160px; margin: 0; }
.inline-form .btn, .inline-form a { flex: 0 0 auto; }
.inline-form label.inline { display: flex; align-items: center; gap: .4rem; margin: 0; font-weight: 500; }
.inline-form label.inline input { margin: 0; }
.push-right { margin: 0 0 0 auto; }
.narrow { max-width: 600px; margin-top: 1.25rem; }

.chip { padding: .3rem .8rem; border: 1px solid var(--border); border-radius: 999px; color: var(--text); background: #fff; font-size: .9rem; }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip:hover { text-decoration: none; }

.table-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.table { width: 100%; border-collapse: collapse; }
.table th, .table td { padding: .5rem .8rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { background: var(--soft); font-weight: 600; font-size: .85rem; color: var(--muted); white-space: nowrap; }
.table tr:last-child td { border-bottom: 0; }
.table .actions { display: flex; flex-wrap: wrap; gap: .9rem; align-items: center; justify-content: flex-end; }
.table .actions form { margin: 0; }
tr.inactive td { color: var(--muted); }
.report th, .report td { padding: .4rem .5rem; }
.report .sticky { position: sticky; left: 0; background: var(--card); z-index: 1; }
.report th.sticky { background: var(--soft); }

.badge { display: inline-block; padding: .2rem .7rem; border-radius: 999px; font-size: .82rem; font-weight: 600; background: var(--soft); color: var(--muted); white-space: nowrap; }
.b-keldi { background: var(--ok-soft); color: var(--ok); }
.b-kechikdi { background: var(--warn-soft); color: var(--warn); }
.b-kelmadi { background: var(--bad-soft); color: var(--bad); }
.b-kutilmoqda { background: #eef1f6; color: var(--muted); }
.tag { display: inline-block; padding: 0 .4rem; border-radius: 6px; font-size: .72rem; font-weight: 500; background: var(--soft); color: var(--muted); border: 1px solid var(--border); vertical-align: middle; }
.warn-tag { color: var(--warn); }
.cell { display: inline-block; min-width: 1.9rem; padding: .08rem 0; border-radius: 6px; font-weight: 700; text-align: center; }
.c-keldi { background: var(--ok-soft); color: var(--ok); }
.c-kechikdi { background: var(--warn-soft); color: var(--warn); }
.c-kelmadi { background: var(--bad-soft); color: var(--bad); }
.cam-dot { display: inline-block; width: .55rem; height: .55rem; border-radius: 50%; margin: 0 .3rem 0 .1rem; background: var(--muted); }
.cam-dot.on { background: var(--ok); }
.cam-dot.off { background: var(--bad); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1rem; align-items: start; }

/* ---------- Bugun ---------- */
.hero-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .75rem; }
.hero-title { display: flex; align-items: center; gap: .55rem; }
.hero-title h1 { margin: 0; font-size: 1.2rem; }
.hero-title h1 span { font-size: .92rem; font-weight: 600; }
.hero-icon { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); }
.hero-icon .ico { width: 17px; height: 17px; }
.hero-pills { display: flex; flex-wrap: wrap; gap: .45rem; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.stat { display: flex; align-items: center; gap: .75rem; padding: .65rem .85rem; border-radius: 12px; border: 1px solid transparent; }
.stat b { display: block; font-size: 1.55rem; line-height: 1.05; }
.stat > div span { font-weight: 600; font-size: .85rem; }
.stat-icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto; }
.stat-icon .ico { width: 21px; height: 21px; }
.stat-ok { background: linear-gradient(135deg, #e8f8ee, #d7f2e1); border-color: #c8ebd5; }
.stat-ok .stat-icon { background: #cdeedb; color: var(--ok); }
.stat-ok b { color: var(--ok); }
.stat-warn { background: linear-gradient(135deg, #fef6e7, #fcecd0); border-color: #f6e0b5; }
.stat-warn .stat-icon { background: #fae3b8; color: var(--warn); }
.stat-warn b { color: #9a5b00; }
.stat-bad { background: linear-gradient(135deg, #fdeeee, #fbdede); border-color: #f6cfcf; }
.stat-bad .stat-icon { background: #f9d3d3; color: var(--bad); }
.stat-bad b { color: var(--bad); }
.stat-info { background: linear-gradient(135deg, #eef3ff, #e2eafe); border-color: #d3defb; }
.stat-info .stat-icon { background: #d6e2fd; color: var(--info); }
.stat-info b { color: var(--text); }

.status-line { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; margin-top: .7rem; font-size: .84rem; }
.status-line .ico { width: 16px; height: 16px; }
.status-line > span { display: inline-flex; align-items: center; gap: .4rem; }
.status-line .sep { width: 1px; height: 18px; background: var(--border); }
.status-line .dot { width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; }
.status-line .st-ok > .ico, .status-line .st-ok .dot { color: var(--ok); }
.status-line .st-bad > .ico, .status-line .st-bad .dot { color: var(--bad); }
.status-line .st-warn > .ico { color: var(--warn); }

.class-block { border: 1px solid var(--border); border-radius: 10px; margin-bottom: .6rem; overflow: hidden; }
.class-block summary {
  display: flex; align-items: center; gap: .6rem;
  padding: .45rem .75rem; background: var(--soft); cursor: pointer; list-style: none;
}
.class-block .chev .ico { width: 16px; height: 16px; }
.class-block summary::-webkit-details-marker { display: none; }
.class-block .chev { display: inline-flex; transition: transform .15s; }
.class-block:not([open]) .chev { transform: rotate(-90deg); }
.class-block summary b { flex: 1; }
.progress { width: 110px; height: 6px; border-radius: 999px; background: #dfe5ef; overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: inherit; background: var(--ok); }
.pct { width: 3rem; text-align: right; font-weight: 600; }

.student-list, .event-list { list-style: none; margin: 0; padding: 0; }
.student-list li { display: flex; align-items: center; gap: .6rem; padding: .28rem .75rem; border-top: 1px solid var(--border); }
.avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex: 0 0 auto; background: var(--soft); }
.avatar-ph { display: inline-flex; align-items: center; justify-content: center; font-size: .66rem; font-weight: 700; color: var(--primary); background: var(--primary-soft); }
.st-name { flex: 1; min-width: 0; }
.st-time { display: inline-flex; align-items: center; justify-content: flex-end; gap: .25rem; width: 4rem; color: var(--muted); font-size: .82rem; }
.st-time .ico { width: 13px; height: 13px; }
.student-list .badge { font-size: .74rem; padding: .1rem .55rem; }

.event-list li { display: flex; align-items: center; gap: .65rem; padding: .35rem .1rem; border-bottom: 1px solid var(--border); }
.event-list li:last-child { border-bottom: 0; }
.thumb { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; flex: 0 0 auto; border: 2px solid transparent; background: var(--soft); }
.thumb-ok { border-color: #9fdcb5; }
.thumb-bad { border-color: #f2a8a8; }
.thumb-ph { display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.ev-body { flex: 1; min-width: 0; }
.ev-name { font-weight: 600; line-height: 1.25; }
.ev-meta { color: var(--muted); font-size: .78rem; }
.ev-meta .ico { width: 12px; height: 12px; vertical-align: -2px; }
.ev-time { color: var(--muted); font-size: .82rem; align-self: flex-start; }

/* ---------- Boshqa sahifalar ---------- */
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: .6rem; margin-top: 1rem; }
.photo img, .photo .noimg { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--soft); }
.photo form { margin: 0; text-align: center; }
.upload { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.upload input { flex: 1 1 200px; margin: 0; }
.danger-zone { margin-top: 1rem; text-align: right; }

.unknown-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; }
.unknown-card { padding: .7rem; }
.unknown-card img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; background: var(--soft); border: 2px solid #f2a8a8; }
.unknown-card select { margin: .4rem 0; }
.unknown-card form { margin: 0; }
.unknown-card .row { margin-bottom: .3rem; }

/* ---------- Ro'yxat sahifalari (O'quvchilar, Sinflar, SMS, Kameralar) ---------- */
.bell { position: relative; }
.bell:hover { text-decoration: none; background: var(--primary-soft); color: var(--primary); }
.bell-dot { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); border: 2px solid #fff; }
.txt-strong { color: var(--text); }
.right { text-align: right; }
th.right { text-align: right; }
.num { width: 2.5rem; }

.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .85rem; }
.toolbar > input, .toolbar > select, .toolbar .search { flex: 1 1 180px; width: auto; margin: 0; }
.toolbar > select { max-width: 320px; }
.toolbar.compact { margin: 0; flex-wrap: nowrap; }
.toolbar.grow { flex: 1 1 360px; max-width: 640px; }
.toolbar.grow .search { flex: 1 1 auto; }
.toolbar .btn { flex: 0 0 auto; white-space: nowrap; }
.toolbar.compact > input { flex: 0 1 190px; }
.search { position: relative; margin: 0; font-weight: 400; }
.search > .ico { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search input { margin: 0; padding-left: 2.1rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { font-weight: 600; }

.table-wrap.flat { box-shadow: none; border-radius: 12px; }
.person { display: inline-flex; align-items: center; gap: .6rem; color: var(--text); }
.person:hover { text-decoration: none; color: var(--primary); }

.icon-actions { display: flex; align-items: center; justify-content: flex-end; gap: .25rem; }
.icon-actions form { margin: 0; }
.ia { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 8px; border: 0; background: none; cursor: pointer; }
.ia:hover { text-decoration: none; }
.ia-view { color: var(--primary); }
.ia-view:hover { background: var(--primary-soft); }
.ia-edit { color: var(--primary); }
.ia-edit:hover { background: var(--primary-soft); }
.ia-del { color: var(--bad); }
.ia-del:hover { background: var(--bad-soft); }
.icon-actions .btn { margin-right: .35rem; }

.text-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 1.1rem; }
.text-actions form { margin: 0; }
.text-actions a, .text-actions .btn-link { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; }

.stats-sm { margin-bottom: 1rem; }
.notice { display: inline-flex; align-items: center; gap: .35rem; margin-bottom: .7rem; padding: .25rem .75rem; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: .82rem; font-weight: 600; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .85rem; }
.pager-nav { display: flex; align-items: center; gap: .35rem; }
.pg { display: inline-flex; align-items: center; justify-content: center; min-width: 32px; height: 32px; padding: 0 .4rem; border: 1px solid var(--border); border-radius: 8px; color: var(--text); background: #fff; font-weight: 600; }
.pg:hover { text-decoration: none; background: var(--soft); }
.pg.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.pg.disabled { pointer-events: none; opacity: .4; }
.pager-nav select { width: auto; margin: 0 0 0 .4rem; padding: .35rem .6rem; }

.cam-name { display: inline-flex; align-items: center; gap: .45rem; }
.cam-name .ico { color: var(--text); }
.cam-state { display: inline-flex; align-items: center; }
.cam-form-panel { display: grid; grid-template-columns: minmax(0, 1fr) 240px; gap: 1.25rem; margin-top: 1rem; }
.cam-form h2 { display: flex; align-items: center; gap: .5rem; margin-bottom: .9rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.req { color: var(--bad); }
.form-grid .span-2 { grid-column: 1 / -1; }
.rtsp-preview { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin: 0 0 .8rem; padding: .5rem .7rem; border-radius: 10px; background: var(--soft); border: 1px dashed var(--border); }
.rtsp-preview code { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; word-break: break-all; }
.cam-help ul { margin: .4rem 0 0; padding-left: 1.1rem; }
.cam-help li { margin-bottom: .35rem; }
.form-actions { display: flex; gap: .6rem; margin-top: .4rem; }
.cam-help { padding: 1rem; border-radius: 12px; background: linear-gradient(160deg, #f1f5fd, #e7eefc); font-size: .88rem; }
.cam-help p { margin: .6rem 0 0; }
.cam-illu { display: flex; align-items: center; justify-content: center; width: 84px; height: 84px; margin: .2rem auto .6rem; border-radius: 50%; background: #fff; color: var(--primary); box-shadow: 0 6px 20px rgba(29, 111, 242, .18); }

/* ---------- Hisobot ---------- */
.class-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1rem; }
.class-card {
  display: flex; flex-direction: column; gap: .7rem;
  padding: .95rem 1rem; color: var(--text);
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .12s, box-shadow .12s, border-color .12s;
}
.class-card:hover { text-decoration: none; transform: translateY(-2px); border-color: #bcd0f7; box-shadow: 0 8px 24px rgba(29, 111, 242, .12); }
.cc-head { display: flex; align-items: center; gap: .65rem; }
.cc-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); flex: 0 0 auto; }
.cc-all .cc-icon { background: var(--primary); color: #fff; }
.cc-title { flex: 1; min-width: 0; }
.cc-title b { display: block; font-size: 1.15rem; line-height: 1.2; }
.cc-title .muted { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-arrow { color: var(--muted); display: inline-flex; }
.class-card:hover .cc-arrow { color: var(--primary); }
.class-card.static:hover { transform: none; border-color: var(--border); box-shadow: var(--shadow); }
.cc-actions { display: flex; align-items: center; gap: .2rem; padding-top: .6rem; border-top: 1px solid var(--border); }
.cc-actions > a:not(.ia) { display: inline-flex; align-items: center; gap: .3rem; padding: .25rem .5rem; border-radius: 8px; font-weight: 600; font-size: .85rem; }
.cc-actions > a:not(.ia):hover { background: var(--primary-soft); text-decoration: none; }
.cc-actions form { margin: 0; }
.cc-actions .ia-edit { margin-left: auto; }
.cc-edit label { margin-bottom: .6rem; }
.cc-meta { display: flex; flex-wrap: wrap; gap: .3rem 1rem; color: var(--muted); font-size: .85rem; }
.cc-meta span { display: inline-flex; align-items: center; gap: .3rem; }
.cc-meta b { color: var(--text); }
.cc-progress { display: flex; align-items: center; gap: .6rem; }
.cc-progress .progress { flex: 1; width: auto; }
.progress .p-ok { background: var(--ok); }
.progress .p-warn { background: #e8a317; }
.progress .p-bad { background: var(--bad); }
.progress .p-none { background: transparent; }

.pct-badge { display: inline-block; min-width: 3.2rem; padding: .12rem .5rem; border-radius: 999px; font-size: .8rem; font-weight: 700; text-align: center; }
.pb-ok { background: var(--ok-soft); color: var(--ok); }
.pb-warn { background: var(--warn-soft); color: var(--warn); }
.pb-bad { background: var(--bad-soft); color: var(--bad); }
.pb-none { background: #eef1f6; color: var(--muted); }

.crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .4rem; margin-bottom: .85rem; font-size: .9rem; }
.crumbs a { display: inline-flex; align-items: center; gap: .3rem; font-weight: 600; }
.crumbs > .ico { color: var(--muted); }

.stat { position: relative; }
.stat-pct { position: absolute; top: .55rem; right: .6rem; padding: .05rem .45rem; border-radius: 999px; background: rgba(255, 255, 255, .7); font-size: .75rem; font-weight: 700; }
.stat-ok .stat-pct { color: var(--ok); }
.stat-warn .stat-pct { color: var(--warn); }
.stat-bad .stat-pct { color: var(--bad); }

.report-filter > select { flex: 1 1 200px; max-width: none; }
.inline-label { display: inline-flex; align-items: center; gap: .4rem; margin: 0; font-weight: 600; white-space: nowrap; }
.inline-label input { width: auto; margin: 0; }
.inline-label .ico { color: var(--muted); }

.legend { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin-bottom: .8rem; padding: .5rem .8rem; border-radius: 10px; background: var(--card); border: 1px solid var(--border); font-size: .85rem; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: .35rem; }
.legend .legend-note { margin-left: auto; color: var(--text); }

.report td, .report th { white-space: nowrap; }
.report th.day { line-height: 1.15; }
.report th.day small { display: block; font-weight: 500; font-size: .72rem; }
.report th.sun { color: var(--bad); }
.report .cell { min-width: 1.9rem; padding: .08rem 0; text-align: center; }
.c-none { background: #eef1f6; color: #9aa6ba; }
.report .avatar { width: 26px; height: 26px; }

/* ---------- Dars jadvali ---------- */
.tabs { display: flex; gap: .3rem; margin: -.1rem 0 1rem; padding: .3rem; overflow-x: auto; background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow); }
.tabs a { display: inline-flex; align-items: center; gap: .4rem; padding: .42rem .8rem; border-radius: 8px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.tabs a:hover { background: var(--soft); color: var(--text); text-decoration: none; }
.tabs a.active { background: var(--primary-soft); color: var(--primary); }

.days { display: inline-flex; gap: 2px; }
.days .day { display: inline-block; min-width: 1.75rem; padding: .05rem 0; border-radius: 5px; font-size: .72rem; font-weight: 700; text-align: center; background: #eef1f6; color: #a8b2c4; }
.days .day.on { background: var(--primary-soft); color: var(--primary); }
.clip { max-width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.day-picker { display: flex; flex-wrap: wrap; gap: .35rem; margin: 0 0 .85rem; padding: 0; border: 0; }
.day-picker legend { padding: 0; margin-bottom: .35rem; font-weight: 500; }
.day-picker label { margin: 0; cursor: pointer; }
.day-picker input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.day-picker label span { display: inline-flex; align-items: center; justify-content: center; min-width: 2.6rem; padding: .4rem .5rem; border: 1px solid var(--border); border-radius: 8px; font-weight: 700; color: var(--muted); background: #fff; }
.day-picker legend { display: block; width: 100%; }
.day-picker input:checked + span { background: var(--primary); border-color: var(--primary); color: #fff; }
.day-picker input:focus-visible + span { outline: 2px solid var(--primary); outline-offset: 1px; }

.class-chips { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: 1rem; }
.cchip { display: inline-flex; flex-direction: column; align-items: center; min-width: 3.6rem; padding: .3rem .55rem; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); line-height: 1.15; }
.cchip small { color: var(--muted); font-size: .72rem; }
.cchip:hover { text-decoration: none; border-color: #bcd0f7; }
.cchip.warn { border-color: #f1d18f; background: #fffaf0; }
.cchip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.cchip.active small { color: #dbe6ff; }

.plan-head { padding: .7rem .9rem 0; }
.table td input, .table td select { margin: 0; padding: .35rem .5rem; }
.hours-col { width: 7.5rem; }
.hours-col input { width: 5rem; }
.table td.right, .table th.right { text-align: right; }
.table tfoot td { background: var(--soft); border-top: 1px solid var(--border); }
.row-warn td { background: #fffaf0; }
.row-bad td { background: #fff5f5; }
.b-xs { font-size: .7rem; padding: .05rem .45rem; }
.check-only { display: inline-flex; margin: 0; }
.check-only input { width: 16px; height: 16px; margin: 0; }
tr.removing td { opacity: .45; text-decoration: line-through; }
.table-foot { padding: .6rem .9rem; border-top: 1px solid var(--border); }
.table td input[type="time"] { width: 8rem; }
.table td select { min-width: 12rem; }
@media (max-width: 600px) {
  .plan-head { flex-wrap: wrap; }
  .hours-col { width: 5rem; }
  .hours-col input { width: 4rem; }
}

/* Jadval ko'rinishi */
.tt-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .9rem; }
.tt-pick select { width: auto; min-width: 260px; margin: 0; }
.tt-actions { display: flex; gap: .5rem; margin-left: auto; }
.tt-actions form { margin: 0; }
.btn-ok { background: var(--ok); }
.btn-ok:hover { background: #12803b; }
.tt-empty { text-align: center; padding: 2rem 1rem; }
.tt-empty p { max-width: 620px; margin: .5rem auto; }
.tt-failed .err-list { margin: .4rem 0 .8rem; padding-left: 1.2rem; }
.tt-failed .err-list li { margin-bottom: .3rem; }
.tt-progress h2 { display: flex; align-items: center; gap: .6rem; }
.progress.big { width: 100%; height: 10px; margin: .6rem 0; }
.progress.big span { transition: width .8s; background: var(--primary); }
.spinner { width: 18px; height: 18px; border: 3px solid var(--primary-soft); border-top-color: var(--primary); border-radius: 50%; animation: spin .9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.tt-stats { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .5rem; margin-bottom: .9rem; }
.tt-stats > div { padding: .5rem .7rem; background: var(--card); border: 1px solid var(--border); border-radius: 10px; }
.tt-stats b { display: block; font-size: 1.25rem; line-height: 1.2; }
.tt-stats b.small { font-size: .95rem; line-height: 1.6; }
.tt-stats span { color: var(--muted); font-size: .76rem; }
.tt-modes { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-bottom: .7rem; }
.tt-sel select { width: auto; min-width: 200px; margin: 0; }

.tt-scroll { max-height: calc(100vh - 150px); overflow: auto; }
/* to'liq ekran rejimi */
.tt-full-btn { margin-left: auto; }
.tt-full-btn .when-full, .tt-full .full-only { display: none; }
.tt-full-btn span { display: inline-flex; align-items: center; gap: 5px; }
.tt-full.is-full { position: fixed; inset: 0; z-index: 1000; background: #fff; padding: .6rem .8rem; display: flex; flex-direction: column; }
.tt-full.is-full .tt-modes { margin-bottom: .5rem; }
.tt-full.is-full .tt-scroll { max-height: none; flex: 1; min-height: 0; }
.tt-full.is-full .full-only { display: inline; }
.tt-full.is-full .tt-full-btn .when-normal { display: none; }
.tt-full.is-full .tt-full-btn .when-full { display: inline-flex; }
.tt-full-title { font-size: 1.05rem; margin-right: .3rem; }
body.tt-full-on { overflow: hidden; }
.tt-full.loading .tt-scroll { opacity: .55; transition: opacity .15s; }
.ttgrid { border-collapse: separate; border-spacing: 0; width: 100%; }
.ttgrid th, .ttgrid td { border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); padding: 3px; vertical-align: top; }
.ttgrid thead th { position: sticky; top: 0; z-index: 3; background: var(--soft); font-size: .82rem; padding: .4rem .3rem; white-space: nowrap; }
.ttgrid thead th a { color: var(--text); }
.ttgrid .sticky-1 { position: sticky; left: 0; z-index: 2; background: var(--soft); }
.ttgrid .sticky-2 { position: sticky; left: 34px; z-index: 2; background: var(--soft); }
.ttgrid thead .sticky-1, .ttgrid thead .sticky-2 { z-index: 4; }
.ttgrid.school .sticky-1 { width: 34px; min-width: 34px; }
.ttgrid .day-cell { vertical-align: middle; padding: 0; }
.ttgrid .day-cell span { display: block; writing-mode: vertical-rl; transform: rotate(180deg); margin: auto; font-size: .8rem; font-weight: 700; color: var(--muted); }
.ttgrid .per { width: 24px; min-width: 24px; text-align: center; color: var(--muted); font-size: .78rem; vertical-align: middle; }
.ttgrid tr.day-start > * { border-top: 2px solid #c8d3e6; }
.ttgrid.school td { min-width: 104px; }
.les { position: relative; height: 100%; min-height: 38px; padding: 3px 5px; border-radius: 6px; background: var(--bg); border-left: 3px solid var(--bd); color: var(--fg); line-height: 1.2; }
.les b { display: block; font-size: .76rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.les small { display: block; font-size: .7rem; opacity: .85; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.les small .ico { vertical-align: -1px; }
.les .lk { position: absolute; top: 2px; right: 3px; opacity: .7; }
.ttgrid.single td { min-width: 130px; }
.ttgrid.single .les { min-height: 54px; padding: 5px 7px; }
.ttgrid.single .les b { font-size: .85rem; white-space: normal; }
.ttgrid.single .les small { font-size: .76rem; }
.ttgrid .per-h { position: sticky; left: 0; z-index: 2; background: var(--soft); width: 78px; text-align: center; vertical-align: middle; }
.ttgrid .per-h small { display: block; font-size: .7rem; color: var(--muted); font-weight: 500; }
.ttgrid thead .per-h { z-index: 4; }
.tt-foot { margin-top: .6rem; }
.ttgrid thead th.today { background: var(--primary-soft); color: var(--primary-dark); }
.ttgrid thead th.today small { font-weight: 600; font-size: .7rem; }
.ttgrid.single td.today { background: #f5f9ff; }
.ttgrid .day-cell.today span { color: var(--primary); }
/* o'qituvchi: bugungi darslar */
.tt-today { margin-bottom: 1rem; }
.today-lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.today-lessons li { display: flex; gap: .7rem; align-items: center; padding: .55rem .7rem; border-radius: 10px;
  background: var(--bg); border: 1px solid var(--bd); color: var(--fg); }
.tl-per { text-align: center; min-width: 74px; }
.tl-per b { display: block; font-size: 1.15rem; }
.tl-per small, .tl-main small { display: block; font-size: .74rem; opacity: .85; }
.tl-main b { display: block; }
small.block { display: block; margin-top: 2px; }
/* qalqib chiquvchi oyna (forma) */
dialog.modal { width: min(460px, calc(100vw - 24px)); max-height: calc(100vh - 32px); padding: 1.2rem 1.3rem; border: 0;
  border-radius: var(--radius); box-shadow: 0 20px 60px rgba(10, 20, 45, .3); color: var(--text); overflow: auto; }
dialog.modal::backdrop { background: rgba(10, 20, 45, .45); }
dialog.modal[open] { animation: modal-in .15s ease-out; }
@keyframes modal-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.modal-head h2 { margin: 0; }
.head-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
/* o'qituvchi hisoblari */
.accounts-box { margin-bottom: 1rem; border: 1px solid #b7d3fb; background: #f7fbff; }
.accounts-box .table td { font-size: .95rem; }
form.inline { display: inline; }
.acc-link { display: inline-flex; align-items: center; gap: 3px; color: var(--muted); }
.acc-link:hover { color: var(--primary); }
.link-btn { background: none; border: 0; padding: 0; color: var(--primary); cursor: pointer; font: inherit; display: inline-flex; align-items: center; gap: 3px; }
.link-btn:hover { text-decoration: underline; }
@media print {
  .sidebar, .topbar, .tabs, .page-head, .users-grid, .no-print, .alert { display: none !important; }
  .main, .content { margin: 0 !important; padding: 0 !important; }
  .accounts-box { border: 0; background: #fff; box-shadow: none; }
}
label[hidden] { display: none; }
td.best { color: var(--ok); font-weight: 700; }
@media (max-width: 1100px) { .tt-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .tt-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tt-actions { margin-left: 0; width: 100%; }
  .tt-pick, .tt-pick select { width: 100%; min-width: 0; }
}

/* Rasmni kattalashtirish */
.zoom-btn { flex: 0 0 auto; padding: 0; border: 0; background: none; cursor: zoom-in; border-radius: 8px; }
.zoom-btn:hover .thumb, .zoom-btn:focus-visible .thumb { transform: scale(1.08); box-shadow: 0 2px 8px rgba(16, 33, 70, .25); }
.zoom-btn .thumb { display: block; transition: transform .12s; }
.zoom-btn.unknown-zoom { display: block; width: 100%; }
.zoom-btn.unknown-zoom img { display: block; }
dialog.zoom { width: min(720px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: var(--radius); box-shadow: 0 20px 60px rgba(10, 20, 45, .35); color: var(--text); }
dialog.zoom::backdrop { background: rgba(10, 20, 45, .6); }
.zoom-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; padding: .8rem 1rem; border-bottom: 1px solid var(--border); }
.zoom-head b { display: block; font-size: 1.05rem; }
.zoom-head small { display: block; color: var(--muted); }
.zoom-body { display: flex; gap: 1rem; justify-content: center; padding: 1rem; background: var(--soft); }
.zoom-body figure { flex: 1 1 0; max-width: 340px; margin: 0; text-align: center; }
.zoom-body figure[hidden] { display: none; }
.zoom-body img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: 12px; background: #0f172a; border: 3px solid var(--border); }
.zoom-body img.z-ok { border-color: #9fdcb5; }
.zoom-body img.z-bad { border-color: #f2a8a8; }
.zoom-body figcaption { margin-top: .4rem; color: var(--muted); font-size: .82rem; }
.zoom-nav { display: flex; align-items: center; justify-content: space-between; padding: .6rem 1rem; border-top: 1px solid var(--border); }
@media (max-width: 600px) { .zoom-body { flex-direction: column; align-items: center; } .zoom-body figure { width: 100%; } }

/* ---------- Kirish sahifasi ---------- */
body.auth { background: linear-gradient(160deg, var(--side-1), #1d4fa8); min-height: 100vh; }
.auth-main { padding: 1rem; }
.login-box { max-width: 400px; margin: 12vh auto 0; padding: 1.4rem 1.6rem 1.6rem; }
.login-brand { display: block; width: 100%; height: auto; margin: .2rem auto 1.2rem; }
.login-logo { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.3rem; }
.login-logo b { font-size: 1.15rem; }
.login-logo .logo-icon { display: inline-flex; align-items: center; justify-content: center; width: 50px; height: 50px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); }

/* ---------- Moslashuvchanlik ---------- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .grid-2 { grid-template-columns: 1fr; }
  .cam-form-panel { grid-template-columns: 1fr; }
  .sidebar {
    position: fixed; left: 0; top: 0; z-index: 50;
    transform: translateX(-100%); transition: transform .2s ease;
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .overlay { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(10, 20, 45, .45); }
  .icon-btn.menu-btn { display: inline-flex; }
  .topbar { padding: .6rem 1rem; gap: .6rem; }
  .content { padding: 1rem; }
}

@media (max-width: 600px) {
  .topbar-title { font-size: 1.1rem; }
  .pill-text, .user-name { display: none; }
  .pill { padding: .45rem; }
  .user-menu summary > .ico { display: none; }
  .stats { gap: .6rem; }
  .stat { flex-direction: column; align-items: flex-start; gap: .5rem; padding: .8rem; }
  .stat-icon { width: 44px; height: 44px; }
  .stat-icon .ico { width: 22px; height: 22px; }
  .stat b { font-size: 1.7rem; }
  .hero-title h1 { font-size: 1.3rem; }
  .hero-title h1 span { display: block; font-size: .9rem; }
  .status-line .sep { display: none; }
  .progress { width: 70px; }
  .panel, .card { padding: .9rem; }
  .student-list li { padding: .5rem .6rem; gap: .6rem; }
  .st-time { width: auto; }
  .push-right { margin: 0; width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .toolbar.compact > input { flex: 1 1 140px; }
  .toolbar > select { max-width: none; }
}
