/* TeachSupplyList — dashboard shell (admin + teacher)
   Loads after site.css and inherits its tokens. */

.app {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  align-items: start;
}

/* ---------- sidebar ---------- */

.side {
  background: var(--surface);
  border-right: 1px solid var(--line);
  min-height: 100vh;
  padding: 22px 16px;
  position: sticky;
  top: 0;
}

.side .brand { margin: 0 8px 26px; }

.side-label {
  font-size: .6875rem;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  font-weight: 700;
  padding: 0 10px;
  margin: 22px 0 8px;
}

.side-nav { display: flex; flex-direction: column; gap: 2px; }

.side-nav a {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: var(--r-sm);
  color: var(--body);
  font-size: .9375rem;
  font-weight: 600;
}
.side-nav a:hover { background: var(--wash); color: var(--ink); }
.side-nav a.on { background: var(--brand-tint); color: var(--brand-dark); }
.side-nav a svg { flex: none; opacity: .8; }

.side-foot {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ---------- main column ---------- */

.main { min-width: 0; padding: 0 0 60px; }

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar h1 { margin: 0; font-size: 1.25rem; }
.topbar .spacer { margin-left: auto; }

.who {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: .875rem;
  color: var(--muted);
}
.avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--brand-tint);
  color: var(--brand-dark);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: .8125rem;
  flex: none;
}

.pad { padding: 28px 32px; }

/* ---------- notes and forms ----------
   Base .note, .form-grid, .f, and .actions styles now live in site.css so the
   public pages (register, contact, password reset) can share them. Only the
   dashboard-specific overrides remain here. */

.f textarea { min-height: 96px; }

/* ---------- stat tiles ---------- */

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 26px; }

.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px 22px;
}
.tile .k { font-size: .8125rem; color: var(--muted); font-weight: 600; }
.tile .v {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--ink);
  letter-spacing: -.03em;
  line-height: 1.2;
  margin-top: 4px;
}
.tile .d { font-size: .8125rem; color: var(--muted); margin-top: 2px; }

/* ---------- panel + table ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 24px;
}

.panel-head {
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.panel-head h2 { margin: 0; font-size: 1.0625rem; }
.panel-head .spacer { margin-left: auto; }
.panel-body { padding: 22px; }

table.grid-t { width: 100%; border-collapse: collapse; }
table.grid-t th {
  text-align: left;
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--canvas);
  white-space: nowrap;
}
table.grid-t td {
  padding: 13px 22px;
  border-bottom: 1px solid var(--line);
  font-size: .9375rem;
  vertical-align: middle;
}
table.grid-t tr:last-child td { border-bottom: 0; }
table.grid-t tr:hover td { background: var(--canvas); }
table.grid-t td.tight { width: 1%; white-space: nowrap; }

.t-title { font-weight: 700; color: var(--ink); }
.t-sub   { font-size: .8125rem; color: var(--muted); }

/* ---------- badges ---------- */

.badge {
  display: inline-block;
  font-size: .75rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: var(--r-pill);
  white-space: nowrap;
}
.badge-draft { background: #fdf1de; color: #8a5a08; }
.badge-live  { background: #e6f7ee; color: #0b6b3d; }
.badge-muted { background: var(--wash); color: var(--muted); }
.badge-brand { background: var(--brand-tint); color: var(--brand-dark); }

/* ---------- item editor rows ---------- */

.rows { display: flex; flex-direction: column; }

.row-item {
  display: grid;
  grid-template-columns: 26px 1fr 110px 150px 92px;
  gap: 12px;
  align-items: center;
  padding: 12px 22px;
  border-bottom: 1px solid var(--line);
}
.row-item:last-child { border-bottom: 0; }
.row-item:hover { background: var(--canvas); }

.handle {
  cursor: grab;
  color: #c4c7d6;
  display: grid;
  place-items: center;
  user-select: none;
}
.handle:active { cursor: grabbing; }
.row-item.drag { opacity: .45; }
.row-item.over { border-top: 2px solid var(--brand); }

.row-item input[type=text], .row-item input[type=url], .row-item input[type=number] {
  font: inherit;
  font-size: .875rem;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: var(--r-sm);
  background: transparent;
  width: 100%;
  color: var(--ink);
}
.row-item input:hover { border-color: var(--line); background: var(--surface); }
.row-item input:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

.link-btn {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: .8125rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.link-btn:hover { color: var(--brand); }
.link-btn.danger:hover { color: #c0392b; }

/* ---------- auth screens ---------- */

.auth-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
  background: var(--wash);
}
.auth-card {
  width: 100%;
  max-width: 424px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 34px;
  box-shadow: var(--shadow-md);
}
.auth-card .brand { justify-content: center; margin-bottom: 22px; }
.auth-card h1 { font-size: 1.5rem; text-align: center; margin-bottom: 6px; }
.auth-card .sub { text-align: center; color: var(--muted); font-size: .9375rem; margin-bottom: 26px; }
.auth-alt { text-align: center; font-size: .875rem; color: var(--muted); margin-top: 22px; }

/* ---------- empty ---------- */

.blank {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}
.blank h3 { margin-bottom: 6px; }
.blank p { max-width: 44ch; margin: 0 auto 18px; }

/* ---------- responsive ---------- */

@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .side {
    position: static;
    min-height: 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .side-nav { flex-direction: row; flex-wrap: wrap; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .form-2, .form-3 { grid-template-columns: 1fr; }
  .pad, .topbar { padding-left: 20px; padding-right: 20px; }
  .row-item { grid-template-columns: 26px 1fr; gap: 8px; }
  .row-item > *:nth-child(n+3) { grid-column: 2; }
  table.grid-t th, table.grid-t td { padding-left: 14px; padding-right: 14px; }
}

@media (max-width: 640px) {
  .tiles { grid-template-columns: 1fr; }
  .table-scroll { overflow-x: auto; }
}
