/* Helicopters Canada Flight Training Unit - FlightForms warm theme (v1.3) */
:root {
  --navy: #2a1f0e;        /* dark espresso - topbar, headings (FlightForms) */
  --navy-2: #4a3a20;
  --blue: #c8860a;        /* amber accent (FlightForms) */
  --blue-dark: #a06a08;   /* amber for text on light backgrounds */
  --blue-soft: #e3bd6b;
  --sky: #eae6de;         /* warm parchment body */
  --paper: #ffffff;
  --ink: #2b2416;
  --line: #d8d2c6;
  --ok: #2e7d43;
  --warn: #c07a1c;
  --bad: #a02c2c;
  --radius: 6px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--sky);
  color: var(--ink);
  font: 15px/1.45 "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ---------- Topbar ---------- */
.topbar {
  background: var(--navy); color: #f3ead9;
  display: flex; align-items: center; gap: 18px;
  padding: 0 16px; height: 54px; flex-wrap: wrap;
  border-bottom: 3px solid var(--blue);
}
.brand { font-weight: 700; letter-spacing: .3px; white-space: nowrap; display: flex; align-items: center; gap: 9px; }
.brand img.logo { height: 34px; filter: brightness(0) invert(1); }
.brand-mark {
  display: inline-block; background: var(--blue); color: #fff;
  font-weight: 800; border-radius: 5px; padding: 2px 7px;
}
.topbar nav { display: flex; gap: 2px; flex: 1; }
.topbar nav a {
  color: #cdbb9b; text-decoration: none; padding: 16px 13px; font-size: 14px;
  border-bottom: 3px solid transparent; margin-bottom: -3px;
}
.topbar nav a:hover { color: #fff; }
.topbar nav a.on { color: #fff; border-bottom-color: var(--blue); font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.logout { color: #cdbb9b; font-size: 13px; text-decoration: none; }
.pill { border-radius: 999px; padding: 2px 10px; font-size: 12px; font-weight: 600; }
.pill-amber { background: var(--blue); color: #fff; }
.pill-ok { background: var(--ok); color: #fff; }
.pill-warn { background: var(--warn); color: #fff; }
.pill-bad { background: var(--bad); color: #fff; }
.pill-grey { background: #9a8f7c; color: #fff; }

.wrap { max-width: 1500px; margin: 0 auto; padding: 22px 18px 44px; width: 100%; flex: 1; }
.wrap.narrow { max-width: 980px; }
h1 { font-size: 22px; margin: 6px 0 14px; color: var(--navy); }
h2 { font-size: 17px; margin: 22px 0 8px; color: var(--navy); }
.muted { color: #7a6f5c; }
.foot { text-align: center; color: #9a8f7c; font-size: 12px; padding: 14px; }

/* ---------- Aircraft tiles (dashboard) ---------- */
.tile-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(235px, 1fr)); gap: 14px; }
.ac-tile {
  background: var(--paper); border: 4px solid #b8b8b8; border-radius: 14px;
  padding: 18px 16px; color: var(--ink); text-decoration: none;
  display: flex; flex-direction: column; gap: 4px; min-height: 122px;
  position: relative; overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,.18), inset 0 0 0 1px #ececec;
  transition: box-shadow .15s, transform .05s;
}
.ac-tile:hover { box-shadow: 0 4px 14px rgba(42,31,14,.22); }
.ac-tile:active { transform: scale(.985); }
.ac-tile .ident { font-size: 30px; font-weight: 800; letter-spacing: 1px; color: var(--navy); }
.ac-tile .type { color: #7a6f5c; font-size: 14px; }
.ac-tile .today {
  margin-top: auto; font-size: 13px; background: var(--sky);
  border: 1px solid var(--line); border-radius: 5px; padding: 3px 9px; align-self: flex-start;
}
.card {
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(42,31,14,.12);
}

/* ---------- Buttons / forms ---------- */
.btn {
  display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--ink);
  border-radius: 7px; padding: 8px 16px; font-size: 14px; cursor: pointer; text-decoration: none;
  font-family: inherit;
}
.btn:hover { border-color: var(--blue); color: var(--blue-dark); }
.btn-amber { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.btn-amber:hover { background: var(--blue-dark); color: #fff; }
.btn-dark { background: var(--navy); border-color: var(--navy); color: #f3ead9; }
.btn-dark:hover { color: #fff; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { color: #fff; }
.btn-sm { padding: 4px 10px; font-size: 13px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
input[type=text], input[type=password], input[type=date], input[type=time], input[type=number], input[type=email], select, textarea {
  border: 1px solid var(--line); border-radius: 7px; padding: 8px 10px; font: inherit;
  background: #fff; color: var(--ink); max-width: 100%;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--blue-soft); border-color: var(--blue); }
label { font-size: 13px; color: #6d6250; display: block; margin-bottom: 3px; }
.frow { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 10px; }
.alert { background: #f9e2e2; border: 1px solid var(--bad); color: var(--bad); padding: 8px 12px; border-radius: 7px; margin-bottom: 12px; }
.notice { background: #e4f0e6; border: 1px solid var(--ok); color: #23582f; padding: 8px 12px; border-radius: 7px; margin-bottom: 12px; }

/* ---------- Login ---------- */
.login-wrap { flex: 1; display: flex; align-items: center; justify-content: center; padding: 30px 14px; }
.login-card {
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  padding: 36px 32px; width: 380px; text-align: center; box-shadow: 0 8px 28px rgba(42,31,14,.22);
}
.login-card img.logo { height: 96px; }
.login-card h1 { margin: 14px 0 2px; }
.login-card form { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }

/* ---------- Generic tables ---------- */
table.data { border-collapse: collapse; width: 100%; background: #fff; font-size: 14px; }
table.data th, table.data td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }
table.data th { background: var(--navy); color: #f3ead9; font-weight: 600; white-space: nowrap; }
table.data tr:nth-child(even) td { background: #f7f4ee; }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
.scroll-x { overflow-x: auto; }

/* ---------- Flight sheet (tablet) ---------- */
.kiosk .topbar { display: none; }

/* ---------- Tablet mode: strip chrome, keep just the flight sheet (v1.4.1) ---------- */
/* Driven by ?tablet=1 so it survives reloads and aircraft switches. Pairs with a
   browser kiosk (stripped browser UI) on the tablet itself. */
body.tablet-body .topbar,
body.tablet-body .foot { display: none; }
.tablet-mode .legal,
.tablet-mode .ac-tabs-lbl { display: none; }
body.tablet-body { padding-top: 6px; }
.tablet-mode .sheet-pdfhead { margin-bottom: 8px; }
.tablet-mode .sheet-pdfhead .sheet-logo { height: 48px; }
.tablet-mode .sheet-titleblock .t1 { font-size: 17px; }
.tablet-mode .sheet-boxes { margin-bottom: 10px; }
/* switcher stays (needed to change aircraft) but sits compact at the bottom */
.tablet-mode .ac-tabs { margin-top: 10px; }
/* ---------- sheet page header: mirrors the exported PDF ---------- */
.sheet-pdfhead { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; }
.sheet-pdfhead .sheet-logo { height: 66px; width: auto; }
.sheet-titleblock { flex: 1; text-align: center; }
.sheet-titleblock .t1 { font-size: 20px; font-weight: 700; color: #1a1a1a; }
.sheet-titleblock .t2 { font-size: 15px; color: #444; margin-top: 2px; }
.sheet-closed { align-self: flex-start; }
.sheet-boxes { display: flex; gap: 14px; margin-bottom: 14px; }
.sheet-boxes .sbox {
  flex: 1; border: 1.2px solid #000; border-radius: 8px; background: #f5f5f5;
  padding: 10px 16px; font-size: 15px; line-height: 1.55;
}
.sheet-boxes .sbox .sbl { color: #555; font-size: 13px; }
.sheet-boxes .sbox b { color: #1a1a1a; }
.sheet-boxes .sbox b.big { font-size: 18px; }

.sheet-table-wrap {
  overflow-x: auto; background: #fff; border: 1px solid #999; border-radius: var(--radius);
  box-shadow: 0 1px 3px rgba(0,0,0,.12);
}
table.sheet { border-collapse: collapse; width: 100%; min-width: 1180px; font-size: 14px; }
table.sheet th {
  background: #ececec; color: #1a1a1a; font-weight: 700; font-size: 12px;
  padding: 9px 6px; border: 1px solid #000; border-top: none; text-align: center;
}
table.sheet thead tr { border-bottom: 1.5px solid #000; }
table.sheet td { border: 1px solid #000; padding: 4px; text-align: center; vertical-align: middle; }
table.sheet td input, table.sheet td select {
  border: none; background: transparent; width: 100%; text-align: center; padding: 10px 4px; font-size: 15px;
}
table.sheet td input:focus, table.sheet td select:focus { outline: 2px solid #bbb; background: #f4f4f4; }
table.sheet td input[readonly] { color: #666; }
table.sheet tr.locked td { background: #f2f2f2; color: #666; }
table.sheet td.rownum { background: #ececec; color: #1a1a1a; font-weight: 800; width: 34px; }
table.sheet tfoot td { background: #e2e2e2; font-weight: 700; border-top: 1.5px solid #000; }
.sig-cell { min-width: 110px; cursor: pointer; }
.sig-cell img { max-height: 34px; max-width: 130px; display: block; margin: 0 auto; }
.sig-cell .sig-empty { color: #333; font-size: 12px; padding: 8px 0; }
.sig-cell.done .sig-empty { display: none; }
.ex-cell { cursor: pointer; min-width: 130px; }
.ex-chip {
  display: inline-block; background: #2b2b2b; color: #fff; border-radius: 4px;
  padding: 2px 8px; margin: 2px; font-size: 13px; font-weight: 700;
}
.ex-chip .m { font-size: 10px; opacity: .85; margin-left: 3px; }
.ex-add { color: #888; font-size: 12px; padding: 8px 0; }
.ds-btn {
  width: 44px; height: 38px; font-size: 16px; font-weight: 700; border-radius: 7px;
  border: 1px solid #999; background: #fff; cursor: pointer; color: #888;
}
.ds-btn.d { background: #2b2b2b; color: #fff; border-color: #2b2b2b; }
.ds-btn.s { background: #777; color: #fff; border-color: #777; }
.sheet-actions { display: flex; gap: 10px; margin: 14px 0; flex-wrap: wrap; }
.save-state { font-size: 13px; color: #7a6f5c; align-self: center; }
.save-state.saving { color: var(--warn); }
.save-state.saved { color: var(--ok); }
.legal { font-size: 11.5px; color: #6d6250; line-height: 1.5; margin-top: 14px; }
.legal b { color: var(--ink); }

/* ---------- sheet page: full width + aircraft switcher tabs (v1.3.3) ---------- */
.wrap.full { max-width: none; padding: 16px 14px 36px; }

/* column sizing (v1.4.0): keep C of G + Time columns readable, narrow the name columns */
table.sheet th.col-name { width: 128px; }
table.sheet th.col-cofg { width: 84px; }
table.sheet th.col-time { width: 76px; }
table.sheet th.col-gw   { width: 76px; }
table.sheet td.sel { width: 128px; min-width: 128px; }
table.sheet td.sel select {
  width: 100%; text-align: left; padding: 9px 6px;
  font-size: 13px; line-height: 1.2; height: auto;
  text-overflow: ellipsis; overflow: hidden;
}
/* let the C of G / time inputs use their full cell */
table.sheet td input[data-f="cofg"],
table.sheet td input[data-f="time_up"],
table.sheet td input[data-f="time_down"],
table.sheet td input[data-f="gross_weight"] { min-width: 60px; }
.ac-tabs {
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 16px;
  border-top: 1px solid var(--line); padding-top: 10px;
}
.ac-tabs-lbl { font-size: 12px; color: #7a6f5c; margin-right: 4px; }
.ac-tab {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 14px; font-size: 13px; font-weight: 600; color: var(--ink); text-decoration: none;
}
.ac-tab:hover { border-color: var(--blue); color: var(--blue-dark); }
.ac-tab.on { background: var(--navy); border-color: var(--navy); color: #f3ead9; }
.ac-tab .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }

/* ---------- Modal ---------- */
.modal-bg {
  position: fixed; inset: 0; background: rgba(12,29,46,.55); display: none;
  align-items: center; justify-content: center; z-index: 50; padding: 12px;
}
.modal-bg.show { display: flex; }
.modal {
  background: var(--paper); border-radius: 12px; padding: 18px; max-width: 640px; width: 100%;
  max-height: 92vh; overflow: auto; box-shadow: 0 10px 40px rgba(0,0,0,.35);
}
.modal h3 { margin: 0 0 10px; color: var(--navy); }
.modal .m-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 14px; }
canvas.sigpad { background: #fff; border: 1px dashed var(--blue); border-radius: 7px; width: 100%; height: 180px; touch-action: none; }
.ex-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.ex-pick button {
  border: 1px solid var(--line); background: #fff; border-radius: 7px; padding: 10px 8px;
  cursor: pointer; font-size: 13px; text-align: left; width: calc(50% - 4px); color: var(--ink);
}
.ex-pick button .code { font-weight: 800; margin-right: 6px; color: var(--navy); }
.ex-pick button.sel-d { background: var(--blue); color: #fff; border-color: var(--blue); }
.ex-pick button.sel-d .code { color: #d8ecff; }
.ex-pick .hint { width: 100%; font-size: 12px; color: #7a6f5c; }

/* ---------- Close-out ---------- */
.co-sheet { margin-bottom: 18px; }
.co-sheet h2 { display: flex; gap: 10px; align-items: center; margin-top: 0; }
ul.problems { margin: 6px 0; padding-left: 20px; color: var(--bad); font-size: 14px; }
ul.problems li { margin: 2px 0; }

/* ---------- Log ---------- */
.bar { display: inline-block; height: 12px; background: var(--blue-soft); border-radius: 2px; vertical-align: middle; }
a.pdf-link { color: var(--blue-dark); font-weight: 600; text-decoration: none; }
a.pdf-link:hover { text-decoration: underline; }

/* ---------- PTR icon button (student overview) ---------- */
a.ptr-btn {
  position: relative; display: inline-block; line-height: 0; border-radius: 5px;
  box-shadow: 0 2px 4px rgba(42,31,14,.3); transition: transform .08s, box-shadow .12s;
}
a.ptr-btn img { width: 62px; height: auto; border-radius: 5px; display: block; }
a.ptr-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 9px rgba(42,31,14,.4); }
a.ptr-btn:active { transform: translateY(1px); box-shadow: 0 1px 3px rgba(42,31,14,.35); }
a.ptr-btn .ptr-btn-tip {
  position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%);
  margin-bottom: 6px; background: var(--navy); color: #f3ead9; font-size: 11px; font-weight: 600;
  line-height: 1.3; white-space: nowrap; padding: 3px 8px; border-radius: 5px;
  opacity: 0; pointer-events: none; transition: opacity .12s; z-index: 5;
}
a.ptr-btn:hover .ptr-btn-tip { opacity: 1; }

/* ---------- PTR section badge (ptr.php header) ---------- */
img.ptr-badge {
  height: 46px; width: auto; border-radius: 5px; margin-left: 6px;
  box-shadow: 0 2px 5px rgba(42,31,14,.28);
}

/* ---------- Students overview ---------- */
.prog { background: #e0d9cb; border-radius: 4px; height: 14px; position: relative; min-width: 90px; }
.prog > span { position: absolute; inset: 0 auto 0 0; background: var(--ok); border-radius: 4px; }
.prog.warn > span { background: var(--blue); }
.prog b { position: relative; z-index: 1; font-size: 11px; padding-left: 5px; color: #fff; text-shadow: 0 0 3px rgba(0,0,0,.5); line-height: 14px; display: block; }
table.ovw td { white-space: nowrap; }
.exgrid th { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 11px; padding: 6px 3px; max-height: 170px; }
.exgrid td { text-align: center; font-size: 13px; }
.exgrid td.hit { background: #efe6cf !important; font-weight: 700; }

/* ---------- PTR ---------- */
.ptr-head { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.ptr-head h1 { margin: 0; }
.tot-strip { display: flex; gap: 8px; flex-wrap: wrap; margin: 12px 0; }
.tot-box { background: var(--paper); border: 1px solid var(--line); border-radius: 7px; padding: 6px 12px; text-align: center; }
.tot-box b { display: block; font-size: 18px; color: var(--navy); }
.tot-box span { font-size: 11px; color: #7a6f5c; }
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--navy); margin: 14px 0 0; flex-wrap: wrap; }
.tabs a {
  padding: 9px 16px; text-decoration: none; color: var(--ink); background: #e0d9cb;
  border-radius: 8px 8px 0 0; font-size: 14px; font-weight: 600;
}
.tabs a.on { background: var(--navy); color: #fff; }
.tabpanel { background: var(--paper); border: 1px solid var(--line); border-top: none; padding: 14px; border-radius: 0 0 9px 9px; }

/* ---------- PTR detailed matrix (light paper look, v1.3.2) ---------- */
table.ptrx2 { border-collapse: collapse; background: #fff; font-size: 12.5px; }
table.ptrx2 th, table.ptrx2 td { border: 1px solid #857a63; padding: 4px 6px; }
table.ptrx2 th { background: #f1ece0; color: var(--ink); font-weight: 700; text-align: center; font-size: 12px; white-space: nowrap; }
table.ptrx2 td.num { text-align: right; font-variant-numeric: tabular-nums; }
table.ptrx2 td.c { text-align: center; }
table.ptrx2 td.nw { white-space: nowrap; }
table.ptrx2 tbody tr:nth-child(even) td { background: #f5f2ea; }
/* grand total strip */
table.ptrx2 tr.gtline td.pad, table.ptrx2 tr.ttline td.pad { border: none; background: none; }
table.ptrx2 tr.gtline td.gtlbl { border: none; background: none; text-align: right; font-weight: 700; padding-right: 10px; }
table.ptrx2 tr.gtline td.gtt { font-weight: 800; text-align: center; font-size: 14px; }
table.ptrx2 tr.gtline td.gtv { text-align: center; font-weight: 700; }
table.ptrx2 tr.ttline td.tt { border-top: none; text-align: center; font-size: 11px; padding: 1px; background: #fff; }
/* vertical exercise headers with code row beneath */
table.ptrx2 th.exv { padding: 4px 2px; vertical-align: bottom; min-width: 22px; max-width: 26px; background: #fff; }
table.ptrx2 th.exv .v {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: 10px; font-weight: 500; max-height: 170px; margin: 0 auto;
  overflow: hidden; white-space: nowrap;
}
table.ptrx2 th.code { background: #f1ece0; font-style: italic; font-size: 11px; padding: 2px; }
/* marks + focus + comments */
table.ptrx2 td.mk { padding: 3px 2px; font-size: 11px; font-weight: 700; }
table.ptrx2 td.mk.hit { background: #efe6cf !important; }
table.ptrx2 td.exf { font-size: 11.5px; white-space: nowrap; }
table.ptrx2 td.cmt { min-width: 340px; max-width: 480px; white-space: pre-wrap; cursor: pointer; font-size: 12px; text-align: left; }
table.ptrx2 td.cmt:hover { background: #fdf6e7 !important; }

/* ---------- PTR Front Matters (paper look) ---------- */
.fm { background: #fff; max-width: 1020px; border: 1px solid var(--line); padding: 22px 26px; box-shadow: 0 2px 10px rgba(42,31,14,.14); }
.fm .fm-title {
  background: #e7e0d0; border: 1px solid #6f6350; color: #000; font-weight: 700; font-size: 16px;
  text-align: center; padding: 7px; margin-bottom: 12px;
}
.fm .fm-band {
  background: #e7e0d0; border: 1px solid #6f6350; color: #000; font-weight: 700; font-size: 14px;
  text-align: center; padding: 5px; margin: 16px 0 0;
}
table.fm-det, table.fm-grid { width: 100%; border-collapse: collapse; background: #fff; }
table.fm-det td, table.fm-grid td, table.fm-grid th { border: 1px solid #857a63; padding: 5px 8px; font-size: 13.5px; }
table.fm-det td.lbl { background: #f1ece0; width: 13%; font-weight: 600; color: #222; }
table.fm-det td.val { width: 37%; }
table.fm-grid th { background: #f1ece0; font-weight: 700; text-align: center; font-size: 12.5px; }
.fm input.fmi {
  border: none; border-bottom: 1px dashed #c7bda6; border-radius: 0; padding: 3px 4px;
  font-size: 13.5px; background: transparent; width: auto; max-width: 100%;
}
.fm input.fmi:focus { outline: none; border-bottom: 1.5px solid var(--blue); background: #fdf6e7; }
.fm input.fmi[type=date] { width: 135px; }

/* ---------- Ground School tab (matches Front Matters) ---------- */
table.gs-new td, table.gs-list td, table.gs-list th, table.gs-new th { vertical-align: middle; }
table.gs-new input, table.gs-new select {
  width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 5px;
  padding: 7px 8px; font: inherit; background: #fff;
}
table.gs-new input:focus, table.gs-new select:focus { outline: none; border-color: var(--blue); background: #fdf6e7; }
table.gs-list tbody tr:nth-child(even) td { background: #faf8f3; }
table.gs-list tfoot td { background: #f1ece0; font-size: 13px; }
table.fm-grid td.c, table.fm-grid th.c { text-align: center; }
.fm-chk { display: inline-flex; align-items: center; gap: 4px; margin-right: 14px; font-size: 13px; }
.fm-chk.dim { color: #a89d89; }
.fm-sig {
  min-height: 40px; min-width: 130px; cursor: pointer; display: flex; align-items: center; justify-content: center;
  border-radius: 4px;
}
.fm-sig:hover { background: #fdf6e7; }
.fm-sig img { max-height: 36px; max-width: 160px; }
.fm-sig .hintt { color: var(--blue-dark); font-size: 11.5px; }
.fm-cols { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 0; }
.fm-col { flex: 1; min-width: 320px; }
.fm-note { font-size: 11px; color: #6d6250; margin: 4px 0 0; }
.fm-state {
  position: fixed; bottom: 22px; right: 26px; background: var(--ok); color: #fff; padding: 7px 16px;
  border-radius: 7px; font-size: 13px; opacity: 0; transition: opacity .25s; pointer-events: none;
}
.fm-state.show { opacity: 1; }

td.cmt { min-width: 260px; max-width: 420px; white-space: pre-wrap; cursor: pointer; font-size: 13px; }
td.cmt:hover { background: #fdf6e7 !important; }
td.cmt .add { color: #9a8f7c; font-style: italic; }
.req-row { display: flex; align-items: center; gap: 12px; margin: 8px 0; }
.req-row .lbl { width: 280px; font-size: 14px; }
.req-row .prog { flex: 1; height: 18px; }
.req-row .val { width: 110px; text-align: right; font-variant-numeric: tabular-nums; font-size: 14px; }

@media (max-width: 760px) {
  .topbar nav a { padding: 16px 8px; font-size: 13px; }
  .req-row .lbl { width: 150px; }
}
@media print {
  .topbar, .sheet-actions, .foot, .tabs { display: none; }
}

/* ---------- Settings layout (v1.3.1) ---------- */
.set-flex { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.set-nav { min-width: 148px; display: flex; flex-direction: column; gap: 5px; }
.set-nav .btn { text-align: left; padding: 6px 11px; font-size: 13px; }
.set-main { flex: 1; min-width: 320px; }
.set-flex.stacked { flex-direction: column; }
.set-flex.stacked .set-nav { flex-direction: row; flex-wrap: wrap; min-width: 0; width: 100%; }
.set-flex.stacked .set-main { width: 100%; min-width: 0; }

/* full-width autosave student table */
table.stuedit { table-layout: fixed; width: 100%; }
table.stuedit th:nth-child(1), table.stuedit th:nth-child(2) { width: 12%; }
table.stuedit th:nth-child(3) { width: 9%; }
table.stuedit th:nth-child(4) { width: 20%; }
table.stuedit th:nth-child(5) { width: 11%; }
table.stuedit th:nth-child(6) { width: 10%; }
table.stuedit th:nth-child(7) { width: 12%; }
table.stuedit td { padding: 3px 4px; }
table.stuedit input, table.stuedit select { width: 100%; box-sizing: border-box; padding: 7px 8px; }

/* ---------- compact exercise picker (v1.3.4) ---------- */
.modal.compact { max-width: 470px; }
.modal.compact .ex-pick {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 6px;
}
.modal.compact .ex-pick .hint { grid-column: 1 / -1; }
.modal.compact .ex-pick button {
  width: auto; padding: 9px 3px; text-align: center; border-radius: 6px; line-height: 1.15;
}
.modal.compact .ex-pick button .code { display: block; font-size: 15px; margin: 0; }
.modal.compact .ex-pick button .sub { display: block; font-size: 9px; color: #7a6f5c; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.modal.compact .ex-pick button.sel-d .sub { color: #f3e4c4; }

/* ---------- backdated sheet warning + brand link (v1.4.6) ---------- */
.date-warn {
  background: #fff3cd; border: 1.5px solid #d4a017; color: #6b5407;
  border-radius: 7px; padding: 10px 16px; font-size: 15px; margin-bottom: 12px;
}
.topbar a.brand { color: inherit; text-decoration: none; }
.topbar a.brand:hover { opacity: .85; }

.foot a { color: var(--blue-dark); text-decoration: none; }
.foot a:hover { text-decoration: underline; }

.sheet-link { color: #1a56c4; text-decoration: underline; font-weight: 600; }
.sheet-link:hover { color: #0d3a8f; }

/* ---------- workflow illustration (index) v1.4.9 ---------- */
.wf-wrap { position: relative; width: 65%; margin: 0 auto 18px; }
.wf-wrap svg { display: block; width: 100%; height: auto; border-radius: 10px; box-shadow: 0 2px 10px rgba(42,31,14,.18); }
.wf-hide {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(255,255,255,.88); border: 1px solid var(--line); border-radius: 6px;
  padding: 4px 10px; font-size: 12px; cursor: pointer; color: var(--ink);
}
.wf-hide:hover { background: #fff; border-color: var(--blue); color: var(--blue-dark); }
.wf-showline { text-align: center; font-size: 12.5px; }
.wf-showline a { color: var(--blue-dark); }
@media (max-width: 900px) { .wf-wrap { width: 100%; } }
