/*
 * ABASC application design system.
 * Tailwind utilities remain available; these application-owned components
 * provide the shared shell and consistent responsive behaviour.
 */

:root {
  --abasc-blue-950: #07334d;
  --abasc-blue-900: #084b70;
  --abasc-blue-800: #0e6795;
  --abasc-blue-700: #0e7fac;
  --abasc-blue-600: #0e97c9;
  --abasc-blue-500: #3b9ed0;
  --abasc-blue-300: #9bc9e7;
  --abasc-blue-100: #e7f4fb;
  --abasc-blue-50: #f3f9fd;
  --abasc-ink: #173244;
  --abasc-muted: #587080;
  --abasc-border: #cfdee7;
  --abasc-border-soft: #e7eff4;
  --abasc-surface: #ffffff;
  --abasc-canvas: #eef7fb;
  --abasc-success: #157347;
  --abasc-success-soft: #e9f7ef;
  --abasc-warning: #9a6700;
  --abasc-warning-soft: #fff6dd;
  --abasc-danger: #b42318;
  --abasc-danger-soft: #fff0ef;
  --abasc-sidebar-width: 16rem;
  --abasc-header-height: 4.5rem;
  --abasc-radius-sm: 0.45rem;
  --abasc-radius: 0.75rem;
  --abasc-radius-lg: 1rem;
  --abasc-shadow-sm: 0 1px 3px rgb(7 51 77 / 0.08);
  --abasc-shadow: 0 10px 30px rgb(7 51 77 / 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--abasc-canvas);
  color: var(--abasc-ink);
  scroll-behavior: smooth;
}

body.abasc-app {
  display: flex;
  min-height: 100vh;
  margin: 0;
  flex-direction: column;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgb(155 201 231 / 0.35), transparent 28rem),
    linear-gradient(180deg, #f8fcfe 0%, var(--abasc-canvas) 100%);
  color: var(--abasc-ink);
  font-family: "Open Sans", Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

body.drawer-open {
  overflow: hidden;
}

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

a {
  color: var(--abasc-blue-800);
}

a:hover {
  color: var(--abasc-blue-600);
}

:focus-visible {
  outline: 3px solid rgb(14 151 201 / 0.42);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  border-radius: var(--abasc-radius-sm);
  background: white;
  padding: 0.75rem 1rem;
  color: var(--abasc-blue-950);
  box-shadow: var(--abasc-shadow);
  font-weight: 700;
}

.skip-link:focus {
  top: 1rem;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--abasc-header-height);
  border-bottom: 1px solid rgb(255 255 255 / 0.18);
  background: linear-gradient(135deg, var(--abasc-blue-900), var(--abasc-blue-700));
  color: white;
  box-shadow: 0 3px 14px rgb(7 51 77 / 0.18);
}

.app-header-inner {
  display: flex;
  min-height: var(--abasc-header-height);
  width: 100%;
  align-items: center;
  gap: 0.85rem;
  padding: 0.55rem clamp(0.75rem, 2.5vw, 1.5rem);
}

.app-brand {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 0.7rem;
  color: white;
  text-decoration: none;
}

.app-brand:hover,
.app-brand:visited {
  color: white;
  text-decoration: none;
}

.app-logo {
  width: 3.25rem;
  height: 3.25rem;
  flex: 0 0 auto;
  border: 2px solid rgb(255 255 255 / 0.82);
  border-radius: 50%;
  background: white;
  object-fit: contain;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.2);
}

.app-brand-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  line-height: 1.1;
}

.app-brand-copy strong {
  overflow: hidden;
  font-family: Raleway, "Open Sans", sans-serif;
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-brand-copy span {
  color: rgb(255 255 255 / 0.8);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 0.65rem;
  margin-left: auto;
}

.header-user {
  max-width: 13rem;
  overflow: hidden;
  color: rgb(255 255 255 / 0.88);
  font-size: 0.9rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-link,
.header-link:visited {
  border-radius: var(--abasc-radius-sm);
  color: white;
  font-weight: 700;
  padding: 0.55rem 0.7rem;
  text-decoration: none;
}

.header-link:hover {
  background: rgb(255 255 255 / 0.12);
  color: white;
}

.workspace-badge,
.guest-label {
  border: 1px solid rgb(255 255 255 / 0.34);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.12);
  color: white;
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  padding: 0.3rem 0.6rem;
  text-transform: uppercase;
}

.menu-button,
.icon-button {
  display: inline-flex;
  min-width: 2.75rem;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--abasc-radius-sm);
  cursor: pointer;
}

.menu-button {
  background: rgb(255 255 255 / 0.12);
  color: white;
}

.menu-button:hover {
  background: rgb(255 255 255 / 0.22);
}

.app-shell {
  display: flex;
  min-height: calc(100vh - var(--abasc-header-height));
  flex: 1 1 auto;
}

.app-sidebar {
  position: fixed;
  inset: var(--abasc-header-height) auto 0 0;
  z-index: 45;
  width: min(var(--abasc-sidebar-width), 88vw);
  overflow-y: auto;
  border-right: 1px solid rgb(255 255 255 / 0.1);
  background: linear-gradient(180deg, var(--abasc-blue-950), var(--abasc-blue-900));
  color: white;
  box-shadow: 8px 0 28px rgb(7 51 77 / 0.18);
  transform: translateX(-105%);
  transition: transform 180ms ease;
}

.drawer-is-open .app-sidebar {
  transform: translateX(0);
}

.drawer-overlay {
  position: fixed;
  inset: var(--abasc-header-height) 0 0;
  z-index: 40;
  display: none;
  border: 0;
  background: rgb(7 30 45 / 0.55);
}

.drawer-is-open .drawer-overlay {
  display: block;
}

.sidebar-inner {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  padding: 1rem;
}

.sidebar-heading {
  padding: 0.25rem 0.6rem 0.85rem;
}

.sidebar-heading h2 {
  margin: 0;
  color: white;
  font-size: 1.05rem;
  font-weight: 750;
}

.sidebar-kicker,
.navigation-label {
  margin: 0 0 0.4rem;
  color: rgb(214 238 250 / 0.64);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.family-controls {
  margin-bottom: 1.2rem;
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: var(--abasc-radius);
  background: rgb(255 255 255 / 0.07);
  padding: 0.75rem;
}

.family-switcher {
  display: grid;
  gap: 0.35rem;
}

.family-label,
.current-swimmer small {
  color: rgb(224 243 252 / 0.75);
  font-size: 0.72rem;
  font-weight: 700;
}

.family-switcher select {
  width: 100%;
  min-height: 2.75rem;
  border: 1px solid rgb(255 255 255 / 0.25);
  border-radius: var(--abasc-radius-sm);
  background: white;
  color: var(--abasc-ink);
  padding: 0.55rem 0.65rem;
}

.current-swimmer {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.current-swimmer > span:last-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.current-swimmer strong {
  overflow: hidden;
  color: white;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.current-swimmer-avatar {
  display: inline-flex;
  width: 2.4rem;
  height: 2.4rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--abasc-blue-500);
  color: white;
  font-weight: 800;
}

.add-family-button {
  display: inline-flex;
  width: 100%;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.7rem;
  border: 1px solid rgb(255 255 255 / 0.26);
  border-radius: var(--abasc-radius-sm);
  background: transparent;
  color: white;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 700;
}

.add-family-button:hover {
  background: rgb(255 255 255 / 0.12);
}

.sidebar-navigation {
  flex: 1 1 auto;
}

.navigation-label {
  margin-top: 1rem;
  padding-inline: 0.55rem;
}

.navigation-label:first-child {
  margin-top: 0;
}

.navigation-list {
  display: grid;
  gap: 0.22rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.sidebar-link,
.sidebar-link:visited {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  border-radius: var(--abasc-radius-sm);
  color: rgb(231 246 253 / 0.84);
  font-size: 0.9rem;
  font-weight: 650;
  padding: 0.55rem 0.75rem;
  text-decoration: none;
}

.sidebar-link:hover,
.sidebar-link:focus-visible {
  background: rgb(255 255 255 / 0.1);
  color: white;
}

.sidebar-link.is-active {
  background: white;
  color: var(--abasc-blue-900);
  box-shadow: var(--abasc-shadow-sm);
}

.navigation-group {
  margin-top: 0.55rem;
  border: 1px solid rgb(255 255 255 / 0.1);
  border-radius: var(--abasc-radius-sm);
  background: rgb(255 255 255 / 0.04);
}

.navigation-group summary {
  min-height: 2.75rem;
  cursor: pointer;
  padding: 0.68rem 0.75rem;
  color: white;
  font-size: 0.82rem;
  font-weight: 800;
}

.navigation-group .navigation-list {
  padding: 0 0.45rem 0.45rem;
}

.sidebar-status {
  margin-top: 1.25rem;
}

.sidebar-status > :last-child {
  border: 1px solid rgb(255 255 255 / 0.12);
  border-radius: var(--abasc-radius-sm);
  background: rgb(255 255 255 / 0.07);
  color: white;
  padding: 0.65rem;
}

.sidebar-entry-status + .sidebar-entry-status { margin-top: 0.55rem; }
.sidebar-entry-status {
  border: 1px solid rgb(255 255 255 / 0.14);
  border-radius: var(--abasc-radius-sm);
  background: rgb(255 255 255 / 0.07);
  color: white;
  padding: 0.7rem;
}
.sidebar-entry-status h3, .sidebar-entry-status p { margin: 0; }
.sidebar-entry-status h3 { font-size: 0.86rem; }
.sidebar-entry-name { margin-top: 0.18rem !important; font-size: 0.78rem; font-weight: 750; }
.sidebar-entry-date { margin-top: 0.18rem !important; color: rgb(255 255 255 / 0.78); font-size: 0.78rem; }
.sidebar-entry-state { display: inline-block; margin-top: 0.45rem; border-radius: 999px; padding: 0.18rem 0.5rem; font-size: 0.72rem; font-weight: 800; }
.sidebar-entry-state.is-open { background: #dcfce7; color: #166534; }
.sidebar-entry-state.is-closed { background: rgb(255 255 255 / 0.12); color: white; }

.sidebar-footer {
  display: grid;
  gap: 0.6rem;
  margin-top: 1.25rem;
}

.workspace-switch,
.workspace-switch:visited,
.sidebar-help,
.sidebar-help:visited {
  display: flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-radius: var(--abasc-radius-sm);
  color: white;
  font-size: 0.84rem;
  font-weight: 800;
  text-decoration: none;
}

.workspace-switch {
  border: 1px solid var(--abasc-blue-300);
  background: var(--abasc-blue-700);
}

.workspace-switch:hover {
  background: var(--abasc-blue-600);
  color: white;
}

.workspace-switch-admin {
  background: white;
  color: var(--abasc-blue-900) !important;
}

.sidebar-help {
  color: rgb(231 246 253 / 0.75) !important;
}

.app-content {
  min-width: 0;
  flex: 1 1 auto;
}

.app-main {
  width: 100%;
  padding: clamp(0.75rem, 2vw, 1.5rem);
}

.page-surface {
  width: min(100%, 84rem);
  min-height: 12rem;
  margin-inline: auto;
  border: 1px solid rgb(207 222 231 / 0.82);
  border-radius: var(--abasc-radius-lg);
  background: rgb(255 255 255 / 0.95);
  box-shadow: var(--abasc-shadow-sm);
  padding: clamp(1rem, 2.5vw, 2rem);
}

.page-surface > :first-child {
  margin-top: 0;
}

.page-surface h1,
.page-surface h2,
.page-surface h3 {
  color: var(--abasc-ink);
  font-family: Raleway, "Open Sans", sans-serif;
  line-height: 1.2;
}

.page-surface h1 {
  font-size: clamp(1.7rem, 3vw, 2.35rem);
}

.page-surface h2 {
  font-size: clamp(1.25rem, 2vw, 1.6rem);
}

.flash-region {
  display: grid;
  width: min(100%, 84rem);
  gap: 0.5rem;
  margin-inline: auto;
  padding: 0.75rem 0.75rem 0;
}

.flash-region:empty {
  display: none;
}

.flash-message {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  border: 1px solid;
  border-radius: var(--abasc-radius);
  padding: 0.75rem 0.9rem;
  box-shadow: var(--abasc-shadow-sm);
  font-weight: 650;
}

.flash-success {
  border-color: #94d3ad;
  background: var(--abasc-success-soft);
  color: var(--abasc-success);
}

.flash-error {
  border-color: #efaaa5;
  background: var(--abasc-danger-soft);
  color: var(--abasc-danger);
}

.flash-icon {
  display: inline-flex;
  width: 1.45rem;
  height: 1.45rem;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 0.8rem;
}

.app-footer {
  display: flex;
  min-height: 3rem;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border-top: 1px solid var(--abasc-border);
  background: rgb(255 255 255 / 0.9);
  color: var(--abasc-muted);
  font-size: 0.76rem;
  padding: 0.75rem;
  text-align: center;
}

.guest-main {
  display: flex;
  min-height: calc(100vh - var(--abasc-header-height) - 3rem);
  flex: 1 1 auto;
  flex-direction: column;
  justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
}

.guest-main > .min-h-screen {
  min-height: auto;
}

.guest-flash {
  width: min(100%, 32rem);
}

.app-dialog {
  width: min(calc(100% - 2rem), 30rem);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  border: 0;
  border-radius: var(--abasc-radius-lg);
  padding: 0;
  color: var(--abasc-ink);
  box-shadow: 0 24px 80px rgb(7 30 45 / 0.35);
}

.app-dialog::backdrop {
  background: rgb(7 30 45 / 0.62);
  backdrop-filter: blur(2px);
}

.dialog-card {
  padding: 1.25rem;
}

.dialog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dialog-header h2,
.eyebrow {
  margin: 0;
}

.eyebrow {
  color: var(--abasc-blue-700);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.icon-button {
  background: var(--abasc-blue-50);
  color: var(--abasc-blue-900);
  font-size: 1.5rem;
}

.form-stack,
.field-group {
  display: grid;
  gap: 0.45rem;
}

.form-stack {
  gap: 1rem;
}

.field-group label,
.page-surface form label {
  color: var(--abasc-ink);
  font-size: 0.88rem;
  font-weight: 750;
}

.field-group input,
.field-group select,
.field-group textarea,
.page-surface input:not([type="checkbox"], [type="radio"], [type="submit"], [type="button"]),
.page-surface select,
.page-surface textarea {
  min-height: 2.75rem;
  border: 1px solid var(--abasc-border);
  border-radius: var(--abasc-radius-sm);
  background: white;
  color: var(--abasc-ink);
  padding: 0.58rem 0.72rem;
}

.page-surface input[type="checkbox"],
.page-surface input[type="radio"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--abasc-blue-700);
}

.admin-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.admin-actions-nowrap { flex-wrap: nowrap; justify-content: flex-end; }
.admin-actions form { display: inline-flex; margin: 0; }

.form-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 0.5rem;
}

.button,
.page-surface input[type="submit"],
.page-surface button[type="submit"] {
  display: inline-flex;
  min-height: 2.75rem;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: var(--abasc-radius-sm);
  cursor: pointer;
  font-weight: 750;
  padding: 0.6rem 1rem;
  text-decoration: none;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.button:hover,
.page-surface input[type="submit"]:hover,
.page-surface button[type="submit"]:hover {
  transform: translateY(-1px);
}

.button-primary,
.page-surface input[type="submit"],
.page-surface button[type="submit"] {
  background: var(--abasc-blue-700);
  color: white;
}

.button-primary:hover,
.page-surface input[type="submit"]:hover,
.page-surface button[type="submit"]:hover {
  background: var(--abasc-blue-800);
  color: white;
}

.button-secondary,
.page-surface input.button-secondary[type="submit"],
.page-surface button.button-secondary[type="submit"] {
  border-color: var(--abasc-border);
  background: white;
  color: var(--abasc-blue-900);
}

.page-surface input.button-secondary[type="submit"]:hover,
.page-surface button.button-secondary[type="submit"]:hover {
  background: var(--abasc-blue-50);
  color: var(--abasc-blue-900);
}

.button-danger,
.page-surface input.button-danger[type="submit"],
.page-surface button.button-danger[type="submit"] {
  border-color: var(--abasc-danger) !important;
  background: var(--abasc-danger) !important;
  color: white !important;
}

.button-danger:hover,
.page-surface input.button-danger[type="submit"]:hover,
.page-surface button.button-danger[type="submit"]:hover {
  border-color: #8f1b13 !important;
  background: #8f1b13 !important;
  color: white !important;
}

.button-compact,
.page-surface input.button-compact[type="submit"],
.page-surface button.button-compact[type="submit"] {
  min-height: 2rem;
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
}

.table-card .button-compact {
  min-width: 4.75rem;
}

.page-surface a[class*="bg-blue-"],
.page-surface a[class*="bg-green-"] {
  background-color: var(--abasc-blue-700) !important;
  color: white !important;
}

.page-surface a[class*="text-blue-"] {
  color: var(--abasc-blue-800) !important;
}

.page-surface .bg-green-800,
.page-surface .bg-green-700,
.page-surface .bg-green-600 {
  background-color: var(--abasc-blue-700) !important;
}

.page-surface .border-green-400,
.page-surface .border-green-500,
.page-surface .border-green-600 {
  border-color: var(--abasc-blue-500) !important;
}

.page-surface .text-green-600,
.page-surface .text-green-700,
.page-surface .text-green-800 {
  color: var(--abasc-blue-800) !important;
}

.page-surface .overflow-x-auto {
  border: 1px solid var(--abasc-border-soft);
  border-radius: var(--abasc-radius);
  box-shadow: none;
}

.page-surface table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  font-size: 0.88rem;
}

.page-surface thead {
  background: var(--abasc-blue-50);
}

.page-surface th {
  color: var(--abasc-blue-950);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.page-surface th,
.page-surface td {
  border-bottom: 1px solid var(--abasc-border-soft);
  padding: 0.75rem;
  vertical-align: top;
}

.page-surface tbody tr:hover {
  background: #f8fbfd;
}

.page-surface nav[aria-label="Pagination"] {
  margin-top: 1rem;
}

.app-dialog input,
.app-dialog select {
  width: 100%;
}

@media (min-width: 1024px) {
  .menu-button {
    display: none;
  }

  .app-sidebar {
    position: sticky;
    top: var(--abasc-header-height);
    height: calc(100vh - var(--abasc-header-height));
    flex: 0 0 var(--abasc-sidebar-width);
    transform: none;
  }

  .drawer-overlay {
    display: none !important;
  }

  .app-content {
    width: calc(100% - var(--abasc-sidebar-width));
  }
}

@media (max-width: 767px) {
  .app-header-inner {
    gap: 0.5rem;
  }

  .app-logo {
    width: 2.75rem;
    height: 2.75rem;
  }

  .app-brand-copy span,
  .header-user,
  .workspace-badge,
  .header-link {
    display: none;
  }

  .header-actions {
    gap: 0.35rem;
  }

  .app-main {
    padding: 0.65rem;
  }

  .page-surface {
    border-radius: var(--abasc-radius);
    padding: 1rem;
  }

  .page-surface .flex.justify-between,
  .page-surface .flex.items-center.justify-between {
    align-items: stretch;
    flex-direction: column;
    gap: 0.75rem;
  }

  .page-surface .flex.flex-row {
    flex-wrap: wrap;
  }

  .page-surface th,
  .page-surface td {
    padding: 0.6rem;
  }

  .form-actions > *,
  .page-surface .flex.justify-end > * {
    width: 100%;
  }

  .app-footer {
    flex-wrap: wrap;
  }
}

@media (max-width: 420px) {
  .app-brand-copy strong {
    max-width: 8.5rem;
    font-size: 0.95rem;
  }

  .app-brand-copy span {
    display: none;
  }

  .button-compact {
    padding-inline: 0.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Shared page and dashboard components */
.page {
  width: 100%;
}

.page-header,
.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-header h1,
.section-heading h2 {
  margin: 0;
}

.page-intro {
  max-width: 48rem;
  margin: 0.4rem 0 0;
  color: var(--abasc-muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card,
.dashboard-panel,
.action-card {
  border: 1px solid var(--abasc-border-soft);
  border-radius: var(--abasc-radius);
  background: white;
}

.stat-card {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  box-shadow: var(--abasc-shadow-sm);
}

.stat-card > span {
  color: var(--abasc-muted);
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.stat-card > strong {
  color: var(--abasc-blue-900);
  font-family: Raleway, sans-serif;
  font-size: 2rem;
}

.stat-card > a {
  width: fit-content;
  font-size: 0.83rem;
  font-weight: 700;
}

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

.dashboard-panel {
  padding: 1.1rem;
}

.section-heading {
  margin-bottom: 1rem;
}

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

.action-card,
.action-card:visited {
  display: grid;
  gap: 0.2rem;
  padding: 0.85rem;
  color: var(--abasc-ink);
  text-decoration: none;
  transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.action-card:hover {
  border-color: var(--abasc-blue-300);
  color: var(--abasc-ink);
  box-shadow: var(--abasc-shadow-sm);
  transform: translateY(-1px);
}

.action-card strong {
  color: var(--abasc-blue-900);
}

.action-card span {
  color: var(--abasc-muted);
  font-size: 0.85rem;
}

.empty-state {
  border: 1px dashed var(--abasc-border);
  border-radius: var(--abasc-radius);
  background: var(--abasc-blue-50);
  color: var(--abasc-muted);
  padding: 1.5rem;
  text-align: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--abasc-blue-100);
  color: var(--abasc-blue-900);
  font-size: 0.75rem;
  font-weight: 800;
  padding: 0.25rem 0.55rem;
}

.entry-status-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: 0.4rem 0.85rem; font-size: 0.9rem; font-weight: 800; }
.entry-status-badge.is-open { background: var(--abasc-success-soft); color: var(--abasc-success); }
.entry-status-badge.is-closed { background: #f1f5f9; color: #475569; }
.meet-status-badge.is-draft { background: #fef3c7; color: #92400e; }
.meet-status-badge.is-archived { background: #e2e8f0; color: #334155; }

.status-success {
  background: var(--abasc-success-soft);
  color: var(--abasc-success);
}

.status-warning {
  background: var(--abasc-warning-soft);
  color: var(--abasc-warning);
}

.table-card {
  overflow-x: auto;
  border: 1px solid var(--abasc-border-soft);
  border-radius: var(--abasc-radius);
  background: white;
}

@media (max-width: 900px) {
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .page-header {
    align-items: stretch;
    flex-direction: column;
  }

  .page-header > .button {
    width: 100%;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }
}

/* Authentication and migrated content surfaces */
.auth-card {
  width: min(100%, 30rem);
  margin-inline: auto;
  border: 1px solid var(--abasc-border);
  border-radius: var(--abasc-radius-lg);
  background: rgb(255 255 255 / 0.97);
  box-shadow: var(--abasc-shadow);
  padding: clamp(1.25rem, 4vw, 2rem);
}

.auth-card form,
.auth-card input:not([type="checkbox"]):not([type="radio"]) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.auth-heading {
  margin-bottom: 1.4rem;
  text-align: center;
}

.auth-heading h1 {
  margin: 0.2rem 0 0.55rem;
  color: var(--abasc-ink);
  font-family: Raleway, sans-serif;
  font-size: clamp(1.55rem, 4vw, 2rem);
}

.auth-heading p:last-child,
.auth-help p {
  margin: 0;
  color: var(--abasc-muted);
}

.auth-submit {
  width: 100%;
}

.auth-help {
  margin-top: 1.4rem;
  border-top: 1px solid var(--abasc-border-soft);
  padding-top: 1.1rem;
}

.auth-help h2 {
  margin: 0 0 0.35rem;
  color: var(--abasc-ink);
  font-size: 0.95rem;
}

.auth-help a,
.auth-return a {
  display: inline-block;
  margin-top: 0.65rem;
  font-weight: 700;
}

.auth-return {
  margin: 1rem 0 0;
  text-align: center;
}

.content-panel {
  border: 1px solid var(--abasc-border-soft);
  border-radius: var(--abasc-radius);
  background: white;
  box-shadow: var(--abasc-shadow-sm);
  padding: clamp(0.85rem, 2vw, 1.25rem);
}

.page > h1:first-child {
  margin-top: 0;
}

.page > h1:first-child + p {
  color: var(--abasc-muted);
}

.page .bg-gray-50 {
  background-color: var(--abasc-blue-50);
}

.page .shadow-md,
.page .shadow-lg {
  box-shadow: var(--abasc-shadow-sm);
}

.page .rounded,
.page .rounded-md,
.page .rounded-lg {
  border-radius: var(--abasc-radius-sm);
}

.page .bg-yellow-100 {
  border-color: #e5c46b;
  background-color: var(--abasc-warning-soft);
  color: var(--abasc-warning);
}

.page .bg-red-100 {
  background-color: var(--abasc-danger-soft);
}

.page .text-red-600,
.page .text-red-700,
.page .text-red-800,
.page .text-red-900 {
  color: var(--abasc-danger);
}

.page form.space-y-4,
.page form.space-y-5,
.page form.space-y-6 {
  display: grid;
  gap: 1rem;
}

.page dl {
  color: var(--abasc-ink);
}

.page dt {
  color: var(--abasc-muted);
}

@media (max-width: 640px) {
  .table-card {
    margin-inline: -0.25rem;
    border-radius: var(--abasc-radius-sm);
  }

  .table-card table {
    min-width: 42rem;
  }

  .page section[class*="p-5"],
  .page section[class*="p-6"],
  .content-panel {
    padding: 0.85rem;
  }

  .page dl.grid-cols-2,
  .page dl[class*="grid-cols-"] {
    grid-template-columns: minmax(0, 1fr);
  }

  .page .grid.md\:grid-cols-2,
  .page .grid.lg\:grid-cols-2 {
    grid-template-columns: minmax(0, 1fr);
  }

  .page input,
  .page select,
  .page textarea {
    max-width: 100%;
  }
}

/* Swimmer-facing tables become labelled cards on phones. */
@media (max-width: 767px) {
  .responsive-card-table {
    display: block;
    min-width: 0 !important;
    background: transparent;
  }

  .responsive-card-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .responsive-card-table tbody {
    display: grid;
    gap: 0.75rem;
  }

  .responsive-card-table tr[data-responsive-card="true"] {
    display: grid;
    overflow: hidden;
    border: 1px solid var(--abasc-border);
    border-radius: var(--abasc-radius);
    background: white;
    box-shadow: var(--abasc-shadow-sm);
  }

  .responsive-card-table tr[data-responsive-card="true"] td {
    display: grid;
    grid-template-columns: minmax(7.5rem, 38%) minmax(0, 1fr);
    gap: 0.75rem;
    align-items: center;
    border: 0;
    border-bottom: 1px solid var(--abasc-border-soft);
    padding: 0.7rem 0.8rem;
    text-align: left;
  }

  .responsive-card-table tr[data-responsive-card="true"] td:last-child {
    border-bottom: 0;
  }

  .responsive-card-table tr[data-responsive-card="true"] td::before {
    content: attr(data-label);
    color: var(--abasc-muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .responsive-card-table tr[data-responsive-card="true"] td form,
  .responsive-card-table tr[data-responsive-card="true"] td .button {
    width: 100%;
  }

  .responsive-card-table tr[data-responsive-card="true"] td button {
    width: 100%;
    min-height: 2.75rem;
  }

  .table-card:has(.responsive-card-table) {
    overflow: visible;
    border: 0;
    background: transparent;
  }

  .table-card .responsive-card-table {
    min-width: 0;
  }
}
