/* =====================================================================
   tabel.headways.space — стиль (Linear/Vercel рухында, қараңғы тақырып әдепкі)
   ===================================================================== */
:root {
  --bg: #0b0c0f;
  --bg-2: #111318;
  --card: #15171d;
  --card-2: #1b1e25;
  --border: #262a33;
  --border-2: #323743;
  --text: #e8eaef;
  --text-2: #a2a8b5;
  --muted: #707786;
  --accent: #6b7cff;
  --accent-2: #5566f0;
  --accent-soft: rgba(107,124,255,.14);
  --green: #3fcf8e;
  --green-soft: rgba(63,207,142,.13);
  --amber: #f5b544;
  --amber-soft: rgba(245,181,68,.13);
  --red: #f26d6d;
  --red-soft: rgba(242,109,109,.13);
  --blue: #5aa9ff;
  --blue-soft: rgba(90,169,255,.13);
  --radius: 10px;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f6f7f9;
  --bg-2: #eef0f3;
  --card: #ffffff;
  --card-2: #f8f9fb;
  --border: #e3e6eb;
  --border-2: #d3d7de;
  --text: #16181d;
  --text-2: #4a505c;
  --muted: #7a8190;
  --accent: #4f5ff0;
  --accent-2: #3f4fe0;
  --accent-soft: rgba(79,95,240,.10);
  --green: #13925b;
  --green-soft: rgba(19,146,91,.10);
  --amber: #b87a0a;
  --amber-soft: rgba(184,122,10,.10);
  --red: #d33b3b;
  --red-soft: rgba(211,59,59,.09);
  --blue: #2474d6;
  --blue-soft: rgba(36,116,214,.10);
  --shadow: 0 1px 2px rgba(16,24,40,.05), 0 4px 16px rgba(16,24,40,.04);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0 0 .5em; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 .8em; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.mono { font-variant-numeric: tabular-nums; }
hr { border: 0; border-top: 1px solid var(--border); margin: 20px 0; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.topbar-inner {
  max-width: 1320px; margin: 0 auto; padding: 0 20px;
  height: 56px; display: flex; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; color: var(--text); font-size: 15px; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 22px; height: 22px; border-radius: 6px; display: inline-block;
  background: linear-gradient(135deg, var(--accent), #9b6bff);
  position: relative;
}
.brand-mark::after {
  content: ""; position: absolute; left: 5px; right: 5px; top: 7px; height: 8px;
  border-top: 2px solid #fff; border-bottom: 2px solid #fff; opacity: .9;
}
.brand-mark.lg { width: 40px; height: 40px; border-radius: 11px; }
.brand-mark.lg::after { left: 10px; right: 10px; top: 13px; height: 14px; border-width: 3px; }
.nav { display: flex; gap: 2px; flex: 1; }
.nav a {
  color: var(--text-2); padding: 6px 11px; border-radius: 7px; font-size: 13.5px;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav a:hover { background: var(--card-2); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--card-2); color: var(--text); }
.dot-count {
  background: var(--red); color: #fff; border-radius: 99px; font-size: 11px;
  min-width: 18px; height: 18px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center;
}
.user-box { display: flex; align-items: center; gap: 12px; }
.user-meta { text-align: right; line-height: 1.25; }
.user-name { font-size: 13px; font-weight: 500; }
.user-role { font-size: 11.5px; color: var(--muted); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: 1px solid var(--border); color: var(--text-2);
  width: 32px; height: 32px; border-radius: 8px; cursor: pointer; font-size: 15px;
}
.icon-btn:hover { background: var(--card-2); }
.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 20px; cursor: pointer; }

.container { max-width: 1320px; width: 100%; margin: 0 auto; padding: 28px 20px 40px; flex: 1; }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 18px; border-top: 1px solid var(--border); }

/* ---------- Page head ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar select, .toolbar input[type=text] { width: auto; min-width: 120px; }

/* ---------- Cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow);
}
.card + .card { margin-top: 14px; }
.grid > .card + .card { margin-top: 0; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.stat { padding: 16px 18px; }
.stat .label { color: var(--muted); font-size: 12.5px; }
.stat .value { font-size: 24px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.stat .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 14px; border-radius: 8px; font-size: 13.5px; font-weight: 500;
  border: 1px solid var(--border-2); background: var(--card-2); color: var(--text);
  cursor: pointer; white-space: nowrap; font-family: inherit;
}
.btn:hover { text-decoration: none; border-color: var(--muted); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-success { background: var(--green); border-color: var(--green); color: #fff; }
.btn-danger { background: transparent; border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn-ghost:hover { background: var(--card-2); border-color: var(--border); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 5px; font-weight: 500; }
input[type=text], input[type=password], input[type=number], input[type=month], input[type=tel], select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 8px 11px; font: inherit; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input:disabled, select:disabled, textarea:disabled { opacity: .65; }
textarea { min-height: 70px; resize: vertical; }
select { cursor: pointer; }
.inline-form { display: inline; }
.check { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 160px; }

/* ---------- Alerts / badges ---------- */
.alert { padding: 11px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid; font-size: 13.5px; }
.alert-success { background: var(--green-soft); border-color: color-mix(in srgb, var(--green) 35%, transparent); color: var(--green); }
.alert-error { background: var(--red-soft); border-color: color-mix(in srgb, var(--red) 35%, transparent); color: var(--red); }
.alert-info { background: var(--blue-soft); border-color: color-mix(in srgb, var(--blue) 35%, transparent); color: var(--blue); }
.alert-warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 35%, transparent); color: var(--amber); }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-draft { background: var(--card-2); color: var(--text-2); border: 1px solid var(--border); }
.badge-submitted { background: var(--blue-soft); color: var(--blue); }
.badge-returned { background: var(--amber-soft); color: var(--amber); }
.badge-approved { background: var(--green-soft); color: var(--green); }
.badge-none { background: transparent; color: var(--muted); border: 1px dashed var(--border-2); }
.tag { display: inline-block; font-size: 11.5px; padding: 1px 7px; border-radius: 5px; background: var(--card-2); border: 1px solid var(--border); color: var(--text-2); }
.tag-accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.tag-red { background: var(--red-soft); color: var(--red); border-color: transparent; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card); }
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; }
.table th { font-weight: 500; color: var(--muted); font-size: 12px; background: var(--card-2); white-space: nowrap; }
.table tbody tr:hover { background: color-mix(in srgb, var(--card-2) 60%, transparent); }
.table tr:last-child td { border-bottom: 0; }
.table tfoot td { font-weight: 600; background: var(--card-2); border-top: 1px solid var(--border-2); }
.table td.person { min-width: 200px; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table .zero { color: var(--muted); }

/* ---------- Progress ---------- */
.progress { height: 6px; background: var(--bg-2); border-radius: 99px; overflow: hidden; border: 1px solid var(--border); }
.progress > div { height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }
.progress.good > div { background: var(--green); }
.progress.mid > div { background: var(--amber); }
.progress.low > div { background: var(--red); }
.pct-cell { display: flex; align-items: center; gap: 10px; min-width: 130px; }
.pct-cell .progress { flex: 1; }

/* ---------- Criterion cards (teacher form) ---------- */
.crit { display: grid; grid-template-columns: 1fr 190px; gap: 20px; }
.crit-num { display: inline-flex; width: 24px; height: 24px; border-radius: 7px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 12.5px; align-items: center; justify-content: center; margin-right: 8px; flex-shrink: 0; }
.crit-title { display: flex; align-items: center; font-weight: 600; font-size: 15px; margin-bottom: 6px; }
.crit-desc { color: var(--text-2); font-size: 13px; margin-bottom: 8px; }
.crit-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.crit-side { border-left: 1px solid var(--border); padding-left: 20px; display: flex; flex-direction: column; justify-content: center; }
.crit-amount { font-size: 22px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.crit-amount.zero { color: var(--muted); }
.crit-max { color: var(--muted); font-size: 12.5px; }
.input-unit { display: flex; align-items: center; gap: 8px; max-width: 220px; }
.input-unit input { text-align: right; font-variant-numeric: tabular-nums; }
.input-unit .unit { color: var(--muted); min-width: 28px; }
.override { margin-top: 10px; padding: 10px 12px; background: var(--amber-soft); border-radius: 8px; font-size: 12.5px; color: var(--amber); }

/* ---------- Screenshots ---------- */
.shots { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 10px; align-items: center; }
.shot { position: relative; width: 92px; height: 92px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--bg-2); }
.shot img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.shot .del {
  position: absolute; top: 4px; right: 4px; width: 22px; height: 22px; border-radius: 6px;
  background: rgba(0,0,0,.65); color: #fff; border: 0; cursor: pointer; font-size: 13px; line-height: 1;
}
.shot-add {
  width: 92px; height: 92px; border-radius: 8px; border: 1px dashed var(--border-2);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); cursor: pointer; font-size: 12px; text-align: center; background: transparent;
}
.shot-add:hover { border-color: var(--accent); color: var(--accent); }
.shot-add .plus { font-size: 22px; line-height: 1; }
.shot.loading::after { content: "…"; position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(0,0,0,.5); color: #fff; font-size: 22px; }

.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.85); display: none; align-items: center; justify-content: center; z-index: 100; cursor: zoom-out; padding: 20px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; border-radius: 8px; }

/* ---------- Sticky summary bar ---------- */
.sumbar {
  position: sticky; bottom: 0; z-index: 10; margin-top: 18px;
  background: var(--card); border: 1px solid var(--border-2); border-radius: var(--radius);
  padding: 14px 18px; display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  box-shadow: 0 -8px 30px rgba(0,0,0,.25);
}
.sumbar .total { font-size: 20px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sumbar .grow { flex: 1; min-width: 180px; }

/* ---------- Announcements ---------- */
.ann { padding: 16px 18px; }
.ann.unread { border-left: 3px solid var(--accent); }
.ann.important { border-left: 3px solid var(--red); }
.ann-title { font-weight: 600; font-size: 15px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ann-meta { color: var(--muted); font-size: 12px; margin: 3px 0 10px; }
.ann-body { white-space: pre-wrap; color: var(--text-2); }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 140px); display: flex; align-items: center; justify-content: center; }
.auth-card { width: 100%; max-width: 380px; padding: 30px 28px; }
.auth-logo { display: flex; justify-content: center; margin-bottom: 14px; }
.auth-title { text-align: center; font-size: 19px; margin-bottom: 4px; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.list-inline { display: flex; gap: 6px; flex-wrap: wrap; }
details summary { cursor: pointer; color: var(--text-2); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: 1fr; }
  .nav-toggle { display: block; margin-left: auto; }
  .nav { display: none; position: absolute; top: 56px; left: 0; right: 0; flex-direction: column; background: var(--card); border-bottom: 1px solid var(--border); padding: 8px 12px; }
  body.nav-open .nav { display: flex; }
  .user-meta { display: none; }
}
@media (max-width: 680px) {
  .container { padding: 18px 14px 30px; }
  .grid-2 { grid-template-columns: 1fr; }
  .crit { grid-template-columns: 1fr; }
  .crit-side { border-left: 0; border-top: 1px solid var(--border); padding: 14px 0 0; }
  .topbar-inner { padding: 0 14px; gap: 12px; }
}

/* ---------- Print ---------- */
@media print {
  .topbar, .footer, .no-print, .sumbar { display: none !important; }
  body { background: #fff; color: #000; }
  .container { max-width: none; padding: 0; }
}
