:root {
  --au-green: #174624;
  --au-green-dark: #0f2f1b;
  --au-green-soft: #dff3dd;
  --paper: #f6f5ef;
  --panel: #ffffff;
  --panel-muted: #ecece6;
  --ink: #111712;
  --muted: #5f665f;
  --line: #d8d9d2;
  --blue: #286f97;
  --blue-soft: #dceef5;
  --gold: #c98f18;
  --gold-soft: #faefd0;
  --rose: #bf405a;
  --rose-soft: #f8dce3;
  --shadow: 0 18px 38px rgba(20, 31, 24, 0.12);
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(23, 70, 36, 0.08), transparent 34%),
    var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-frame {
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px clamp(18px, 4vw, 44px);
  color: #fff;
  background: var(--au-green-dark);
  border-bottom: 4px solid #82d47d;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
}

.reference-thumb {
  width: 112px;
  height: 72px;
  object-fit: cover;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.12);
}

.eyebrow {
  margin: 0 0 6px;
  color: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  opacity: 0.72;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 4px;
  font-size: clamp(1.65rem, 2.4vw, 2.4rem);
  line-height: 1;
  letter-spacing: 0;
}

.intro-line {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-weight: 600;
}

.top-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.ghost-button,
.danger-button,
.primary-button,
.filter-button,
.icon-button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.ghost-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
  text-decoration: none;
}

.danger-button {
  background: rgba(191, 64, 90, 0.42);
}

.ghost-button:hover,
.danger-button:hover,
.primary-button:hover,
.filter-button:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 380px);
  gap: 20px;
  align-items: start;
  padding: 20px clamp(14px, 3vw, 34px) 34px;
}

.admin-shell {
  width: min(980px, calc(100% - 28px));
  margin: 20px auto 34px;
}

.admin-login-panel {
  padding: 18px;
}

.board-panel,
.library-panel {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.board-panel {
  overflow: hidden;
  border-radius: var(--radius);
}

.board-head,
.library-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

.board-head {
  padding: 18px 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.board-head h2,
.library-head h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.15;
}

.login-hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.summary-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 8px;
  min-width: min(100%, 240px);
}

.metric {
  padding: 9px 10px;
  background: var(--panel-muted);
  border: 1px solid transparent;
  border-radius: var(--radius);
}

.metric strong {
  display: block;
  font-size: 1rem;
  line-height: 1.1;
}

.metric span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 750;
  text-transform: uppercase;
}

.metric.is-good {
  background: var(--au-green-soft);
  border-color: rgba(23, 70, 36, 0.18);
}

.metric.is-warn {
  background: var(--gold-soft);
  border-color: rgba(201, 143, 24, 0.24);
}

.metric.is-alert {
  background: var(--rose-soft);
  border-color: rgba(191, 64, 90, 0.22);
}

.semester-board {
  background: #e6e6e0;
}

.semester-row {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 132px;
  border-top: 1px solid #f8f8f2;
}

.semester-row:first-child {
  border-top: 0;
}

.semester-label {
  position: relative;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 18px 16px 18px 32px;
  color: #fff;
  background: var(--au-green);
}

.semester-label::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 54px;
  width: 2px;
  content: "";
  background: rgba(255, 255, 255, 0.65);
}

.semester-row:first-child .semester-label::before {
  top: 28px;
}

.semester-row:last-child .semester-label::before {
  bottom: calc(100% - 42px);
}

.semester-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  color: #fff;
  font-weight: 850;
  background: var(--au-green);
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 999px;
}

.semester-label h3 {
  margin: 1px 0 3px;
  font-size: 1.02rem;
  line-height: 1.1;
}

.semester-label p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.82rem;
  font-weight: 700;
}

.semester-content {
  display: grid;
  grid-template-columns: repeat(6, minmax(96px, 1fr));
  gap: 10px;
  align-content: stretch;
  padding: 16px;
}

.course-card,
.slot-card,
.library-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  min-height: 112px;
  padding: 14px;
  background: var(--panel);
  border: 1px solid transparent;
  border-radius: 0;
}

.course-card {
  grid-column: span var(--span);
}

.course-card.is-fixed {
  box-shadow: inset 4px 0 0 rgba(23, 70, 36, 0.14);
}

.course-card.is-technical,
.library-card.is-technical {
  box-shadow: inset 4px 0 0 #77ca74;
}

.course-card.is-business,
.library-card.is-business {
  box-shadow: inset 4px 0 0 var(--blue);
}

.course-card.is-custom,
.library-card.is-custom {
  background: #fff8df;
  border-color: rgba(201, 143, 24, 0.42);
  box-shadow: inset 4px 0 0 var(--gold);
}

.course-card.has-internship {
  min-height: 112px;
  justify-content: flex-start;
}

.course-card.has-internship.is-internship-expanded {
  min-height: 300px;
}

.course-card.has-internship .course-title {
  margin-bottom: 6px;
}

.course-card.has-internship .course-meta {
  margin-top: 0;
}

.course-title {
  margin: 0 0 12px;
  font-size: clamp(0.88rem, 1.2vw, 1.04rem);
  font-weight: 750;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.course-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  color: var(--ink);
  background: var(--panel-muted);
  border-radius: 999px;
}

.pill.is-tech {
  background: var(--au-green-soft);
}

.pill.is-business {
  background: var(--blue-soft);
}

.pill.is-custom-pill {
  background: var(--gold-soft);
}

.pill.is-warning-pill {
  color: #8b1630;
  background: var(--rose-soft);
}

.course-card.has-season-warning {
  border-color: rgba(191, 64, 90, 0.5);
  box-shadow: inset 4px 0 0 var(--rose);
}

.remove-button,
.add-button,
.delete-custom-button {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.delete-custom-button {
  right: 46px;
  color: #7d3300;
  background: #fff2c3;
  border-color: rgba(201, 143, 24, 0.45);
}

.slot-card {
  grid-column: span var(--span);
  min-height: 136px;
  padding: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.62);
  border: 1px dashed rgba(23, 70, 36, 0.3);
}

.slot-card.is-active {
  border-color: var(--au-green);
  box-shadow: 0 0 0 3px rgba(120, 208, 118, 0.2);
}

.slot-card.is-full {
  border-style: solid;
}

.slot-card.is-over {
  background: #f3fbf0;
  border-color: #56bd63;
}

.slot-card.has-season-warning {
  border-style: solid;
  border-color: var(--rose);
}

.slot-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.72);
  border-bottom: 1px solid rgba(216, 217, 210, 0.8);
}

.slot-head strong {
  font-size: 0.95rem;
}

.slot-head span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.slot-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-height: 88px;
  padding: 10px;
}

.slot-body .course-card {
  grid-column: span 1;
  min-height: 92px;
  padding-right: 44px;
}

.slot-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 68px;
  color: rgba(95, 102, 95, 0.72);
  font-size: 0.9rem;
  font-weight: 750;
  border: 1px dashed rgba(95, 102, 95, 0.22);
}

.slot-warning-list {
  padding: 0 10px 10px;
}

.slot-warning {
  margin: 0 0 4px;
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.3;
}

.library-panel {
  position: sticky;
  top: 14px;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 28px);
  padding: 16px;
  border-radius: var(--radius);
  overflow: auto;
}

.library-head {
  align-items: center;
  margin-bottom: 14px;
}

.is-hidden {
  display: none !important;
}

.account-panel,
.admin-panel {
  margin-bottom: 14px;
  padding: 14px;
  background: #f7f8f3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-panel {
  background: #f8f8f4;
}

.auth-tabs {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  min-width: 128px;
  padding: 3px;
  background: var(--panel-muted);
  border-radius: var(--radius);
}

.auth-tab {
  min-height: 30px;
  padding: 0 8px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 6px;
  font-size: 0.78rem;
  font-weight: 850;
}

.auth-tab.is-active {
  color: #fff;
  background: var(--au-green);
}

.auth-form label {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
}

.auth-form label span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-form input {
  width: 100%;
  min-height: 40px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.terms-box {
  margin: 2px 0 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.terms-box summary {
  padding: 10px;
  color: var(--au-green-dark);
  cursor: pointer;
  font-size: 0.84rem;
  font-weight: 850;
}

.terms-copy {
  max-height: 220px;
  padding: 0 10px 10px;
  overflow: auto;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.terms-copy h4 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 0.92rem;
}

.terms-copy p {
  margin-bottom: 8px;
}

.auth-form .consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
}

.auth-form .consent-row input {
  flex: 0 0 auto;
  width: 18px;
  min-height: 18px;
  height: 18px;
  margin-top: 1px;
  padding: 0;
  accent-color: var(--au-green);
}

.auth-form .consent-row span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
  text-transform: none;
}

.admin-dashboard {
  display: grid;
  gap: 10px;
}

.admin-users {
  display: grid;
  gap: 10px;
}

.admin-user-card {
  padding: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-user-card h4 {
  margin: 0 0 4px;
  font-size: 0.95rem;
}

.admin-user-email,
.admin-user-meta {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.admin-password-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 8px;
  align-items: end;
}

.admin-password-form label {
  display: grid;
  gap: 5px;
}

.admin-password-form span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  text-transform: uppercase;
}

.admin-password-form input {
  width: 100%;
  min-height: 36px;
  padding: 8px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-empty {
  min-height: 54px;
}

.account-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.account-card h3 {
  margin: 0 0 2px;
  font-size: 1rem;
}

.account-card p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

.ghost-light-button {
  min-height: 36px;
  padding: 0 12px;
  color: var(--au-green-dark);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 850;
}

.switch-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
}

.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--au-green);
}

.search-field,
.custom-course > label {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.search-field span,
.custom-course > label span {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.search-field input,
.custom-course input,
.custom-course select {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.filter-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.filter-button {
  min-height: 38px;
  padding: 0 10px;
  color: var(--muted);
  background: #fff;
  border-color: var(--line);
  font-size: 0.82rem;
  font-weight: 850;
}

.filter-button.is-active {
  color: #fff;
  background: var(--au-green);
  border-color: var(--au-green);
}

.technical-row {
  margin: 0 0 12px;
}

.line-panel {
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #f8f8f4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.line-panel .eyebrow {
  margin-bottom: 10px;
  color: var(--muted);
}

.line-option {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--ink);
  font-weight: 700;
}

.line-option:last-child {
  margin-bottom: 0;
}

.line-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--au-green);
}

.course-library {
  display: grid;
  gap: 10px;
  padding-right: 4px;
  overflow: visible;
}

.library-card {
  min-height: 110px;
  padding-right: 52px;
  border-color: var(--line);
  box-shadow: none;
}

.library-card.is-custom {
  padding-right: 88px;
}

.library-card[draggable="true"] {
  cursor: grab;
}

.library-card.is-selected {
  opacity: 0.52;
}

.library-card:active {
  cursor: grabbing;
}

.custom-course {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.custom-course.is-locked {
  opacity: 0.72;
}

.custom-note {
  margin: -2px 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 700;
}

.custom-note.is-warning {
  color: var(--rose);
}

.custom-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.custom-title h3 {
  margin: 0;
  font-size: 1rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
}

.custom-switch {
  margin: 2px 0 12px;
}

.custom-technical-group {
  margin: 4px 0 12px;
  padding: 0;
  border: 0;
}

.custom-technical-group legend {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 850;
  text-transform: uppercase;
}

.custom-technical-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.custom-technical-option:last-child {
  margin-bottom: 0;
}

.custom-technical-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--au-green);
}

.primary-button {
  width: 100%;
  min-height: 44px;
  color: #fff;
  background: var(--au-green);
  border-color: var(--au-green);
  font-weight: 850;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 10;
  max-width: min(420px, calc(100vw - 40px));
  padding: 13px 15px;
  color: #fff;
  background: var(--au-green-dark);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
}

.drag-ghost {
  opacity: 0.42;
}

.internship-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.internship-form input {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.internship-add {
  min-height: 40px;
  grid-column: span 2;
}

.internship-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.internship-wish-card {
  position: relative;
  min-height: 122px;
  padding: 12px 44px 12px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: inset 4px 0 0 #2f8d5b;
}

.internship-inline {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid rgba(216, 217, 210, 0.85);
}

.internship-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.internship-title {
  margin-bottom: 0;
  color: var(--muted);
}

.internship-toggle-button {
  min-height: 30px;
  padding: 0 10px;
  color: var(--au-green);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

.internship-body {
  margin-top: 8px;
}

.internship-meta {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}

.internship-meta.is-warning {
  color: var(--rose);
}

.internship-link {
  display: block;
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 700;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.internship-link:hover {
  text-decoration: underline;
}

.internship-delete-button {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #7d3300;
  background: #fff2c3;
  border: 1px solid rgba(201, 143, 24, 0.45);
  border-radius: 999px;
}

.internship-empty {
  min-height: 62px;
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .library-panel {
    position: static;
    max-height: none;
  }

  .course-library {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: none;
  }
}

@media (max-width: 780px) {
  .topbar,
  .board-head,
  .library-head {
    flex-direction: column;
    align-items: stretch;
  }

  .top-actions {
    justify-content: stretch;
  }

  .top-actions > button {
    flex: 1;
    justify-content: center;
  }

  .reference-thumb {
    width: 88px;
    height: 60px;
  }

  .summary-strip {
    grid-template-columns: 1fr;
  }

  .semester-row {
    grid-template-columns: 1fr;
  }

  .semester-label {
    min-height: 94px;
  }

  .semester-content {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .course-card,
  .slot-card {
    grid-column: span 2;
  }

  .slot-body {
    grid-template-columns: 1fr;
  }

  .internship-form {
    grid-template-columns: 1fr;
  }

  .internship-add {
    grid-column: span 1;
  }

  .internship-list {
    grid-template-columns: 1fr;
  }

  .course-library,
  .filter-grid {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  .top-actions,
  .library-panel,
  .toast {
    display: none;
  }

  .workspace {
    display: block;
    padding: 0;
  }

  .board-panel {
    box-shadow: none;
    border: 0;
  }
}
