/*
 * SI GetSet CMS.
 *
 * An internal tool for one educator, so this favours density and legibility
 * over presentation. Deliberately neutral: the CMS manages all four brands, so
 * it carries none of their colours itself.
 */

:root {
  --ink: #10192b;
  --ink-soft: #55617a;
  --line: #dde2ea;
  --bg: #f4f6fa;
  --surface: #ffffff;
  --accent: #1d4ed8;
  --accent-dark: #1739a8;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --ok: #067647;
  --ok-bg: #ecfdf3;
  --radius: 10px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { margin: 0; line-height: 1.25; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.muted { color: var(--ink-soft); }

/* ------------------------------------------------------------------ shell */

.shell {
  display: grid;
  grid-template-columns: 232px 1fr;
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 20px 16px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.sidebar__brand {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.sidebar__brand span {
  display: block;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 500;
}

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

.sidebar__link {
  padding: 7px 10px;
  border-radius: 6px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 500;
}

.sidebar__link:hover { background: var(--bg); color: var(--ink); }

.sidebar__link.is-active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.sidebar__foot { margin-top: auto; font-size: 13px; }
.sidebar__user { color: var(--ink-soft); word-break: break-all; }
.sidebar__logout { color: var(--accent); font-weight: 600; }
.sidebar__logout:hover { text-decoration: underline; }

.main {
  min-width: 0;
  padding: 24px 28px 64px;
}

/* ----------------------------------------------------------------- topbar */

.topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.topbar__title { font-size: 22px; font-weight: 700; }
.topbar__brand {
  margin-left: 10px;
  padding: 2px 9px;
  border-radius: 100px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  vertical-align: middle;
}

.topbar__intro { margin-top: 4px; max-width: 68ch; color: var(--ink-soft); font-size: 14px; }

.switcher { display: flex; align-items: center; gap: 8px; }
.switcher__label { color: var(--ink-soft); font-size: 13px; font-weight: 600; }

.switcher__select,
.fld__input {
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
}

.fld__input:focus { border-color: var(--accent); }

/* ---------------------------------------------------------------- flashes */

.flashes { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }

.flash {
  padding: 9px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
}

.flash--success { background: var(--ok-bg); color: var(--ok); }
.flash--error { background: var(--danger-bg); color: var(--danger); }

/* ------------------------------------------------------------------ cards */

.card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.card--new { border-style: dashed; background: transparent; margin-top: 24px; }
.card__title { font-size: 15px; font-weight: 700; }

.card__fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  align-items: start;
}

.card__fields .fld--wide { grid-column: 1 / -1; }

.card__actions { display: flex; gap: 8px; }

/* ----------------------------------------------------------------- fields */

.fld { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

.fld__label { color: var(--ink-soft); font-size: 12px; font-weight: 600; }
.fld__label abbr { color: var(--danger); text-decoration: none; }
.fld__help { color: var(--ink-soft); font-size: 12px; }

.fld__check { display: flex; align-items: center; height: 33px; }
.fld__check input { width: 17px; height: 17px; accent-color: var(--accent); }

.fld__colour { display: flex; align-items: center; gap: 8px; }
.fld__colour input { width: 44px; height: 33px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: none; }

textarea.fld__input { resize: vertical; line-height: 1.5; }

/* ---------------------------------------------------------------- buttons */

.btn {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

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

.btn--primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); }

.btn--danger { border-color: transparent; background: transparent; color: var(--danger); }
.btn--danger:hover { background: var(--danger-bg); }

/* ------------------------------------------------------------------ login */

.login-page {
  display: grid;
  place-items: center;
  min-height: 100vh;
  padding: 20px;
}

.login-card {
  width: min(100%, 380px);
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.login-card h1 { font-size: 19px; font-weight: 700; }
.login-card .fld { margin-top: 14px; }
.login-card .btn { width: 100%; margin-top: 18px; justify-content: center; }

/* ------------------------------------------------------------- brand list */

.brand-row__swatches { display: flex; gap: 6px; align-items: center; }

.swatch {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

.tag {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 100px;
  background: var(--bg);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
}

.tag--real { background: var(--ok-bg); color: var(--ok); }

@media (max-width: 800px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar__nav { flex-direction: row; flex-wrap: wrap; }
  .main { padding: 20px 16px 48px; }
}
