/* SHED Access admin — styled to match the SHED app tokens
   (style-guides/SHED-style-guide-v1.json / shed-tokens.json). */
:root {
  --bg: #f8f9fa;
  --panel: #ffffff;
  --panel-alt: #eef2f7;
  --line: #d9dee7;
  --ink: #333333;
  --muted: #6b7280;
  --blue: #4f80ff;
  --purple: #7b52d9;
  --yellow: #ffd13b;
  --orange: #f37021;
  --red: #e63c48;
  --green: #1e9e5a;
  --radius-control: 6px;
  --radius-card: 8px;
  --shadow-card: 0 1px 2px rgba(51, 51, 51, 0.05), 0 8px 24px rgba(51, 51, 51, 0.06);
  --shadow-panel: -12px 0 32px rgba(51, 51, 51, 0.1);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.55 "proxima-nova", "Proxima Nova", "Avenir Next", "Segoe UI", sans-serif;
}
.hidden { display: none !important; }
.center { display: grid; place-items: center; min-height: 100vh; }
.spacer { flex: 1; }
.err { color: var(--red); font-size: 13px; min-height: 18px; margin-top: 8px; }
.hint { color: var(--muted); font-size: 12.5px; }
code {
  background: var(--panel-alt); border: 1px solid var(--line);
  padding: 1px 5px; border-radius: 4px; font-size: 12px;
}

.brand { font-weight: 800; letter-spacing: 0.12em; font-size: 15px; color: var(--ink); }
.brand span { color: var(--blue); }

.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 28px; box-shadow: var(--shadow-card);
}
.login-card { width: 320px; text-align: center; display: grid; gap: 12px; }

header {
  display: flex; align-items: center; gap: 24px;
  padding: 14px 22px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--panel); z-index: 5;
}
nav { display: flex; gap: 4px; }
.tab {
  background: none; border: 0; color: var(--muted); font: inherit; font-weight: 700;
  padding: 7px 14px; border-radius: var(--radius-control); cursor: pointer;
  transition: background 120ms cubic-bezier(0.2, 0, 0, 1);
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); background: var(--panel-alt); }

section { padding: 18px 22px; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; }

input, select, textarea {
  background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  border-radius: var(--radius-control); padding: 9px 12px; font: inherit; outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue); box-shadow: 0 0 0 3px rgba(79, 128, 255, 0.15);
}
#search { width: 320px; }

.btn {
  background: var(--panel); border: 1px solid var(--line); color: var(--ink);
  border-radius: var(--radius-control); padding: 9px 14px; font: inherit; font-weight: 700;
  cursor: pointer; transition: border-color 120ms, background 120ms;
}
.btn:hover { border-color: var(--blue); color: var(--blue); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #3d6ef0; color: #fff; }
.btn.danger { background: var(--panel); border-color: var(--red); color: var(--red); }
.btn.danger:hover { background: var(--red); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); border-color: transparent; }
.btn.wide { width: 100%; }
.btn.small { padding: 4px 9px; font-size: 12.5px; }
.btn:disabled { opacity: 0.5; cursor: default; }

.col-div { border-left: 2px solid var(--line); }
.totals { font-size: 13px; color: var(--muted); white-space: nowrap; padding: 0 6px; }
.totals b { color: var(--ink); }
.group-row td {
  background: var(--panel-alt);
  border-top: 2px solid var(--line);
}
.group-row { cursor: default; }
/* Name on the left, actions pushed right against the sales divider. */
.group-head { display: flex; align-items: center; gap: 8px; }
.access-block {
  border-top: 1px solid var(--line); margin-top: 14px; padding-top: 12px;
}
.access-block h4 {
  margin: 0 0 4px; font-size: 11.5px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted);
}
.access-block .codes-row { margin-top: 8px; }
#dlg-email { width: 620px; }
#em-meta { margin-bottom: 10px; line-height: 1.7; }
#em-body {
  background: var(--panel-alt); border: 1px solid var(--line); border-radius: var(--radius-control);
  padding: 14px 16px; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px;
  line-height: 1.6; white-space: pre-wrap; word-break: break-word;
  max-height: 50vh; overflow-y: auto; margin: 0;
}
.event-link { color: var(--ink); text-decoration: none; }
.event-link:hover { color: var(--blue); text-decoration: underline; }
.from-picker { display: flex; align-items: center; gap: 6px; }
.from-picker select { padding: 5px 8px; font-size: 12.5px; max-width: 190px; }
.mail-btn { padding: 3px 8px; font-size: 13px; line-height: 1.2; }
.mail-btn:hover { border-color: var(--blue); color: var(--blue); }
.input-row { display: flex; gap: 6px; align-items: center; }
.input-row input { flex: 1; min-width: 0; }
.group-row:hover { background: transparent; }
#dlg-request { width: 680px; }
.rq-line { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.rq-line select { flex: 1; min-width: 0; }
.rq-line .rq-qty { width: 58px; }
.rq-line .rq-price { width: 92px; }
.rq-line .rq-line-total { width: 76px; text-align: right; font-weight: 700; font-size: 13px; }
.rq-discount-row { display: flex; gap: 8px; align-items: center; margin: 10px 0; }
.rq-discount-row input { width: 90px; }
/* Pipeline colors matching the sales spreadsheet. */
.sales-inline { padding: 5px 8px; font-size: 12.5px; font-weight: 700; }
.sales-inline[data-status="estimate"] { background: #cfe2f3; border-color: #a8c6e3; color: #1f3d5c; }
.sales-inline[data-status="po"] { background: #fce5cd; border-color: #f0c99a; color: #6b3d0d; }
.sales-inline[data-status="invoiced"] { background: #f4cccc; border-color: #e3a3a3; color: #6b1f1f; }
.sales-inline[data-status="paid"] { background: #d9ead3; border-color: #aecfa2; color: #234d17; }
.sales-inline option { font-weight: 700; }
.sales-inline option[data-status="estimate"] { background: #cfe2f3; color: #1f3d5c; }
.sales-inline option[data-status="po"] { background: #fce5cd; color: #6b3d0d; }
.sales-inline option[data-status="invoiced"] { background: #f4cccc; color: #6b1f1f; }
.sales-inline option[data-status="paid"] { background: #d9ead3; color: #234d17; }
.sales-inline option[data-status="none"] { background: #fff; color: var(--muted); }
.money-inline { width: 90px; padding: 5px 8px; font-size: 12.5px; }

.table-wrap {
  overflow-x: auto; border: 1px solid var(--line);
  border-radius: var(--radius-card); background: var(--panel); box-shadow: var(--shadow-card);
}
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 14px; white-space: nowrap; }
th {
  font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); border-bottom: 1px solid var(--line); background: var(--panel-alt);
}
tbody tr { border-bottom: 1px solid var(--line); cursor: pointer; }
tbody tr:last-child { border-bottom: 0; }
tbody tr:hover { background: rgba(79, 128, 255, 0.05); }
.empty { padding: 40px; text-align: center; color: var(--muted); }

.code-chip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px;
  background: var(--panel-alt); border: 1px solid var(--line); color: var(--ink);
  padding: 3px 8px; border-radius: var(--radius-control); cursor: copy;
}
.code-chip:hover { border-color: var(--blue); color: var(--blue); }

.badge {
  display: inline-block; font-size: 11.5px; font-weight: 700; border-radius: 999px;
  padding: 2px 10px;
}
.badge.active { background: rgba(30, 158, 90, 0.12); color: var(--green); }
.badge.suspended { background: rgba(230, 60, 72, 0.1); color: var(--red); }
.badge.expired { background: rgba(243, 112, 33, 0.12); color: var(--orange); }
.badge.unpaid { background: var(--panel-alt); color: var(--muted); }

#detail {
  position: fixed; top: 0; right: 0; bottom: 0; width: 420px; max-width: 92vw;
  background: var(--panel); border-left: 1px solid var(--line);
  padding: 20px 22px; overflow-y: auto; z-index: 10;
  box-shadow: var(--shadow-panel);
}
.detail-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.detail-head h2 { margin: 0; font-size: 18px; font-weight: 800; }
.field { margin-bottom: 10px; }
/* Direct child only — nested labels (course chips) keep their own styling. */
.field > label {
  display: block; font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 3px; font-weight: 700;
}
.field input, .field select, .field textarea { width: 100%; }
.field .chip input { width: 17px; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.teacher-row {
  border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 10px 12px; margin-bottom: 8px;
}
.teacher-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.codes-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.codes-row .code-chip { font-size: 14px; padding: 6px 10px; }
.events { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 12px; }
.events h4 {
  margin: 0 0 8px; font-size: 12px; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
}
.event { font-size: 12.5px; color: var(--muted); padding: 3px 0; }
.event b { color: var(--ink); font-weight: 700; }

.hint-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card);
  padding: 14px 16px; margin-bottom: 14px; color: var(--muted); font-size: 13px;
  box-shadow: var(--shadow-card);
}
.snippet-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.snippet-row code { flex: 1; overflow-x: auto; white-space: nowrap; padding: 7px 10px; }

.course-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-card);
  box-shadow: var(--shadow-card); margin-bottom: 14px; overflow: hidden;
}
.course-head {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--panel-alt);
  cursor: pointer; user-select: none;
}
.chev { color: var(--muted); font-size: 12px; width: 12px; }
.drag-handle {
  color: var(--muted); cursor: grab; user-select: none;
  font-size: 14px; padding: 0 2px; line-height: 1;
}
.drag-handle:active { cursor: grabbing; }
.handle-cell { width: 26px; }
.dragging { opacity: 0.45; }
.course-head h3 { margin: 0; font-size: 15px; font-weight: 800; }
.course-card table { width: 100%; }
.course-card .add-row { display: flex; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); align-items: center; }
.home-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; white-space: nowrap; }
.preset-row { display: flex; gap: 6px; margin: -4px 0 10px; }
.gen-row { display: flex; gap: 8px; margin-top: 4px; align-items: center; }
.gen-row input { flex: 1; min-width: 0; text-transform: uppercase; font-family: ui-monospace, Menlo, monospace; }
.gen-row .dash { font-weight: 800; font-size: 18px; color: var(--muted); }
.gen-row .btn { white-space: nowrap; }
.email-card { padding: 16px; margin-bottom: 14px; }
.email-card h3 { margin: 0; font-size: 14px; }
.email-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 8px; }
.email-head h3 { flex: 1; }
.email-head .btn { flex: none; }
.email-card h3 .hint { font-weight: 400; }
.email-card textarea { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; line-height: 1.5; }
.trial-form { padding: 14px 16px; margin-bottom: 16px; }
.trial-form .toolbar { margin-bottom: 8px; }
.scope-wrap {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 6px; margin-top: 4px;
}
.chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-control);
  padding: 9px 11px; font-size: 13px; font-weight: 600; line-height: 1.25;
  text-transform: none; letter-spacing: 0; color: var(--ink);
  cursor: pointer; user-select: none; margin: 0;
  transition: border-color 120ms, background 120ms;
}
.chip:hover { border-color: var(--blue); }
.chip.all-chip { grid-column: 1 / -1; }
/* Custom checkbox so the row reads as one tidy tile. */
.chip input {
  appearance: none; -webkit-appearance: none; margin: 0; flex: none;
  width: 17px; height: 17px; border: 1px solid var(--line); border-radius: 4px;
  background: #fff; position: relative; cursor: pointer;
}
.chip input:checked { background: var(--blue); border-color: var(--blue); }
.chip input:checked::after {
  content: "✓"; position: absolute; inset: 0; color: #fff;
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
}
.chip:has(input:checked) { border-color: var(--blue); background: rgba(79, 128, 255, 0.07); }
.course-card .add-row input { flex: 1; }
.badge.student { background: rgba(79, 128, 255, 0.12); color: var(--blue); }
.badge.teacher { background: rgba(123, 82, 217, 0.12); color: var(--purple); }
.badge.scope { background: rgba(243, 112, 33, 0.12); color: var(--orange); }
.no-pages { padding: 14px; color: var(--muted); font-size: 13px; }

dialog {
  background: var(--panel); color: var(--ink); border: 1px solid var(--line);
  border-radius: var(--radius-card); padding: 24px; width: 440px; max-width: 92vw;
  box-shadow: 0 16px 48px rgba(51, 51, 51, 0.18);
}
dialog::backdrop { background: rgba(51, 51, 51, 0.4); }
dialog h3 { margin: 0 0 14px; font-weight: 800; }
dialog label { display: block; margin-bottom: 10px; font-size: 13px; color: var(--muted); }
dialog label input, dialog label select, dialog label textarea { width: 100%; margin-top: 3px; }
dialog .radio { display: flex; align-items: center; gap: 8px; color: var(--ink); }
dialog .radio input { width: auto; margin: 0; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
#import-csv { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; }
#import-results { margin-top: 12px; max-height: 240px; overflow-y: auto; font-size: 12.5px; }
#import-results table { font-size: 12px; }
#import-results td, #import-results th { padding: 5px 8px; }

/* ============================ Mobile ============================
   Below 820px the wide tables stop being tables: each row becomes a
   card with labelled fields, the header/toolbar wrap, and the detail
   panel and dialogs go full-screen. */
@media (max-width: 820px) {
  /* --- Header --- */
  header {
    flex-wrap: wrap; gap: 10px 14px; padding: 10px 14px;
    align-items: center;
  }
  header .brand { font-size: 14px; }
  header .spacer { display: none; }
  nav {
    order: 3; width: 100%;
    overflow-x: auto; -webkit-overflow-scrolling: touch;
    gap: 2px; padding-bottom: 2px;
  }
  nav::-webkit-scrollbar { display: none; }
  .tab { white-space: nowrap; padding: 9px 12px; font-size: 13.5px; }
  .from-picker { order: 2; margin-left: auto; }
  .from-picker span { display: none; }
  .from-picker select { max-width: 150px; }
  #btn-popout { display: none; }          /* pop-out is a desktop idea */

  /* --- Toolbar --- */
  section { padding: 14px; }
  .toolbar { flex-wrap: wrap; gap: 8px; }
  #search { width: 100%; order: -2; }
  .totals {
    order: -1; width: 100%; padding: 8px 10px;
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius-control); white-space: normal;
  }
  .toolbar .btn { flex: 1 1 auto; }

  /* --- Tables become cards --- */
  .table-wrap { border: 0; background: transparent; box-shadow: none; overflow: visible; }
  .table-wrap table, .table-wrap tbody, .table-wrap tr, .table-wrap td { display: block; width: 100%; }
  .table-wrap thead { display: none; }
  .table-wrap tr {
    background: var(--panel); border: 1px solid var(--line);
    border-radius: var(--radius-card); box-shadow: var(--shadow-card);
    margin-bottom: 10px; padding: 12px 14px;
  }
  .table-wrap td {
    padding: 5px 0; white-space: normal; border: 0;
    display: flex; align-items: center; gap: 10px; min-height: 34px;
  }
  /* Field label from the column header. */
  .table-wrap td[data-label]::before {
    content: attr(data-label);
    flex: none; width: 108px;
    font-size: 11px; text-transform: uppercase; letter-spacing: .07em;
    color: var(--muted); font-weight: 700;
  }
  .table-wrap td.cell-title {
    font-size: 16px; padding-bottom: 8px; margin-bottom: 4px;
    border-bottom: 1px solid var(--line);
  }
  .table-wrap td.col-div { border-left: 0; }
  .hide-mobile { display: none !important; }
  .money-inline, .sales-inline { flex: 1; min-width: 0; width: auto; font-size: 16px; }

  /* Group heading cards read as a section marker. */
  .group-row { background: var(--panel-alt); }
  .group-row td { background: transparent; }
  .group-head { flex-wrap: wrap; }
  .group-head .spacer { display: none; }
  .group-head .btn { flex: 1 1 auto; }

  /* --- Detail panel: full screen --- */
  #detail {
    width: 100%; max-width: 100%; border-left: 0;
    padding: 16px 14px calc(24px + env(safe-area-inset-bottom));
  }
  .detail-head {
    position: sticky; top: 0; background: var(--panel); z-index: 2;
    padding: 4px 0 10px; margin: -4px 0 8px;
    border-bottom: 1px solid var(--line);
  }
  .detail-head h2 { font-size: 17px; }
  .detail-actions .btn { flex: 1 1 45%; }
  .codes-row { flex-wrap: wrap; }
  .teacher-actions .btn { flex: 1 1 auto; }

  /* --- Dialogs: full screen sheets --- */
  dialog, #dlg-request, #dlg-email, #dlg-group {
    width: 100%; max-width: 100%; height: 100%; max-height: 100%;
    border-radius: 0; margin: 0; padding: 18px 16px calc(24px + env(safe-area-inset-bottom));
    overflow-y: auto;
  }
  .dlg-actions {
    position: sticky; bottom: 0; background: var(--panel);
    padding: 12px 0 0; margin-top: 16px; border-top: 1px solid var(--line);
    flex-wrap: wrap;
  }
  .dlg-actions .btn { flex: 1 1 auto; }
  .rq-line { flex-wrap: wrap; }
  .rq-line select { flex: 1 1 100%; }
  .gen-row { flex-wrap: wrap; }
  .gen-row input { flex: 1 1 40%; }
  .scope-wrap { grid-template-columns: 1fr 1fr; }

  /* --- Touch sizing: 16px inputs stop iOS from zooming on focus --- */
  input, select, textarea { font-size: 16px; }
  .btn { padding: 10px 14px; }
  .btn.small { padding: 7px 11px; font-size: 13px; }
  .email-head { flex-wrap: wrap; }
}

@media (max-width: 420px) {
  .table-wrap td { flex-wrap: wrap; gap: 2px; }
  .table-wrap td[data-label]::before { width: 100%; }
  .scope-wrap { grid-template-columns: 1fr; }
}

/* Collapsed-card summary bits are mobile-only. */
.row-meta, .open-cell { display: none; }

@media (max-width: 820px) {
  /* Cards start collapsed: only the title row shows until tapped. */
  #schools-body tr[data-id] { padding: 4px 14px; }
  #schools-body tr[data-id] td { display: none; }
  #schools-body tr[data-id] td.cell-title {
    display: flex; align-items: center; gap: 10px;
    border-bottom: 0; margin: 0; padding: 10px 0; font-size: 15px;
  }
  #schools-body tr[data-id].open { padding: 4px 14px 12px; }
  #schools-body tr[data-id].open td { display: flex; }
  #schools-body tr[data-id].open td.cell-title {
    border-bottom: 1px solid var(--line); margin-bottom: 6px; padding-bottom: 10px;
  }
  #schools-body tr[data-id].open .chev-m { transform: rotate(90deg); }

  .row-meta { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
  .row-meta .badge { font-size: 10.5px; padding: 2px 8px; }
  .chev-m { color: var(--muted); font-size: 12px; transition: transform 120ms; }

  /* "Open school details" button, shown only inside an expanded card. */
  #schools-body tr[data-id].open td.open-cell { display: block; padding-top: 10px; }
  td.open-cell::before { content: none; }
  td.open-cell .btn { width: 100%; }
}

@media (max-width: 820px) {
  /* Group headings collapse too — name + stage + balance, tap for the rest. */
  .group-row td:not(:first-child) { display: none; }
  .group-row.open td:not(:first-child) { display: flex; }
  .group-row:not(.open) .group-head .btn { display: none; }
  .group-row .group-head { flex-wrap: wrap; row-gap: 6px; }
  .group-row.open .group-head { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
  .group-row.open .chev-m { transform: rotate(90deg); }
  .group-row .row-meta { margin-left: auto; }
}

@media (max-width: 820px) {
  /* Member schools are nested inside their group: hidden until it's open. */
  #schools-body tr[data-group-member]:not(.member-visible) { display: none; }
  #schools-body tr[data-group-member] {
    margin-left: 12px; border-left: 3px solid var(--blue);
  }
}

/* Activation switch in the school panel. */
.activate-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 42px; height: 24px; border-radius: 999px; background: var(--line);
  position: relative; transition: background 140ms; flex: none;
}
.switch-knob {
  position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(51,51,51,.3); transition: transform 140ms;
}
.switch input:checked + .switch-track { background: var(--green); }
.switch input:checked + .switch-track .switch-knob { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(79,128,255,.25); }

/* Total sales pill with click-to-expand breakdown. */
.totals-btn {
  background: none; border: 0; padding: 0; font: inherit; color: var(--muted);
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.totals-btn b { color: var(--ink); }
.totals-btn .chev-m { display: inline-block; transition: transform 120ms; }
.totals-detail { margin-left: 10px; padding-left: 10px; border-left: 1px solid var(--line); }

/* Bulk-select columns. */
.sel-col { width: 34px; }
.sel-box { width: 17px; height: 17px; cursor: pointer; }

/* Groups collapse on desktop too. */
tr[data-group-member]:not(.member-visible) { display: none; }
.group-row .chev-m { display: inline-block; transition: transform 120ms; }
.group-row.open .chev-m { transform: rotate(90deg); }

@media (max-width: 820px) {
  /* Collapsed group cards stay clean: no sales summary. */
  .group-row .row-meta .badge, .group-row .row-meta .hint { display: none; }
  .totals-detail { display: block; margin: 6px 0 0; padding: 0; border-left: 0; }
  .sel-col { width: auto; }
  .table-wrap td.sel-col::before { content: none; }
}

/* Course units editor */
.units-block { padding: 10px 14px; border-top: 1px solid var(--line); background: #fbfcfe; }
.unit-row { display: flex; gap: 6px; align-items: center; margin-top: 6px; flex-wrap: wrap; }
.unit-row input[type="text"] { flex: 1; min-width: 120px; font-size: 13px; padding: 6px 9px; }
.unit-row .chip { padding: 5px 9px; font-size: 12px; }
@media (max-width: 820px) {
  .unit-row input[type="text"] { flex: 1 1 100%; }
}
