@font-face {
  font-family: "Poppins";
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/poppins-600.woff2") format("woff2");
}
@font-face {
  font-family: "Poppins";
  font-weight: 800;
  font-display: swap;
  src: url("/static/fonts/poppins-800.woff2") format("woff2");
}

:root {
  --brand: #ea580c;
  --brand-2: #f97316;
  --brand-dark: #c2410c;
  --brand-soft: #ffedd5;
  --ok: #16a34a;
  --ok-soft: #dcfce7;
  --bad: #dc2626;
  --bad-soft: #fee2e2;
  --text: #2b1d12;
  --muted: #7c6a5c;
  --line: #f3e3d3;
  --bg: #fff8f1;
  --card: #fff;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(70, 35, 10, .04), 0 6px 20px rgba(70, 35, 10, .06);
  --accent: #f59e0b;
  --shadow-hover: 0 4px 10px rgba(234, 88, 12, .08), 0 14px 34px rgba(234, 88, 12, .12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(1200px 400px at 100% -10%, rgba(245, 158, 11, .08), transparent 60%),
    radial-gradient(900px 300px at -10% 0%, rgba(234, 88, 12, .06), transparent 60%),
    var(--bg);
  background-attachment: fixed;
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
.ico { flex-shrink: 0; }
.muted { color: var(--muted); }
.ok-text { color: var(--ok); font-weight: 600; }
.bad-text { color: var(--bad); font-weight: 600; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand-mark {
  display: block;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(234, 88, 12, .28);
  transition: transform .25s ease;
}
.brand:hover .brand-mark { transform: rotate(-6deg) scale(1.05); }
.brand-mark img { width: 100%; height: 100%; display: block; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; font-family: "Poppins", system-ui, sans-serif; }
.brand-text b {
  display: flex;
  align-items: flex-end;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .2px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.brand-text i { font-style: normal; font-size: 10.5px; font-weight: 600; letter-spacing: 2.6px; text-transform: uppercase; color: var(--muted); padding-left: 2px; }

.day-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.day-picker input {
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  padding: 6px 4px;
  cursor: pointer;
}
.day-picker input:focus { outline: none; }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--brand); }
.icon-btn.disabled { opacity: .35; pointer-events: none; }

.account { display: flex; align-items: center; gap: 10px; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.nav-link:hover, .nav-link.active { background: var(--brand-soft); color: var(--brand); }
.user-chip { display: flex; align-items: center; gap: 10px; padding-left: 10px; border-left: 1px solid var(--line); }
.user-avatar {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex-shrink: 0;
}
.user-avatar img, .edit-photo { width: 100%; height: 100%; object-fit: cover; }
a.user-chip { color: inherit; }
a.user-chip:hover small { color: var(--brand); }
.user-meta { display: flex; flex-direction: column; line-height: 1.2; }
.user-meta b { font-size: 14px; }
.user-meta small { font-size: 12px; color: var(--muted); }

/* ---------- layout ---------- */
main { max-width: 1120px; margin: 0 auto; padding: 20px 24px 48px; }

.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--muted); display: inline-flex; }
.crumbs a:hover { color: var(--brand); }
.crumbs .sep { color: #e5cdb6; }
.crumbs span:last-child { color: var(--text); font-weight: 600; }

.page-head { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
h1 { margin: 0; font-family: "Poppins", system-ui, sans-serif; font-size: 30px; font-weight: 800; letter-spacing: -.3px; }
.subtitle { margin: 4px 0 0; color: var(--muted); }
.section-title { font-size: 18px; margin: 30px 0 14px; }

/* percentage ring */
.ring {
  --p: 0;
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-content: center;
  text-align: center;
  background:
    radial-gradient(closest-side, #fff 78%, transparent 79% 100%),
    conic-gradient(var(--ok) calc(var(--p) * 1%), var(--bad-soft) 0);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.ring span { font-family: "Poppins", system-ui, sans-serif; font-size: 22px; font-weight: 800; line-height: 1; }
.ring small { font-size: 11px; color: var(--muted); }

/* ---------- stats ---------- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.stat-ico {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--brand-soft);
  color: var(--brand);
}
.stat.ok .stat-ico { background: var(--ok-soft); color: var(--ok); }
.stat.bad .stat-ico { background: var(--bad-soft); color: var(--bad); }
.stat b { display: block; font-family: "Poppins", system-ui, sans-serif; font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat small { color: var(--muted); font-size: 13px; }

/* ---------- school / class cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.stats-grid + .card-grid { margin-top: 24px; }
.item-card {
  display: block;
  padding: 18px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  color: inherit;
  transition: transform .18s ease, box-shadow .18s ease;
}
.item-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.item-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.item-ico {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}
.item-pct { font-family: "Poppins", system-ui, sans-serif; font-weight: 800; font-size: 20px; color: var(--brand); }
.item-pct.good { color: var(--ok); }
.item-pct.low { color: var(--bad); }
.item-title { font-size: 18px; font-weight: 700; margin-bottom: 10px; }
.progress { height: 8px; border-radius: 99px; background: var(--bad-soft); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #22c55e, var(--ok)); }
.item-foot { display: flex; gap: 12px; margin-top: 12px; font-size: 13px; }
.item-foot .muted { margin-left: auto; }

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  background: var(--card);
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  margin-top: 20px;
}
.empty p { margin: 0; max-width: 420px; }

/* ---------- class page ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 26px 0 14px; }
.search {
  display: flex;
  flex-direction: row;
  align-items: center;
  font-weight: 400;
  gap: 8px;
  flex: 1;
  min-width: 220px;
  max-width: 380px;
  padding: 0 14px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
}
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search input,
.search input:focus {
  flex: 1;
  width: 100%;
  border: none;
  outline: none;
  box-shadow: none;
  padding: 11px 0;
  margin: 0;
  font: inherit;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
}
.search input::-webkit-search-decoration,
.search input::-webkit-search-cancel-button,
.search input::-webkit-search-results-button { display: none; }
.tabs { display: flex; gap: 4px; padding: 4px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.tab {
  padding: 7px 14px;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}
.tab:hover { background: var(--bg); color: var(--text); }
.tab.active { background: var(--brand); color: #fff; }
.tab em { font-style: normal; opacity: .7; margin-left: 4px; font-size: 12px; }

.student-list { display: flex; flex-direction: column; gap: 8px; }
.student {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--card);
  border-radius: 14px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--bad-soft);
  transition: box-shadow .15s;
}
.student.is-ok { border-left-color: #86efac; }
.student:hover { box-shadow: var(--shadow-hover); }
.student[hidden] { display: none; }
.avatar {
  position: relative;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand-soft), #fed7aa);
  color: var(--brand);
  font-weight: 700;
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.student-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.student-info b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-info small { display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}
.pill.ok { background: var(--ok-soft); color: #166534; }
.pill.bad { background: var(--bad-soft); color: #991b1b; }
.empty-filter { text-align: center; padding: 20px; }

/* ---------- buttons & forms ---------- */
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: filter .15s, transform .1s, box-shadow .15s;
}
button:hover { filter: brightness(1.08); box-shadow: 0 4px 14px rgba(234, 88, 12, .25); }
button:active { transform: translateY(1px); }
button.icon-btn, button.tab { box-shadow: none; filter: none; }
button.tab.active { background: var(--brand); }
button.icon-btn { background: transparent; }
button.btn-sm { padding: 7px 12px; font-size: 13px; }
button.btn-lg { padding: 13px; font-size: 16px; }
button.secondary { background: var(--bg); color: var(--text); border: 1px solid var(--line); }
button.secondary:hover { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
button.danger { background: var(--bad-soft); color: #991b1b; }
button.danger:hover { background: #fecaca; box-shadow: none; }
form { margin: 0; }
form.inline { display: flex; gap: 6px; }

input, select {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, #7c6a5c 50%), linear-gradient(135deg, #7c6a5c 50%, transparent 50%);
  background-position: calc(100% - 18px) calc(50% - 2px), calc(100% - 12px) calc(50% - 2px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
input[type="file"] { padding: 8px 12px; background: #fff; }
.user-form .muted { margin: 0 0 14px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.error { background: var(--bad-soft); color: #991b1b; padding: 12px 16px; border-radius: 12px; font-weight: 600; }

.panel { background: var(--card); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin-bottom: 22px; }
.stats-grid + .panel { margin-top: 22px; }
.panel h2 { display: flex; align-items: center; gap: 8px; margin: 0 0 16px; font-size: 17px; color: var(--brand); }
.user-form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; margin-bottom: 14px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; border-radius: var(--radius); box-shadow: var(--shadow); }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line); }
th { font-size: 12px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); background: #fffaf4; }
tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fff7ef; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell span:last-child { display: flex; flex-direction: column; }
.user-cell small { font-size: 12px; }
.role { display: inline-block; padding: 4px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; }
.role-admin { background: #ede9fe; color: #5b21b6; }
.role-school { background: var(--brand-soft); color: var(--brand); }
.role-teacher { background: var(--ok-soft); color: #166534; }

/* ---------- login ---------- */
.login-body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 24px;
  background:
    radial-gradient(700px 420px at 12% 8%, rgba(251, 191, 36, .35), transparent 60%),
    radial-gradient(640px 420px at 92% 92%, rgba(249, 115, 22, .30), transparent 60%),
    linear-gradient(160deg, #fff7ed, #ffedd5);
}
.login-box {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 36px 32px;
  background: rgba(255, 255, 255, .9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: 22px;
  box-shadow: 0 20px 60px rgba(234, 88, 12, .15);
}
.login-brand { justify-content: center; gap: 16px; margin: 0 0 4px; }
.login-brand .brand-mark { width: 64px; height: 64px; border-radius: 20px; }
.login-brand .brand-text b { font-size: 32px; }
.login-brand .brand-text i { font-size: 12px; letter-spacing: 3.4px; }
.login-hint { margin: 0; text-align: center; color: var(--muted); font-size: 14px; }
.login-foot { margin: 0; color: var(--muted); font-size: 13px; }
.welcome-box { max-width: 440px; }
.welcome-box h2 { margin: 8px 0 0; font-size: 13px; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.welcome-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.welcome-steps li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.welcome-steps .ico { color: var(--brand); }
button.who-card, a.who-card {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  box-shadow: none;
  text-align: left;
  box-sizing: border-box;
}
button.who-card:hover, a.who-card:hover { filter: none; background: var(--brand-soft); box-shadow: none; color: var(--text); }
.who-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.who-text b { font-size: 15px; }
.who-text small { color: var(--muted); font-size: 12px; font-weight: 600; }
.who-card > .ico:last-child { color: var(--muted); }
.guide {
  background: #fff;
  border: 1px solid #fed7aa;
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.guide h2 { margin: 0 0 6px; font-size: 20px; }
.guide p { margin: 0; color: var(--muted); }
.guide ol { margin: 12px 0 14px; padding-left: 18px; }
.guide li { margin: 6px 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grade .section-title { margin-top: 8px; }
a.action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 18px;
  padding: 10px 16px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 600;
}
a.action:hover { filter: brightness(1.08); color: #fff; }
.secret { position: relative; display: block; }
.secret input { width: 100%; padding-right: 46px; }
button.secret-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}
button.secret-btn:hover { background: var(--brand-soft); color: var(--brand); filter: none; box-shadow: none; }
.secret-btn .eye-on, .secret-btn .eye-off { display: grid; place-items: center; }
.secret-btn .eye-off, .secret-btn.on .eye-on { display: none; }
.secret-btn.on .eye-off { display: grid; }

.role-pick { position: relative; }
button.role-current {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  box-shadow: none;
  font-weight: 600;
}
button.role-current:hover, button.role-current:focus {
  filter: none;
  box-shadow: 0 0 0 3px var(--brand-soft);
  border-color: var(--brand);
  background: #fff;
}
.role-current > .ico { color: var(--muted); flex-shrink: 0; }
.role-current-body { display: flex; align-items: center; gap: 10px; min-width: 0; }
.role-current-body small { display: none; }
.role-pick.open { z-index: 40; }
.role-menu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 260px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-hover);
}
.role-menu[hidden] { display: none; }
button.role-option {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  box-shadow: none;
  text-align: left;
  font-weight: 500;
}
button.role-option:hover { filter: none; box-shadow: none; background: var(--bg); }
button.role-option.active { background: var(--brand-soft); }
button.role-option b { display: block; font-size: 14px; }
button.role-option small { display: block; color: var(--muted); font-size: 12px; font-weight: 500; }
.role-ico {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.role-ico.school { background: var(--brand-soft); color: var(--brand); }
.role-ico.teacher { background: var(--ok-soft); color: #166534; }
.role-ico.admin { background: #fef3c7; color: #92400e; }
.with-chevron { position: relative; display: block; }
.with-chevron input { width: 100%; padding-right: 40px; }
.with-chevron > .ico {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}
input[list]::-webkit-calendar-picker-indicator { opacity: 0; display: none; width: 0; }
.photo-field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.photo-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
button.photo-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  box-shadow: none;
}
button.photo-btn.camera { background: var(--ok-soft); color: #166534; }
button.photo-btn:hover { filter: none; box-shadow: none; }
.photo-pick small { color: var(--muted); font-weight: 500; }
button.photo-btn.only-phone { display: none; }
@media (max-width: 760px) {
  button.photo-btn.only-desk { display: none; }
  button.photo-btn.only-phone { display: inline-flex; }
}
.edit-link { font-size: 13px; font-weight: 600; }
.edit-photo { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; }
.edit-photo.initials {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 800;
  font-size: 22px;
}

/* ---------- mobile ---------- */
@media (max-width: 760px) {
  .topbar-inner { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .brand { margin-right: auto; }
  .day-nav { order: 3; width: 100%; justify-content: space-between; }
  .nav-link span, .user-meta { display: none; }
  .user-chip { border-left: none; padding-left: 0; }
  main { padding: 16px 14px 40px; }
  h1 { font-size: 24px; }
  .ring { width: 76px; height: 76px; }
  .ring span { font-size: 18px; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; gap: 10px; }
  .stat-ico { width: 38px; height: 38px; }
  .stat b { font-size: 22px; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search { max-width: none; }
  .tabs { justify-content: space-between; }
  .tab { flex: 1; padding: 7px 6px; }
  .student { padding: 10px 12px; gap: 10px; }
  .student .pill { display: none; }
  .avatar { width: 42px; height: 42px; }
}

/* ---------- Yuzni ro'yxatga olish (Face ID uslubi) va sinf rasmi ---------- */
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; }
a.action.secondary { background: var(--ok-soft); color: #166534; }
a.action.secondary:hover { color: #166534; }
.photo-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 10px;
  background: var(--brand-soft); color: var(--brand); font-weight: 600; text-decoration: none; border: 0; cursor: pointer; }
.photo-btn.active { background: var(--brand); color: #fff; }
button.photo-btn.danger { background: var(--bad-soft); color: #991b1b; }
.cam-sources { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.inline-form { display: inline; margin: 0; }
.note { background: var(--brand-soft); color: var(--brand); padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.enroll-cam { display: grid; grid-template-columns: minmax(0, 2fr) minmax(220px, 1fr); gap: 18px; margin: 10px 0 16px; }
@media (max-width: 760px) { .enroll-cam { grid-template-columns: 1fr; } }
.cam-stage { position: relative; background: #1f140b; border-radius: 14px; overflow: hidden; line-height: 0; }
.cam-stage video, .cam-stage img { width: 100%; height: auto; display: block; }
.cam-stage video.mirror { transform: scaleX(-1); }
.pose-text { font-size: 18px; font-weight: 700; margin: 4px 0 0; }
.cam-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.live-preview { margin-top: 8px; }
.live-preview summary { cursor: pointer; font-weight: 600; color: var(--brand); }
.live-preview img { width: 100%; border-radius: 12px; margin-top: 8px; }
.class-photo { position: relative; line-height: 0; border-radius: 12px; overflow: hidden; }
.class-photo img { width: 100%; display: block; }
.face-mark { position: absolute; border: 2px solid #22c55e; border-radius: 6px; line-height: 1.2; text-decoration: none; }
.face-mark span { position: absolute; left: -2px; bottom: 100%; white-space: nowrap; font-size: 11px; font-weight: 700;
  background: #22c55e; color: #fff; padding: 1px 5px; border-radius: 4px; }
.face-mark.unknown { border-color: #ef4444; } .face-mark.unknown span { background: #ef4444; }
.face-mark.ignored { border-color: #9ca3af; opacity: .6; } .face-mark.ignored span { background: #9ca3af; }
.legend { display: flex; gap: 14px; align-items: center; font-size: 13px; color: var(--muted); margin: 10px 0 0; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; border: 2px solid #22c55e; margin-right: -8px; }
.legend i.unknown { border-color: #ef4444; } .legend i.ignored { border-color: #9ca3af; }
.face-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
.face-card { display: flex; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; }
.face-card > img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; flex: none; }
.face-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.face-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.face-actions select { max-width: 100%; padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
.face-actions .photo-btn { padding: 7px 10px; font-size: 13px; }
.known-list { columns: 2 220px; margin: 0; padding-left: 18px; }
.enroll-cam.simple { display: block; max-width: 900px; }
.enroll-cam.simple .pose-text { font-size: 16px; margin: 12px 0 4px; }
.enroll-cam.simple .cam-actions { justify-content: flex-start; }
.student-name { color: inherit; text-decoration: none; }
.student-name:hover b { color: var(--brand); }
a.avatar { text-decoration: none; }
.danger-zone { border: 1px solid var(--bad-soft); }
.danger-zone h2 { color: var(--bad); }
.delete-confirm { display: flex; flex-direction: column; gap: 10px; background: var(--bad-soft);
  padding: 14px; border-radius: 12px; color: #991b1b; }
.delete-confirm[hidden] { display: none; }
.stat.late .stat-ico { background: #fef3c7; color: #b45309; }
.pill.late { background: #fef3c7; color: #92400e; }
.pill.seen { background: var(--brand-soft); color: var(--brand); }
.lesson-bar { display: flex; flex-wrap: wrap; gap: 8px 18px; align-items: center; background: var(--card);
  border-radius: 12px; padding: 12px 16px; margin: 0 0 18px; box-shadow: var(--shadow); font-size: 14px; }
.lesson-bar span { display: inline-flex; align-items: center; gap: 6px; }
.schedule-table { width: 100%; border-collapse: collapse; }
.schedule-table td, .schedule-table th { padding: 6px 8px; text-align: left; }
.schedule-table input[type=time] { padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
.lesson-chips { display: inline-flex; gap: 3px; margin-top: 4px; flex-wrap: wrap; }
.lesson-chips i { font-style: normal; font-size: 11px; font-weight: 700; width: 20px; height: 20px; border-radius: 6px;
  display: grid; place-items: center; }
.lesson-chips i.on { background: var(--ok-soft); color: #166534; }
.lesson-chips i.off { background: var(--bad-soft); color: #991b1b; }
.report-filter { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.report-filter .tabs a.tab { text-decoration: none; }
.date-range { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.date-range input { padding: 8px; border-radius: 8px; border: 1px solid var(--line); }
.report-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.report-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 2px solid var(--line); }
.report-table td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.report-table td.place { font-size: 18px; font-weight: 700; }
.report-table tr.warn td { background: #fffbeb; }
.report-table .bar { display: inline-block; width: 80px; height: 8px; background: var(--line); border-radius: 4px;
  overflow: hidden; margin-right: 8px; vertical-align: middle; }
.report-table .bar i { display: block; height: 100%; background: var(--ok); }
.xl-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; }
.limit-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.limit-form input { width: 78px; padding: 6px; border-radius: 8px; border: 1px solid var(--line); }
.cam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.cam-card { margin-bottom: 0; display: flex; flex-direction: column; gap: 8px; }
.cam-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cam-shot { width: 100%; border-radius: 10px; background: #1f140b; aspect-ratio: 16 / 9; object-fit: cover; }
.user-form select { padding: 10px; border-radius: 10px; border: 1px solid var(--line); width: 100%; }


/* ---------- obuna (litsenziya) ---------- */
.sub-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  padding: 12px 16px;
  border-radius: 12px;
  background: linear-gradient(90deg, #fff1e0, #fff7ed);
  border: 1px solid #fed7aa;
  color: #9a3412;
  font-size: 14px;
}
.sub-cell { min-width: 170px; }
.sub-cell small { display: block; margin: 4px 0 8px; }
.pill.trial { background: #fef3c7; color: #92400e; }
.blocked-box { max-width: 440px; text-align: center; }
.blocked-box h1 { margin: 4px 0 0; font-size: 22px; color: var(--brand-dark); }
.blocked-box p { margin: 0; line-height: 1.5; }

/* ---------- boshqaruv sayti ---------- */
.owner-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 22px 0; }
.owner-stats .panel { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.owner-stats small { color: var(--muted); font-weight: 600; }
.owner-stats b { font-size: 30px; font-family: "Poppins", system-ui, sans-serif; color: var(--brand); }
.owner-stats .alert { background: var(--bad-soft); }
.owner-stats .alert b { color: var(--bad); }
.owner-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: 13px; word-break: break-all; }
