/* Admin streams: Ағындар → ағын → топтар, plus directions */
.st-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.st-card {
  position: relative;
  border: 1px solid var(--test-line);
  border-radius: 18px;
  background: #fff;
  overflow: hidden;
}
.st-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: #34409d;
}
.st-card--marathon::before { background: #d4ff3a; }
.st-card.is-archived { opacity: 0.72; }
.st-card-link { display: grid; gap: 8px; padding: 18px 18px 16px; color: inherit; }
.st-card-link:hover strong { color: var(--test-blue); }
.st-card-link:focus-visible { outline: 3px solid #959ee0; outline-offset: -3px; border-radius: 18px; }
.st-card-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.st-card strong { font-size: 18px; line-height: 1.25; overflow-wrap: anywhere; }
.st-card small { display: inline-flex; align-items: center; gap: 6px; color: var(--test-muted); font-size: 13px; }
.st-card small svg { width: 15px; height: 15px; }
.st-kind {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #34409d;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}
.st-kind svg { width: 15px; height: 15px; }
.st-card-stats { display: flex; gap: 16px; margin-top: 4px; color: var(--test-muted); font-size: 13px; }
.st-card-stats b { color: var(--test-ink); font-size: 17px; }

.st-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.st-section-head h2 { margin: 0 0 4px; font-size: 19px; }
.st-section-head p { margin: 0; max-width: 62ch; font-size: 14px; line-height: 1.5; }
.st-section-head .button { flex-shrink: 0; }

.st-direction-list, .st-group-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.st-direction {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--test-line);
  border-radius: 14px;
  background: #fbfbff;
}
.st-direction > div { flex: 1; min-width: 0; display: grid; gap: 6px; }
.st-direction.is-archived { opacity: 0.7; }

.st-hero { align-items: flex-end; }
.st-hero h1 { overflow-wrap: anywhere; }
.st-hero-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; color: var(--test-muted); }
.st-hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.st-hero-meta svg { width: 16px; height: 16px; }

.st-group {
  display: grid;
  grid-template-columns: minmax(150px, 1.2fr) minmax(140px, 1fr) minmax(160px, 1.4fr) auto auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--test-line);
  border-radius: 14px;
  background: #fbfbff;
}
.st-group-main { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; min-width: 0; }
.st-group-main strong { font-size: 16px; overflow-wrap: anywhere; }
.st-group-main .tag { padding: 2px 8px; border-radius: 99px; background: #34409d; color: #fff; font-size: 11px; font-weight: 700; }
.st-group-curator { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: 14px; overflow-wrap: anywhere; }
.st-group-curator svg { flex-shrink: 0; width: 16px; height: 16px; color: var(--test-muted); }
.st-warn { color: #87530c; font-weight: 600; }
.st-group-students {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--test-blue);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.st-group-students svg { width: 15px; height: 15px; }
.st-group .test-menu { margin-left: 0; }

.stream-dialog fieldset { display: grid; gap: 8px; margin: 4px 0 12px; padding: 0; border: 0; }
.stream-dialog legend { margin-bottom: 6px; font-weight: 600; }
.st-courses { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.st-kind-choice { grid-auto-flow: column; justify-content: start; gap: 18px !important; }
.st-check { display: inline-flex !important; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
.st-check input { width: 18px; height: 18px; margin: 0; accent-color: #34409d; }
.st-check[hidden] { display: none !important; }
.st-dates { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Dashboard */
.dash-streams { margin-bottom: 18px; }
.dash-stream-list { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.dash-stream {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid var(--test-line);
  border-left: 5px solid #34409d;
  border-radius: 14px;
  background: #fbfbff;
}
.dash-stream > a { display: grid; gap: 2px; color: inherit; }
.dash-stream > a strong { font-size: 17px; overflow-wrap: anywhere; }
.dash-stream > a:hover strong { color: var(--test-blue); }
.dash-stream-stats { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--test-muted); font-size: 14px; }
.dash-stream-stats b { color: var(--test-ink); font-size: 16px; }
.dash-curators td, .dash-curators th { white-space: nowrap; }

/* New-student form: what the chosen group opens */
.new-student-group-info { display: grid; gap: 4px; margin-top: 8px; }

/* Staff bottom bar on phones: up to seven items, short labels on one line */
@media (max-width: 760px) {
  .staff-bottom-nav a { min-width: 0; padding-inline: 2px; }
  .staff-bottom-nav a span { display: block; max-width: 100%; overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
}

@media (max-width: 900px) {
  .st-group { grid-template-columns: minmax(0, 1fr) auto auto; }
  .st-group-curator, .st-group-courses { grid-column: 1 / -1; }
  .st-group-main { grid-column: 1; grid-row: 1; }
  .st-group-students { grid-column: 2; grid-row: 1; }
  .st-group .test-menu { grid-column: 3; grid-row: 1; }
}
@media (max-width: 560px) {
  .st-section-head { flex-direction: column; }
  .st-section-head .button { width: 100%; justify-content: center; }
  .st-dates { grid-template-columns: minmax(0, 1fr); }
}

/* Section tabs: Курстар | Тесттер and Оқушылар | Қызметкерлер | Топтар */
.section-tabs {
  display: inline-flex;
  gap: 4px;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 4px;
  border: 1px solid var(--test-line);
  border-radius: 14px;
  background: #fff;
  overflow-x: auto;
}
.section-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 10px;
  color: var(--test-muted);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}
.section-tabs a svg { width: 16px; height: 16px; flex-shrink: 0; }
.section-tabs a:hover { background: var(--test-tint); color: var(--test-ink); }
.section-tabs a[aria-current="page"] { background: #34409d; color: #fff; }
.section-tabs a[aria-current="page"] svg { color: #d4ff3a; }
.section-tabs a:focus-visible { outline: 3px solid #959ee0; outline-offset: 1px; }
@media (max-width: 560px) {
  .section-tabs { display: flex; }
  .section-tabs a { flex: 1 0 auto; justify-content: center; padding: 8px 10px; font-size: 13px; }
}
.st-group-links { display: grid; gap: 4px; justify-items: end; }
