/*
 * The First Due Education look (design/FDE-Design-Spec.md, step 5).
 *
 * One stylesheet for every page of the product: the tokens, the typefaces,
 * the sidebar, and the handful of parts every screen is built from. The
 * platform's own pages and each module's pages load it; a page's own
 * stylesheet adds only what is that page's alone.
 *
 * The product is First Due Education everywhere: forest green and champagne
 * gold, Sora and DM Sans, the hexagonal shield. A program sets its name and
 * nothing else: no logo, no color.
 *
 * COLOR ROLES (strict; design spec section 1):
 *
 *   Primary action   .btn.gold           gold fill, green text. Publish, New class: one per page.
 *   Needs attention  .tag.attn, .attn    attention tint + ▲ + text. Awaiting confirmation, open seats,
 *                                        Check flags, waitlist-lacks-credential, paused.
 *   Label            .tag                neutral outline tag (green border). Course codes, EXAM,
 *                                        PARAMEDIC, CONFIRMED, FULL, requirements.
 *   Count badge      .fde-badge          gold pill, on the dark sidebar only.
 *   Destructive      .btn.danger, .red   red. A no-notice mark and a destructive confirmation, only.
 *
 * Gold is used for nothing else, and red for nothing else. Meaning never
 * rides on color alone: an attention tag always carries its words and the
 * ▲, which this file writes in front of it.
 *
 * The typefaces are served from this site (./fonts): a page makes no
 * request to anywhere else. Sora, DM Sans and DM Mono are each under the
 * SIL Open Font License 1.1 (each project's own license file is in ./fonts/, listed in ./fonts/README.txt).
 */

/* ---------- typefaces ---------- */
@font-face { font-family: "Sora"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("fonts/sora-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Sora"; font-style: normal; font-weight: 100 800; font-display: swap; src: url("fonts/sora-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 100 1000; font-display: swap; src: url("fonts/dm-sans-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Sans"; font-style: normal; font-weight: 100 1000; font-display: swap; src: url("fonts/dm-sans-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/dm-mono-400-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 400; font-display: swap; src: url("fonts/dm-mono-400-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/dm-mono-500-latin-ext.woff2") format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "DM Mono"; font-style: normal; font-weight: 500; font-display: swap; src: url("fonts/dm-mono-500-latin.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

/* ---------- tokens (design spec section 1) ---------- */
:root {
  --green: #0A3422;        /* deep: sidebar, headers, primary text accents, filled buttons */
  --green-mid: #1E4D33;    /* active nav background, links */
  --gold: #DEAF5C;         /* primary actions and sidebar count badges ONLY */
  --bg: #F6F4EF;
  --card: #FFFFFF;
  --ink: #1F1D1A;
  --muted: #4A524C;
  --line: #E4E1D9;
  --input: #C9CEC7;        /* input border */
  --attn-bg: #FBF3E1;      /* attention tint */
  --red: #A1241C;          /* destructive confirmations and no-notice marks ONLY */
  --on-green: #E8EEE9;     /* body text on the dark sidebar */
  --on-green-muted: #B9C4BC;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(10, 52, 34, .12), 0 6px 16px rgba(10, 52, 34, .06);
  --focus-ring: 0 0 0 3px rgba(222, 175, 92, .35); /* the soft gold glow of a focused field */
  --head: "Sora", "Segoe UI", system-ui, sans-serif;
  --sans: "DM Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
  --mono: "DM Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sidebar: 240px;
  --tap: 40px;             /* desktop controls; 44px on a phone, below */
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.fde { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--sans); }
.fde h1, .fde h2, .fde h3 { font-family: var(--head); font-weight: 700; color: var(--green); margin: 0; line-height: 1.25; }
.fde h1 { font-size: 26px; }
.fde h2 { font-size: 18px; }
.fde h3 { font-size: 16px; }
.fde a { color: var(--green-mid); }
.fde a:hover { color: var(--green); }
.fde p { margin: 0; }
.fde :focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.fde [hidden] { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); }
.small { font-size: 13px; }
/* Labels: 12px uppercase, 0.08em tracking, muted. */
.label, .fde label.label { display: block; font: 700 12px/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* A long name is cut short with an ellipsis. Nothing on a staff page scrolls sideways. */
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: var(--tap); padding: 0 16px; border: 1px solid var(--green); border-radius: 6px; background: #fff; color: var(--green); font: 500 15px/1.2 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn:hover { background: #F0F3EF; color: var(--green); }
/* A filled button: the action of a row or a dialog. Deep green. */
.btn.primary { border-color: var(--green); background: var(--green); color: #fff; font-weight: 700; }
.btn.primary:hover { background: var(--green-mid); color: #fff; }
/* The page's one primary action: gold fill, green text. */
.btn.gold { border-color: var(--gold); background: var(--gold); color: var(--green); font-weight: 700; padding: 0 18px; }
.btn.gold:hover { background: #D4A24A; color: var(--green); }
/* A destructive confirmation, and a no-notice mark. Nothing else is red. */
.btn.danger { border-color: var(--red); background: var(--red); color: #fff; font-weight: 700; }
.btn.danger:hover { background: #8A1E17; color: #fff; }
/* A small, quiet control beside a line: Move, Change. */
.btn.quiet { min-height: 32px; padding: 0 10px; border-color: var(--input); font-size: 13px; font-weight: 400; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 13px; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn.block { display: flex; width: 100%; }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--green-mid); text-decoration: underline; cursor: pointer; }
.linkbtn:hover { color: var(--green); }
.btnrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---------- tags ---------- */
/* Label: a neutral outline tag. */
.tag { display: inline-block; font: 400 11px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--green); color: var(--green); border-radius: 4px; padding: 2px 8px; white-space: nowrap; vertical-align: middle; background: transparent; }
/* Needs attention: the tint, the border, and the ▲ in front of the words. */
.tag.attn { background: var(--attn-bg); color: var(--ink); border-color: var(--gold); font-weight: 500; }
.tag.attn::before { content: "\25B2\00A0"; }
/* A label for something that is over: withdrawn, cancelled. Neutral, and quieter. */
.tag.off { border-color: var(--line); background: var(--line); color: var(--ink); }
.tag.wrap { white-space: normal; }
/* A block of text that needs attention: a notice on a day, a warning above a form. */
.attn:not(.tag) { background: var(--attn-bg); border-left: 3px solid var(--gold); border-radius: 4px; padding: 8px 12px; font-size: 14px; color: var(--ink); }
.attn.icon:not(.tag)::before { content: "\25B2\00A0"; }
.red { color: var(--red); }

/* ---------- cards, rules, fields ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.card.flush { padding: 8px 12px; }
.rule-gold { border-top: 2px solid var(--gold); padding-top: 12px; }
.rule { border-top: 1px solid var(--line); padding-top: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.fde input[type="text"], .fde input[type="email"], .fde input[type="password"], .fde input[type="search"], .fde input[type="date"], .fde input[type="number"], .fde input[type="time"], .fde input:not([type]), .fde select, .fde textarea {
  min-height: var(--tap); border: 1px solid var(--input); border-radius: 6px; padding: 0 12px; font: 15px/1.3 var(--sans); background: #fff; color: var(--ink); max-width: 100%;
}
.fde textarea { padding: 8px 12px; min-height: 96px; }
.fde input:focus, .fde select:focus, .fde textarea:focus { outline: none; border: 2px solid var(--green); box-shadow: var(--focus-ring); }
.fde input[type="checkbox"], .fde input[type="radio"] { accent-color: var(--green); width: 18px; height: 18px; margin: 0; flex: none; }
.msg { font-size: 14px; }
.msg:empty { display: none; }
.msg.error { color: var(--red); }
.msg.ok { color: var(--green); }

/* ---------- segmented toggle: Student Schedule · Evaluator Schedule, Week grid · Day cards ---------- */
.seg { display: inline-flex; border: 1px solid var(--input); border-radius: 6px; overflow: hidden; background: #fff; max-width: 100%; }
.seg button { height: 42px; padding: 0 18px; border: 0; font: 15px var(--sans); background: #fff; color: var(--green); cursor: pointer; white-space: nowrap; }
.seg.small button { height: var(--tap); padding: 0 14px; }
.seg button[aria-pressed="true"] { background: var(--green); color: #fff; font-weight: 700; }
/* Filter pills: Waiting on you · Approved · Denied. */
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pills button { min-height: 38px; padding: 0 14px; border: 1px solid var(--input); border-radius: 19px; background: #fff; color: var(--green); font: 14px var(--sans); cursor: pointer; }
.pills button[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }

/* ---------- the day number: a green hexagon with a gold numeral ---------- */
.hex { flex: none; width: 44px; height: 48px; background: var(--green); color: var(--gold); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); display: flex; align-items: center; justify-content: center; font: 500 18px var(--mono); }
.hex.small { width: 36px; height: 40px; font-size: 15px; }

/* ---------- tables ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 15px; }
.tbl th { text-align: left; font: 700 11px/1.4 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 12px; border-bottom: 2px solid var(--green); white-space: nowrap; }
.tbl td { padding: 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl .num { font-family: var(--mono); text-align: right; }
.tblwrap { overflow-x: auto; }

/* ---------- the shell: sidebar (program level) and the page beside it ---------- */
.fde-shell { display: flex; min-height: 100vh; align-items: stretch; }
.fde-side { flex: 0 0 var(--sidebar); width: var(--sidebar); background: var(--green); color: var(--on-green); padding: 24px 16px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.fde-side a { color: var(--on-green); }
.fde-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.fde-brand img { width: 44px; height: 48px; object-fit: contain; }
.fde-brand span { font: 700 15px/1.25 var(--head); color: #fff; }
.fde-program { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fde-program .name { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--on-green-muted); overflow-wrap: anywhere; }
.fde-program .module { font: 700 15px var(--head); color: #fff; }
.fde-modules { display: flex; flex-direction: column; gap: 4px; }
.fde-modules select { width: 100%; min-height: var(--tap); border: 1px solid var(--green-mid); border-radius: 6px; background: var(--green-mid); color: #fff; font: 14px var(--sans); padding: 0 10px; }
.fde-nav { display: flex; flex-direction: column; gap: 2px; }
.fde-nav a { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: var(--tap); padding: 0 12px; border-radius: 6px; text-decoration: none; color: var(--on-green); }
.fde-nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.fde-nav a[aria-current="page"] { background: var(--green-mid); color: #fff; font-weight: 700; box-shadow: inset 3px 0 0 var(--gold); }
/* The count badge: a gold pill. On the dark sidebar, and nowhere else. */
.fde-badge { font: 400 12px/1.5 var(--mono); background: var(--gold); color: var(--green); border-radius: 10px; padding: 1px 8px; }
.fde-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.fde-settings { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--green-mid); padding-top: 14px; }
.fde-settings .grouplabel { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--on-green-muted); padding: 0 12px 4px; }
.fde-user { display: flex; flex-direction: column; gap: 6px; border-top: 1px solid var(--green-mid); padding-top: 14px; min-width: 0; }
.fde-user .who { color: #fff; font-weight: 500; overflow-wrap: anywhere; }
.fde-user .row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
/* The level tag: a gold outline. */
.fde-level { font: 400 11px/1.5 var(--mono); letter-spacing: .06em; text-transform: uppercase; border: 1px solid var(--gold); color: var(--gold); border-radius: 4px; padding: 1px 6px; }
.fde-user a, .fde-user button.linkbtn { color: var(--on-green-muted); font-size: 13px; }
.fde-user button.linkbtn:hover { color: #fff; }
.fde-main { flex: 1 1 640px; min-width: 0; padding: 24px 32px 48px; display: flex; flex-direction: column; gap: 20px; }
.fde-pagehead { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
/* The green top bar of a phone, and of a page with no sidebar: the mark and a title. */
.fde-top { display: none; align-items: center; gap: 12px; background: var(--green); color: #fff; padding: 10px 16px; position: sticky; top: 0; z-index: 30; }
.fde-top img { width: 30px; height: 33px; object-fit: contain; flex: none; }
.fde-top .title { flex: 1 1 auto; min-width: 0; font: 700 16px/1.25 var(--head); color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fde-top .sub { display: block; font: 400 12px/1.3 var(--sans); color: var(--on-green-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fde-menu { flex: none; min-width: 44px; min-height: 44px; border: 1px solid var(--green-mid); border-radius: 6px; background: transparent; color: #fff; font: 500 14px var(--sans); padding: 0 12px; cursor: pointer; }
.fde-scrim { display: none; }
body.fde.plain .fde-top { display: flex; position: static; }

/* ---------- inside a class: the breadcrumb and the tabs ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.crumbs a { font-size: 14px; }
.crumbs .sep { color: #7C857E; }
.crumbs .here { font: 700 22px/1.25 var(--head); color: var(--green); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; border-bottom: 2px solid var(--line); }
.tabs a, .tabs button { min-height: 42px; display: inline-flex; align-items: center; gap: 6px; padding: 0 16px; text-decoration: none; font: 15px var(--sans); color: var(--muted); border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; background: none; cursor: pointer; white-space: nowrap; }
.tabs a:hover, .tabs button:hover { color: var(--green); }
/* The active tab: bold green with a 3px gold underline. */
.tabs [aria-selected="true"] { color: var(--green); font-weight: 700; border-bottom-color: var(--gold); }

/* ---------- a dialog ---------- */
.fde-dialog { border: 0; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; max-width: min(520px, calc(100vw - 32px)); color: var(--ink); }
.fde-dialog::backdrop { background: rgba(10, 52, 34, .45); }

/* ---------- phone rules (design spec section 5) ---------- */
@media (max-width: 860px) {
  :root { --tap: 44px; }
  .fde-shell { display: block; }
  .fde-top { display: flex; }
  /* The sidebar collapses to a menu button in the green top bar. Opened, it slides over the page. */
  .fde-side { position: fixed; top: 0; left: 0; bottom: 0; z-index: 50; width: min(84vw, 300px); height: auto; transform: translateX(-102%); transition: transform .18s ease; }
  body.fde.menu-open .fde-side { transform: none; }
  /* Sign out and Switch program, at the foot of the menu: a finger's height like everything else in it. */
  .fde-user .linkbtn, .fde-user a { display: inline-flex; align-items: center; min-height: 44px; }
  body.fde.menu-open .fde-scrim { display: block; position: fixed; inset: 0; z-index: 40; background: rgba(10, 52, 34, .45); }
  .fde-main { padding: 16px 16px 40px; gap: 16px; }
  /* Class tabs become one row that scrolls sideways within itself; the page does not. */
  .tabs { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tabs a, .tabs button { min-height: 44px; flex: none; }
  .crumbs .here { font-size: 18px; }
  .btn.quiet, .btn.small { min-height: 44px; }
  .seg button, .seg.small button { height: 44px; }
  .pills button { min-height: 44px; }
  .fde h1 { font-size: 22px; }
  .card { padding: 16px; }
  /* Nothing on a staff page scrolls sideways (this replaces the kit's rule, which let a long name push the page wide). */
  body.fde { overflow-x: hidden; }
}
@media print {
  .fde-side, .fde-top, .fde-scrim { display: none !important; }
  .fde-shell { display: block; }
  .fde-main { padding: 0; }
  body.fde { background: #fff; }
}
