:root {
  color-scheme: light;
  --navy: #182d54;
  --navy-dark: #101f3a;
  --ink: #152641;
  --muted: #506079;
  --accent: #233cb4;
  --silver: #dce3ed;
  --sky: #ecf2fd;
  --page: #f6f7fa;
  --white: #fff;
  --focus: #246ebd;
  --success: #1d5b41;
  --danger: #962e39;
  --shadow: 0 7px 25px #1927640b;
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; color: var(--ink); background: var(--page); }
a { color: var(--accent); text-underline-offset: .2em; }
img { display: block; max-width: 100%; }
h1, h2, h3, p { margin-block: 0; }
h1 { font-family: Georgia, serif; font-size: clamp(2.15rem, 5vw, 3.35rem); font-weight: 400; line-height: 1.05; letter-spacing: -.035em; }
h2 { font-size: 1.23rem; letter-spacing: -.025em; }
h3 { font-size: 1rem; }
p + p { margin-top: .75rem; }
hr { border: 0; border-top: 1px solid var(--silver); margin-block: 1.4rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.skip { position: absolute; inset: .5rem auto auto .5rem; transform: translateY(-250%); padding: .6rem 1rem; background: var(--white); z-index: 3; }
.skip:focus { transform: none; }
.admin-shell { display: grid; min-height: 100vh; grid-template-columns: 16.25rem minmax(0, 1fr); }
.sidebar { display: flex; flex-direction: column; padding: 1.4rem 1rem; background: var(--navy-dark); color: var(--white); }
.brand { display: flex; align-items: center; gap: .75rem; color: inherit; text-decoration: none; margin: .2rem .25rem 1.5rem; padding-bottom: 1.45rem; border-bottom: 1px solid #fff3; }
.brand img { width: 3rem; height: 3rem; object-fit: cover; border-radius: 50%; }
.brand strong { display: block; font: 1.2rem/1.05 Georgia, serif; }
.brand span span { display: block; margin-top: .3rem; color: #b7c8dc; font-size: .79rem; }
.sidebar nav { display: grid; gap: .22rem; }
.sidebar nav a, .sidebar footer a { display: block; color: #d7e3ef; text-decoration: none; border-radius: .35rem; padding: .67rem .8rem; }
.sidebar nav a:hover { color: var(--white); background: #ffffff17; }
.sidebar nav a[aria-current="page"] { color: var(--white); background: #2a408d; }
.sidebar nav a[aria-current="page"] { box-shadow: inset 3px 0 #86beff; }
.sidebar :focus-visible { outline-color: #a6d2ff; }
.sidebar footer { display: grid; gap: .35rem; margin-top: auto; padding-top: 2rem; }
.sidebar footer button { width: 100%; justify-content: flex-start; border-color: #476079; background: transparent; color: #e3edf8; }
.workspace { min-width: 0; }
.workspace-bar { min-height: 3.8rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .65rem clamp(1.05rem, 3.6vw, 3rem); background: var(--white); border-bottom: 1px solid var(--silver); color: var(--muted); font-size: .9rem; }
.workspace-bar a { font-weight: 650; color: var(--ink); overflow-wrap: anywhere; }
.workspace-header { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.45rem; }
.workspace-header p { color: var(--muted); margin-top: .55rem; }
.workspace-content { max-width: 94rem; margin-inline: auto; padding: clamp(1.2rem, 3.6vw, 3rem); }
.panel { background: var(--white); border: 1px solid var(--silver); border-radius: .75rem; padding: clamp(.95rem, 3vw, 1.45rem); box-shadow: var(--shadow); min-width: 0; }
.panel > :first-child + * { margin-top: .8rem; }
.panel + .panel { margin-top: 1rem; }
.section-stack { margin-top: 1rem; }
.columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-top: 1rem; }
.columns > .panel { margin: 0; }
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .8rem; }
.dashboard-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 1.5rem; border-radius: .75rem; padding: clamp(1.2rem, 3.5vw, 2rem); margin-bottom: 1rem; background: var(--navy); color: var(--white); }
.dashboard-tools > div:first-child { min-width: 0; }
.dashboard-tools h2 { font: 400 clamp(1.55rem, 3vw, 2.2rem)/1.125 Georgia, serif; }
.dashboard-tools p { margin-top: .4rem; color: #dbe5f9; overflow-wrap: anywhere; }
.dashboard-tools .button { min-height: 2.65rem; background: var(--white); border-color: var(--white); color: var(--navy-dark); }
.dashboard-tools .button.secondary { background: transparent; border-color: #a4b7df; color: var(--white); }
.dashboard-tools .button:focus-visible { outline-color: #bdd9ff; }
.publishing-layout { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .85fr); gap: 1rem; align-items: start; }
.publishing-layout > .panel { margin: 0; }
.notice-form { margin-block: .9rem .65rem; }
.notice-form button { justify-self: start; }
.notice-state { color: var(--muted); font-size: .91rem; }
.announcement summary > span:first-child { margin-inline: .35rem .7rem; overflow-wrap: anywhere; }
.announcement-meta { display: inline-flex; gap: .4rem; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: .82rem; }
.stat { min-width: 0; display: grid; grid-template-rows: auto 1fr; gap: .5rem; padding: 1rem 1.1rem; background: var(--white); border: 1px solid var(--silver); border-radius: .55rem; box-shadow: var(--shadow); color: var(--ink); text-decoration: none; }
.stat:hover { border-color: #91a5d7; background: #f9fbff; }
.stat:hover span { text-decoration: underline; }
.stat span { color: var(--muted); font-size: .875rem; font-weight: 650; }
.stat strong { align-self: end; font: 2.1rem/1 Georgia, serif; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .91rem; }
th, td { padding: .7rem .55rem; vertical-align: top; border-bottom: 1px solid var(--silver); }
th { color: var(--muted); font-size: .8rem; font-weight: 650; }
thead { background: #f7f9fb; }
tbody tr:last-child td { border-bottom: 0; }
td time, td small, td .pill { white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: .45rem; align-items: center; }
.actions form { margin: 0; }
.pill { display: inline-block; padding: .16rem .55rem; border-radius: 2rem; background: #eaf0f6; color: #344b63; font-size: .82rem; font-weight: 650; }
.pill[data-status="pending"] { background: #fff3d8; color: #734f00; }
.pill[data-status="draft"] { background: var(--sky); color: var(--accent); }
.pill[data-status="approved"], .pill[data-status="published"] { background: #e6f4eb; color: var(--success); }
.pill[data-status="declined"], .pill[data-status="cancelled"] { background: #fbecef; color: var(--danger); }
.empty, .muted, .field-hint { color: var(--muted); }
.field-hint { font-size: .86rem; font-weight: 400; }
.list { list-style: none; padding: 0; margin-bottom: 0; }
.list > li { padding: .66rem 0; border-bottom: 1px solid var(--silver); overflow-wrap: anywhere; }
.list > li:last-child { border-bottom: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.form-grid .wide, .form-grid .actions { grid-column: 1 / -1; }
.stack { display: grid; gap: .8rem; }
.field { display: grid; align-content: start; gap: .28rem; min-width: 0; font-size: .91rem; font-weight: 650; }
input, textarea, select, button { font: inherit; }
input:not([type="checkbox"]):not([type="hidden"]), textarea, select { display: block; width: 100%; min-width: 0; padding: .57rem .7rem; border: 1px solid #aebccd; border-radius: .32rem; background: var(--white); color: var(--ink); font-size: 1rem; font-weight: 400; }
input[type="file"] { overflow: hidden; }
textarea { min-height: 5.5rem; resize: vertical; }
.check { display: flex; gap: .5rem; align-items: baseline; font-size: .94rem; font-weight: 600; }
.check input { accent-color: var(--accent); }
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: .35rem; min-height: 2.45rem; padding: .45rem .72rem; color: var(--white); background: var(--accent); border: 1px solid var(--accent); border-radius: .36rem; cursor: pointer; font-size: .87rem; font-weight: 650; line-height: 1.25; text-decoration: none; }
button:hover, .button:hover { filter: brightness(.91); }
.button.secondary, button.secondary { background: var(--white); border-color: #aec0d2; color: var(--accent); }
button.danger { background: var(--white); border-color: #ddb8be; color: var(--danger); }
.alert { padding: .75rem .9rem; margin-bottom: 1rem; border: 1px solid #c1e0ce; background: #e9f5ee; border-radius: .4rem; color: var(--success); }
.alert.error { border-color: #e7bfc6; background: #fff1f4; color: var(--danger); }
.record { border: 1px solid var(--silver); border-radius: .45rem; margin-top: .7rem; background: var(--white); }
.record summary { padding: .65rem .8rem; cursor: pointer; font-weight: 650; }
.record[open] summary { border-bottom: 1px solid var(--silver); }
.record-body { padding: .8rem; }
.record-body > * + * { margin-top: .65rem; }
.thumb { width: 8rem; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .33rem; }
.long-copy { white-space: pre-wrap; overflow-wrap: anywhere; }
.auth { min-height: 100vh; min-height: 100svh; display: grid; grid-template-columns: minmax(18rem, .94fr) minmax(0, 1fr); background: var(--page); }
.auth-identity { display: flex; align-items: end; padding: clamp(1.25rem, 5vw, 4rem); background: linear-gradient(180deg,#10213b22 10%,#101f3af7 100%), url('/assets/course-recent-2.jpg') center 62% / cover, var(--navy-dark); color: var(--white); }
.auth-club { display: flex; align-items: center; gap: .9rem; }
.auth-identity img { width: clamp(3.2rem, 7vw, 6rem); height: auto; aspect-ratio: 1; object-fit: cover; border: 2px solid #ffffff70; border-radius: 50%; }
.auth-identity strong { display: block; font: 400 clamp(1.7rem, 4.65vw, 3.9rem)/1 Georgia, serif; letter-spacing: -.035em; }
.auth-identity span { display: block; margin-top: .5rem; color: #e0e9fa; }
.auth-main { display: grid; place-items: center; padding: clamp(1rem, 4.8vw, 4rem); min-width: 0; }
.auth-card { width: 100%; max-width: 31rem; padding: clamp(1.1rem, 4vw, 2.4rem); background: var(--white); border: 1px solid var(--silver); border-radius: .8rem; box-shadow: var(--shadow); }
.auth-card h1 { font-size: clamp(2rem, 3.5vw, 2.95rem); }
.auth-card > p:not(.alert) { margin-top: .7rem; color: var(--muted); }
.auth-card form { gap: .95rem; margin-block: 1.45rem 1.2rem; }
.auth-card input:not([type="hidden"]) { min-height: 2.85rem; }
.auth-card form button { min-height: 2.8rem; }
.auth-links { display: flex; flex-wrap: wrap; gap: .45rem 1rem; padding-top: .9rem; border-top: 1px solid var(--silver); font-size: .9rem; }
.calendar-head, .calendar { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-head span { padding: .18rem; color: var(--muted); text-align: center; font-size: .8rem; }
.calendar { border-left: 1px solid var(--silver); border-top: 1px solid var(--silver); }
.calendar-day { min-height: 4rem; min-width: 0; padding: .25rem .35rem; border-right: 1px solid var(--silver); border-bottom: 1px solid var(--silver); }
.calendar-day small { display: block; font-size: .72rem; overflow-wrap: anywhere; }
.calendar-day.blocked { background: #fff1f4; color: var(--danger); }
.calendar-tools { justify-content: space-between; margin-block: .65rem; }
.panel form + .table-wrap, .panel form + .empty, .panel form + .field-hint { margin-top: .8rem; }

@media (max-width: 850px) {
  .admin-shell { grid-template-columns: 12.5rem minmax(0, 1fr); }
  .columns, .publishing-layout { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .auth { grid-template-columns: minmax(12rem, .6fr) minmax(0, 1fr); }
}
@media (max-width: 620px) {
  .admin-shell, .auth { grid-template-columns: 1fr; }
  .sidebar { padding: .65rem .75rem; }
  .sidebar .brand { margin: .15rem 0 .45rem; padding-bottom: .6rem; }
  .sidebar .brand img { width: 2.2rem; height: 2.2rem; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: .12rem; }
  .sidebar nav a, .sidebar footer a { font-size: .88rem; padding: .45rem .55rem; }
  .sidebar footer { grid-template-columns: 1fr auto; padding-top: .35rem; }
  .sidebar footer button { min-height: 2rem; }
  .workspace-bar { min-height: 2.85rem; }
  .workspace-header { align-items: start; flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .auth { min-height: 0; }
  .auth-identity { min-height: 9rem; padding: 1rem; background-position: center, center 62%; }
  .auth-identity strong { font-size: 1.7rem; }
  .auth-identity span { margin-top: .3rem; font-size: .92rem; }
  .calendar-day { padding: .13rem .2rem; min-height: 3rem; }
}
