/* RepoEdu · Design System v4 */
:root {
  --black: #000;
  --black-soft: #141414;
  --white: #fff;
  --bg: #f5f5f5;
  --surface: #fff;
  --border: #e8e8e8;
  --border-strong: #d6d6d6;
  --text: #111;
  --text-secondary: #5c5c5c;
  --text-tertiary: #8a8a8a;
  --text-authTitle: #424242; 
  --red-50: #fef2f2;
  --red-600: #dc2626;
  --green-50: #f0fdf4;
  --green-700: #15803d;
  --amber-50: #fffbeb;
  --amber-800: #92400e;

  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", monospace;
  --sidebar-w: 272px;
  --content-max: 1080px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-xs: 8px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

h1, h2, h3, h4, h5 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.3;
  color: var(--text);
}

a { color: inherit; text-decoration: none; }

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

code {
  font-family: var(--mono);
  font-size: 0.85em;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.15em 0.45em;
}

::selection {
  background: rgba(0, 0, 0, 0.12);
}

/* Utilities */
.u-mt-sm { margin-top: 0.5rem; }
.u-mt-md { margin-top: 1rem; }
.u-mt-lg { margin-top: 1.5rem; }

.text-muted { color: var(--text-secondary); }

.text-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--border-strong);
}

.text-link:hover { text-decoration-color: var(--black); }

/* ── Auth ── */
body.auth-body { background: var(--black); }

.auth-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.auth-page__hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(2rem, 5vw, 3.5rem);
  color: var(--white);
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.06), transparent 40%),
    var(--black);
}

.auth-page__hero-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 28rem;
  margin: auto 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--white);
}

.brand-mark__logo,
.sidebar__logo {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--white);
  position: relative;
  flex-shrink: 0;
}

.brand-mark__logo::after,
.sidebar__logo::after {
  content: "";
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  background: var(--black);
}

.auth-page__title {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text-authTitle) ;
}

.auth-page__text {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.68);
}

.auth-page__content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--white);
}

.auth-card {
  width: min(420px, 100%);
  padding: 0.25rem;
}

.auth-card h2 {
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
}

.auth-card > p,
.auth-card .text-muted {
  margin: 0 0 1.75rem;
  color: var(--text-secondary);
}

.auth-page__copy {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.35);
  line-height: 1.5;
}

/* ── Shell ── */
.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  background: var(--black);
  color: var(--white);
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 2rem;
  padding: 0 0.5rem;
}

.sidebar__brand-text {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.sidebar__brand:hover { opacity: 0.88; }

.sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.sidebar__section {
  margin: 1.25rem 0 0.5rem;
  padding: 0 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}

.sidebar__link {
  display: block;
  padding: 0.7rem 0.75rem;
  border-radius: var(--radius-xs);
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.62);
  transition: background var(--transition), color var(--transition);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar__link:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.sidebar__link.is-active {
  background: rgba(255, 255, 255, 0.12);
  color: var(--white);
  box-shadow: inset 3px 0 0 var(--white);
}

.sidebar__footer {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar__user {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.25rem 0.75rem;
}

.sidebar__avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar__user-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}

.sidebar__logout {
  background: none;
  border: none;
  padding: 0;
  margin-top: 0.125rem;
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.45);
  cursor: pointer;
  transition: color var(--transition);
}

.sidebar__logout:hover { color: var(--white); }

.sidebar__copy {
  margin: 0;
  padding: 0 0.25rem;
  font-size: 0.6875rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.28);
}

.shell__main {
  flex: 1;
  min-width: 0;
  background: var(--bg);
}

.shell__inner {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 3vw, 2.5rem) 3rem;
}

.shell__content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.page-header__title {
  font-size: clamp(1.75rem, 3vw, 2.125rem);
  letter-spacing: -0.035em;
}

.page-header__subtitle {
  margin: 0.4rem 0 0;
  max-width: 48ch;
  color: var(--text-secondary);
  font-size: 1rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
  font-size: 0.8125rem;
  color: var(--text-tertiary);
}

.breadcrumbs a:hover { color: var(--text); }

.breadcrumbs__sep { opacity: 0.45; }

.breadcrumbs__current { color: var(--text-secondary); }

/* ── Dashboard actions ── */
.quick-actions {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
}

.action-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.action-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.action-card--muted {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.action-card--muted .action-card__label,
.action-card--muted .action-card__hint {
  color: rgba(255, 255, 255, 0.55);
}

.action-card--muted .action-card__title { color: var(--white); }

.action-card__label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.action-card__title {
  font-size: 1.125rem;
  font-weight: 600;
}

.action-card__hint {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Cards ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.card__title {
  font-size: 1.0625rem;
  margin-bottom: 0.25rem;
}

.card__desc {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

.card--empty,
.empty-state {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}

.empty-state__title {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.empty-state__text {
  margin: 0;
  color: var(--text-secondary);
}

.card-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .card-grid--2 { grid-template-columns: repeat(2, 1fr); }
}

.dashboard-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 160px;
}

.stack { display: flex; flex-direction: column; gap: 1rem; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1.25rem 0;
}

.info-bar {
  padding: 0.875rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  display: inline-flex;
  padding: 0.35rem 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
}

/* ── Student sections ── */
.section-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-card);
}

.section-block__title {
  font-size: 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.section-block__group + .section-block__group {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.section-block__heading {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text);
}

.section-block__subgroup + .section-block__subgroup {
  margin-top: 1.25rem;
}

.section-block__subheading {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.activity-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 640px) {
  .activity-grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
}

.activity-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.activity-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.activity-card__title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.35;
}

.activity-card__desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.activity-card__empty {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-tertiary);
}

.activity-card__upload {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.file-list__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
}

.file-list__name {
  font-size: 0.875rem;
  font-weight: 500;
}

.file-list__meta {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  margin-top: 0.125rem;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.625rem 1.125rem;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition), transform var(--transition);
  white-space: nowrap;
}

.btn:active { transform: scale(0.98); }

.btn--primary,
.btn-primary {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.btn--primary:hover,
.btn-primary:hover { background: var(--black-soft); }

.btn--secondary,
.btn-secondary {
  background: var(--white);
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--secondary:hover,
.btn-secondary:hover {
  border-color: var(--black);
  background: var(--white);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn--ghost:hover {
  background: var(--bg);
  border-color: var(--border-strong);
}

.btn--danger,
.btn-danger {
  background: var(--white);
  color: var(--red-600);
  border-color: #fecaca;
}

.btn--danger:hover,
.btn-danger:hover { background: var(--red-50); }

.btn--sm,
.btn-sm {
  padding: 0.4375rem 0.875rem;
  font-size: 0.8125rem;
}

.btn--block { width: 100%; }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

/* ── Forms ── */
.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.field input,
.field textarea,
.field select,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="file"],
textarea,
select {
  width: 100%;
  padding: 0.6875rem 0.875rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xs);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.field input::placeholder,
textarea::placeholder { color: var(--text-tertiary); }

.field input:focus,
.field textarea:focus,
.field select:focus,
input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--black);
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

input[type="file"] {
  padding: 0.5rem;
  font-size: 0.8125rem;
  background: var(--bg);
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
}

.field-row .field { flex: 1; min-width: 200px; }

.field-row .field--sm { flex: 0 0 110px; min-width: 110px; }

.field-check {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9375rem;
  font-weight: 500;
}

.field-check input { width: auto; accent-color: var(--black); }

/* ── Alerts ── */
.alert,
.alert-error,
.alert-success,
.alert--error,
.alert--success {
  padding: 0.875rem 1rem;
  border-radius: var(--radius-xs);
  font-size: 0.9375rem;
  border: 1px solid transparent;
}

.alert-error,
.alert--error {
  background: var(--red-50);
  color: #991b1b;
  border-color: #fecaca;
}

.alert-success,
.alert--success {
  background: var(--green-50);
  color: var(--green-700);
  border-color: #bbf7d0;
}

/* ── Tags ── */
.tag,
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.625rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid transparent;
  white-space: nowrap;
}

.tag--dark,
.badge-success {
  background: var(--black);
  color: var(--white);
}

.tag--warn,
.badge-warning {
  background: var(--amber-50);
  color: var(--amber-800);
  border-color: #fde68a;
}

.tag--neutral,
.badge-status-nao_iniciada {
  background: var(--bg);
  color: var(--text-secondary);
  border-color: var(--border);
}

.badge-status-em_andamento {
  background: #eef2ff;
  color: #3730a3;
  border-color: #c7d2fe;
}

.badge-status-entregue {
  background: var(--black);
  color: var(--white);
}

.badge-status-concluida {
  background: var(--green-50);
  color: var(--green-700);
  border-color: #bbf7d0;
}

.status-ok {
  color: var(--text);
  font-weight: 600;
}

/* ── Tables ── */
.table-wrap {
  overflow-x: auto;
  margin: 0 -0.5rem;
  padding: 0 0.5rem;
}

.table,
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.table th,
.data-table th {
  text-align: left;
  padding: 0.75rem 1rem 0.75rem 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-strong);
}

.table td,
.data-table td {
  padding: 1rem 1rem 1rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.table tbody tr:last-child td,
.data-table tbody tr:last-child td { border-bottom: none; }

.cell-sub {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

.cell-actions { min-width: 150px; }

.cell-actions .btn { margin-bottom: 0.35rem; }

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.inline-form input[type="password"],
.inline-form select {
  min-width: 130px;
  max-width: 160px;
  padding: 0.5rem 0.625rem;
  font-size: 0.8125rem;
}

/* ── Lists ── */
.list-plain {
  list-style: none;
  margin: 0;
  padding: 0;
}

.list-plain li {
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
}

.list-plain li:last-child { border-bottom: none; }

.submission-files li { padding: 0.625rem 0; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.75rem;
  margin: 1rem 0;
}

.summary-grid div {
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  text-align: center;
}

.summary-grid strong {
  display: block;
  font-size: 1.375rem;
  margin-bottom: 0.15rem;
}

.code-block {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 0.8125rem;
  line-height: 1.6;
}

/* ── Curriculum (professor) ── */
.topic-block + .topic-block { margin-top: 0; }

.subtopic-card {
  margin-top: 1rem;
  padding: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.details-toggle summary {
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
  list-style: none;
  user-select: none;
}

.details-toggle summary::-webkit-details-marker { display: none; }

.details-toggle summary:hover { color: var(--text); }

.details-toggle[open] summary {
  color: var(--text);
  margin-bottom: 0.5rem;
}

.activity-item {
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.activity-item__title { font-weight: 600; }

.upload-box {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .shell { flex-direction: column; }

  .sidebar {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 1rem;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "brand user"
      "nav nav"
      "footer footer";
    gap: 0.75rem 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  }

  .sidebar__brand {
    grid-area: brand;
    margin-bottom: 0;
    padding: 0;
  }

  .sidebar__nav {
    grid-area: nav;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.375rem;
    padding-bottom: 0.25rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .sidebar__nav::-webkit-scrollbar { display: none; }

  .sidebar__section {
    display: none;
  }

  .sidebar__link {
    flex-shrink: 0;
    padding: 0.5rem 0.875rem;
    font-size: 0.875rem;
    box-shadow: none;
  }

  .sidebar__link.is-active {
    background: var(--white);
    color: var(--black);
  }

  .sidebar__footer {
    grid-area: footer;
    border-top: none;
    padding-top: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
  }

  .sidebar__user {
    padding: 0;
  }

  .sidebar__copy {
    text-align: right;
    padding: 0;
  }

  .shell__inner { padding: 1.25rem 1rem 2rem; }

  .auth-page { grid-template-columns: 1fr; }

  .auth-page__hero {
    min-height: auto;
    padding: 2rem 1.5rem 1.5rem;
  }

  .auth-page__hero-inner { margin: 0; }

  .auth-page__copy { margin-top: 1rem; }
}

@media (max-width: 640px) {
  .page-header,
  .card__head,
  .btn-row,
  .field-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-row .btn,
  .cell-actions .btn,
  .cell-actions form { width: 100%; }

  .inline-form {
    flex-direction: column;
    align-items: stretch;
  }

  .inline-form input[type="password"],
  .inline-form select {
    max-width: none;
    width: 100%;
  }

  .file-list__item {
    flex-direction: column;
    align-items: stretch;
  }

  .sidebar__footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .sidebar__copy { text-align: left; }
}

/* Legacy aliases */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow-card); }
.panel-empty { text-align: center; padding: 3.5rem 1.5rem; color: var(--text-secondary); }
.panel-header-row, .panel-actions { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; flex-wrap: wrap; }
.muted { color: var(--text-secondary); }
.table-subtext { font-size: 0.8125rem; color: var(--text-secondary); margin-top: 0.2rem; }
.table-actions { min-width: 150px; }
.table-scroll { overflow-x: auto; }
.form-inline { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; }
.form-row { flex: 1; min-width: 200px; }
.form-row-small { flex: 0 0 110px; }
.checkbox-row { display: flex; align-items: center; gap: 0.5rem; }
.password-reset-form, .remove-student-form, .status-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.upload-form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--border); }
.curriculum-block, .student-topic, .student-subtopic { margin-top: 1rem; }
.curriculum-header { display: flex; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; }
.curriculum-section { margin-top: 1.25rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.subtopic-block { margin-top: 1rem; padding: 1.25rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.edit-box summary { cursor: pointer; color: var(--text-secondary); font-weight: 500; }
.activity-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 1rem; }
.class-list { list-style: none; padding: 0; margin: 0; }
.class-list li { padding: 0.875rem 0; border-bottom: 1px solid var(--border); }
.created-list, .error-list { margin: 1rem 0 0; padding-left: 1.25rem; font-size: 0.9375rem; }
.error-list { color: #991b1b; }
.csv-example { margin-top: 1rem; padding: 1rem; background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-xs); overflow-x: auto; font-family: var(--mono); font-size: 0.8125rem; }
.breadcrumb { margin-bottom: 1rem; font-size: 0.8125rem; color: var(--text-tertiary); }
.dashboard-grid { display: grid; gap: 1rem; }
@media (min-width: 768px) { .dashboard-grid { grid-template-columns: 1fr 1fr; } }
