:root {
  --bg-warm: #f8eeee;
  --bg-mist: #edf2fb;
  --bg-cool: #7dbcf2;
  --text: #171b3c;
  --muted: #6f7894;
  --primary: #45a7f5;
  --primary-strong: #2f8ee8;
  --danger: #f4778d;
  --blue: #bfe0ff;
  --orange: #ffd39a;
  --green: #c6f1d3;
  --purple: #dfd0ff;
  --yellow: #fff0a8;
  --pink: #ffd0dc;
  --line: rgba(31, 42, 84, .10);
  --shadow: 0 24px 70px rgba(83, 105, 150, .18), 0 8px 22px rgba(83, 105, 150, .10);
  --shadow-soft: 0 12px 30px rgba(83, 105, 150, .10);
  --radius-xl: 28px;
  --schedule-header-height: 70px;
  --slot-height: 44px;
  --time-width: 76px;
  --day-width: minmax(132px, 1fr);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 6%, rgba(255, 241, 235, .98), transparent 38%),
    radial-gradient(circle at 70% 8%, rgba(202, 232, 255, .92), transparent 42%),
    radial-gradient(circle at 86% 88%, rgba(86, 149, 226, .62), transparent 38%),
    linear-gradient(135deg, var(--bg-warm) 0%, var(--bg-mist) 48%, var(--bg-cool) 100%);
  background-attachment: fixed;
}

body.is-logged-out .app-shell {
  display: none;
}

body.is-logged-in .login-screen {
  display: none;
}

body:not(.role-admin) .admin-only {
  display: none !important;
}

body:not(.role-member) .member-only {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.login-panel {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 18px;
}

.login-copy,
.login-card,
.card {
  border: 1px solid rgba(255, 255, 255, .68);
  background: linear-gradient(180deg, rgba(255, 250, 250, .80), rgba(250, 245, 248, .64));
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.login-copy {
  min-height: 540px;
  padding: clamp(26px, 5vw, 46px);
  display: grid;
  align-content: space-between;
  overflow: hidden;
  position: relative;
}

.login-copy::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -120px;
  bottom: -130px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(69, 167, 245, .26), transparent 68%);
  pointer-events: none;
}

.logo-box,
.brand-mark {
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, rgba(72, 166, 245, .22), rgba(255, 255, 255, .68));
  border: 1px solid rgba(255,255,255,.74);
  box-shadow: inset 0 0 24px rgba(255,255,255,.56), var(--shadow-soft);
  font-weight: 950;
  letter-spacing: -.08em;
}

.logo-box {
  width: 54px;
  height: 54px;
  border-radius: 20px;
}

.login-copy h1 {
  margin: 26px 0 0;
  font-size: clamp(42px, 6vw, 74px);
  line-height: .94;
  letter-spacing: -.09em;
}

.login-copy p,
.login-card p,
.overview-card p,
.card-title p {
  color: var(--muted);
  line-height: 1.65;
}

.login-note {
  font-size: 13px;
}

.login-card {
  padding: 24px;
  display: grid;
  align-content: center;
}

.login-card h2 {
  margin: 0;
  font-size: 26px;
  letter-spacing: -.06em;
}

.auth-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 18px;
  padding: 5px;
  border-radius: 17px;
  background: rgba(255, 255, 255, .42);
  border: 1px solid rgba(255,255,255,.64);
}

.auth-tab {
  min-height: 38px;
  border-radius: 13px;
  background: transparent;
  color: var(--muted);
  font-weight: 850;
  transition: .18s ease;
}

.auth-tab.active {
  background: rgba(255,255,255,.82);
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.login-card .auth-form {
  display: none;
}

.login-card .auth-form.active {
  display: grid;
}

.check-row {
  display: flex;
  grid-template-columns: none;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.check-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.badge-row,
.button-row,
.nav,
.legend,
.week-switch {
  display: flex;
  gap: 9px;
  flex-wrap: wrap;
  align-items: center;
}

.form-stack,
.today-list,
.notice-list,
.side-column,
.main-column {
  display: grid;
  gap: 14px;
}

.hint {
  margin: 0;
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
}

.hint.danger {
  color: #ad4058;
}

.hint.success {
  color: #2e7a4c;
}

.auth-message {
  margin-bottom: 14px;
}

.app-shell {
  width: min(1440px, calc(100% - 36px));
  margin: 0 auto;
  min-height: 100vh;
  padding: 18px 0 34px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 10px 4px 14px;
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 17px;
  flex: 0 0 auto;
}

.brand h1 {
  margin: 0;
  font-size: clamp(24px, 2.8vw, 34px);
  font-weight: 950;
  letter-spacing: -.04em;
  line-height: 1;
}

.brand p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .70);
  border: 1px solid rgba(255,255,255,.74);
  color: var(--muted);
  box-shadow: 0 8px 22px rgba(83, 105, 150, .10);
  font-size: 12px;
  white-space: nowrap;
  backdrop-filter: blur(18px);
  transition: .18s ease;
  font-weight: 760;
}

.pill:hover {
  transform: translateY(-1px);
  color: var(--text);
  background: rgba(255,255,255,.86);
}

.pill.primary,
.btn.primary {
  background: linear-gradient(135deg, #55b9ff, #3097ef);
  color: white;
  border-color: rgba(255,255,255,.58);
  box-shadow: 0 18px 36px rgba(47, 142, 232, .24);
}

.session-pill {
  color: var(--text);
  background: rgba(255,255,255,.86);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 16px;
  align-items: start;
}

.card {
  overflow: hidden;
}

.card.pad {
  padding: 20px;
}

.overview-card {
  padding: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
  align-items: stretch;
}

.overview-main {
  display: grid;
  align-content: space-between;
  gap: 18px;
}

.overview-heading {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.18;
  letter-spacing: -.04em;
}

.summary-card {
  display: grid;
  align-content: space-between;
  gap: 16px;
  border-radius: 24px;
  background: rgba(255,255,255,.52);
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}

.summary-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
}

.summary-card strong {
  display: block;
  margin-top: 10px;
  font-size: 42px;
  line-height: 1;
  letter-spacing: -.07em;
}

.summary-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(31, 42, 84, .08);
}

.card-header h3,
.card-title h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: -.045em;
}

.card-header p,
.card-title p {
  margin: 6px 0 0;
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 15px;
  background: rgba(255, 255, 255, .58);
  color: var(--text);
  border: 1px solid rgba(255,255,255,.72);
  box-shadow: 0 8px 20px rgba(83, 105, 150, .08);
  transition: .18s ease;
  font-weight: 780;
}

.btn:hover {
  background: rgba(255, 255, 255, .78);
  transform: translateY(-1px);
}

.btn.danger {
  background: rgba(244, 119, 141, .14);
  border-color: rgba(244, 119, 141, .26);
  color: #ad4058;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(31, 42, 84, .08);
  background: rgba(255,255,255,.36);
  flex-wrap: wrap;
}

.week-switch strong {
  min-width: 190px;
  text-align: center;
  font-size: 16px;
  letter-spacing: -.04em;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,.52);
  border: 1px solid rgba(255,255,255,.64);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.dot {
  width: 9px;
  height: 9px;
  border-radius: 99px;
}

.dot.regular { background: #60a5fa; }
.dot.personal { background: #fb923c; }
.dot.busking { background: #22c55e; }
.dot.wanted { background: #facc15; }
.dot.edu { background: #fb7185; }

.schedule-wrap {
  overflow: auto;
  max-height: 660px;
  min-height: 560px;
  background: rgba(255,255,255,.28);
}

.schedule-grid {
  display: grid;
  grid-template-columns: var(--time-width) repeat(7, var(--day-width));
  grid-template-rows: var(--schedule-header-height) repeat(32, var(--slot-height));
  min-width: 1080px;
  position: relative;
  user-select: none;
}

.corner,
.day-head,
.time-cell,
.slot-cell {
  border-right: 1px solid rgba(31, 42, 84, .06);
  border-bottom: 1px solid rgba(31, 42, 84, .055);
}

.corner,
.day-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(248, 250, 255, .90);
  backdrop-filter: blur(18px);
}

.corner {
  left: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.day-head {
  padding: 13px 12px;
}

.day-head.today {
  background: linear-gradient(180deg, rgba(98, 181, 248, .28), rgba(248, 250, 255, .90));
}

.day-head .day-name {
  font-weight: 950;
}

.day-head .date {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.time-cell {
  position: sticky;
  left: 0;
  z-index: 25;
  padding: 6px 8px;
  background: rgba(248, 250, 255, .84);
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  font-weight: 750;
}

.slot-cell {
  background: rgba(255,255,255,.22);
  transition: .12s ease;
}

.slot-cell.today {
  background: rgba(105, 185, 249, .075);
}

.slot-cell.available {
  cursor: pointer;
}

.slot-cell.available:hover {
  background: rgba(69, 167, 245, .13);
}

.current-time-indicator {
  --indicator-color: rgba(244, 82, 103, .92);
  position: absolute;
  right: 0;
  left: 0;
  z-index: 26;
  height: 0;
  pointer-events: none;
}

.current-time-line {
  position: absolute;
  right: 0;
  left: var(--time-width);
  border-top: 2px solid var(--indicator-color);
  opacity: .78;
}

.current-time-label {
  position: absolute;
  left: 7px;
  top: 0;
  min-width: calc(var(--time-width) - 14px);
  padding: 4px 7px;
  border-radius: 999px;
  color: #fff;
  background: var(--indicator-color);
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  text-align: center;
  transform: translateY(-50%);
  box-shadow: 0 5px 14px rgba(204, 70, 93, .20);
}

.current-time-dot {
  position: absolute;
  top: 0;
  width: 11px;
  height: 11px;
  border: 2px solid rgba(255,255,255,.88);
  border-radius: 50%;
  background: var(--indicator-color);
  transform: translate(-50%, -50%);
  box-shadow: 0 3px 10px rgba(204, 70, 93, .28);
}

.selection-mirror {
  position: relative;
  z-index: 18;
  display: grid;
  align-content: start;
  gap: 5px;
  min-height: 0;
  margin: 3px;
  padding: 8px 10px;
  overflow: hidden;
  pointer-events: none;
  border-radius: 11px;
  color: #123359;
  background: rgba(119, 198, 255, .92);
  box-shadow: inset 3px 0 0 rgba(255,255,255,.74),
    inset 0 0 0 1px rgba(255,255,255,.44),
    0 11px 22px rgba(68, 128, 188, .22);
  animation: selection-mirror-in .14s ease-out;
}

.selection-mirror.dragging {
  background: rgba(102, 188, 251, .84);
  box-shadow: inset 3px 0 0 rgba(255,255,255,.86),
    inset 0 0 0 1px rgba(255,255,255,.54),
    0 12px 24px rgba(68, 128, 188, .24);
}

.selection-mirror-title {
  overflow: hidden;
  color: #10345d;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.18;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selection-mirror-range {
  color: rgba(16, 52, 93, .70);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.2;
}

.selection-mirror.compact {
  display: flex;
  align-items: center;
  padding: 6px 10px;
}

@keyframes selection-mirror-in {
  from {
    opacity: .55;
    transform: scale(.985);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

.reservation-popover {
  --notch-top: 38px;
  position: fixed;
  z-index: 90;
  width: min(326px, calc(100vw - 24px));
  max-height: min(620px, calc(100vh - 24px));
  padding: 16px;
  border: 1px solid rgba(255,255,255,.78);
  border-radius: 17px;
  background: rgba(255, 252, 252, .96);
  box-shadow: 0 24px 70px rgba(83, 105, 150, .30), 0 4px 14px rgba(83, 105, 150, .10);
  backdrop-filter: blur(24px);
  animation: reservation-popover-in .15s ease-out;
}

.reservation-popover.is-anchor-hidden {
  visibility: hidden;
  pointer-events: none;
}

.reservation-popover::before {
  position: absolute;
  top: var(--notch-top);
  width: 13px;
  height: 13px;
  content: '';
  background: rgba(255, 252, 252, .96);
  transform: translateY(-50%) rotate(45deg);
}

.reservation-popover.opens-right::before {
  left: -7px;
  border-bottom: 1px solid rgba(255,255,255,.78);
  border-left: 1px solid rgba(255,255,255,.78);
}

.reservation-popover.opens-left::before {
  right: -7px;
  border-right: 1px solid rgba(255,255,255,.78);
  border-top: 1px solid rgba(255,255,255,.78);
}

@keyframes reservation-popover-in {
  from {
    opacity: .68;
    transform: translateY(4px) scale(.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.reservation-popover-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.reservation-popover-header h3 {
  margin: 0;
  font-size: 19px;
}

.reservation-popover-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.reservation-popover .form-stack {
  max-height: calc(100vh - 142px);
  overflow: auto;
  padding-right: 2px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 12px;
  background: rgba(255,255,255,.70);
  border: 1px solid rgba(255,255,255,.78);
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.slot-cell.has-event,
.slot-cell.continuation,
.slot-cell.has-event:hover,
.slot-cell.continuation:hover {
  background: rgba(255,255,255,.18);
}

.event {
  position: relative;
  z-index: 10;
  margin: 3px;
  padding: 8px 9px;
  border-radius: 13px;
  overflow: hidden;
  color: #161a35;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.18;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.58), 0 10px 20px rgba(83, 105, 150, .16);
  display: grid;
  align-content: start;
  gap: 5px;
  cursor: pointer;
  transition: .16s ease;
}

.event:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.72), 0 16px 28px rgba(83, 105, 150, .20);
}

.event-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.event-range {
  color: rgba(22, 26, 53, .62);
  font-size: 11px;
  font-weight: 800;
}

.event.cancel-pending {
  opacity: .74;
  box-shadow: inset 0 0 0 2px rgba(244, 119, 141, .64), 0 10px 20px rgba(83, 105, 150, .16);
}

.event.compact {
  display: flex;
  align-items: center;
  align-content: center;
  padding: 6px 10px;
}

.event.compact .event-title {
  font-size: 12px;
  line-height: 1;
}

.event.regular { background: var(--blue); }
.event.personal { background: var(--orange); }
.event.busking { background: var(--green); }
.event.other { background: var(--purple); }
.event.wanted { background: var(--yellow); }
.event.edu { background: var(--pink); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(255,255,255,.70);
  background: rgba(255, 255, 255, .56);
  color: var(--text);
  border-radius: 15px;
  padding: 12px 13px;
  outline: none;
}

.input:focus {
  border-color: rgba(69, 167, 245, .62);
  box-shadow: 0 0 0 4px rgba(69, 167, 245, .14);
}

.input[readonly] {
  color: rgba(23, 27, 60, .72);
  background: rgba(255, 255, 255, .34);
  cursor: default;
}

.textarea {
  min-height: 92px;
  resize: vertical;
}

.full {
  grid-column: 1 / -1;
}

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

.today-item,
.notice-item,
.stats-grid > div {
  border-radius: 20px;
  background: rgba(255,255,255,.50);
  border: 1px solid rgba(255,255,255,.66);
  padding: 14px;
  box-shadow: var(--shadow-soft);
}

.today-item {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: center;
}

.today-time {
  color: var(--primary-strong);
  font-size: 13px;
  font-weight: 950;
  line-height: 1.35;
}

.today-range {
  display: grid;
  gap: 4px;
}

.today-range span {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.today-range small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.today-name {
  font-weight: 900;
}

.today-meta,
.notice-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
  line-height: 1.45;
}

.notice-item.important {
  background: rgba(191, 224, 255, .46);
  border-color: rgba(69, 167, 245, .28);
}

.notice-title {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-weight: 900;
}

.notice-body {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.62;
  margin-top: 8px;
  white-space: pre-wrap;
}

.tag {
  display: inline-flex;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
  background: rgba(69, 167, 245, .12);
  color: #3169aa;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.stats-grid span {
  color: var(--muted);
  font-size: 12px;
}

.stats-grid strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
}

.notice-box {
  padding: 14px 15px;
  border-radius: 19px;
  background: rgba(255, 236, 166, .34);
  border: 1px solid rgba(246, 201, 86, .32);
  color: #826717;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 700;
}

.notice-box.success {
  background: rgba(198, 241, 211, .40);
  border-color: rgba(123, 212, 155, .32);
  color: #2e7a4c;
}

.notice-box.danger {
  background: rgba(255, 208, 220, .44);
  border-color: rgba(244, 119, 141, .30);
  color: #a83d56;
}

.info-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 13px;
}

.info-table th,
.info-table td {
  padding: 11px 10px;
  border-bottom: 1px solid rgba(31, 42, 84, .08);
  text-align: left;
  color: var(--muted);
}

.info-table th {
  color: var(--text);
}

.guide {
  border: 1px solid rgba(255,255,255,.66);
  background: rgba(255,255,255,.48);
  border-radius: 19px;
  overflow: hidden;
  margin-top: 12px;
}

.guide summary {
  cursor: pointer;
  padding: 16px;
  font-weight: 850;
}

.guide ol,
.guide ul {
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
  padding: 0 18px 16px 36px;
}

.notice-form {
  margin-top: 14px;
}

.admin-undo-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: 17px;
  background: rgba(255,255,255,.44);
  border: 1px solid rgba(255,255,255,.66);
}

.admin-undo-bar strong,
.admin-undo-bar span {
  display: block;
}

.admin-undo-bar span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-tabs {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.admin-tab {
  appearance: none;
  border: 1px solid rgba(31, 42, 84, .10);
  border-radius: 999px;
  background: rgba(255,255,255,.44);
  color: var(--muted);
  cursor: pointer;
  flex: 0 0 auto;
  padding: 9px 13px;
  font: inherit;
  font-size: 12px;
  font-weight: 850;
}

.admin-tab.active {
  background: rgba(69, 167, 245, .16);
  border-color: rgba(69, 167, 245, .28);
  color: #3169aa;
}

.admin-tab-panel {
  display: none;
}

.admin-tab-panel.active {
  display: block;
}

.admin-page-link {
  width: fit-content;
}

.admin-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid rgba(31, 42, 84, .08);
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.admin-list {
  display: grid;
  gap: 8px;
}

.admin-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 15px;
  background: rgba(255,255,255,.42);
  border: 1px solid rgba(255,255,255,.64);
  font-size: 13px;
  font-weight: 780;
}

.admin-list-item .btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.admin-list-copy {
  min-width: 0;
}

.admin-list-copy strong,
.admin-list-copy span {
  display: block;
}

.admin-list-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.admin-list-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .48;
}

.registry-textarea {
  min-height: 160px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  line-height: 1.55;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(95, 119, 164, .26);
  backdrop-filter: blur(18px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  width: min(620px, 100%);
  max-height: min(780px, 92vh);
  overflow: auto;
  background: rgba(255, 250, 250, .88);
  border: 1px solid rgba(255,255,255,.70);
  border-radius: 28px;
  box-shadow: 0 30px 100px rgba(83, 105, 150, .26);
  backdrop-filter: blur(24px);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  border-bottom: 1px solid rgba(31, 42, 84, .08);
}

.modal-header h3 {
  margin: 0;
}

.modal-header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.modal-body {
  padding: 22px;
}

.modal-body > .btn + .btn {
  margin-left: 8px;
}

.modal-actions {
  justify-content: flex-end;
  margin-top: 18px;
}

.cancellation-modal-backdrop {
  z-index: 110;
}

.cancellation-modal {
  width: min(460px, 100%);
}

.confirm-modal-backdrop {
  z-index: 130;
}

.confirm-modal {
  width: min(460px, 100%);
}

.confirm-modal .modal-header {
  border-bottom: 0;
  padding-bottom: 0;
}

.confirm-modal .modal-actions {
  margin-top: 0;
}

.cancellation-request-note {
  margin: 0;
  padding: 12px 13px;
  border-radius: 14px;
  background: rgba(255, 236, 166, .28);
  border: 1px solid rgba(246, 201, 86, .28);
  color: #826717;
  font-size: 12px;
  font-weight: 720;
  line-height: 1.55;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 120;
  width: min(420px, calc(100% - 44px));
  padding: 15px 16px;
  background: rgba(255, 250, 250, .88);
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 19px;
  box-shadow: var(--shadow);
  color: var(--text);
  display: none;
  line-height: 1.5;
  backdrop-filter: blur(22px);
  font-weight: 760;
}

.toast.open {
  display: block;
}

.empty {
  color: var(--muted);
  text-align: center;
  padding: 24px;
  border: 1px dashed rgba(31, 42, 84, .16);
  border-radius: 19px;
  background: rgba(255,255,255,.28);
}

.member-admin-page {
  min-height: 100vh;
}

.member-admin-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.member-admin-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.member-admin-header h1 {
  margin: 4px 0 7px;
  font-size: clamp(30px, 6vw, 52px);
  letter-spacing: -.06em;
}

.member-admin-header p {
  margin: 0;
  color: var(--muted);
}

.eyebrow {
  color: #3169aa !important;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .16em;
}

.member-stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.admin-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-dashboard-card {
  margin-top: 14px;
}

.member-stat-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.member-stat-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
}

.member-toolbar-card {
  margin-top: 14px;
}

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

.member-card-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.member-card {
  padding: 16px;
}

.member-card-header,
.member-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.member-card h3 {
  margin: 0;
}

.member-card-subtitle {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.member-badge-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.member-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 850;
}

.member-badge.active,
.member-badge.registered {
  background: rgba(198, 241, 211, .62);
  color: #2e7a4c;
}

.member-badge.inactive {
  background: rgba(255, 236, 166, .62);
  color: #826717;
}

.member-badge.graduated,
.member-badge.unregistered {
  background: rgba(221, 226, 239, .66);
  color: #68718b;
}

.member-info-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 15px 0;
}

.member-info-grid span,
.member-account-copy span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.member-info-grid strong,
.member-account-copy strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
}

.member-card-actions {
  padding-top: 13px;
  border-top: 1px solid rgba(31, 42, 84, .08);
}

.member-status-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.member-status-actions .btn {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 12px;
}

.member-status-actions .btn.is-current {
  background: rgba(69, 167, 245, .16);
  border-color: rgba(69, 167, 245, .28);
  color: #3169aa;
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .side-column {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .overview-card,
  .login-panel {
    grid-template-columns: 1fr;
  }

  .login-copy {
    min-height: auto;
  }
}

@media (max-width: 860px) {
  .app-shell {
    width: min(100% - 24px, 720px);
    padding-top: 10px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    position: relative;
  }

  .nav,
  .side-column,
  .form-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .toolbar {
    align-items: flex-start;
  }

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

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

  .member-toolbar,
  .member-info-grid {
    grid-template-columns: 1fr;
  }

  .member-admin-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .overview-card {
    padding: 18px;
  }

}

@media (max-width: 600px) {
  .reservation-popover {
    right: 12px;
    bottom: 12px;
    left: 12px !important;
    top: auto !important;
    width: auto;
    max-height: calc(100vh - 24px);
  }

  .reservation-popover::before {
    display: none;
  }

  .reservation-popover .form-stack {
    max-height: calc(100vh - 148px);
  }
}

.login-logo-square {
  display: block;
  width: 86px;
  height: 86px;
  max-width: 86px;
  max-height: 86px;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 18px 34px rgba(20, 20, 30, .18);
}

.brand-logo-square {
  display: block;
  width: 46px;
  height: 46px;
  max-width: 46px;
  max-height: 46px;
  object-fit: cover;
  border-radius: 16px;
  flex: 0 0 auto;
  box-shadow: 0 10px 22px rgba(20, 20, 30, .14);
}
