:root {
  --bg: #f4efe6;
  --surface: rgba(255, 252, 246, 0.92);
  --surface-strong: #fffaf1;
  --text: #1c1a17;
  --muted: #655d52;
  --line: rgba(28, 26, 23, 0.12);
  --accent: #2f6b53;
  --accent-strong: #184634;
  --accent-soft: #dbeade;
  --danger: #9a3f2e;
  --shadow: 0 24px 80px rgba(77, 59, 24, 0.14);
  --radius: 22px;
  --font-body: Georgia, "Times New Roman", serif;
  --font-heading: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(47, 107, 83, 0.16), transparent 28%),
    radial-gradient(circle at right 20%, rgba(201, 141, 65, 0.18), transparent 24%),
    linear-gradient(180deg, #f8f4eb 0%, #efe6d7 100%);
  font-family: var(--font-body);
  min-height: 100vh;
}

.page-shell {
  width: min(1280px, calc(100% - 24px));
  margin: 0 auto;
  padding: 16px 0 32px;
}

.hero {
  display: none;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 16px;
  align-items: stretch;
  margin-bottom: 16px;
}

.hero,
.panel,
.card,
.table-wrap,
.login-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero {
  padding: 18px 20px;
}

body.authenticated .hero {
  display: none;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-size: 0.8rem;
  margin: 0 0 10px;
}

h1,
h2,
h3 {
  margin-top: 0;
  font-family: var(--font-heading);
}

h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 0.95;
  max-width: 9ch;
  margin-bottom: 8px;
}

.hero-copy,
.subtle {
  color: var(--muted);
}

.hero-card {
  background: linear-gradient(180deg, #f8efe0, #fff8ef);
  border-radius: 18px;
  padding: 16px;
  align-self: end;
}

.hero-card p {
  margin: 8px 0;
}

#app {
  display: grid;
  gap: 18px;
}

.admin-layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 18px;
}

.admin-sidebar {
  align-self: start;
  position: sticky;
  top: 16px;
}

.admin-content {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.side-nav {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.subnav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.court-week-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.court-day-tab {
  background: #f6f6f6;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 6px;
  display: grid;
  gap: 2px;
  justify-items: center;
}

.court-day-tab strong {
  font-size: 1.1rem;
}

.court-day-tab span,
.court-day-tab small {
  font-size: 0.8rem;
}

.court-day-tab.active {
  background: linear-gradient(180deg, #2bc265, #15985c);
  color: #fff;
}

.court-board-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.court-board-card {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #1a1f2a;
  box-shadow: 0 16px 36px rgba(12, 15, 20, 0.2);
}

.court-board-hero {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: stretch;
  padding: 14px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(34, 57, 102, 0.98), rgba(69, 108, 170, 0.86)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 30%);
}

.court-board-hero .eyebrow {
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 6px;
}

.court-board-hero .subtle {
  color: rgba(255, 255, 255, 0.8);
}

.court-board-hero-side {
  display: grid;
  gap: 8px;
  align-content: start;
}

.court-board-photo {
  width: 118px;
  height: 74px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(180deg, rgba(138, 204, 255, 0.9) 0%, rgba(101, 176, 238, 0.84) 55%, rgba(40, 117, 197, 0.9) 56%, rgba(34, 149, 87, 0.92) 100%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent);
  box-shadow: inset 0 -18px 30px rgba(255, 255, 255, 0.08);
}

.weather-pill {
  min-width: 82px;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  padding: 10px;
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
}

.court-board-slots {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 14px;
  background: #f3f6fb;
}

.court-board-slot {
  min-height: 86px;
  border-radius: 14px;
  padding: 10px;
  display: grid;
  gap: 4px;
  color: #fff;
  align-content: start;
}

.court-board-slot-button {
  width: 100%;
  border: 0;
  text-align: left;
  box-shadow: none;
  cursor: pointer;
}

.court-board-slot-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.03);
}

.court-board-slot strong {
  font-size: 0.92rem;
}

.court-board-slot span,
.court-board-slot small {
  font-size: 0.8rem;
}

.court-board-slot small {
  opacity: 0.9;
}

.court-slot-free {
  background: linear-gradient(180deg, #1ebd73, #15985c);
}

.court-slot-busy {
  background: linear-gradient(180deg, #ff6a57, #e14a37);
}

.court-slot-hold {
  background: linear-gradient(180deg, #ef9b3a, #d37910);
}

.court-slot-rental {
  background: linear-gradient(180deg, #3b6dd7, #244ea8);
}

@media (max-width: 720px) {
  .court-board-slots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .court-board-photo {
    width: 96px;
    height: 64px;
  }
}

.subnav-link {
  background: #ece3d4;
  color: var(--text);
  padding: 10px 14px;
}

.subnav-link.active {
  background: var(--accent);
  color: #fff;
}

.compact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.nav-link {
  width: 100%;
  text-align: left;
  background: #efe6d7;
  color: var(--text);
}

.nav-link.active {
  background: var(--accent);
  color: #fff;
}

.login-card,
.panel,
.card,
.table-wrap {
  padding: 20px;
}

.compact-mode .login-card,
.compact-mode .panel,
.compact-mode .card,
.compact-mode .table-wrap {
  padding: 16px;
}

.table-wrap {
  overflow-x: auto;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

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

.stat {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: bold;
}

.grid {
  display: grid;
  gap: 18px;
}

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

.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.95rem;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(28, 26, 23, 0.14);
  background: white;
}

button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

button.secondary {
  background: #e5dccb;
  color: var(--text);
}

button:hover {
  background: var(--accent-strong);
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.login-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 18px;
  align-items: start;
}

.login-title {
  max-width: 14ch;
  margin-bottom: 10px;
}

.brand-block {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 18px;
}

.brand-title {
  margin-bottom: 6px;
}

.brand-logo {
  width: 64px;
  height: 64px;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex-shrink: 0;
}

.brand-logo-text {
  font-weight: 700;
  font-size: 1.25rem;
}

.brand-logo-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.actions-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.mini-card {
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.order-grid,
.toggle-grid,
.color-grid {
  display: grid;
  gap: 12px;
}

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

.color-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.toggle-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
}

.toggle-option input {
  width: auto;
}

.inline-toggle {
  align-self: end;
}

.hero-card.compact {
  padding: 18px;
}

.coach-accordion summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  list-style: none;
  gap: 12px;
}

.coach-accordion summary::-webkit-details-marker {
  display: none;
}

.coach-accordion[open] summary {
  margin-bottom: 14px;
}

.message {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 14px;
}

.message.error {
  background: #f9e4df;
  color: var(--danger);
}

.message.success {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

th {
  color: var(--muted);
  font-weight: normal;
}

.pill {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #ece3d4;
}

.pill.success {
  background: #dcecdf;
  color: var(--accent-strong);
}

.pill.warning {
  background: #f4dfb9;
  color: #7b4d0f;
}

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

.empty {
  color: var(--muted);
  padding: 8px 0 0;
}

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

.slot-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
}

.slot-option.disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.slot-option.occupied {
  background: rgba(242, 215, 209, 0.82);
  border-color: rgba(154, 63, 46, 0.28);
  color: var(--danger);
}

.slot-option.occupied.disabled {
  opacity: 0.95;
}

.slot-option.occupied small {
  color: color-mix(in srgb, var(--danger) 74%, black 26%);
}

.slot-option.disabled span {
  text-decoration: line-through;
}

.slot-option input {
  width: auto;
  min-height: auto;
}

.slot-option small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.court-block + .court-block {
  margin-top: 14px;
}

.slot-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border-radius: 999px;
  font-size: 0.9rem;
}

.slot-chip.free {
  background: #dcecdf;
  color: var(--accent-strong);
}

.slot-chip.occupied {
  background: #f2d7d1;
  color: var(--danger);
}

.availability-summary {
  margin: -4px 0 4px;
}

.checkbox-group {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  display: grid;
  gap: 10px;
}

.checkbox-group legend {
  padding: 0 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
}

.checkbox-option input {
  width: auto;
  min-height: auto;
}

.reservation-wizard {
  display: grid;
  gap: 16px;
}

.reservation-step {
  display: grid;
  gap: 12px;
}

.compact-toolbar {
  gap: 12px;
}

.reservation-court-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.reservation-court-card {
  min-height: 82px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--surface-strong);
  color: var(--text);
  display: grid;
  gap: 6px;
  align-content: center;
  justify-items: start;
  text-align: left;
}

.reservation-court-card span {
  color: var(--muted);
  font-size: 0.88rem;
}

.reservation-court-card.active {
  background: var(--accent);
  color: #fff;
  border-color: transparent;
}

.reservation-court-card.active span {
  color: rgba(255, 255, 255, 0.82);
}

.slot-grid.static {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 18, 14, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
}

.modal-card {
  width: min(100%, 560px);
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 30px 60px rgba(19, 17, 13, 0.18);
  padding: 20px;
}

.modal-card.modal-wide {
  width: min(1100px, calc(100vw - 32px));
}

@media (max-width: 900px) {
  .hero,
  .login-grid,
  .grid.two,
  .grid.three,
  .stats,
  .slot-grid,
  .order-grid,
  .toggle-grid,
  .color-grid {
    grid-template-columns: 1fr;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .page-shell {
    width: min(100% - 20px, 1180px);
  }

  h1 {
    max-width: none;
  }

  .hero,
  .panel,
  .card,
  .table-wrap,
  .login-card {
    border-radius: 18px;
  }

  .page-shell {
    padding: 14px 0 28px;
  }

  .modal-card {
    padding: 16px;
    border-radius: 18px;
  }

  input,
  textarea,
  select,
  button {
    min-height: 46px;
  }

  th,
  td {
    white-space: nowrap;
    font-size: 0.95rem;
  }
}
/* iPhone-like comfort layer */
body {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.page-shell {
  width: min(1320px, calc(100% - 20px));
  padding: 10px 0 28px;
}

.hero,
.panel,
.card,
.table-wrap,
.login-card {
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow:
    0 22px 60px rgba(101, 82, 44, 0.12),
    0 4px 14px rgba(68, 55, 30, 0.06);
  backdrop-filter: blur(22px);
}

.panel,
.card,
.table-wrap,
.login-card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 250, 241, 0.78)),
    var(--surface);
}

.admin-layout {
  gap: 20px;
}

.admin-sidebar {
  padding: 18px;
  border-radius: 30px;
}

.side-nav {
  gap: 12px;
}

.nav-link,
.subnav-link {
  position: relative;
  min-height: 52px;
  border-radius: 18px;
  border: 1px solid rgba(28, 26, 23, 0.08);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease,
    color 140ms ease;
}

.nav-link {
  padding: 14px 16px 14px 52px;
}

.subnav-link {
  padding: 10px 16px;
}

.nav-link::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 50%;
  width: 24px;
  height: 24px;
  border-radius: 9px;
  transform: translateY(-50%);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.92), transparent 38%),
    linear-gradient(180deg, rgba(47, 107, 83, 0.22), rgba(24, 70, 52, 0.16));
  border: 1px solid rgba(47, 107, 83, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.nav-link.active,
.subnav-link.active {
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #fff;
  box-shadow:
    0 12px 28px rgba(24, 70, 52, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.nav-link.active::before {
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.9), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0.12));
  border-color: rgba(255, 255, 255, 0.22);
}

.nav-link:hover,
.subnav-link:hover,
button:hover {
  transform: translateY(-1px);
}

.stats {
  gap: 16px;
}

.stat,
.mini-card,
.toggle-option,
.hero-card {
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(255, 250, 241, 0.82));
  border: 1px solid rgba(28, 26, 23, 0.08);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 10px 24px rgba(77, 59, 24, 0.06);
}

.stat {
  padding: 16px 16px 18px;
}

.stat-value {
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

input,
textarea,
select {
  min-height: 50px;
  border-radius: 18px;
  border: 1px solid rgba(28, 26, 23, 0.09);
  background: rgba(255, 255, 255, 0.88);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 2px 8px rgba(83, 66, 32, 0.04);
}

textarea {
  min-height: 120px;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(47, 107, 83, 0.35);
  box-shadow:
    0 0 0 4px rgba(47, 107, 83, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

button {
  min-height: 48px;
  font-weight: 600;
  letter-spacing: -0.01em;
  box-shadow:
    0 10px 22px rgba(24, 70, 52, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

button.secondary {
  background: linear-gradient(180deg, #f7f3ec, #e8dece);
  color: var(--text);
  box-shadow:
    0 8px 18px rgba(88, 72, 39, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.84);
}

.pill {
  border-radius: 999px;
  padding: 8px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.brand-logo {
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background:
    radial-gradient(circle at 28% 26%, rgba(255, 255, 255, 0.9), transparent 34%),
    linear-gradient(180deg, rgba(219, 234, 222, 0.95), rgba(197, 222, 204, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 12px 26px rgba(47, 107, 83, 0.14);
}

.table-wrap {
  overflow: hidden;
}

table {
  border-collapse: separate;
  border-spacing: 0;
}

thead th {
  position: sticky;
  top: 0;
  background: rgba(248, 242, 232, 0.96);
  backdrop-filter: blur(10px);
}

tbody tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.34);
}

tbody td,
thead th {
  padding-top: 14px;
  padding-bottom: 14px;
}

.court-day-tab,
.reservation-court-card,
.slot-option,
.checkbox-option {
  border-radius: 20px;
}

.reservation-court-card,
.slot-option,
.checkbox-option,
.toggle-option {
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    border-color 140ms ease;
}

.reservation-court-card:hover,
.slot-option:hover,
.checkbox-option:hover,
.toggle-option:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(77, 59, 24, 0.08);
}

@media (max-width: 920px) {
  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

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

@media (max-width: 640px) {
  .page-shell {
    width: min(100%, calc(100% - 14px));
    padding-top: 8px;
  }

  .panel,
  .card,
  .table-wrap,
  .login-card,
  .admin-sidebar {
    border-radius: 24px;
  }

  .side-nav {
    grid-template-columns: 1fr 1fr;
  }

  .nav-link {
    padding-left: 46px;
    font-size: 0.95rem;
  }

  .stats,
  .grid.two,
  .grid.three,
  .order-grid,
  .toggle-grid,
  .color-grid,
  .login-grid {
    grid-template-columns: 1fr;
  }
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-link::before {
  display: none;
}

.nav-icon {
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.92), transparent 38%),
    linear-gradient(180deg, rgba(47, 107, 83, 0.22), rgba(24, 70, 52, 0.16));
  border: 1px solid rgba(47, 107, 83, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.nav-link.active .nav-icon {
  color: var(--accent-strong);
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.95), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0.62));
  border-color: rgba(255, 255, 255, 0.22);
}

.entity-link {
  padding: 0;
  min-height: auto;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--accent-strong);
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.entity-link.inline {
  display: inline;
}

.entity-link:hover {
  transform: none;
  text-decoration: underline;
}

.search-inline {
  display: grid;
  gap: 6px;
  min-width: min(280px, 100%);
}

.form-hint-stack {
  display: grid;
  gap: 10px;
}

.duplicate-warning {
  background: rgba(219, 234, 222, 0.55);
  border: 1px solid rgba(47, 107, 83, 0.16);
}

.duplicate-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.duplicate-row {
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(28, 26, 23, 0.08);
}

.multi-select-tall {
  min-height: 220px;
}

.upload-field {
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(28, 26, 23, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.6);
}

.upload-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.upload-preview {
  min-height: 92px;
  border-radius: 18px;
  border: 1px dashed rgba(28, 26, 23, 0.12);
  background: rgba(255, 255, 255, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.upload-preview img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  display: block;
}

.upload-placeholder {
  color: var(--muted);
  font-size: 0.95rem;
}

.merge-preview-card {
  gap: 0.85rem;
}

.merge-preview-list {
  display: grid;
  gap: 0.7rem;
}

.merge-preview-item {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface-strong) 92%, white 8%);
}

.merge-preview-item span {
  color: var(--muted);
  font-size: 0.92rem;
}

.member-group-cell {
  display: grid;
  gap: 8px;
}

.member-group-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.person-table-entry {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.person-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(28, 26, 23, 0.1);
  background: rgba(219, 234, 222, 0.55);
  flex: 0 0 auto;
}

.person-avatar-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.person-avatar-fallback {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.member-group-duplicates {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.member-chip {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(28, 26, 23, 0.08);
  color: var(--muted);
  font-size: 0.8rem;
}

.lesson-calendar-shell {
  display: grid;
  gap: 18px;
}

.lesson-calendar-months {
  display: grid;
  gap: 16px;
}

.lesson-calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.lesson-calendar-nav strong {
  font-size: 1rem;
  letter-spacing: -0.02em;
}

.lesson-calendar-month {
  padding: 16px;
  overflow-x: auto;
}

.lesson-calendar-month-header {
  display: none;
}

.lesson-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.lesson-calendar-modal #app-modal-form {
  display: grid;
  gap: 18px;
}

.lesson-calendar-modal .lesson-calendar-grid {
  min-width: 700px;
}

.lesson-calendar-weekdays {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.lesson-calendar-day {
  min-height: 72px;
  padding: 10px 8px;
  border-radius: 18px;
  border: 1px solid rgba(28, 26, 23, 0.08);
  background: rgba(255, 255, 255, 0.7);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.lesson-calendar-day.empty {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.lesson-calendar-day-muted {
  opacity: 0.7;
}

.lesson-calendar-day.today,
.lesson-calendar-day-button.today {
  border-color: rgba(24, 70, 52, 0.36);
  box-shadow: inset 0 0 0 1px rgba(24, 70, 52, 0.1);
}

.lesson-calendar-day.has-lesson {
  background: linear-gradient(180deg, rgba(47, 107, 83, 0.16), rgba(24, 70, 52, 0.08));
  border-color: rgba(47, 107, 83, 0.18);
}

.lesson-calendar-day-button {
  width: 100%;
  min-height: 72px;
  padding: 10px 8px;
  border-radius: 18px;
  border: 1px solid rgba(47, 107, 83, 0.18);
  background: linear-gradient(180deg, rgba(47, 107, 83, 0.16), rgba(24, 70, 52, 0.08));
  color: var(--text);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: left;
  box-shadow: none;
}

.lesson-calendar-day-button.active {
  border-color: rgba(24, 70, 52, 0.4);
  box-shadow:
    0 12px 24px rgba(24, 70, 52, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.lesson-history-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-radius: 22px;
  border: 1px solid rgba(28, 26, 23, 0.08);
  background: rgba(255, 255, 255, 0.62);
}

.lesson-history-list {
  display: grid;
  gap: 10px;
  max-height: 220px;
  overflow: auto;
  padding-right: 4px;
}

.lesson-history-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(28, 26, 23, 0.08);
}

.detail-stack {
  display: grid;
  gap: 10px;
}

.reservation-highlight-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.reservation-highlight-card {
  display: grid;
  gap: 6px;
  align-content: start;
}

.reservation-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.reservation-summary-card {
  min-height: 92px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(28, 26, 23, 0.08);
  background: rgba(255, 255, 255, 0.72);
  display: grid;
  gap: 4px;
  justify-items: start;
  text-align: left;
  box-shadow: none;
  color: var(--text);
}

.reservation-summary-card.active {
  border-color: rgba(24, 70, 52, 0.34);
  background: linear-gradient(180deg, rgba(47, 107, 83, 0.16), rgba(24, 70, 52, 0.08));
}

.reservation-summary-card strong {
  font-size: 1.1rem;
}

.reservation-summary-card span,
.reservation-summary-card small {
  color: var(--muted);
}

.nested-card {
  margin-top: 18px;
}

@media (max-width: 640px) {
  .lesson-calendar-nav {
    flex-wrap: wrap;
  }

  .lesson-calendar-grid {
    gap: 6px;
  }

  .lesson-calendar-day {
    min-height: 62px;
    padding: 8px 6px;
  }
}
