:root {
  --g: #12613c;
  --g2: #167a45;
  --mint: #e8f4ed;
  --ink: #15221a;
  --muted: #647069;
  --line: #dce4df;
  --bg: #f3f6f4;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
button,
input,
select {
  font: inherit;
}
.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  color: var(--g2);
}
.brand-logo { width:58px; height:58px; object-fit:contain; border-radius:10px; background:white; padding:3px; }
.login-logo { width:150px; height:150px; margin-bottom:20px; }
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  background: #083122;
}
.login-brand {
  padding: 8vw;
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.login-brand h1 {
  font-size: 48px;
  max-width: 650px;
  margin: 30px 0 16px;
  letter-spacing: -0.04em;
}
.login-brand p {
  max-width: 620px;
  color: #c6ded2;
  line-height: 1.7;
}
.login-card {
  margin: auto;
  width: min(420px, 86%);
  background: white;
  border-radius: 18px;
  padding: 34px;
  display: grid;
  gap: 16px;
}
.login-card h2 {
  font-size: 28px;
  margin: 0 0 10px;
}
.login-card label,
.form label {
  display: grid;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}
.login-card input,
.form input,
.form select,
.filters select {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  background: white;
}
.searchable-select {
  position: relative;
  width: 100%;
  min-width: 0;
  color: var(--ink);
  font-weight: 400;
}
.searchable-select-input {
  width: 100%;
  min-width: 0;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 42px 10px 12px;
  background: white;
  color: var(--ink);
  font: inherit;
  cursor: text;
}
.searchable-select-input::placeholder { color: #7c8781; opacity: 1; }
.searchable-select-input:focus {
  border-color: var(--g2);
  outline: 3px solid rgba(22, 122, 69, 0.14);
}
.searchable-select-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  z-index: 2;
  width: 39px;
  height: 40px;
  border: 0;
  border-radius: 0 8px 8px 0;
  background: transparent;
  color: var(--g);
  cursor: pointer;
}
.searchable-select-toggle span {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translate(-2px, 2px);
  transition: transform .15s ease;
}
.searchable-select.open .searchable-select-toggle span { transform: rotate(225deg) translate(-2px, 2px); }
.searchable-select-menu {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 5px);
  left: 0;
  width: max(100%, 260px);
  max-width: min(540px, 92vw);
  border: 1px solid #b9c9c0;
  border-radius: 10px;
  background: white;
  box-shadow: 0 16px 38px rgba(9, 47, 33, 0.18);
  overflow: hidden;
}
.searchable-select-menu[hidden] { display: none; }
.searchable-select-options {
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
}
.searchable-select-options button {
  width: 100%;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  border-radius: 7px;
  padding: 10px 11px;
  background: white;
  color: var(--ink);
  text-align: left;
  line-height: 1.35;
  cursor: pointer;
}
.searchable-select-options button:hover,
.searchable-select-options button.active { background: var(--mint); color: var(--g); }
.searchable-select-options button[aria-selected="true"] { font-weight: 800; }
.searchable-select-options button:disabled { color: #9aa39e; cursor: not-allowed; }
.searchable-select-options button b { flex: 0 0 auto; color: var(--g2); }
.searchable-select-status {
  border-top: 1px solid var(--line);
  padding: 8px 11px;
  color: var(--muted);
  background: #f7faf8;
  font-size: 10px;
}
.searchable-native-select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
.home-student-search .searchable-select-input {
  border-color: #ffffff42;
  color: var(--ink);
}
.home-student-search .searchable-select-menu { min-width: 300px; }
.mapping-programme + .searchable-select,
td .searchable-select { min-width: 250px; }
.filters .searchable-select { min-width: 0; }
.data-search {
  width: 100%;
  margin: 18px 0 10px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  background: white;
}
.dashboard-search {
  width: 100%;
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 12px;
  background: white;
}
.academic-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
}
.academic-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  background: white;
  color: var(--g);
  border: 1px solid var(--line);
  border-radius: 14px;
  text-align: left;
  cursor: pointer;
}
.academic-tab b { font-size: 24px; }
.academic-tab span { font-weight: 800; }
.academic-tab.active { background: var(--g); color: white; border-color: var(--g); }
.academic-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 18px;
  margin-top: 22px;
}
.academic-card {
  min-height: 168px;
  display: grid;
  grid-template-columns: 58px 1fr auto;
  grid-template-rows: 1fr auto;
  align-items: center;
  gap: 12px 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  color: var(--g);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(9, 47, 33, 0.05);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.academic-card:hover,
.academic-card:focus-visible {
  transform: translateY(-2px);
  border-color: #86b39c;
  box-shadow: 0 12px 28px rgba(9, 47, 33, 0.10);
  outline: none;
}
.academic-card-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--mint);
  font-size: 18px;
  font-weight: 900;
}
.academic-card-copy { display: grid; gap: 7px; }
.academic-card-copy b { font-size: 20px; }
.academic-card-copy small { color: var(--muted); line-height: 1.45; }
.academic-card strong { font-size: 32px; }
.academic-card-arrow { grid-column: 2 / 4; color: var(--g2); font-size: 12px; font-weight: 900; }
.academic-workspace-heading {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 18px;
}
.academic-workspace-heading h2 { margin: 4px 0; font-size: 28px; }
.academic-workspace-heading p { margin: 0; color: var(--muted); }
.back-to-cards {
  border: 1px solid var(--line);
  background: white;
  color: var(--g);
  border-radius: 10px;
  padding: 11px 13px;
  font-weight: 800;
  cursor: pointer;
}
.academic-heading-actions { display: flex; gap: 8px; align-items: center; }
.field-note {
  align-self: stretch;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-radius: 9px;
  background: #eef7f2;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}
.mapping-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 18px 0;
  padding: 18px 22px;
  border: 1px solid #bdd8ca;
  border-radius: 14px;
  background: #f2faf5;
}
.mapping-summary div { display: flex; align-items: baseline; gap: 10px; color: var(--g); }
.mapping-summary b { font-size: 30px; }
.mapping-summary span { font-weight: 800; }
.mapping-summary p { margin: 0; max-width: 560px; color: var(--muted); }
.empty-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 54px 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: white;
  text-align: center;
}
.empty-state > span { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: var(--mint); color: var(--g); font-size: 26px; font-weight: 900; }
.empty-state h3, .empty-state p { margin: 0; }
.empty-state p { color: var(--muted); }
.panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; }
.panel-heading h3, .panel-heading p { margin: 0; }
.panel-heading p { color: var(--muted); margin-top: 4px; }
.record-editor { border: 1px solid var(--line); border-radius: 12px; background: #f7faf8; margin-bottom: 14px; }
.record-editor summary { cursor: pointer; padding: 14px 16px; font-weight: 800; color: var(--g); }
.record-editor[open] summary { border-bottom: 1px solid var(--line); }
.record-editor .form { padding: 16px; }
.remove-data {
  border: 1px solid #b44a3b;
  border-radius: 7px;
  padding: 7px 10px;
  color: #9a3327;
  background: #fff7f5;
  cursor: pointer;
}
.login-card button,
.primary {
  border: 0;
  border-radius: 9px;
  padding: 12px 16px;
  background: var(--g2);
  color: white;
  font-weight: 800;
  cursor: pointer;
}
.login-card small {
  color: var(--muted);
}
.public-timetable-link { display:block; border:1px solid #bdd8ca; border-radius:9px; padding:11px 13px; color:var(--g); background:#f2faf5; text-align:center; font-size:13px; font-weight:800; text-decoration:none; }
.error {
  padding: 10px;
  background: #fff0ec;
  color: #9a3327;
  border-radius: 8px;
}
.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px 1fr;
}
.app-shell aside {
  height: 100vh;
  position: sticky;
  top: 0;
  background: #092f21;
  color: white;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 7px 28px;
}
.brand b,
.brand span {
  display: block;
}
.brand b {
  letter-spacing: 0.18em;
}
.brand span {
  font-size: 11px;
  color: #b7d0c4;
  margin-top: 3px;
}
nav {
  display: grid;
  gap: 6px;
}
nav button {
  border: 0;
  border-radius: 9px;
  padding: 12px;
  text-align: left;
  color: #bdd1c7;
  background: transparent;
  cursor: pointer;
}
nav button.active,
nav button:hover {
  background: #15513a;
  color: white;
}
.side-note {
  margin-top: auto;
  padding: 15px;
  border: 1px solid #2c654d;
  border-radius: 12px;
  display: grid;
  gap: 6px;
}
.side-note span {
  font-size: 11px;
  color: #b7d0c4;
}
.workspace {
  min-width: 0;
}
.workspace header {
  height: 100px;
  background: white;
  border-bottom: 1px solid var(--line);
  padding: 22px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.workspace header h1 {
  font-size: 23px;
  margin: 6px 0 0;
}
.profile {
  text-align: right;
}
.profile b,
.profile span {
  display: block;
}
.profile span {
  font-size: 11px;
  color: var(--muted);
  text-transform: capitalize;
}
.profile a {
  font-size: 11px;
  color: var(--g);
  display: inline-block;
  margin-top: 5px;
}
.content {
  padding: 30px 32px 55px;
  display: grid;
  gap: 20px;
}
.loading,
.panel,
.metric,
.hero,
.table-wrap,
.upload {
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px;
}
.hero {
  background: linear-gradient(120deg, #0b4b32, #167a45);
  color: white;
  padding: 30px;
  display: flex;
  justify-content: space-between;
  align-items: end;
}
.hero h2 {
  font-size: 30px;
  max-width: 700px;
  margin: 10px 0;
}
.hero p {
  color: #d6e9df;
  max-width: 760px;
}
.hero .primary {
  background: #f2a51a;
  color: #183725;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 13px;
}
.metric span,
.metric b,
.metric small {
  display: block;
}
.metric span,
.metric small {
  color: var(--muted);
  font-size: 11px;
}
.metric b {
  font-size: 28px;
  margin: 9px 0 4px;
}
.cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.panel h2,
.panel h3 {
  margin-top: 0;
}
.rules {
  list-style: none;
  padding: 0;
}
.rules li {
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.rules li:before {
  content: "✓";
  margin-right: 9px;
  color: var(--g2);
  font-weight: 900;
}
.section-title h2 {
  font-size: 28px;
  margin: 5px 0;
}
.section-title p {
  color: var(--muted);
}
.form {
  display: grid;
  grid-template-columns: repeat(4, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.table-wrap {
  overflow: auto;
}
.academic-panel { padding:18px; }
.academic-panel .table-wrap { max-height:62vh; padding:0; border-radius:10px; }
.academic-panel .table-wrap thead th { position:sticky; top:0; z-index:2; background:#f5f8f6; }
.academic-panel td { padding-top:9px; padding-bottom:9px; }
.search-status { display:flex; align-items:center; justify-content:space-between; min-height:30px; margin:-7px 2px 8px; color:var(--muted); font-size:11px; }
.search-status button { border:0; background:transparent; color:var(--g); font-weight:800; cursor:pointer; }
.public-page { background:#eef4f0; }
.public-shell { width:min(1050px,calc(100% - 32px)); margin:36px auto; }
.public-header,.public-search,.lecturer-results article,.public-message { background:white; border:1px solid var(--line); border-radius:16px; }
.public-header { display:flex; align-items:center; gap:24px; padding:26px 30px; }
.public-header img { width:92px; height:92px; object-fit:contain; flex:0 0 auto; }
.public-header h1 { margin:6px 0; font-size:30px; }
.public-header p { margin:0; color:var(--muted); }
.public-search { margin-top:16px; padding:22px 26px; display:flex; align-items:end; justify-content:space-between; gap:20px; }
.public-search form { width:min(640px,100%); }
.public-search label { display:block; margin-bottom:7px; color:var(--muted); font-size:12px; font-weight:800; }
.public-search form>div { display:grid; grid-template-columns:1fr auto; gap:8px; }
.public-search input { min-width:0; border:1px solid var(--line); border-radius:9px; padding:12px 14px; }
.public-search>a { color:var(--g); font-size:12px; }
.public-message { margin-top:16px; padding:24px; color:var(--muted); }
.lecturer-results { display:grid; gap:12px; margin-top:16px; }
.lecturer-results article { display:grid; grid-template-columns:minmax(220px,.8fr) 1.4fr; gap:24px; padding:22px 26px; align-items:center; }
.lecturer-results h2 { margin:7px 0 4px; font-size:20px; }
.lecturer-results small { color:var(--muted); }
.surname-chip { color:var(--g); background:var(--mint); border-radius:99px; padding:5px 9px; font-size:10px; font-weight:800; text-transform:uppercase; }
.mode-downloads { display:grid; gap:8px; }
.mode-downloads section { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:9px 11px; background:#f6f9f7; border-radius:9px; }
.mode-downloads section>div { display:flex; gap:6px; }
.mode-downloads a { color:var(--g); background:white; border:1px solid var(--line); border-radius:7px; padding:7px 10px; font-size:11px; font-weight:800; text-decoration:none; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
th {
  text-align: left;
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
th,
td {
  padding: 11px;
  border-bottom: 1px solid #edf1ee;
}
.chip {
  display: inline-block;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--g);
  font-size: 10px;
  font-weight: 800;
}
.upload-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 13px;
}
.upload {
  border-style: dashed;
  text-align: center;
}
.upload input {
  width: 100%;
  margin: 15px 0;
}
.filters {
  display: grid;
  grid-template-columns: 1fr 2fr 2fr auto;
  gap: 10px;
  align-items: end;
}
.filters label {
  display: grid;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
}
.timetable {
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 14px;
}
.timetable-grid {
  display: grid;
  grid-template-columns: 90px repeat(6, minmax(135px, 1fr));
}
.timetable-grid.pt {
  grid-template-columns: 90px repeat(8, minmax(135px, 1fr));
}
.cell {
  min-height: 95px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 5px;
}
.cell.unavailable { background: #f3f5f4; }
.head {
  min-height: auto;
  background: #eef4f0;
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  padding: 9px;
}
.day {
  background: #f9fbfa;
  font-weight: 800;
  font-size: 11px;
  padding: 12px;
}
.class {
  background: var(--mint);
  border-left: 3px solid var(--g2);
  border-radius: 5px;
  padding: 7px;
  margin-bottom: 4px;
  font-size: 10px;
}
.class b,
.class span,
.class small {
  display: block;
}
.class span {
  margin: 3px 0;
}
.class small {
  color: #50645a;
}
.class .edit-class {
  width: 100%;
  margin-top: 6px;
  padding: 5px 7px;
  border: 1px solid #97bba7;
  border-radius: 6px;
  background: white;
  color: var(--g);
  font-size: 9px;
  font-weight: 800;
  cursor: pointer;
}
.timetable-editor { border: 2px solid #9bc5ac; background: #f5fbf7; }
.weekend-rule-tools { display:flex; align-items:center; justify-content:space-between; gap:22px; margin-bottom:14px; }
.weekend-rule-tools h3,.weekend-rule-tools p { margin:0; }
.weekend-rule-tools p { margin-top:5px; color:var(--muted); max-width:720px; line-height:1.45; }
.weekend-rule-tools .actions { flex-wrap:wrap; justify-content:flex-end; }
.home-public-card { width:min(820px,100%); padding:22px; border:1px solid #ffffff38; border-radius:16px; background:#ffffff10; }
.home-student-search { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; align-items:end; margin-top:12px; }
.home-student-search label { display:grid; gap:6px; color:#d9e9e0; font-size:11px; font-weight:800; }
.home-student-search select { min-width:0; border:1px solid #ffffff42; border-radius:9px; padding:11px; background:white; color:var(--ink); }
.student-search-status { grid-column:1 / 4; min-height:18px; color:#e4f1e9; font-size:11px; line-height:1.45; }
.lecturer-home-link { margin-top:12px; background:#fff; }
.wide-public-shell { width:min(1500px,calc(100% - 32px)); }
.public-view-nav { display:flex; gap:9px; margin:12px 0; }
.public-view-nav a { padding:9px 12px; border:1px solid var(--line); border-radius:8px; background:white; color:var(--g); text-decoration:none; font-weight:800; font-size:12px; }
.public-download-bar { display:flex; justify-content:space-between; align-items:center; gap:18px; margin:15px 0; padding:16px 20px; border:1px solid var(--line); border-radius:13px; background:white; }
.public-download-bar>div { display:flex; align-items:center; gap:10px; }
.public-download-bar span { color:var(--muted); font-size:12px; }
.public-download-bar a { padding:8px 12px; border:1px solid #aacbb8; border-radius:7px; color:var(--g); text-decoration:none; font-size:11px; font-weight:900; }
.public-grid-wrap { overflow:auto; border:1px solid var(--line); border-radius:14px; background:white; }
.public-grid { display:grid; grid-template-columns:90px repeat(var(--periods),minmax(150px,1fr)); min-width:1000px; }
.public-grid-cell { min-height:105px; padding:6px; border-right:1px solid var(--line); border-bottom:1px solid var(--line); }
.public-grid-head { min-height:auto; padding:10px; background:#eaf3ee; text-align:center; font-size:10px; font-weight:900; }
.public-grid-day { background:#f7faf8; font-size:11px; font-weight:900; padding:14px 10px; }
.public-grid-cell.unavailable { background:#f0f3f1; }
.public-class { padding:8px; border-left:3px solid var(--g2); border-radius:6px; background:var(--mint); font-size:10px; }
.public-class b,.public-class span,.public-class small { display:block; }
.public-class span { margin:4px 0; }
.public-class small { color:#50645a; margin-top:2px; }
.actions {
  display: flex;
  gap: 7px;
}
.secondary {
  border: 1px solid var(--line);
  background: white;
  color: var(--g);
  border-radius: 9px;
  padding: 10px 13px;
  font-weight: 800;
  cursor: pointer;
}
#notice:not(:empty) {
  margin: 15px 32px -10px;
  padding: 12px 15px;
  background: #fff7e6;
  border: 1px solid #ead4aa;
  border-radius: 9px;
  color: #76501d;
}
.publication-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-left: 5px solid var(--g);
}
.publication-notice h3 { margin: 0 0 6px; }
.publication-notice p { margin: 0; }
@media (max-width: 900px) {
  .academic-card-grid { grid-template-columns: 1fr; }
  .academic-workspace-heading { grid-template-columns: 1fr; align-items: start; }
  .academic-heading-actions { flex-wrap: wrap; }
  .mapping-summary { align-items: flex-start; flex-direction: column; }
  .academic-summary { grid-template-columns: repeat(2, 1fr); }
  .panel-heading { align-items: flex-start; flex-direction: column; }
  .weekend-rule-tools,.public-download-bar,.publication-notice { align-items:flex-start; flex-direction:column; }
  .home-student-search { grid-template-columns:1fr 1fr; }
  .student-search-status { grid-column:1 / -1; }
  .app-shell {
    grid-template-columns: 76px 1fr;
  }
  .app-shell aside {
    padding: 14px 8px;
  }
  .brand > div:last-child,
  .side-note {
    display: none;
  }
  nav button {
    font-size: 0;
    text-align: center;
  }
  nav button:before {
    content: "•";
    font-size: 20px;
  }
  .metrics,
  .upload-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cols,
  .form,
  .filters {
    grid-template-columns: 1fr;
  }
  .workspace header,
  .content {
    padding-left: 18px;
    padding-right: 18px;
  }
}
@media (max-width: 620px) {
  .login-shell {
    grid-template-columns: 1fr;
  }
  .login-brand {
    padding:28px 20px;
  }
  .login-brand h1 { font-size:34px; }
  .home-student-search { grid-template-columns:1fr; }
  .metrics,
  .upload-grid {
    grid-template-columns: 1fr;
  }
  .public-header { align-items:flex-start; padding:22px; }
  .public-header img { width:70px; height:70px; }
  .public-header h1 { font-size:23px; }
  .public-search,.lecturer-results article { display:grid; grid-template-columns:1fr; }
  .mode-downloads section { align-items:flex-start; flex-direction:column; }
}
