:root {
  --maroon: #8e2333;
  --maroon-dark: #5c1520;
  --ink-dark: #2a1115;
  --paper: #faf6f4;
  --line: #e5d8d6;
  --line-soft: #f0e6e4;
  --text: #221417;
  --muted: #77625f;
}

* { box-sizing: border-box; margin: 0; }
body { font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: var(--paper); color: var(--text); display: flex; min-height: 100vh; }

/* ---------------------------------------------------------------- sidebar -- */
aside { width: 210px; background: var(--ink-dark); color: #f3e6e4; padding: 20px 0; flex-shrink: 0;
        position: sticky; top: 0; align-self: flex-start; max-height: 100vh; overflow-y: auto; }
aside h1 { font-size: 18px; padding: 0 20px 16px; border-bottom: 1px solid #4a2027; }
aside a { display: block; color: #d9bec2; text-decoration: none; padding: 10px 20px; font-size: 14px;
          border-left: 3px solid transparent; }
aside a:hover { background: #3a181e; color: #fff; }
aside a.active { background: #4a2027; color: #fff; border-left-color: var(--maroon); font-weight: 600; }
aside .logout { margin-top: 24px; color: #a98289; }

main { flex: 1; padding: 28px; max-width: 1200px; min-width: 0; }
h2 { font-size: 20px; margin-bottom: 16px; color: var(--maroon-dark); }
h3 { font-size: 15px; margin: 20px 0 8px; }
.panel h3:first-child { margin-top: 0; }
a { color: var(--maroon); }

.msg { background: #dcefd8; border: 1px solid #9ac48f; padding: 8px 12px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.warn { background: #fdeaea; border-color: #e3a5a5; }

/* ------------------------------------------------------------------ cards -- */
.cards { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 14px 18px; min-width: 140px; }
.card .num { font-size: 26px; font-weight: 600; color: var(--maroon); }
.card .lbl { font-size: 12px; color: var(--muted); }
.card .sub { font-size: 11.5px; color: #a08a86; margin-top: 2px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 20px; margin-bottom: 20px; }
.attn { list-style: none; padding: 0; margin: 0; }
.attn li { padding: 9px 2px; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.attn li:last-child { border-bottom: 0; }
.attn-icon { display: inline-block; width: 26px; }

/* ------------------------------------------------------------------ tables -- */
table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
th { background: #f5e7ea; font-weight: 600; color: var(--maroon-dark); }
tr:last-child td { border-bottom: 0; }

/* ------------------------------------------------------------------- forms -- */
form.inline { display: inline; }
input, select, textarea { font: inherit; padding: 6px 8px; border: 1px solid #cfb9b6; border-radius: 6px; background: #fff; color: inherit; }
input:focus, select:focus, textarea:focus { outline: 2px solid #d9a3ac; outline-offset: 1px; border-color: var(--maroon); }
textarea { width: 100%; min-height: 90px; }
button { font: inherit; padding: 6px 12px; border: 0; border-radius: 6px; background: var(--maroon); color: #fff; cursor: pointer; }
button:hover { background: #6e1a28; }
button:focus-visible { outline: 2px solid var(--maroon-dark); outline-offset: 2px; }
button.small { padding: 3px 8px; font-size: 12px; }
button.danger { background: #a33; }
.formrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 8px 0; }
.formrow label { display: inline-flex; align-items: center; gap: 6px; }

/* A tick list that stays readable at any width — the services switchboard and the
   per-area login checklist are the same shape, so they get the same grid. */
.switches { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px 16px; margin: 10px 0; }
.switch { display: flex; align-items: center; gap: 7px; font-size: 13.5px; padding: 3px 0; }

.muted { color: var(--muted); font-size: 12.5px; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 12px; background: #f5e7ea; color: var(--maroon-dark); }
.pill.red { background: #f6d5d5; color: #7a1f1f; }
.pill.green { background: #d9edd3; color: #295c2a; }
.scroll { overflow-x: auto; }
.menucell { min-width: 130px; }
.menucell ul { padding-left: 16px; }
details summary { cursor: pointer; color: var(--maroon); font-size: 12px; }

/* -------------------------------------------------------------------- tabs -- */
/* One page doing seven jobs is a scroll; these split it without splitting the
   routes. No JS and every panel is simply visible — the old page, in order — so a
   browser that can't run the switcher loses nothing but the tabs. */
.tabbar { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line); margin-bottom: 18px; }
.tabbar a { text-decoration: none; color: var(--muted); font-size: 13.5px; font-weight: 500;
            padding: 9px 14px; border-radius: 8px 8px 0 0; border: 1px solid transparent; border-bottom: 0;
            margin-bottom: -2px; }
.tabbar a:hover { color: var(--maroon); background: #f5eceb; }
.tabbar a.active { background: #fff; color: var(--maroon-dark); font-weight: 650;
                   border-color: var(--line); box-shadow: 0 2px 0 0 #fff; }
.tabs.js .tabpanel { display: none; }
.tabs.js .tabpanel.active { display: block; animation: fade .18s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(3px); } to { opacity: 1; transform: none; } }

.login-wrap { margin: 12vh auto; max-width: 340px; background: #fff; padding: 28px; border-radius: 12px; border: 1px solid var(--line); }
.login-wrap input { width: 100%; margin-bottom: 12px; }
.login-wrap button { width: 100%; }

/* Tag editing is a twice-a-year job, so it hides until asked for. Three dropdowns
   under every student turned the table into a wall. */
.tagedit summary { cursor: pointer; list-style: none; }
.tagedit summary::-webkit-details-marker { display: none; }
.tagedit summary::after { content: " ✎"; color: #b39a97; font-size: 11px; }
.tagedit[open] summary::after { content: " ✕"; }
.tagedit form { margin-top: 8px; flex-wrap: wrap; gap: 5px; }
.tagedit select, .tagedit input { font-size: 12.5px; padding: 4px 6px; }

/* -------------------------------------------------------------- small screens -- */
/* Wardens and committee members open this on a phone, often on campus wifi. The
   sidebar becomes a scrolling strip rather than eating half the width. */
@media (max-width: 760px) {
  body { flex-direction: column; }
  aside { width: 100%; position: static; max-height: none; padding: 12px 0 0;
          display: flex; flex-wrap: nowrap; overflow-x: auto; gap: 2px;
          align-items: center; -webkit-overflow-scrolling: touch; }
  /* The strip is 375px wide; the wordmark was eating half of it. The crest keeps
     the brand, the nav gets the room. */
  aside h1 { font-size: 17px; padding: 0 10px 0 14px; border-bottom: 0; white-space: nowrap; }
  aside .brandword { display: none; }
  aside a { padding: 9px 13px; white-space: nowrap; border-left: 0; border-bottom: 3px solid transparent; }
  aside a.active { border-left: 0; border-bottom-color: var(--maroon); }
  aside .logout { margin-top: 0; }
  main { padding: 16px 14px 32px; }
  .formrow { gap: 6px; }
  .card { flex: 1 1 140px; }
}
