:root {
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #eef8f2;
  --surface-warm: #fff8e7;
  --text: #17211c;
  --muted: #66706b;
  --faint: #909995;
  --border: #e4e8ec;
  --primary: #2f8f5d;
  --primary-strong: #1f6f47;
  --primary-soft: #e7f5ed;
  --blue-soft: #edf5ff;
  --blue: #2f6f9f;
  --purple-soft: #f4efff;
  --purple: #6654a3;
  --yellow-soft: #fff6d8;
  --yellow: #8d6508;
  --danger: #b84949;
  --danger-soft: #fff0f0;
  --orange-soft: #fff3e5;
  --orange: #b8671d;
  --pink-soft: #fff0f5;
  --pink: #a94d6a;
  --mint-soft: #ecf8f1;
  --sky-soft: #eef7ff;
  --shadow: 0 18px 48px rgba(26, 39, 55, 0.08);
  --shadow-soft: 0 8px 22px rgba(26, 39, 55, 0.055);
  --radius: 14px;
  --radius-sm: 10px;
  --sidebar: 238px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 2rem;
  line-height: 1.12;
  letter-spacing: 0;
}

h2 {
  font-size: 1.08rem;
  line-height: 1.25;
}

h3 {
  font-size: 1rem;
  line-height: 1.25;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 20px 14px;
  background: #ffffff;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 6px 14px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary);
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 22px rgba(47, 143, 93, 0.18);
}

.brand-title {
  font-weight: 850;
  font-size: 1.08rem;
  line-height: 1.1;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 2px;
}

.nav-list {
  display: grid;
  gap: 4px;
}

.nav-item {
  border: 0;
  width: 100%;
  min-height: 42px;
  border-radius: 10px;
  padding: 0 11px;
  background: transparent;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  font-weight: 720;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.nav-item:hover {
  background: #f3f6f4;
  color: var(--primary-strong);
}

.nav-item.active {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.nav-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #f4f6f5;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.nav-item.active .nav-icon {
  background: #ffffff;
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border-radius: 12px;
  background: #f7faf8;
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  display: grid;
  gap: 4px;
}

.sidebar-note strong {
  color: var(--text);
}

.main {
  min-width: 0;
  padding: 30px;
  padding-bottom: 40px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
  padding: 0 0 12px;
}

.eyebrow,
.soft-label {
  color: var(--primary-strong);
  font-size: 0.75rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0;
}

.subtext {
  color: var(--muted);
  margin-top: 7px;
  line-height: 1.45;
  max-width: 720px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profile-chip {
  min-height: 44px;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 9px;
  box-shadow: var(--shadow-soft);
}

.profile-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 850;
  overflow: hidden;
}

.profile-chip span:last-child {
  display: grid;
  line-height: 1.2;
}

.profile-chip small {
  color: var(--muted);
  font-size: 0.72rem;
}

.mobile-app-header {
  display: none;
}

.icon-button {
  position: relative;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f2f4f3;
  color: var(--muted);
}

.notif-badge {
  position: absolute;
  top: -2px;
  right: -1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #f04f57;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 850;
}

.teacher-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-weight: 850;
  overflow: hidden;
}

.profile-avatar img,
.teacher-avatar img,
.student-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.link-action {
  border: 0;
  background: transparent;
  color: var(--primary-strong);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 760;
  padding: 0;
}

.link-action svg {
  width: 16px;
  height: 16px;
}

.btn {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0 14px;
  background: var(--surface);
  color: var(--text);
  font-weight: 760;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  box-shadow: none;
}

.btn.primary {
  background: var(--primary);
  color: #fff;
}

.btn.primary:hover {
  background: var(--primary-strong);
}

.btn.secondary {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.btn.outline {
  border-color: var(--border);
  background: var(--surface);
}

.btn.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.btn.small {
  min-height: 32px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 0.84rem;
}

.grid {
  display: grid;
  gap: 16px;
}

.hero-panel {
  margin-bottom: 18px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.hero-panel h2 {
  margin-top: 8px;
  max-width: 680px;
  font-size: 1.55rem;
}

.hero-panel p {
  color: var(--muted);
  line-height: 1.5;
  margin-top: 8px;
  max-width: 680px;
}

.hero-date {
  min-width: 150px;
  align-self: stretch;
  border-radius: 12px;
  background: #f8faf9;
  border: 1px solid var(--border);
  display: grid;
  place-content: center;
  gap: 4px;
  text-align: center;
  color: var(--muted);
}

.hero-date strong {
  color: var(--text);
}

.stats-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 16px;
}

.stats-grid .stat-card:nth-child(1),
.stats-grid .stat-card:nth-child(4) {
  grid-column: span 2;
}

.stats-grid .stat-card:nth-child(2),
.stats-grid .stat-card:nth-child(3) {
  grid-column: span 2;
}

.dashboard-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.activity-wide {
  margin-top: 16px;
}

.two-col {
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr);
}

.card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.card-pad {
  padding: 18px;
}

.section-gap {
  margin-bottom: 16px;
}

.section-gap-top {
  margin-top: 16px;
}

.stat-card {
  padding: 17px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 11px;
}

.stat-card:nth-child(1) {
  background: #ffffff;
}

.stat-card:nth-child(2) {
  background: #ffffff;
}

.stat-card:nth-child(3) {
  background: #ffffff;
}

.stat-card:nth-child(4) {
  background: #ffffff;
}

.stat-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.stat-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 720;
}

.stat-icon,
.data-icon,
.empty-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--primary-strong);
  box-shadow: inset 0 0 0 1px rgba(58, 154, 103, 0.14);
}

.stat-value {
  font-size: 2.05rem;
  font-weight: 860;
  line-height: 1;
  color: #208447;
}

.stat-foot {
  color: var(--faint);
  font-size: 0.8rem;
}

.mini-progress {
  height: 5px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(39, 116, 73, 0.12);
}

.mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #2aa353;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.quick-card {
  min-height: 118px;
  text-align: left;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.quick-card:nth-child(1) {
  background: #ffffff;
  border-color: rgba(47, 143, 93, 0.22);
}

.quick-card:nth-child(2) {
  background: #ffffff;
  border-color: rgba(141, 101, 8, 0.18);
}

.quick-card:nth-child(3) {
  background: #ffffff;
  border-color: rgba(102, 84, 163, 0.18);
}

.quick-card:nth-child(4) {
  background: #ffffff;
  border-color: rgba(47, 111, 159, 0.18);
}

.quick-card:hover {
  transform: translateY(-2px);
  border-color: rgba(58, 154, 103, 0.42);
  box-shadow: var(--shadow-soft);
}

.quick-kicker {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: var(--primary-strong);
  background: var(--primary-soft);
  box-shadow: none;
}

.quick-title {
  font-weight: 820;
  margin-top: 8px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.section-title.compact {
  margin-bottom: 6px;
}

.schedule-list,
.list {
  display: grid;
  gap: 10px;
}

.schedule-item {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr) auto 18px;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.schedule-item::after {
  content: "›";
  color: var(--muted);
  font-size: 1.7rem;
  line-height: 1;
}

.schedule-time {
  font-weight: 840;
  color: #59645d;
  white-space: nowrap;
  text-align: center;
}

.schedule-time + div {
  position: relative;
  padding-left: 14px;
}

.schedule-time + div::before {
  content: "";
  position: absolute;
  left: 0;
  top: 3px;
  bottom: 3px;
  width: 3px;
  border-radius: 99px;
  background: var(--primary);
}

.schedule-item:nth-child(2) .schedule-time + div::before {
  background: #ff8a1d;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.toolbar .input,
.toolbar .select {
  max-width: 260px;
}

.field,
.input,
.select,
.textarea {
  width: 100%;
}

.input,
.select,
.textarea {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 10px;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--text);
  outline: none;
}

.textarea {
  min-height: 104px;
  resize: vertical;
  line-height: 1.5;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(58, 154, 103, 0.72);
  box-shadow: 0 0 0 3px rgba(58, 154, 103, 0.12);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

.time-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
}

.time-picker span {
  color: var(--muted);
  font-weight: 800;
}

.form-hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 14px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 730;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

th,
td {
  padding: 13px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
  font-size: 0.9rem;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0;
  background: #f8faf9;
}

tr:last-child td {
  border-bottom: 0;
}

.row-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 0.78rem;
  font-weight: 820;
  background: var(--surface-soft);
  color: var(--primary-strong);
}

.badge.good {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.badge.info {
  background: var(--blue-soft);
  color: var(--blue);
}

.badge.warn {
  background: var(--yellow-soft);
  color: var(--yellow);
}

.badge.bad {
  background: var(--danger-soft);
  color: var(--danger);
}

.badge-stack {
  margin-top: 8px;
}

.list-item {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
}

.attention-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
}

.attention-card p {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.84rem;
}

.attention-card .badge {
  margin-top: 5px;
}

.mini-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 850;
}

.student-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.student-photo {
  border-radius: 50%;
  overflow: hidden;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 850;
  border: 1px solid var(--border);
  flex: 0 0 auto;
}

.student-photo.tiny {
  width: 34px;
  height: 34px;
}

.student-photo.small {
  width: 44px;
  height: 44px;
}

.student-photo.preview {
  width: 92px;
  height: 92px;
  border-radius: 18px;
}

.photo-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.photo-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.activity-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border-bottom: 0;
}

.activity-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.activity-item:nth-child(2) .activity-icon {
  background: var(--yellow-soft);
  color: var(--yellow);
}

.activity-item:nth-child(3) .activity-icon {
  background: var(--purple-soft);
  color: var(--purple);
}

.activity-item p,
.activity-item time {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 3px;
}

.list-meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 4px;
  line-height: 1.4;
}

.journal-preview {
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.action-row {
  margin-top: 12px;
}

.empty {
  padding: 28px 18px;
  border: 1px dashed #cfd8d2;
  border-radius: var(--radius);
  text-align: center;
  color: var(--muted);
  background: #fbfcfd;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.empty strong {
  color: var(--text);
}

.empty .btn {
  margin-top: 4px;
}

.class-grid,
.mobile-card-list {
  display: none;
}

.data-card {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  gap: 10px;
}

.data-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.data-card p {
  color: var(--muted);
  line-height: 1.45;
}

.data-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.82rem;
}

.data-meta span,
.status-grid span {
  border-radius: 999px;
  background: #f5f7f6;
  padding: 5px 9px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  color: var(--muted);
  font-size: 0.84rem;
}

.status-grid span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.attendance-list,
.score-list {
  display: grid;
  gap: 9px;
}

.student-input-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 148px minmax(160px, 0.8fr);
  gap: 10px;
  align-items: center;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
}

.student-name {
  font-weight: 820;
}

.student-sub {
  color: var(--faint);
  font-size: 0.8rem;
  margin-top: 2px;
}

.tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.tab {
  border: 1px solid var(--border);
  background: var(--surface);
  min-height: 36px;
  border-radius: 999px;
  padding: 0 13px;
  font-weight: 760;
  color: var(--muted);
}

.tab.active {
  border-color: rgba(58, 154, 103, 0.45);
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.recap-visual-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.85fr) minmax(0, 1.15fr);
  gap: 16px;
  margin-bottom: 16px;
}

.recap-hero,
.recap-metrics {
  border: 1px solid rgba(90, 110, 255, 0.18);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(241, 247, 255, 0.96));
  box-shadow: var(--shadow-soft);
}

.recap-hero {
  padding: 20px;
  display: grid;
  align-content: center;
  gap: 8px;
}

.recap-hero h2 {
  font-size: 1.35rem;
}

.recap-hero p {
  color: var(--muted);
  line-height: 1.45;
}

.recap-metrics {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.recap-metric {
  padding: 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(228, 232, 236, 0.86);
}

.recap-metric div:first-child {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.recap-metric span {
  color: var(--muted);
  font-size: 0.82rem;
}

.recap-metric strong {
  font-size: 1.35rem;
}

.recap-chart {
  height: 9px;
  overflow: hidden;
  margin-top: 12px;
  border-radius: 999px;
  background: #edf1f4;
}

.recap-chart-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f8f5d, #49c78a);
}

.recap-metric.orange .recap-chart-fill {
  background: linear-gradient(90deg, #d98324, #ffbd66);
}

.recap-metric.blue .recap-chart-fill {
  background: linear-gradient(90deg, #2f6f9f, #60b7ff);
}

.recap-metric.purple .recap-chart-fill {
  background: linear-gradient(90deg, #6654a3, #9c85ff);
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(17, 24, 39, 0.38);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal {
  width: min(760px, 100%);
  max-height: min(88vh, 900px);
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 28px 72px rgba(17, 24, 39, 0.18);
}

.modal-header {
  position: sticky;
  top: 0;
  background: #ffffff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--border);
  z-index: 1;
}

.modal-body {
  padding: 18px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 18px;
  border-top: 1px solid var(--border);
  background: #fafbfc;
}

.close-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  background: #17211c;
  color: #fff;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-weight: 720;
}

.mobile-bar {
  display: none;
}

.mobile-drawer-backdrop {
  display: none;
}

.hidden {
  display: none !important;
}

@media (min-width: 821px) {
  .class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 14px;
  }

  .class-grid + .table-wrap {
    display: none;
  }
}

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

  .dashboard-grid,
  .two-col {
    grid-template-columns: 1fr;
  }

  .stats-grid .stat-card {
    grid-column: auto !important;
  }
}

@media (max-width: 820px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  body {
    background: var(--bg);
  }

  .main {
    padding: 18px;
    padding-bottom: 92px;
  }

  .mobile-app-header {
    position: sticky;
    top: 0;
    z-index: 13;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 24px;
    padding: 10px 0;
    background: rgba(246, 247, 249, 0.94);
    backdrop-filter: blur(14px);
  }

  .mobile-brand {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .mobile-brand-mark {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: var(--primary);
    color: #fff;
  }

  .mobile-brand strong {
    display: block;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--primary-strong);
  }

  .mobile-brand span {
    display: block;
    color: var(--muted);
    margin-top: 4px;
  }

  .mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    display: none;
    align-items: stretch;
    background: rgba(17, 24, 39, 0.38);
  }

  .mobile-drawer-backdrop.open {
    display: flex;
  }

  .mobile-drawer {
    width: min(320px, 86vw);
    min-height: 100%;
    padding: 18px;
    background: #ffffff;
    border-right: 1px solid var(--border);
    box-shadow: 18px 0 48px rgba(17, 24, 39, 0.14);
    overflow-y: auto;
  }

  .mobile-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
  }

  .mobile-drawer-head strong,
  .mobile-drawer-head span {
    display: block;
  }

  .mobile-drawer-head span {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.82rem;
  }

  .mobile-drawer .nav-list {
    gap: 7px;
  }

  .mobile-drawer .nav-item {
    width: 100%;
  }
  }

  .topbar {
    display: grid;
    top: 66px;
    margin-bottom: 16px;
  }

  .route-dashboard .topbar {
    margin-bottom: 18px;
  }

  .route-dashboard .topbar .eyebrow,
  .route-dashboard .topbar-right {
    display: none;
  }

  .route-dashboard .topbar h1 {
    font-size: 1.46rem;
  }

  .route-dashboard .topbar .subtext {
    display: block;
    font-size: 1rem;
    margin-top: 8px;
  }

  .route-dashboard .topbar h1::after {
    content: " 👋";
  }

  .topbar-right,
  .top-actions {
    justify-content: flex-start;
    width: 100%;
  }

  .profile-chip {
    display: none;
  }

  .hero-panel {
    display: none;
  }

  .hero-date {
    min-width: 0;
    min-height: 74px;
  }

  .stats-grid,
  .quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
  }

  .stat-card {
    min-height: 132px;
    padding: 14px 12px;
    border-radius: var(--radius);
  }

  .stat-icon {
    width: 34px;
    height: 34px;
  }

  .stat-label {
    font-size: 0.74rem;
    min-height: 32px;
  }

  .stat-value {
    font-size: 1.45rem;
  }

  .stat-foot {
    font-size: 0.74rem;
  }

  .quick-card {
    min-height: 126px;
    align-items: center;
    text-align: center;
    border-radius: var(--radius);
    padding: 14px 8px;
  }

  .quick-kicker {
    width: 46px;
    height: 46px;
  }

  .quick-title {
    font-size: 0.84rem;
  }

  .quick-card .list-meta {
    display: none;
  }

  .card-pad,
  .stat-card {
    padding: 15px;
  }

  .section-title {
    align-items: flex-start;
  }

  .toolbar {
    display: grid;
  }

  .toolbar .input,
  .toolbar .select,
  .toolbar > * {
    width: 100%;
    max-width: none;
  }

  .table-wrap {
    display: none;
  }

  .mobile-card-list {
    display: grid;
    gap: 10px;
  }

  .class-grid {
    display: grid;
    gap: 10px;
  }

  .student-input-row {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .photo-field,
  .recap-visual-grid,
  .recap-metrics {
    grid-template-columns: 1fr;
  }

  .schedule-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .schedule-time {
    text-align: left;
  }

  .schedule-item .badge,
  .schedule-item::after {
    grid-column: 1;
    justify-self: start;
  }

  .schedule-item::after {
    display: none;
  }

  .route-dashboard .dashboard-grid > .card .list {
    grid-template-columns: minmax(0, 1fr);
    overflow-x: visible;
  }

  .mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: #ffffff;
    border-top: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -10px 28px rgba(17, 24, 39, 0.08);
  }

  .mobile-bar .nav-item {
    min-width: 0;
    min-height: 58px;
    padding: 5px 3px;
    color: var(--muted);
    justify-content: center;
    text-align: center;
    flex-direction: column;
    gap: 3px;
    font-size: 0.7rem;
    border-radius: 10px;
  }

  .mobile-bar .nav-item.active {
    background: var(--primary-soft);
    color: var(--primary-strong);
  }

  .mobile-bar .nav-icon {
    background: transparent;
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 560px) {
  h1 {
    font-size: 1.45rem;
  }

  .route-dashboard .stats-grid,
  .route-dashboard .quick-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .top-actions .btn,
  .toolbar .btn,
  .form-actions .btn {
    width: 100%;
  }

  .row-actions .btn {
    width: auto;
  }

  .modal-backdrop {
    padding: 10px;
    align-items: end;
  }

  .modal {
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }

  .modal-footer {
    display: grid;
  }

  .modal-footer .btn {
    width: 100%;
  }
}
