@import url("./pros-loader.css?v=20260716-1");

/* ============================================================================
   PROS — Design System
   Professional, squared (zero border-radius) UI. Hand-written, no framework.
   Tokens → base → layout → components → utilities.
   ========================================================================= */

:root {
  /* Surfaces & lines ------------------------------------------------------ */
  --c-bg:        #eef1f6;   /* app canvas */
  --c-surface:   #ffffff;   /* cards, panels */
  --c-surface-2: #f3f5f9;   /* inset / subtle fills */
  --c-surface-3: #e9edf4;   /* hover fills */
  --c-border:    #d7dde7;   /* hairlines */
  --c-border-strong: #c2cad8;

  /* Ink ------------------------------------------------------------------- */
  --c-ink:    #0d1320;      /* near-black brand surface (topbar) */
  --c-ink-2:  #161e2e;
  --c-text:   #131a27;      /* body text */
  --c-muted:  #5d6878;      /* secondary text */
  --c-faint:  #8b96a7;      /* tertiary / on dark muted */

  /* Brand accent ---------------------------------------------------------- */
  --c-primary:      #2150d4;
  --c-primary-d:    #1a3fab;
  --c-primary-dd:   #15348e;
  --c-primary-soft: #e7edfd;
  --c-primary-line: #b9c9f6;

  /* Status ---------------------------------------------------------------- */
  --c-success: #1a8a4f;  --c-success-soft: #e4f6ec; --c-success-line: #b4e2c6;
  --c-danger:  #c5302f;  --c-danger-soft:  #fdeaea; --c-danger-line:  #f3c2c2;
  --c-warning: #b3760a;  --c-warning-soft: #fcf2dd; --c-warning-line: #ecd6a3;

  /* Radius — squared design ---------------------------------------------- */
  --radius: 0;
  --radius-sm: 0;

  /* Elevation ------------------------------------------------------------- */
  --shadow-sm: 0 1px 0 rgba(13, 19, 32, .03), 0 1px 2px rgba(13, 19, 32, .05);
  --shadow:    0 1px 1px rgba(13, 19, 32, .04), 0 6px 18px rgba(13, 19, 32, .07);
  --shadow-lg: 0 2px 4px rgba(13, 19, 32, .05), 0 18px 44px rgba(13, 19, 32, .12);

  /* Rhythm ---------------------------------------------------------------- */
  --space: 16px;
  --maxw: 1140px;
  --topbar-h: 60px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Menlo", Consolas, monospace;
}

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

/* Ensure the hidden attribute always wins over display rules from classes. */
[hidden] { display: none !important; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--font);
  color: var(--c-text);
  background:
    linear-gradient(180deg, #f6f8fc 0%, var(--c-bg) 280px) no-repeat;
  background-color: var(--c-bg);
  line-height: 1.55;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
/* Authenticated app shell uses a sidebar layout instead of a column. */
body.has-shell { display: block; background: var(--c-bg); }

h1, h2, h3, h4 { letter-spacing: -.013em; font-weight: 700; color: var(--c-text); }
h1 { line-height: 1.2; }

a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-d); text-decoration: underline; }

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

code, .mono {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  padding: .08em .4em;
  color: var(--c-text);
}

hr { border: none; border-top: 1px solid var(--c-border); margin: 20px 0; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--c-primary); color: #fff; padding: 8px 14px; z-index: 100;
  font-weight: 600;
}
.skip-link:focus { left: 8px; top: 8px; }

/* Icons inherit text color and align with text */
.icon { display: inline-block; vertical-align: -0.18em; stroke: currentColor; flex: none; }

/* Topbar --------------------------------------------------------------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space);
  min-height: var(--topbar-h);
  padding: 0 28px;
  background: var(--c-ink);
  background-image: linear-gradient(180deg, #131b2c 0%, var(--c-ink) 100%);
  border-bottom: 1px solid #000;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 8px 24px rgba(13, 19, 32, .14);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.06rem; letter-spacing: -.01em;
  color: #fff;
}
.brand:hover { color: #fff; text-decoration: none; }
.brand .icon { color: #7fa0ff; }

.topnav { display: flex; align-items: center; gap: 14px; }
.topbar .who { color: #c3cbd9; font-size: .9rem; font-weight: 500; }
.topbar .role-chip { background: rgba(255, 255, 255, .1); color: #e6ebf4; }
.topbar .btn-ghost { color: #d6dce8; }
.topbar .btn-ghost:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.topbar a.btn-ghost:hover { text-decoration: none; }

.inline-form { display: inline; margin: 0; }

/* Role chips ----------------------------------------------------------- */
.role-chip {
  display: inline-flex; align-items: center;
  font-size: .68rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; padding: 3px 8px;
  background: var(--c-surface-3); color: var(--c-muted);
  border-radius: var(--radius-sm);
  vertical-align: middle;
}
.role-admin       { background: #efe6ff; color: #6b29c7; }
.role-coordinator { background: #e0eeff; color: #155fb0; }
.role-supervisor  { background: #e0f4ea; color: #1a7a48; }
.role-student     { background: #ffeede; color: #ab6310; }

/* Layout --------------------------------------------------------------- */
.container {
  width: 100%; max-width: var(--maxw);
  margin: 0 auto; padding: 40px 28px 56px;
  flex: 1;
}
.footer {
  padding: 22px 28px; text-align: center;
  color: var(--c-muted); font-size: .86rem;
  border-top: 1px solid var(--c-border);
  background: var(--c-surface);
}

/* Messages ------------------------------------------------------------- */
.messages {
  list-style: none; margin: 0 auto; padding: 16px 28px 0;
  max-width: var(--maxw); width: 100%;
}
.message {
  position: relative;
  padding: 12px 16px 12px 18px;
  border: 1px solid transparent;
  border-left-width: 3px;
  margin-bottom: 10px; font-size: .92rem; font-weight: 500;
  background: var(--c-surface);
  box-shadow: var(--shadow-sm);
}
.message-success { background: var(--c-success-soft); border-color: var(--c-success-line); border-left-color: var(--c-success); color: #115e35; }
.message-error, .message-danger { background: var(--c-danger-soft); border-color: var(--c-danger-line); border-left-color: var(--c-danger); color: #8f1f1f; }
.message-warning { background: var(--c-warning-soft); border-color: var(--c-warning-line); border-left-color: var(--c-warning); color: #7a5207; }
.message-info { background: var(--c-primary-soft); border-color: var(--c-primary-line); border-left-color: var(--c-primary); color: var(--c-primary-dd); }

/* Buttons -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: .92rem; line-height: 1.2;
  cursor: pointer; white-space: nowrap;
  padding: 10px 17px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  background: var(--c-surface); color: var(--c-text);
  box-shadow: var(--shadow-sm);
  transition: background .14s ease, border-color .14s ease, color .14s ease, box-shadow .14s ease, transform .04s ease;
}
.btn:hover { text-decoration: none; background: var(--c-surface-2); border-color: var(--c-border-strong); }
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--c-primary); border-color: var(--c-primary);
  color: #fff;
  box-shadow: 0 1px 2px rgba(21, 52, 142, .35), 0 1px 0 rgba(255,255,255,.12) inset;
}
.btn-primary:hover { background: var(--c-primary-d); border-color: var(--c-primary-d); color: #fff; }

.btn-ghost { background: transparent; border-color: transparent; box-shadow: none; color: var(--c-text); }
.btn-ghost:hover { background: var(--c-surface-3); border-color: transparent; }

.btn-outline { background: transparent; box-shadow: none; border-color: var(--c-border-strong); color: var(--c-text); }
.btn-outline:hover { background: var(--c-surface-2); border-color: var(--c-muted); }

.btn-lg { padding: 13px 26px; font-size: 1rem; }
.btn-sm { padding: 6px 11px; font-size: .82rem; gap: 6px; }
.btn-block { width: 100%; }

/* Cards & grid --------------------------------------------------------- */
.card {
  position: relative;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 26px;
}

a.card { display: block; color: inherit; }
a.card:hover { text-decoration: none; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1080px) { .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 760px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

/* Settings logo preview */
.logo-preview { display: flex; gap: 18px; align-items: flex-start; }
.logo-preview img { width: 84px; height: 84px; object-fit: cover; border: 1px solid var(--c-border); flex: none; background: #fff; }
.logo-empty {
  width: 84px; height: 84px; flex: none; display: grid; place-items: center;
  background: var(--c-surface-2); border: 1px solid var(--c-border); color: var(--c-faint);
}
.logo-preview > div { flex: 1; }

/* Relationship marker (supervision map) */
.rel { display: inline-flex; align-items: center; gap: 7px; }
.rel-dot { width: 8px; height: 8px; background: var(--c-success); display: inline-block; }

/* Onboarding empty state */
.onboard { max-width: 720px; }
.onboard-steps { margin: 6px 0 22px; padding-left: 20px; color: var(--c-muted); }
.onboard-steps li { padding: 5px 0; }
.onboard-steps li strong { color: var(--c-text); }

/* Feature cards (also used as nav tiles) ------------------------------- */
.feature { display: flex; flex-direction: column; gap: 10px; }
.feature h3 { font-size: 1.05rem; }
.feature .feature-icon {
  width: 46px; height: 46px;
  border-radius: var(--radius-sm);
  display: grid; place-items: center;
  background: var(--c-primary-soft); color: var(--c-primary-d);
  border: 1px solid var(--c-primary-line);
}
a.card.feature {
  transition: border-color .15s ease, box-shadow .15s ease, transform .12s ease;
}
a.card.feature::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--c-primary); transform: scaleY(0); transform-origin: top;
  transition: transform .18s ease;
}
a.card.feature:hover {
  border-color: var(--c-primary-line);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
a.card.feature:hover::after { transform: scaleY(1); }

/* Hero ----------------------------------------------------------------- */
.hero { text-align: center; padding: 36px 0 18px; }
.hero h1 {
  font-size: clamp(2rem, 4.4vw, 2.85rem);
  margin: 0 0 16px; letter-spacing: -.03em; line-height: 1.08;
}
.hero p {
  color: var(--c-muted); font-size: 1.14rem;
  max-width: 660px; margin: 0 auto 28px;
}
.hero-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* Forms ---------------------------------------------------------------- */
.form { max-width: 440px; margin: 0 auto; }
.form-row { margin-bottom: 18px; }
.form-row label { display: block; font-weight: 600; margin-bottom: 7px; font-size: .9rem; color: var(--c-text); }

.input,
input[type=text], input[type=email], input[type=password],
input[type=number], input[type=tel], input[type=url], input[type=date],
input[type=file], select, textarea {
  width: 100%; padding: 10px 13px;
  border: 1px solid var(--c-border-strong);
  border-radius: var(--radius-sm);
  font: inherit; font-size: .95rem;
  background: #fff; color: var(--c-text);
  transition: border-color .14s ease, box-shadow .14s ease;
}
input[type=file] { padding: 8px 11px; background: var(--c-surface-2); }
.input:focus, input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235d6878' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 11px center;
  padding-right: 34px;
}
.help { color: var(--c-muted); font-size: .84rem; margin-top: 5px; }
.errorlist { list-style: none; padding: 0; margin: 7px 0 0; color: var(--c-danger); font-size: .85rem; font-weight: 500; }

/* Page head ------------------------------------------------------------ */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 28px;
  padding-bottom: 20px; border-bottom: 1px solid var(--c-border);
}
.page-head .page-title, .page-head .page-sub { margin-bottom: 0; }
.page-title { font-size: 1.7rem; margin: 0 0 6px; letter-spacing: -.02em; }
.page-sub { color: var(--c-muted); margin: 0 0 26px; font-size: 1rem; }

/* Tables --------------------------------------------------------------- */
.table { width: 100%; border-collapse: collapse; font-size: .93rem; }
.table th, .table td {
  text-align: left; padding: 12px 14px;
  border-bottom: 1px solid var(--c-border); vertical-align: middle;
}
.table th {
  color: var(--c-muted); font-weight: 700; font-size: .73rem;
  text-transform: uppercase; letter-spacing: .06em;
  background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border-strong);
}
.table tbody tr { transition: background .12s ease; }
.table tbody tr:hover { background: var(--c-surface-2); }
.table tr:last-child td { border-bottom: none; }

/* Let tables sit flush inside cards */
.card > .table:last-child { margin-bottom: -26px; }
.card > .table { margin-left: -26px; margin-right: -26px; width: calc(100% + 52px); }
.card > .table th:first-child, .card > .table td:first-child { padding-left: 26px; }
.card > .table th:last-child, .card > .table td:last-child { padding-right: 26px; }

.row-actions { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.inline-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin: 0; }
.inline-controls label { font-weight: 600; font-size: .9rem; }
.inline-controls .help { flex-basis: 100%; }

/* Dashboard stat cards ------------------------------------------------- */
.stat-card {
  text-align: left; padding: 22px 24px;
  border-left: 3px solid var(--c-primary);
}
.stat-number { font-size: 2.2rem; font-weight: 800; color: var(--c-text); line-height: 1.05; letter-spacing: -.02em; }
.stat-label  { font-size: .76rem; color: var(--c-muted); text-transform: uppercase; letter-spacing: .07em; font-weight: 700; margin-top: 6px; }

/* Warning / callout card ----------------------------------------------- */
.card-warning {
  border-color: var(--c-warning-line); border-left: 3px solid var(--c-warning);
  background: var(--c-warning-soft); color: #7a5207;
  display: flex; align-items: center; gap: 10px; box-shadow: var(--shadow-sm);
}
.card-warning a { color: #7a5207; font-weight: 700; text-decoration: underline; }

/* Coordinator class card ----------------------------------------------- */
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.card-head h3 { font-size: 1.12rem; }
.section-title {
  font-size: .8rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--c-muted); margin: 32px 0 14px; font-weight: 700;
  display: flex; align-items: center; gap: 12px;
}
.section-title::after { content: ""; flex: 1; height: 1px; background: var(--c-border); }

.stats-row { display: flex; flex-wrap: wrap; gap: 8px; }
.stat-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .8rem; font-weight: 500;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-sm);
  padding: 4px 10px; color: var(--c-muted);
}
.stat-pill .icon { color: var(--c-faint); }

/* Get-started / signup ------------------------------------------------- */
.signup {
  display: grid; grid-template-columns: 1fr 1.15fr; gap: 44px;
  align-items: start; max-width: 980px; margin: 8px auto 0;
}
.signup-intro { padding-top: 8px; }
.eyebrow {
  display: inline-block; font-size: .74rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--c-primary-d); background: var(--c-primary-soft);
  border: 1px solid var(--c-primary-line); padding: 4px 10px; margin-bottom: 16px;
}
.signup-intro .page-title { font-size: 1.95rem; }
.signup-points { list-style: none; padding: 0; margin: 22px 0 0; }
.signup-points li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 0; color: var(--c-text); font-weight: 500;
  border-top: 1px solid var(--c-border);
}
.signup-points li .icon { color: var(--c-success); flex: none; }
.signup-card { padding: 30px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.req { color: var(--c-danger); font-weight: 700; }
@media (max-width: 820px) {
  .signup { grid-template-columns: 1fr; gap: 28px; }
  .form-grid { grid-template-columns: 1fr; }
}

/* Outbox / message log ------------------------------------------------- */
.msg { padding: 18px 20px; }
.msg-expired { opacity: .55; }
.msg-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.msg-subject { font-size: 1rem; }
.msg-to { font-size: .86rem; }
.msg-time { margin-left: auto; font-size: .82rem; white-space: nowrap; }
.msg-body {
  margin: 14px 0 0; padding: 14px 16px;
  background: var(--c-surface-2); border: 1px solid var(--c-border);
  font-family: var(--font-mono); font-size: .85rem; color: var(--c-text);
  white-space: pre-wrap; word-break: break-word; line-height: 1.5;
}
.msg-actions { display: flex; gap: 10px; align-items: center; margin-top: 12px; flex-wrap: wrap; }
.msg-link {
  flex: 1; min-width: 220px; font-family: var(--font-mono); font-size: .82rem;
  padding: 8px 10px; border: 1px solid var(--c-border-strong); background: #fff; color: var(--c-primary-d);
}

/* ===========================================================================
   App shell — sidebar + main (authenticated)
   ======================================================================== */
:root { --sidebar-w: 256px; --appbar-h: 60px; }

.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0; width: var(--sidebar-w);
  display: flex; flex-direction: column; z-index: 60;
  background: linear-gradient(180deg, #131b2c 0%, var(--c-ink) 100%);
  border-right: 1px solid #000;
  color: #c3cbd9;
}
.side-brand {
  display: flex; align-items: center; gap: 11px;
  padding: 16px 18px; min-height: var(--appbar-h);
  border-bottom: 1px solid rgba(255,255,255,.07);
  color: #fff;
}
.side-brand:hover { text-decoration: none; color: #fff; }
.side-mark {
  width: 38px; height: 38px; flex: none; display: grid; place-items: center;
  background: rgba(94,135,255,.16); border: 1px solid rgba(94,135,255,.32); color: #8fa9ff;
}
.side-logo { width: 38px; height: 38px; object-fit: cover; background: #fff; flex: none; }
.side-brand-text { display: flex; flex-direction: column; line-height: 1.15; overflow: hidden; }
.side-brand-text strong { font-size: .98rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-brand-text small { font-size: .7rem; color: #7e8aa3; text-transform: uppercase; letter-spacing: .08em; }

.side-nav { flex: 1; overflow-y: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 3px; }
.side-label {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em;
  color: #6b7790; padding: 14px 12px 6px;
}
.side-link {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; color: #b6c0d4; font-weight: 500; font-size: .94rem;
  border-left: 3px solid transparent;
}
.side-link:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.side-link .icon { color: #7e8aa3; flex: none; }
.side-link.is-active { background: rgba(94,135,255,.14); color: #fff; border-left-color: var(--c-accent, #5e87ff); }
.side-link.is-active .icon { color: #8fa9ff; }

.side-foot {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.07);
}
.avatar {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  background: var(--c-primary); color: #fff; font-weight: 700; font-size: .95rem;
}
.side-user-text { display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.side-user-text strong { color: #fff; font-size: .9rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-text .role-chip { align-self: flex-start; }

.app-main {
  flex: 1; min-width: 0; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column; min-height: 100vh;
}
.appbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  height: var(--appbar-h); padding: 0 28px;
  background: rgba(255,255,255,.88); backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--c-border);
}
.appbar-title { font-weight: 700; font-size: 1rem; letter-spacing: -.01em; color: var(--c-text); }
.appbar-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }

/* Account menu (top-right) --------------------------------------------- */
.acct { position: relative; }
.acct-btn {
  display: inline-flex; align-items: center; gap: 9px; cursor: pointer;
  background: transparent; border: 1px solid transparent; padding: 5px 8px 5px 5px; font: inherit;
}
.acct-btn:hover { background: var(--c-surface-2); border-color: var(--c-border); }
.acct-avatar {
  width: 32px; height: 32px; flex: none; display: grid; place-items: center;
  background: var(--c-primary); color: #fff; font-weight: 700; font-size: .9rem;
}
.acct-avatar.lg { width: 40px; height: 40px; font-size: 1rem; }
.acct-meta { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.acct-name { font-weight: 600; font-size: .88rem; color: var(--c-text); }
.acct-role { font-size: .72rem; color: var(--c-muted); }
.acct-caret { color: var(--c-muted); }
.acct-menu {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60; min-width: 240px;
  background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--shadow-lg); padding: 8px;
}
.acct-head { display: flex; gap: 11px; align-items: center; padding: 8px 10px 12px; border-bottom: 1px solid var(--c-border); margin-bottom: 6px; }
.acct-head-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.acct-head-text strong { font-size: .94rem; }
.acct-head-text small { font-size: .75rem; }
.acct-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 11px;
  background: transparent; border: none; font: inherit; font-size: .9rem; color: var(--c-text);
  cursor: pointer; text-align: left;
}
.acct-item:hover { background: var(--c-surface-2); text-decoration: none; }
.acct-signout { color: var(--c-danger); }
@media (max-width: 620px) { .acct-meta { display: none; } }

/* Sidebar collapsible group ------------------------------------------- */
.side-group { margin: 0; }
.side-group > summary { list-style: none; cursor: pointer; }
.side-group > summary::-webkit-details-marker { display: none; }
.side-summary { display: flex; align-items: center; justify-content: space-between; }
.side-summary-label { display: inline-flex; align-items: center; gap: 11px; }
.side-summary.is-parent { color: #fff; }
.side-chevron { transition: transform .18s ease; color: #7e8aa3; }
.side-group[open] > .side-summary .side-chevron { transform: rotate(90deg); }
.side-sub { display: flex; flex-direction: column; padding: 2px 0 4px; }
.side-link-sub { padding-left: 41px; font-size: .9rem; }

/* Tabs ----------------------------------------------------------------- */
.tab-bar { display: flex; gap: 2px; border-bottom: 1px solid var(--c-border); margin-bottom: 22px; flex-wrap: wrap; }
.tab-bar.mb-0 { margin-bottom: 0; border-bottom: none; }
.tab-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 11px 16px;
  background: transparent; border: none; border-bottom: 2px solid transparent; margin-bottom: -1px;
  font: inherit; font-weight: 600; font-size: .92rem; color: var(--c-muted); cursor: pointer;
}
.tab-btn:hover { color: var(--c-text); }
.tab-btn.is-active { color: var(--c-primary); border-bottom-color: var(--c-primary); }
.tab-btn .pill { background: var(--c-surface-3); }
.tab-card { padding: 26px; }
.tab-panel { animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.settings-h { margin: 0 0 18px; font-size: 1.05rem; }
.tab-foot { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--c-border); }

/* Toolbar + search ----------------------------------------------------- */
.toolbar-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.tabs-toolbar { justify-content: space-between; border-bottom: 1px solid var(--c-border); padding-bottom: 0; margin-bottom: 20px; }
.search-input {
  width: 280px; max-width: 100%; padding: 9px 13px; border: 1px solid var(--c-border-strong);
  background: #fff; font: inherit; font-size: .92rem;
}
.search-input:focus { outline: none; border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }

/* Class chooser cards -------------------------------------------------- */
.class-card { display: flex; flex-direction: column; gap: 4px; transition: border-color .15s, box-shadow .15s, transform .12s; }
.class-card:hover { border-color: var(--c-primary-line); box-shadow: var(--shadow); transform: translateY(-2px); }
.class-card-top { display: flex; align-items: center; justify-content: space-between; }
.class-card h3 { font-size: 1.12rem; }
.class-card-open { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--c-border); display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .88rem; color: var(--c-primary); }

/* User table cells ----------------------------------------------------- */
.u-cell { display: flex; align-items: center; gap: 10px; }
.u-avatar { width: 30px; height: 30px; flex: none; display: grid; place-items: center; background: var(--c-primary-soft); color: var(--c-primary-d); font-weight: 700; font-size: .8rem; }
.u-avatar.sup { background: var(--c-success-soft); color: #1a7a48; }

/* ===========================================================================
   Phases engine + editor
   ======================================================================== */
.add-phase { display: flex; gap: 10px; align-items: center; padding: 16px; margin-bottom: 18px; }
.add-phase input { flex: 1; }

.phase-card { margin-bottom: 16px; }
.phase-card.is-sub { box-shadow: none; border-left: 3px solid var(--c-primary-line); margin: 12px 0 0; }
.phase-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.phase-titlewrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.subphases { margin-top: 6px; }

.req-list { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.req-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: var(--c-surface-2); border: 1px solid var(--c-border); }
.req-row .req-title { flex: 1; font-size: .92rem; }
.req-kind { display: inline-flex; align-items: center; gap: 5px; font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; padding: 3px 8px; flex: none; }
.kind-file { background: #e0eeff; color: #155fb0; }
.kind-text { background: #fff1e0; color: #ab6310; }
.kind-document { background: #efe6ff; color: #6b29c7; }

.phase-tools { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.tool { position: relative; }
.tool > summary { list-style: none; display: inline-flex; }
.tool > summary::-webkit-details-marker { display: none; }
.tool-form { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; padding: 14px; border: 1px solid var(--c-border); background: var(--c-surface-2); max-width: 460px; }
.tool-form input, .tool-form select, .tool-form textarea { width: 100%; }

/* Student / review requirement items */
.phase-view .phase-head { margin-bottom: 6px; }
.subphase-view { border-top: 1px solid var(--c-border); margin-top: 16px; padding-top: 10px; }
.req-item { border: 1px solid var(--c-border); padding: 16px; margin-top: 12px; }
.req-item-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.req-item-title { flex: 1; }
.req-instructions { margin: 8px 0 0; font-size: .9rem; }
.req-action { margin-top: 12px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.req-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.req-form.col { flex-direction: column; align-items: stretch; width: 100%; }
.req-form textarea { width: 100%; }
.review-form { display: flex; flex-direction: column; gap: 8px; max-width: 620px; }

/* Editor */
.editor { display: flex; flex-direction: column; gap: 12px; }
.editor-bar { position: sticky; top: var(--appbar-h); z-index: 25; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--shadow-sm); }
.editor-bar-left, .editor-bar-right { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.editor-titlewrap { display: flex; flex-direction: column; line-height: 1.2; }
.editor-titlewrap small { font-size: .78rem; }
.editor-stat { font-size: .82rem; font-weight: 600; color: var(--c-muted); display: inline-flex; align-items: center; gap: 5px; background: var(--c-surface-2); border: 1px solid var(--c-border); padding: 4px 9px; white-space: nowrap; }
.editor-stat.ok { color: var(--c-success); border-color: var(--c-success-line); background: var(--c-success-soft); }
.ed-paste { color: var(--c-warning); border-color: var(--c-warning-line); background: var(--c-warning-soft); }
.ed-paste.buzz { animation: buzz .35s; }
@keyframes buzz { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-3px)} 75%{transform:translateX(3px)} }
.editor-save { font-size: .8rem; color: var(--c-muted); min-width: 60px; }
.editor-toolbar {
  position: sticky; top: calc(var(--appbar-h) + 58px); z-index: 24;
  display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding: 8px 10px; background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--shadow-sm);
}
.tb-group { display: flex; gap: 2px; align-items: center; padding-right: 6px; margin-right: 2px; border-right: 1px solid var(--c-border); }
.tb-group:last-child { border-right: none; }
.editor-toolbar button { min-width: 32px; height: 32px; padding: 0 7px; border: 1px solid transparent; background: transparent; cursor: pointer; font-size: .95rem; color: var(--c-text); border-radius: 0; }
.editor-toolbar button:hover { background: var(--c-surface-2); border-color: var(--c-border); }
.tb-select { height: 32px; padding: 0 8px; font-size: .85rem; border: 1px solid var(--c-border-strong); background: #fff; }
.tb-color { display: inline-flex; align-items: center; justify-content: center; position: relative; width: 32px; height: 32px; border: 1px solid transparent; cursor: pointer; font-weight: 700; }
.tb-color:hover { background: var(--c-surface-2); border-color: var(--c-border); }
.tb-color input[type="color"] { position: absolute; left: 4px; bottom: 2px; width: 24px; height: 6px; border: none; padding: 0; background: none; cursor: pointer; }
.tb-hl span { background: #fff3a3; padding: 0 2px; }
.stat-danger { border-left-color: var(--c-danger); }
.stat-danger .stat-number { color: var(--c-danger); }
.editor-instructions { margin: 0; font-size: .9rem; }
.editor-stage { display: flex; justify-content: center; }
.editor-paper {
  width: 100%; max-width: 820px; min-height: 60vh; background: #fff;
  border: 1px solid var(--c-border); box-shadow: var(--shadow-sm);
  padding: 48px 56px; font-size: 1.02rem; line-height: 1.7; outline: none;
}
.editor-paper:focus { border-color: var(--c-primary-line); box-shadow: 0 0 0 3px var(--c-primary-soft); }
.editor-paper h2 { font-size: 1.4rem; margin: 1em 0 .4em; }
.editor-paper:empty::before { content: attr(aria-label); color: var(--c-faint); }
.editor-foot { font-size: .82rem; display: flex; align-items: center; gap: 6px; }
.editor-hint {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--c-warning); color: #3a2906; font-weight: 600; font-size: .88rem;
  padding: 11px 18px; box-shadow: var(--shadow-lg); z-index: 120; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none;
}
.editor-hint.show { opacity: 1; transform: translateX(-50%) translateY(0); }

.content { padding: 30px 36px 56px; max-width: 1280px; width: 100%; }
.has-shell .messages { padding: 18px 36px 0; max-width: 1280px; }

/* Mobile nav toggle */
.nav-burger { display: none; flex-direction: column; gap: 4px; cursor: pointer; padding: 6px; }
.nav-burger span { width: 22px; height: 2px; background: var(--c-text); display: block; }
.nav-scrim { display: none; }

@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); transition: transform .22s ease; }
  .app-main { margin-left: 0; }
  .nav-burger { display: flex; }
  #navtoggle:checked ~ .app .sidebar { transform: translateX(0); }
  #navtoggle:checked ~ .app .nav-scrim {
    display: block; position: fixed; inset: 0; z-index: 55;
    background: rgba(10,15,25,.5);
  }
}

/* ===========================================================================
   Interactive board (drag & drop)
   ======================================================================== */
.board { display: flex; flex-direction: column; gap: 14px; }

.board-bar {
  position: sticky; top: var(--appbar-h); z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; padding: 12px 16px;
  background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--shadow-sm);
}
.board-bar-left, .board-bar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.stage { display: inline-flex; align-items: center; }
.stage-step {
  font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em;
  color: var(--c-faint); padding: 5px 14px; border: 1px solid var(--c-border);
  border-right-width: 0; background: var(--c-surface-2); white-space: nowrap;
}
.stage-step:last-child { border-right-width: 1px; }
.stage-step.done { color: var(--c-success); border-color: var(--c-success-line); background: var(--c-success-soft); }
.stage-step.active { color: #fff; background: var(--c-primary); border-color: var(--c-primary); }

/* Toolbar controls */
.class-switch { padding: 7px 10px; font-weight: 600; font-size: .9rem; max-width: 220px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  border: 1px solid var(--c-border-strong); background: var(--c-surface); cursor: pointer; color: var(--c-muted);
}
.icon-btn:hover { background: var(--c-surface-2); color: var(--c-text); }
.menu { position: relative; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 45; min-width: 196px;
  background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--shadow-lg);
  display: flex; flex-direction: column; padding: 6px;
}
.menu-pop button, .menu-pop a {
  display: flex; align-items: center; gap: 10px; padding: 9px 11px; background: transparent;
  border: none; text-align: left; font: inherit; font-size: .9rem; color: var(--c-text); cursor: pointer; width: 100%;
}
.menu-pop button:hover, .menu-pop a:hover { background: var(--c-surface-2); text-decoration: none; }
.menu-pop .icon { color: var(--c-muted); }

.board-summary { display: flex; gap: 12px; flex-wrap: wrap; }
.board-summary .sum {
  flex: 1; min-width: 120px; background: var(--c-surface); border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-primary); padding: 12px 16px; box-shadow: var(--shadow-sm);
}
.board-summary .sum b { display: block; font-size: 1.7rem; font-weight: 800; line-height: 1; }
.board-summary .sum span { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--c-muted); font-weight: 700; }

.board-canvas { display: grid; grid-template-columns: 248px 1fr; gap: 14px; align-items: start; }
@media (max-width: 900px) { .board-canvas { grid-template-columns: 1fr; } }

/* Supervisor rail */
.rail {
  position: sticky; top: calc(var(--appbar-h) + 70px);
  background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--shadow-sm);
  padding: 14px; max-height: calc(100vh - var(--appbar-h) - 90px); overflow-y: auto;
}
.rail-head { font-weight: 700; font-size: .9rem; margin-bottom: 10px; display: flex; gap: 6px; align-items: baseline; }
.rail-list { display: flex; flex-direction: column; gap: 8px; }
.rail-hint { font-size: .78rem; margin: 12px 0 0; }

/* Lanes */
.lanes { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; align-items: start; }
.lane { background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--shadow-sm); }
.lane-group { transition: box-shadow .15s ease, border-color .15s ease; }
.lane-group.over { border-color: var(--c-primary); box-shadow: 0 0 0 3px var(--c-primary-soft); }
.lane-pool .lane-body { display: flex; flex-wrap: wrap; gap: 8px; }
.lane-head {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border-bottom: 1px solid var(--c-border); background: var(--c-surface-2);
}
.lane-head strong { font-size: .95rem; }
.lane-head .pill, .pill {
  font-size: .72rem; font-weight: 700; background: var(--c-surface-3); color: var(--c-muted);
  padding: 2px 8px; min-width: 20px; text-align: center;
}
.lane-body { padding: 12px; min-height: 56px; }
.lane-group .lane-body { display: flex; flex-direction: column; gap: 7px; }
.grp-meta { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--c-border); align-items: center; flex-wrap: wrap; }
.grp-area { flex: 1; min-width: 110px; padding: 6px 8px; font-size: .85rem; }
.grp-del { margin-left: auto; border: none; background: transparent; color: var(--c-faint); font-size: 1.1rem; cursor: pointer; line-height: 1; padding: 2px 6px; opacity: 0; transition: opacity .12s ease; }
.lane-group:hover .grp-del, .grp-del:focus-visible { opacity: 1; }
.grp-del:hover { color: var(--c-danger); }

/* Drop targets */
.drop.over { outline: 2px dashed var(--c-primary); outline-offset: -4px; background: var(--c-primary-soft); }
.drop-hint { display: none; color: var(--c-primary-d); font-size: .8rem; font-weight: 600; text-align: center; padding: 8px; }
.drop.over .drop-hint { display: block; }
.empty-note { color: var(--c-faint); font-size: .85rem; }
.empty-note.pad { padding: 24px; text-align: center; }

/* Chips */
.chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--c-surface); border: 1px solid var(--c-border-strong);
  padding: 7px 9px; font-size: .86rem; cursor: grab; user-select: none;
  box-shadow: 0 1px 0 rgba(16,24,40,.03);
}
.chip:active { cursor: grabbing; }
.chip.dragging { opacity: .45; }
.chip-student { background: #fff; }
.chip-student.is-leader { border-color: var(--c-primary-line); background: var(--c-primary-soft); }
.chip-name { font-weight: 600; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.chip-gpa { font-size: .72rem; color: var(--c-muted); font-variant-numeric: tabular-nums; }
.chip-lead { color: var(--c-primary); }
.chip-star { border: none; background: transparent; color: var(--c-faint); cursor: pointer; font-size: .95rem; padding: 0 2px; margin-left: auto; opacity: 0; transition: opacity .12s ease; }
.chip-student:hover .chip-star, .chip-star:focus-visible { opacity: 1; }
.chip-star:hover { color: var(--c-primary); }
.lane-group .chip-student { width: 100%; }

.chip-sup { flex-direction: column; align-items: flex-start; gap: 3px; width: 100%; }
.chip-sup .chip-name { max-width: 100%; }
.chip-sup .sup-cap { font-size: .72rem; color: var(--c-success); font-weight: 700; }
.chip-sup.is-full .sup-cap { color: var(--c-warning); }
.chip-sup .sup-areas { font-size: .72rem; color: var(--c-muted); }

/* Supervisor slot on a group */
.sup-slot { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border: 1px dashed var(--c-border-strong); font-size: .82rem; }
.sup-slot.empty { color: var(--c-faint); }
.sup-slot.has-sup { border-style: solid; border-color: var(--c-success-line); background: var(--c-success-soft); }
.sup-slot-name { font-weight: 600; }
.sup-slot.over { outline: 2px dashed var(--c-primary); outline-offset: 2px; }
.sup-rm { border: none; background: transparent; color: var(--c-faint); cursor: pointer; font-size: 1rem; line-height: 1; }
.sup-rm:hover { color: var(--c-danger); }
.tag-manual { font-size: .62rem; text-transform: uppercase; letter-spacing: .05em; background: #efe6ff; color: #6b29c7; padding: 1px 5px; font-weight: 700; }

/* Modal */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(10,15,25,.5); display: grid; place-items: center; padding: 20px; }
.modal { width: 100%; max-width: 460px; background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--shadow-lg); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--c-border); }
.modal-head h3 { margin: 0; font-size: 1.1rem; }
.modal-x { border: none; background: transparent; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--c-muted); }
.modal-body { padding: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--c-border); background: var(--c-surface-2); }
.fld { display: block; margin-bottom: 12px; }
.fld > span { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.chks { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; max-height: 160px; overflow-y: auto; border: 1px solid var(--c-border); padding: 8px; }
.chk { display: flex; align-items: center; gap: 6px; font-size: .85rem; font-weight: 500; }
.preview { display: flex; flex-direction: column; gap: 8px; }
.note { font-size: .85rem; padding: 9px 11px; border: 1px solid transparent; border-left-width: 3px; }
.note-info { background: var(--c-primary-soft); border-color: var(--c-primary-line); color: var(--c-primary-dd); }
.note-warn { background: var(--c-warning-soft); border-color: var(--c-warning-line); color: #7a5207; }
.note-ok { background: var(--c-success-soft); border-color: var(--c-success-line); color: #115e35; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%); z-index: 120;
  padding: 11px 18px; font-weight: 600; font-size: .9rem; color: #fff; box-shadow: var(--shadow-lg);
}
.toast-ok { background: var(--c-success); }
.toast-error { background: var(--c-danger); }

/* Utilities ------------------------------------------------------------ */
.muted { color: var(--c-muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; }
.stack > * + * { margin-top: 16px; }

/* ===========================================================================
   PROS field-notebook skin

   The public site established a tactile academic language: ruled paper,
   registration marks, dark green ledger covers and restrained red ink.  The
   rules below bring that same system to every application component while
   leaving the underlying templates and interactions untouched.
   ======================================================================== */

:root {
  --paper: #f3e5c7;
  --paper-light: #faefd7;
  --paper-deep: #e5d3ad;
  --paper-rule: rgba(57, 80, 72, .16);
  --paper-rule-strong: rgba(57, 80, 72, .28);
  --ink: #17231f;
  --forest: #153f36;
  --forest-light: #315f53;
  --red-ink: #a91c1b;
  --mustard: #c7a744;
  --study-blue: #3f7180;
  --study-green: #587967;
  --serif: "Source Serif 4", Georgia, "Times New Roman", Times, serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, monospace;

  --c-bg: var(--paper);
  --c-surface: var(--paper-light);
  --c-surface-2: #ecddbd;
  --c-surface-3: #e2d0a8;
  --c-border: rgba(23, 35, 31, .34);
  --c-border-strong: var(--ink);
  --c-ink: var(--forest);
  --c-ink-2: #244b41;
  --c-text: var(--ink);
  --c-muted: #596a63;
  --c-faint: #7d887e;
  --c-primary: var(--red-ink);
  --c-primary-d: #871616;
  --c-primary-dd: #681010;
  --c-primary-soft: #f2d5ca;
  --c-primary-line: #c98978;
  --c-success: var(--study-green);
  --c-success-soft: #dce8d8;
  --c-success-line: #9caf9e;
  --c-danger: var(--red-ink);
  --c-danger-soft: #f1d6ca;
  --c-danger-line: #c98978;
  --c-warning: #8a6914;
  --c-warning-soft: #efe0ac;
  --c-warning-line: #c7a744;
  --shadow-sm: none;
  --shadow: none;
  --shadow-lg: none;
  --sidebar-w: 248px;
}

html {
  scrollbar-color: var(--red-ink) var(--paper-deep);
  scrollbar-width: thin;
}

::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track {
  background: var(--paper-deep);
  border-left: 1px solid rgba(23, 35, 31, .28);
}
::-webkit-scrollbar-thumb {
  min-height: 44px;
  background: var(--red-ink);
  border: 3px solid var(--paper-deep);
}
::-webkit-scrollbar-thumb:hover { background: #871616; }
::-webkit-scrollbar-corner { background: var(--paper-deep); }

body.has-shell {
  color: var(--ink);
  background: var(--paper);
}

.has-shell *,
.has-shell *::before,
.has-shell *::after {
  box-shadow: none !important;
  border-radius: 0 !important;
}

.has-shell h1,
.has-shell h2,
.has-shell h3,
.has-shell h4 {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  letter-spacing: -.025em;
}

.has-shell h1 { line-height: 1.04; }
.has-shell a { color: var(--red-ink); }
.has-shell a:hover { color: #741111; }
.has-shell ::selection { color: var(--paper-light); background: var(--red-ink); }
.has-shell :focus-visible { outline: 2px solid var(--red-ink); outline-offset: 3px; }

/* Shell / ruled work surface ------------------------------------------- */
.has-shell .sidebar {
  color: #d8dfd6;
  background-color: var(--forest);
  background-image:
    linear-gradient(90deg, rgba(255,255,255,.025), transparent 58%),
    repeating-linear-gradient(to bottom, transparent 0, transparent 37px, rgba(255,255,255,.055) 38px);
  border-right: 1px solid #09251f;
}

.has-shell .side-brand {
  color: #fff9e9;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(249, 237, 212, .28);
}
.has-shell .side-brand:hover { color: #fff9e9; }
.has-shell .side-mark {
  color: var(--ink);
  background: var(--mustard);
  border: 1px solid var(--ink);
}
.has-shell .side-logo { border: 1px solid var(--paper-light); background: var(--paper-light); }
.has-shell .side-brand-text strong { font-family: var(--serif); font-size: 1.02rem; }
.has-shell .side-brand-text small,
.has-shell .side-label {
  color: #a7b9af;
  font-family: var(--font-mono);
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .115em;
}
.has-shell .side-nav { padding: 12px 10px; scrollbar-color: var(--mustard) var(--forest); }
.has-shell .side-label { padding: 16px 12px 6px; }
.has-shell .side-link {
  color: #cfdbd5;
  padding: 10px 11px;
  border-left-width: 4px;
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .01em;
}
.has-shell .side-link:hover {
  color: #fff9e9;
  background: rgba(249, 237, 212, .08);
}
.has-shell .side-link .icon { color: #a7b9af; }
.has-shell .side-link.is-active {
  color: #fff9e9;
  background: rgba(199, 167, 68, .16);
  border-left-color: var(--mustard);
}
.has-shell .side-link.is-active .icon { color: var(--mustard); }
.has-shell .side-summary.is-parent { color: #fff9e9; }
.has-shell .side-chevron { color: #a7b9af; }
.has-shell .side-link-sub {
  padding-left: 40px;
  color: #b7c8bf;
  font-size: .72rem;
}
.has-shell .side-foot { border-top-color: rgba(249,237,212,.25); }
.has-shell .side-user-text strong { color: #fff9e9; font-family: var(--serif); }

.has-shell .app-main {
  background-color: var(--paper);
  background-image:
    linear-gradient(
      to right,
      transparent 0,
      transparent 54px,
      rgba(169, 28, 27, .34) 54px,
      rgba(169, 28, 27, .34) 55px,
      transparent 55px,
      transparent calc(100% - 55px),
      rgba(169, 28, 27, .34) calc(100% - 55px),
      rgba(169, 28, 27, .34) calc(100% - 54px),
      transparent calc(100% - 54px)
    ),
    repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--paper-rule) 32px);
}

.has-shell .appbar {
  height: var(--appbar-h);
  padding: 0 68px;
  color: var(--ink);
  background: rgba(243, 229, 199, .94);
  border-bottom: 1px solid rgba(23, 35, 31, .75);
  backdrop-filter: blur(8px);
}
.has-shell .appbar-title {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.has-shell .content {
  width: 100%;
  max-width: 1440px;
  padding: 36px 74px 72px;
}

/* Account register ----------------------------------------------------- */
.has-shell .acct-btn { border: 1px solid transparent; }
.has-shell .acct-btn:hover { background: var(--paper-light); border-color: var(--ink); }
.has-shell .acct-avatar,
.has-shell .avatar {
  color: var(--ink);
  background: var(--mustard);
  border: 1px solid var(--ink);
  font-family: var(--font-mono);
}
.has-shell .acct-name { color: var(--ink); font-family: var(--serif); font-weight: 600; }
.has-shell .acct-role,
.has-shell .acct-caret { color: #596a63; font-family: var(--font-mono); }
.has-shell .acct-menu {
  min-width: 250px;
  padding: 8px;
  color: var(--ink);
  background: var(--paper-light);
  border: 1px solid var(--ink);
}
.has-shell .acct-head { border-bottom-color: var(--ink); }
.has-shell .acct-item { color: var(--ink); font-family: var(--font-mono); font-size: .76rem; }
.has-shell .acct-item:hover { color: var(--ink); background: #e8d6af; }
.has-shell .acct-signout { color: var(--red-ink); }

/* Page registers and headings ----------------------------------------- */
.has-shell .page-head {
  align-items: flex-end;
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ink);
}
.has-shell .page-title {
  max-width: 850px;
  margin-bottom: 8px;
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(1.9rem, 3.2vw, 3rem);
  font-weight: 600;
  line-height: 1.02;
}
.has-shell .page-title::before {
  content: "";
  display: inline-block;
  width: 28px;
  height: 7px;
  margin: 0 12px .19em 0;
  background: var(--red-ink);
  vertical-align: middle;
}
.has-shell .page-sub {
  max-width: 760px;
  color: #4e625a;
  font-size: .96rem;
  line-height: 1.65;
}
.has-shell .section-title {
  color: var(--red-ink);
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
}
.has-shell .section-title::after { height: 1px; background: var(--ink); }
.has-shell .content > .page-title + .page-sub {
  margin-bottom: 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--ink);
}
.has-shell hr { border-top-color: rgba(23,35,31,.65); }
.has-shell code,
.has-shell .mono {
  color: var(--forest);
  background: #ead9b5;
  border-color: rgba(23,35,31,.42);
  font-family: var(--font-mono);
}

/* Cards and empty states ---------------------------------------------- */
.has-shell .card {
  color: var(--ink);
  background-color: rgba(250, 239, 215, .94);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, rgba(57,80,72,.09) 32px);
  border: 1px solid var(--ink);
  padding: 24px;
}
.has-shell a.card { color: var(--ink); }
.has-shell a.card:hover {
  color: var(--ink);
  background-color: #f4e4c4;
  border-color: var(--red-ink);
  transform: none;
}
.has-shell a.card.feature::after {
  top: -1px;
  left: -1px;
  bottom: auto;
  width: 46px;
  height: 7px;
  background: var(--red-ink);
  transform: none;
}
.has-shell .card-head { border-bottom-color: var(--ink); }
.has-shell .card-head h3 { line-height: 1.15; }
.has-shell .feature-icon {
  color: var(--paper-light);
  background: var(--study-blue);
  border: 1px solid var(--ink);
}
.has-shell .feature:nth-child(3n + 2) .feature-icon { color: var(--ink); background: var(--mustard); }
.has-shell .feature:nth-child(3n + 3) .feature-icon { background: var(--study-green); }
.has-shell .class-card-open {
  color: var(--red-ink);
  border-top-color: var(--ink);
  font-family: var(--font-mono);
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.has-shell .onboard { border-left: 8px solid var(--mustard); }
.has-shell .empty-note,
.has-shell .empty-note.pad { color: #68776f; font-family: var(--font-mono); font-size: .76rem; }

/* Buttons -------------------------------------------------------------- */
.has-shell .btn,
.has-shell button.btn {
  min-height: 38px;
  color: var(--ink);
  background: var(--paper-light);
  border: 1px solid var(--ink);
  font-family: var(--font-mono);
  font-size: .74rem;
  font-weight: 700;
  letter-spacing: .025em;
  transition: color .14s ease, background-color .14s ease, border-color .14s ease;
}
.has-shell .btn:hover,
.has-shell button.btn:hover {
  color: var(--paper-light);
  background: var(--forest);
  border-color: var(--forest);
  transform: none;
}
.has-shell .btn:active { transform: translateY(1px); }
.has-shell .btn-primary,
.has-shell button.btn-primary {
  color: #fff9e9;
  background: var(--red-ink);
  border-color: var(--ink);
}
.has-shell .btn-primary:hover,
.has-shell button.btn-primary:hover { color: #fff9e9; background: #861515; border-color: var(--ink); }
.has-shell .btn-outline { color: var(--ink); background: transparent; border-color: var(--ink); }
.has-shell .btn-ghost { color: var(--ink); background: transparent; border-color: transparent; }
.has-shell .btn-ghost:hover { color: var(--red-ink); background: transparent; border-color: var(--red-ink); }
.has-shell .btn-sm { min-height: 31px; padding: 6px 10px; font-size: .67rem; }
.has-shell .btn-lg { min-height: 46px; padding: 12px 22px; font-size: .79rem; }
.has-shell button:disabled,
.has-shell .btn[aria-disabled="true"] {
  cursor: not-allowed;
  color: #7a8279;
  background: #ded0b2;
  border-color: #918d80;
  opacity: .72;
}

/* Fields --------------------------------------------------------------- */
.has-shell .form-row label,
.has-shell .fld > span,
.has-shell .inline-controls label {
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
}
.has-shell .input,
.has-shell input[type=text],
.has-shell input[type=email],
.has-shell input[type=password],
.has-shell input[type=number],
.has-shell input[type=tel],
.has-shell input[type=url],
.has-shell input[type=date],
.has-shell input[type=file],
.has-shell select,
.has-shell textarea,
.has-shell .search-input,
.has-shell .msg-link {
  color: var(--ink);
  background-color: rgba(255, 249, 233, .72);
  border: 1px solid var(--ink);
  font-family: var(--font);
}
.has-shell input::placeholder,
.has-shell textarea::placeholder { color: #827e70; opacity: 1; }
.has-shell .input:focus,
.has-shell input:focus,
.has-shell select:focus,
.has-shell textarea:focus,
.has-shell .search-input:focus {
  border-color: var(--red-ink);
  outline: 2px solid rgba(169, 28, 27, .28);
  outline-offset: 2px;
}
.has-shell input[type="checkbox"],
.has-shell input[type="radio"] { accent-color: var(--red-ink); }
.has-shell input[type=file] { background: #ead9b5; }
.has-shell .help { color: #5d6d64; font-family: var(--font-mono); font-size: .7rem; }
.has-shell .req { color: var(--red-ink); }
.has-shell .errorlist {
  color: var(--red-ink);
  font-family: Georgia, cursive;
  font-size: .88rem;
  font-style: italic;
  font-weight: 700;
  transform: rotate(-.35deg);
}
.has-shell .form-row:has(.errorlist) input,
.has-shell .form-row:has(.errorlist) select,
.has-shell .form-row:has(.errorlist) textarea {
  border: 2px solid var(--red-ink);
  outline: 1px solid var(--red-ink);
  outline-offset: 3px;
}

/* Tables and records --------------------------------------------------- */
.has-shell .table {
  color: var(--ink);
  border: 1px solid var(--ink);
  font-size: .88rem;
}
.has-shell .table th,
.has-shell .table td { border-color: rgba(23,35,31,.34); }
.has-shell .table th {
  color: #fff9e9;
  background: var(--forest);
  border-color: var(--ink);
  font-family: var(--font-mono);
  font-size: .62rem;
  letter-spacing: .075em;
}
.has-shell .table tbody tr { background: rgba(250,239,215,.58); }
.has-shell .table tbody tr:nth-child(even) { background: rgba(234,219,185,.46); }
.has-shell .table tbody tr:hover { background: rgba(199,167,68,.2); }
.has-shell .table td.row-actions {
  display: table-cell;
  text-align: right;
  white-space: nowrap;
}
.has-shell .table td.row-actions .inline-form { display: inline-block; }
.has-shell .table td.row-actions .inline-form + .inline-form { margin-left: 5px; }
.has-shell .card > .table {
  width: calc(100% + 48px);
  margin-right: -24px;
  margin-left: -24px;
}
.has-shell .card > .table:last-child { margin-bottom: -24px; }
.has-shell .card > .table th:first-child,
.has-shell .card > .table td:first-child { padding-left: 24px; }
.has-shell .card > .table th:last-child,
.has-shell .card > .table td:last-child { padding-right: 24px; }
.has-shell .u-avatar {
  color: var(--ink);
  background: var(--mustard);
  border: 1px solid var(--ink);
  font-family: var(--font-mono);
}
.has-shell .u-avatar.sup { color: #fff9e9; background: var(--study-green); }

/* Status marks, stats and messages ------------------------------------ */
.has-shell .role-chip,
.has-shell .pill,
.has-shell .stat-pill,
.has-shell .req-kind,
.has-shell .tag-manual {
  color: var(--ink);
  background: #e8d7ae;
  border: 1px solid rgba(23,35,31,.55);
  font-family: var(--font-mono);
  font-size: .61rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.has-shell .role-admin,
.has-shell .tag-manual { color: #fff9e9; background: var(--red-ink); border-color: var(--red-ink); }
.has-shell .role-coordinator,
.has-shell .kind-file { color: #fff9e9; background: var(--study-blue); border-color: var(--study-blue); }
.has-shell .role-supervisor { color: #fff9e9; background: var(--study-green); border-color: var(--study-green); }
.has-shell .role-student,
.has-shell .kind-text { color: var(--ink); background: var(--mustard); border-color: #8d7122; }
.has-shell .kind-document { color: var(--paper-light); background: var(--forest-light); border-color: var(--forest); }
.has-shell .rel-dot { background: var(--study-green); border: 1px solid var(--ink); }
.has-shell .stat-card { border-left: 8px solid var(--study-blue); }
.has-shell .stat-card:nth-child(2) { border-left-color: var(--mustard); }
.has-shell .stat-card:nth-child(3) { border-left-color: var(--study-green); }
.has-shell .stat-card:nth-child(4),
.has-shell .stat-danger { border-left-color: var(--red-ink); }
.has-shell .stat-number { color: var(--ink); font-family: var(--serif); font-weight: 600; }
.has-shell .stat-label {
  color: #596a63;
  font-family: var(--font-mono);
  font-size: .62rem;
}
.has-shell .card-warning {
  color: #5e4910;
  background-color: #efe0ac;
  border: 1px solid var(--ink);
  border-left: 8px solid var(--mustard);
}
.has-shell .card-warning a { color: #5e4910; }
.has-shell .messages {
  position: fixed;
  top: 14px;
  left: calc(var(--sidebar-w) + (100vw - var(--sidebar-w)) / 2);
  z-index: 150;
  width: min(480px, calc(100vw - var(--sidebar-w) - 32px));
  max-width: none;
  margin: 0;
  padding: 0;
  transform: translateX(-50%);
  pointer-events: none;
}
.has-shell .message {
  color: #fff9e9;
  background: var(--forest);
  border: 1px solid #071f1a;
  border-left: 8px solid var(--mustard);
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .02em;
  animation: notebook-notice .45s cubic-bezier(.2,.85,.25,1) both;
  pointer-events: auto;
}
.has-shell .message-error,
.has-shell .message-danger { border-left-color: #e75b4c; }
.has-shell .message-success { border-left-color: #86aa92; }
.has-shell .message-info { border-left-color: #78adba; }
@keyframes notebook-notice {
  from { opacity: 0; transform: translateY(-28px) scaleX(.72) scaleY(.65); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Tabs, pagination and small navigation ------------------------------- */
.has-shell .tab-bar { gap: 0; border-bottom-color: var(--ink); }
.has-shell .tab-btn {
  color: #596a63;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-bottom: none;
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.has-shell .tab-btn:hover { color: var(--red-ink); background: rgba(250,239,215,.65); }
.has-shell .tab-btn.is-active {
  color: #fff9e9;
  background: var(--forest);
  border-color: var(--ink);
}
.has-shell .tab-btn.is-active .pill { color: var(--ink); background: var(--mustard); }
.has-shell .tabs-toolbar { border-bottom-color: var(--ink); }
.has-shell .tab-foot { border-top-color: var(--ink); }
.has-shell .pagination,
.has-shell .pager {
  display: flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
  margin: 24px 0;
  font-family: var(--font-mono);
}
.has-shell .pagination a,
.has-shell .pagination span,
.has-shell .page-link,
.has-shell .pager a {
  display: inline-grid;
  min-width: 34px;
  min-height: 34px;
  place-items: center;
  color: var(--ink);
  background: var(--paper-light);
  border: 1px solid var(--ink);
}
.has-shell .pagination .active,
.has-shell .page-item.active .page-link { color: #fff9e9; background: var(--red-ink); }

/* Setup list / form trays --------------------------------------------- */
.has-shell .setup-steps { list-style: none; padding: 0; }
.has-shell .step { display: flex; align-items: center; gap: 18px; }
.has-shell .step-mark {
  display: grid;
  width: 36px;
  height: 36px;
  flex: none;
  place-items: center;
  color: #fff9e9;
  background: var(--study-blue);
  border: 1px solid var(--ink);
  font: 700 .72rem/1 var(--font-mono);
}
.has-shell .step-done .step-mark { color: var(--ink); background: var(--mustard); }
.has-shell .step-body { flex: 1; }
.has-shell .step-action { margin-left: auto; }
.has-shell .tool-form,
.has-shell .req-row {
  color: var(--ink);
  background: rgba(234,219,185,.72);
  border-color: rgba(23,35,31,.52);
}
.has-shell .req-row { flex-wrap: wrap; }
.has-shell .req-row .req-title { min-width: min(240px, 100%); }
.has-shell .move-form select,
.has-shell td .inline-form select {
  width: auto;
  min-width: 132px;
  max-width: 220px;
}
.has-shell .phase-card.is-sub { border-left: 7px solid var(--study-blue); }
.has-shell .subphase-view { border-top-color: var(--ink); }
.has-shell .req-item { background: rgba(250,239,215,.58); border-color: var(--ink); }

/* Editor — a real sheet on the notebook desk -------------------------- */
.has-shell .editor-bar,
.has-shell .editor-toolbar,
.has-shell .board-bar {
  color: var(--ink);
  background: rgba(250,239,215,.96);
  border: 1px solid var(--ink);
}
.has-shell .editor-toolbar button { color: var(--ink); }
.has-shell .editor-toolbar button:hover,
.has-shell .tb-color:hover { background: #e7d5ad; border-color: var(--ink); }
.has-shell .tb-group { border-right-color: var(--ink); }
.has-shell .editor-stat { color: var(--ink); background: #ead9b5; border-color: var(--ink); font-family: var(--font-mono); }
.has-shell .editor-stat.ok { color: #fff9e9; background: var(--study-green); }
.has-shell .ed-paste { color: var(--ink); background: var(--mustard); }
.has-shell .editor-paper {
  color: var(--ink);
  background-color: #fff8e8;
  background-image:
    linear-gradient(to right, transparent 0, transparent 52px, rgba(169,28,27,.32) 52px, rgba(169,28,27,.32) 53px, transparent 53px),
    repeating-linear-gradient(to bottom, transparent 0, transparent 30px, rgba(63,113,128,.18) 31px);
  border: 1px solid var(--ink);
  padding: 48px 56px 48px 74px;
}
.has-shell .editor-paper:focus { border-color: var(--red-ink); outline: 2px solid rgba(169,28,27,.28); }
.has-shell .editor-hint,
.has-shell .toast { color: var(--ink); background: var(--mustard); border: 1px solid var(--ink); font-family: var(--font-mono); }
.has-shell .toast-error { color: #fff9e9; background: var(--red-ink); }
.has-shell .toast-ok { color: #fff9e9; background: var(--study-green); }

/* Matching board / kanban ledger -------------------------------------- */
.has-shell .stage-step {
  color: #596a63;
  background: #ead9b5;
  border-color: var(--ink);
  font-family: var(--font-mono);
}
.has-shell .stage-step.done { color: #fff9e9; background: var(--study-green); border-color: var(--ink); }
.has-shell .stage-step.active { color: var(--ink); background: var(--mustard); border-color: var(--ink); }
.has-shell .icon-btn { color: var(--ink); background: var(--paper-light); border-color: var(--ink); }
.has-shell .icon-btn:hover { color: #fff9e9; background: var(--forest); }
.has-shell .menu-pop { background: var(--paper-light); border-color: var(--ink); }
.has-shell .menu-pop button,
.has-shell .menu-pop a { color: var(--ink); font-family: var(--font-mono); font-size: .73rem; }
.has-shell .menu-pop button:hover,
.has-shell .menu-pop a:hover { background: #e8d6af; }
.has-shell .board-summary .sum {
  color: var(--ink);
  background: var(--paper-light);
  border: 1px solid var(--ink);
  border-left: 7px solid var(--study-blue);
}
.has-shell .board-summary .sum:nth-child(2) { border-left-color: var(--mustard); }
.has-shell .board-summary .sum:nth-child(3) { border-left-color: var(--study-green); }
.has-shell .board-summary .sum:nth-child(4) { border-left-color: var(--red-ink); }
.has-shell .board-summary .sum b { font-family: var(--serif); font-weight: 600; }
.has-shell .board-summary .sum span { font-family: var(--font-mono); }
.has-shell .rail,
.has-shell .lane {
  color: var(--ink);
  background-color: rgba(250,239,215,.94);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, rgba(57,80,72,.09) 32px);
  border-color: var(--ink);
}
.has-shell .rail-head,
.has-shell .lane-head {
  color: #fff9e9;
  background: var(--forest);
  border-bottom-color: var(--ink);
  font-family: var(--font-mono);
}
.has-shell .lane-head .pill { color: var(--ink); background: var(--mustard); }
.has-shell .lane-group.over { border-color: var(--red-ink); outline: 2px solid rgba(169,28,27,.25); }
.has-shell .grp-meta { border-bottom-color: var(--ink); }
.has-shell .chip {
  color: var(--ink);
  background: #fff7e5;
  border-color: var(--ink);
}
.has-shell .chip-student.is-leader { background: #efe0ac; border-color: var(--ink); }
.has-shell .chip-lead,
.has-shell .chip-star:hover { color: var(--red-ink); }
.has-shell .chip-sup .sup-cap { color: var(--study-green); }
.has-shell .chip-sup.is-full .sup-cap { color: #8a6914; }
.has-shell .sup-slot { border-color: var(--ink); }
.has-shell .sup-slot.has-sup { color: #fff9e9; background: var(--study-green); border-color: var(--ink); }
.has-shell .drop.over { background: rgba(199,167,68,.25); outline-color: var(--red-ink); }
.has-shell .drop-hint { color: var(--red-ink); font-family: var(--font-mono); }

/* Dialogs, notes and message records ---------------------------------- */
.has-shell .modal-back { background: rgba(12,34,29,.72); backdrop-filter: blur(2px); }
.has-shell .modal { color: var(--ink); background: var(--paper-light); border-color: var(--ink); }
.has-shell .modal-head { color: #fff9e9; background: var(--forest); border-bottom-color: var(--ink); }
.has-shell .modal-head h3 { color: #fff9e9; }
.has-shell .modal-x { color: #fff9e9; }
.has-shell .modal-foot { background: #e7d4ab; border-top-color: var(--ink); }
.has-shell .chks { background: rgba(255,249,233,.65); border-color: var(--ink); }
.has-shell .note { border: 1px solid var(--ink); border-left-width: 7px; font-family: var(--font-mono); }
.has-shell .note-info { color: var(--ink); background: #cbdde0; border-left-color: var(--study-blue); }
.has-shell .note-warn { color: var(--ink); background: #efe0ac; border-left-color: var(--mustard); }
.has-shell .note-ok { color: var(--ink); background: #d8e4d7; border-left-color: var(--study-green); }
.has-shell .msg-body {
  color: var(--ink);
  background-color: #fff7e4;
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 23px, rgba(63,113,128,.15) 24px);
  border-color: var(--ink);
}
.has-shell .msg-link { color: var(--red-ink); }
.has-shell .msg {
  border-left: 7px solid var(--study-blue);
}
.has-shell .msg:nth-child(3n + 2) { border-left-color: var(--mustard); }
.has-shell .msg:nth-child(3n + 3) { border-left-color: var(--study-green); }
.has-shell .msg-head {
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(23,35,31,.55);
}
.has-shell .msg-subject { font-family: var(--serif); font-size: 1.08rem; }
.has-shell .msg-to,
.has-shell .msg-time { color: #596a63; font-family: var(--font-mono); font-size: .69rem; }
.has-shell .msg-actions { padding-top: 2px; }
.has-shell .msg-expired {
  opacity: .68;
  background-color: rgba(229,211,173,.92);
}

/* Settings record ----------------------------------------------------- */
.has-shell .tab-card { border-top: 7px solid var(--study-blue); }
.has-shell .settings-h {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ink);
  font-size: 1.2rem;
}
.has-shell .logo-preview img,
.has-shell .logo-empty {
  color: #fff9e9;
  background: var(--forest);
  border: 1px solid var(--ink);
}

/* Anonymous account utilities ----------------------------------------
   Password recovery, activation and set-password screens use base.html
   without the dedicated registration stylesheet. */
body:not(.has-shell):not(.paper-public) {
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, transparent 0, transparent 82px, rgba(169,28,27,.32) 82px, rgba(169,28,27,.32) 83px, transparent 83px, transparent calc(100% - 83px), rgba(169,28,27,.32) calc(100% - 83px), rgba(169,28,27,.32) calc(100% - 82px), transparent calc(100% - 82px)),
    repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--paper-rule) 32px);
}
body:not(.has-shell):not(.paper-public) .topbar {
  min-height: 72px;
  color: var(--ink);
  background: rgba(243,229,199,.94);
  border-bottom: 1px solid var(--ink);
  box-shadow: none;
}
body:not(.has-shell):not(.paper-public) .brand { color: var(--ink); font-family: var(--serif); }
body:not(.has-shell):not(.paper-public) .brand:hover { color: var(--red-ink); }
body:not(.has-shell):not(.paper-public) .public-brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #fff9e9;
  background: var(--forest);
  border: 1px solid var(--ink);
}
body:not(.has-shell):not(.paper-public) .container {
  display: grid;
  width: 100%;
  max-width: 1120px;
  place-items: center;
  padding: 52px 100px 70px;
}
body:not(.has-shell):not(.paper-public) .card {
  color: var(--ink);
  background-color: rgba(250,239,215,.96);
  background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 31px, rgba(57,80,72,.1) 32px);
  border: 1px solid var(--ink);
  box-shadow: none;
}
body:not(.has-shell):not(.paper-public) .form { width: min(100%, 500px); max-width: 500px; }
body:not(.has-shell):not(.paper-public) h1,
body:not(.has-shell):not(.paper-public) h2,
body:not(.has-shell):not(.paper-public) h3 { color: var(--ink); font-family: var(--serif); }
body:not(.has-shell):not(.paper-public) .form-row label {
  font-family: var(--font-mono);
  font-size: .67rem;
  letter-spacing: .05em;
  text-transform: uppercase;
}
body:not(.has-shell):not(.paper-public) input,
body:not(.has-shell):not(.paper-public) select,
body:not(.has-shell):not(.paper-public) textarea {
  color: var(--ink);
  background: rgba(255,249,233,.76);
  border-color: var(--ink);
}
body:not(.has-shell):not(.paper-public) input:focus,
body:not(.has-shell):not(.paper-public) select:focus,
body:not(.has-shell):not(.paper-public) textarea:focus {
  border-color: var(--red-ink);
  box-shadow: none;
  outline: 2px solid rgba(169,28,27,.3);
  outline-offset: 2px;
}
body:not(.has-shell):not(.paper-public) .btn { color: var(--ink); border-color: var(--ink); box-shadow: none; font-family: var(--font-mono); }
body:not(.has-shell):not(.paper-public) .btn-ghost { color: var(--ink); }
body:not(.has-shell):not(.paper-public) .btn-ghost:hover { color: #fff9e9; background: var(--forest); }
body:not(.has-shell):not(.paper-public) .btn-primary { color: #fff9e9; background: var(--red-ink); }
body:not(.has-shell):not(.paper-public) .btn-primary:hover { color: #fff9e9; background: #861515; }
body:not(.has-shell):not(.paper-public) .errorlist { color: var(--red-ink); font-family: Georgia, cursive; font-style: italic; }
body:not(.has-shell):not(.paper-public) .footer { background: rgba(243,229,199,.9); border-top-color: var(--ink); }

/* System errors ------------------------------------------------------- */
.system-error {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: clamp(30px, 6vw, 58px);
  border-left: 8px solid var(--red-ink) !important;
}
.system-error-code {
  display: inline-block;
  margin-bottom: 18px;
  color: var(--red-ink);
  font-family: var(--font-mono);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.system-error h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 6vw, 4rem);
  line-height: 1;
}
.system-error p {
  max-width: 560px;
  margin: 18px 0 26px;
  color: var(--c-muted);
  font-size: 1rem;
  line-height: 1.65;
}

/* Responsive field desk ----------------------------------------------- */
@media (max-width: 1024px) {
  .has-shell .appbar { padding: 0 40px; }
  .has-shell .content { padding: 32px 58px 64px; }
  .has-shell .messages {
    left: 50%;
    width: min(480px, calc(100vw - 32px));
  }
  .has-shell .nav-burger {
    border: 1px solid var(--ink);
    background: var(--mustard);
  }
  .has-shell .nav-burger span { background: var(--ink); }
  .has-shell .nav-scrim { background: rgba(9,37,31,.7) !important; }
}

@media (max-width: 900px) {
  .has-shell .rail {
    position: static;
    top: auto;
    max-height: none;
    overflow-y: visible;
  }
}

@media (max-width: 760px) {
  .has-shell .app-main {
    background-image:
      linear-gradient(to right, transparent 0, transparent 25px, rgba(169,28,27,.34) 25px, rgba(169,28,27,.34) 26px, transparent 26px, transparent calc(100% - 21px), rgba(169,28,27,.34) calc(100% - 21px), rgba(169,28,27,.34) calc(100% - 20px), transparent calc(100% - 20px)),
      repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--paper-rule) 32px);
  }
  .has-shell .appbar { padding: 0 32px; }
  .has-shell .content { padding: 28px 39px 56px 42px; }
  .has-shell .page-head { align-items: flex-start; margin-bottom: 20px; }
  .has-shell .page-title { font-size: clamp(1.7rem, 9vw, 2.35rem); }
  .has-shell .page-title::before { width: 20px; height: 6px; margin-right: 8px; }
  .has-shell .page-sub { font-size: .9rem; }
  .has-shell .card { padding: 18px; }
  .has-shell .card:has(> .table) { overflow-x: auto; }
  .has-shell .card > .table {
    min-width: 620px;
    width: calc(100% + 36px);
    margin-right: -18px;
    margin-left: -18px;
  }
  .has-shell .card > .table:last-child { margin-bottom: -18px; }
  .has-shell .card > .table th:first-child,
  .has-shell .card > .table td:first-child { padding-left: 18px; }
  .has-shell .card > .table th:last-child,
  .has-shell .card > .table td:last-child { padding-right: 18px; }
  .has-shell .table th,
  .has-shell .table td { padding: 10px 11px; }
  .has-shell .row-actions { justify-content: flex-start; flex-wrap: wrap; }
  .has-shell .step { align-items: flex-start; flex-wrap: wrap; }
  .has-shell .step-action { width: 100%; margin-left: 54px; }
  .has-shell .stage { max-width: 100%; overflow-x: auto; }
  .has-shell .stage-step { padding: 5px 10px; }
  .has-shell .board-bar { position: relative; top: auto; }
  .has-shell .board-bar-left,
  .has-shell .board-bar-right { width: 100%; }
  .has-shell .class-switch { flex: 1; }
  .has-shell .editor-bar { position: relative; top: auto; }
  .has-shell .editor-paper { padding: 40px 24px 40px 52px; }
  .has-shell .editor-toolbar { top: var(--appbar-h); }
  .has-shell .add-phase {
    align-items: stretch;
    flex-direction: column;
  }
  .has-shell .add-phase .btn { align-self: flex-start; }
  .has-shell .req-row { align-items: flex-start; }
  .has-shell .req-row .row-actions { width: 100%; }
  .has-shell .logo-preview { flex-direction: column; }
  .has-shell .grid2,
  .has-shell .chks { grid-template-columns: 1fr; }
  body:not(.has-shell):not(.paper-public) .container { padding: 42px 44px 60px; }
}

@media (max-width: 480px) {
  .has-shell .appbar { padding: 0 26px 0 31px; }
  .has-shell .appbar-title { max-width: 44vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .has-shell .content { padding: 24px 30px 48px 35px; }
  .has-shell .card { padding: 15px; }
  .has-shell .card > .table { width: calc(100% + 30px); margin-right: -15px; margin-left: -15px; }
  .has-shell .card > .table:last-child { margin-bottom: -15px; }
  .has-shell .card > .table th:first-child,
  .has-shell .card > .table td:first-child { padding-left: 15px; }
  .has-shell .card > .table th:last-child,
  .has-shell .card > .table td:last-child { padding-right: 15px; }
  .has-shell .btn { white-space: normal; }
  .has-shell .acct-menu { position: fixed; top: 54px; right: 12px; left: 12px; }
  .has-shell .messages { top: 10px; width: calc(100vw - 20px); }
  .has-shell .message { font-size: .67rem; }
  .has-shell .editor-paper {
    background-image:
      linear-gradient(to right, transparent 0, transparent 35px, rgba(169,28,27,.32) 35px, rgba(169,28,27,.32) 36px, transparent 36px),
      repeating-linear-gradient(to bottom, transparent 0, transparent 30px, rgba(63,113,128,.18) 31px);
    padding: 34px 17px 34px 47px;
  }
  body:not(.has-shell):not(.paper-public) {
    background-image:
      linear-gradient(to right, transparent 0, transparent 16px, rgba(169,28,27,.32) 16px, rgba(169,28,27,.32) 17px, transparent 17px, transparent calc(100% - 17px), rgba(169,28,27,.32) calc(100% - 17px), rgba(169,28,27,.32) calc(100% - 16px), transparent calc(100% - 16px)),
      repeating-linear-gradient(to bottom, transparent 0, transparent 31px, var(--paper-rule) 32px);
  }
  body:not(.has-shell):not(.paper-public) .topbar { padding: 0 20px; }
  body:not(.has-shell):not(.paper-public) .container { padding: 30px 28px 52px; }
  body:not(.has-shell):not(.paper-public) .card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .has-shell *,
  .has-shell *::before,
  .has-shell *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}

/* ===========================================================================
   Board — Connections view (draggable node map)
   ======================================================================== */
.view-toggle { display: inline-flex; }
.view-toggle .btn { border-radius: 0; }
.view-toggle .btn.is-active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }

.connections-wrap { display: flex; flex-direction: column; gap: 8px; }
.connections-hint { margin: 0; font-size: .82rem; }
.connections-canvas {
  width: 100%; height: 640px; touch-action: none; cursor: grab;
  background: var(--c-surface); border: 1px solid var(--c-border); box-shadow: var(--shadow-sm);
  background-image: radial-gradient(var(--c-border) 1px, transparent 1px);
  background-size: 22px 22px;
}
.connections-canvas.panning { cursor: grabbing; }

.cv-node { cursor: move; }
.cv-node rect { stroke-width: 1.5; }
.cv-node.dragging rect { filter: drop-shadow(0 4px 10px rgba(0,0,0,.25)); }
.cv-node-student rect { fill: var(--c-surface-2); stroke: var(--c-border-strong); }
.cv-node-group rect { fill: var(--c-primary); stroke: var(--c-primary); }
.cv-node-supervisor rect { fill: var(--c-success-soft, #e8f5ee); stroke: var(--c-success, #2c7a4b); }
.cv-label { font: 700 .78rem/1 var(--font-body, Inter, sans-serif); fill: var(--c-text); }
.cv-node-group .cv-label { fill: #fff; }
.cv-sub { font: 600 .66rem/1 var(--font-body, Inter, sans-serif); fill: var(--c-muted); }
.cv-node-group .cv-sub { fill: rgba(255,255,255,.75); }

.cv-edge { fill: none; stroke-width: 1.6; }
.cv-edge-member { stroke: var(--c-border-strong); }
.cv-edge-match { stroke: var(--c-success, #2c7a4b); stroke-dasharray: none; stroke-width: 2; }

/* ===========================================================================
   Archive — search toolbar, view toggle, project cards
   ======================================================================== */
.arch-toolbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.arch-search {
  display: flex; align-items: center; gap: 8px;
  flex: 1; min-width: 240px;
  padding: 0 12px; height: 42px;
  background: var(--c-surface); border: 1px solid var(--c-border-strong);
  border-radius: 8px; color: var(--c-muted);
}
.arch-search:focus-within { border-color: var(--c-primary); }
.arch-search input {
  flex: 1; border: none; background: transparent; outline: none;
  font: inherit; font-size: .95rem; color: var(--c-text); height: 100%;
}
.arch-toolbar select { height: 42px; padding: 0 12px; border-radius: 8px; }

.arch-view { display: inline-flex; border: 1px solid var(--c-border-strong); border-radius: 8px; overflow: hidden; }
.arch-view-btn {
  display: grid; place-items: center; width: 40px; height: 42px;
  color: var(--c-muted); background: var(--c-surface);
}
.arch-view-btn + .arch-view-btn { border-left: 1px solid var(--c-border-strong); }
.arch-view-btn:hover { background: var(--c-surface-2); color: var(--c-text); text-decoration: none; }
.arch-view-btn.is-active { background: var(--c-primary); color: #fff; }
.arch-count { margin: 0 0 12px; font-size: .85rem; }

/* Project cards (grid view) */
.proj-grid { align-items: stretch; }
.proj-card {
  display: flex; flex-direction: column; gap: 8px;
  padding: 16px; height: 100%;
  border: 1px solid var(--c-border); border-top: 3px solid var(--c-primary);
  transition: box-shadow .15s, transform .15s;
}
.proj-card:hover { box-shadow: var(--shadow-md, 0 6px 20px rgba(0,0,0,.1)); transform: translateY(-2px); }
.proj-card-top { display: flex; align-items: center; justify-content: space-between; }
.proj-badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--c-primary); background: var(--c-primary-soft, rgba(23,60,52,.08));
  padding: 3px 8px; border-radius: 20px;
}
.proj-year { font-family: var(--font-mono, monospace); font-size: .72rem; color: var(--c-muted); }
.proj-title { margin: 2px 0 0; font-size: 1.02rem; font-weight: 700; line-height: 1.25; color: var(--c-text); }
.proj-abstract { margin: 0; font-size: .82rem; line-height: 1.5; color: var(--c-muted); }
.proj-meta { display: flex; flex-direction: column; gap: 4px; margin-top: auto; padding-top: 8px; }
.proj-meta span { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; color: var(--c-muted); }
.proj-area {
  align-self: flex-start; font-size: .68rem !important; font-weight: 600;
  color: var(--c-text) !important; background: var(--c-surface-2);
  padding: 2px 8px; border-radius: 12px;
}
.proj-card-foot { display: flex; align-items: center; gap: 6px; padding-top: 10px; border-top: 1px solid var(--c-border); }

/* Project list view */
.arch-list { padding: 0; }
.arch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 18px; border-bottom: 1px solid var(--c-border);
}
.arch-row:last-child { border-bottom: none; }
.arch-row-main h3 { font-size: .98rem; }
.arch-row-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* Class card with a settings gear overlay */
.class-card-wrap { position: relative; }
.class-gear {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  display: grid; place-items: center; width: 32px; height: 32px;
  border-radius: 8px; color: var(--c-muted);
  background: var(--c-surface); border: 1px solid var(--c-border-strong);
}
.class-gear:hover { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.class-card-wrap .class-card { height: 100%; }

/* Providers — delivery on/off switches + banner */
.delivery-banner {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 16px; padding: 12px 16px;
  background: #fdecea; color: #922b21; border: 1px solid #e6b0aa;
  border-left: 4px solid #c0392b; border-radius: 6px;
  font-weight: 600; font-size: .9rem;
}
.delivery-switches {
  margin: -4px 0 8px; padding: 14px 16px;
  background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: 8px;
}
.switch-row {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0; cursor: pointer;
}
.switch-row input[type="checkbox"] { width: 20px; height: 20px; flex-shrink: 0; accent-color: var(--c-primary); }
.switch-row span { display: flex; flex-direction: column; line-height: 1.3; }
.switch-row small { color: var(--c-muted); font-size: .8rem; }
.switch-row.is-off small { color: #c0392b; }
