/* Utility class for horizontal button alignment */
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

:root {
  --dashboard-navy: #102542;
  --dashboard-blue: #1d4ed8;
  --dashboard-cyan: #0f766e;
  --dashboard-warm: #b45309;
  --dashboard-rose: #be123c;
  --dashboard-surface: rgba(255, 255, 255, 0.9);
}
/* App-wide styles (Tailwind is loaded via assets/vendor/). */

html, body {
  height: 100%;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.92);
}

.app-topbar__title {
  letter-spacing: -0.01em;
}

.app-topbar__subtitle {
  line-height: 1.2;
}

.app-main {
  padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
}

.app-modal__viewport {
  align-items: center;
  justify-content: center;
}

.app-modal__panel {
  width: 100%;
}

/* Make wide tables scroll nicely inside content area. */
main {
  overflow: hidden;
}

.dashboard-shell {
  position: relative;
}

.dashboard-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background:
    radial-gradient(circle at top left, rgba(96, 165, 250, 0.32), transparent 32%),
    radial-gradient(circle at top right, rgba(45, 212, 191, 0.22), transparent 28%),
    linear-gradient(135deg, #102542 0%, #173b72 58%, #1d4ed8 100%);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
}

.dashboard-hero__bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, rgba(255, 255, 255, 0.05) 0%, transparent 42%),
    linear-gradient(300deg, rgba(255, 255, 255, 0.08) 0%, transparent 38%);
  pointer-events: none;
}

.dashboard-hero__content {
  position: relative;
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  color: #eff6ff;
}

.dashboard-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(219, 234, 254, 0.9);
}

.dashboard-title {
  font-size: clamp(1.6rem, 2vw + 1rem, 2.4rem);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.dashboard-subtitle {
  max-width: 48rem;
  margin-top: 0.6rem;
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(219, 234, 254, 0.88);
}

.dashboard-hero__meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.dashboard-chip {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
}

.dashboard-chip--light {
  background: rgba(255, 255, 255, 0.12);
}

.dashboard-chip--ok {
  background: rgba(16, 185, 129, 0.14);
}

.dashboard-chip--warn {
  background: rgba(251, 191, 36, 0.16);
}

.dashboard-chip__label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.8);
}

.dashboard-chip__value {
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1;
  color: #ffffff;
}

.dashboard-stat,
.dashboard-panel {
  border-radius: 1.35rem;
  border: 1px solid #e2e8f0;
  background: var(--dashboard-surface);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.dashboard-stat {
  position: relative;
  overflow: hidden;
  padding: 1rem;
}

.dashboard-stat::after {
  content: "";
  position: absolute;
  inset: auto -1.5rem -1.5rem auto;
  width: 5rem;
  height: 5rem;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.34);
  filter: blur(12px);
}

.dashboard-stat--blue {
  background: linear-gradient(135deg, rgba(219, 234, 254, 0.95), rgba(239, 246, 255, 0.98));
}

.dashboard-stat--emerald {
  background: linear-gradient(135deg, rgba(209, 250, 229, 0.95), rgba(236, 253, 245, 0.98));
}

.dashboard-stat--amber {
  background: linear-gradient(135deg, rgba(254, 243, 199, 0.95), rgba(255, 251, 235, 0.98));
}

.dashboard-stat--rose {
  background: linear-gradient(135deg, rgba(255, 228, 230, 0.95), rgba(255, 241, 242, 0.98));
}

.dashboard-stat--slate {
  background: linear-gradient(135deg, rgba(226, 232, 240, 0.95), rgba(248, 250, 252, 0.98));
}

.dashboard-stat__label {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #475569;
}

.dashboard-stat__value {
  margin-top: 0.55rem;
  font-size: clamp(1.9rem, 3vw, 2.75rem);
  font-weight: 900;
  line-height: 1;
  color: #0f172a;
}

.dashboard-stat__meta {
  margin-top: 0.65rem;
  max-width: 20rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #475569;
}

.dashboard-panel {
  padding: 1rem;
}

.dashboard-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.dashboard-panel__title {
  font-size: 0.96rem;
  font-weight: 900;
  color: #0f172a;
}

.dashboard-panel__desc {
  margin-top: 0.25rem;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #64748b;
}

.dashboard-mini {
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 0.9rem;
}

.dashboard-mini__label {
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748b;
}

.dashboard-mini__value {
  margin-top: 0.45rem;
  font-size: 1.7rem;
  font-weight: 900;
  line-height: 1;
  color: #0f172a;
}

.dashboard-mini__meta {
  margin-top: 0.45rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #475569;
}

.dashboard-inline-stat {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: 0.95rem;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 0.85rem 0.95rem;
}

.dashboard-inline-stat__label {
  font-size: 0.82rem;
  font-weight: 700;
  color: #334155;
}

.dashboard-inline-stat__value {
  font-size: 1rem;
  font-weight: 900;
  color: #0f172a;
}

.dashboard-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  border-radius: 0.95rem;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  padding: 0.8rem 0.95rem;
  font-size: 0.88rem;
  color: #334155;
}

.dashboard-list-row strong {
  font-size: 1rem;
  font-weight: 900;
  color: #0f172a;
}

.dashboard-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.78rem 1rem;
  border-radius: 0.95rem;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 800;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.dashboard-link:hover {
  background: #111f38;
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.12);
}

.dashboard-activity-callout {
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(191, 219, 254, 0.6), rgba(239, 246, 255, 0.92));
  border: 1px solid rgba(96, 165, 250, 0.24);
  padding: 1rem;
}

.dashboard-activity-callout__value {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
  color: #0f172a;
}

.dashboard-activity-callout__text {
  margin-top: 0.35rem;
  font-size: 0.86rem;
  color: #334155;
}

.dashboard-action-card {
  display: block;
  border-radius: 1rem;
  border: 1px solid #e5e7eb;
  padding: 1rem;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.dashboard-action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.08);
  border-color: #cbd5e1;
}

.dashboard-action-card--primary {
  background: linear-gradient(135deg, rgba(29, 78, 216, 0.12), rgba(255, 255, 255, 0.95));
}

.dashboard-action-card--warm {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16), rgba(255, 255, 255, 0.95));
}

.dashboard-action-card__title {
  font-size: 0.92rem;
  font-weight: 900;
  color: #0f172a;
}

.dashboard-action-card__desc {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  line-height: 1.5;
  color: #475569;
}

@media (min-width: 768px) {
  .dashboard-hero__content {
    grid-template-columns: minmax(0, 1.6fr) minmax(16rem, 0.9fr);
    align-items: end;
    padding: 1.5rem 1.6rem;
  }

  .dashboard-hero__meta {
    justify-self: end;
    width: 100%;
    max-width: 18rem;
  }

  .dashboard-panel,
  .dashboard-stat {
    padding: 1.15rem;
  }
}

/* Gallery cards */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
  align-content: start;
}

.gallery-card {
  background: #ffffff;
  border: 1px solid #e5e7eb; /* gray-200 */
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
  cursor: pointer;
}

.gallery-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
  border-color: #d1d5db; /* gray-300 */
}

.gallery-card__media {
  background: #f9fafb; /* gray-50 */
}

.gallery-card__img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
}

.gallery-card__body {
  padding: 0.5rem 0.625rem;
  text-align: center;
}

.gallery-card__title {
  font-weight: 800;
  font-size: 0.875rem;
  line-height: 1.15;
  color: #111827; /* gray-900 */
  margin-bottom: 0.25rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gallery-card__subtitle {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280; /* gray-500 */
}

.gallery-card__subtitle-sep {
  opacity: 0.7;
}

.gallery-card__subtitle-cat {
  color: #2563eb; /* blue-600 */
}

/* Gallery "Athlete's Gallery Form" modal */
.gallery-form {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background: #ffffff;
}

.gallery-form table {
  width: 100%;
  border-collapse: collapse;
  border: 2px solid #000000;
  background: transparent;
}

.gallery-form th,
.gallery-form td {
  border: 1px solid #000000;
  min-height: 18px;
  height: 18px;
  padding: 2px;
  box-sizing: border-box;
  font-size: 11px;
  font-weight: 700;
  vertical-align: middle;
}

.gallery-form .col-side { width: 1.5in; }
.gallery-form .col-gap { width: 1.5%; }
.gallery-form .col-check { width: 3%; }
.gallery-form .col-text { width: 54%; }

.gallery-form .title-box {
  text-align: center;
  vertical-align: middle;
  background: #ffffff;
  padding: 0;
}

.gallery-form .center-text {
  text-align: center;
  vertical-align: middle;
}

.gallery-form .req-cell-container {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.gallery-form .req-letter {
  width: 20px;
  text-align: left;
  padding-left: 2px;
}

.gallery-form .req-text {
  flex: 1;
  text-align: center;
  line-height: 1.15;
}

.gallery-form .req-spacer { width: 20px; }
.gallery-form .small-text { font-size: 8.5px; }

.gallery-form .spacer-row td {
  height: 6px;
  border-left: 1px solid #000000;
  border-right: 1px solid #000000;
  background: #ffffff;
  padding: 0;
}

.gallery-form__photo {
  position: relative;
  width: min(35mm, 100%);
  height: 45mm;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.35);
  border-radius: 2px;
  overflow: hidden;
  margin: 0 auto;
}

.gallery-form__photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.gallery-form__photo-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2px 4px;
  font-size: 8.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(0, 0, 0, 0.2);
  color: #111827;
}

.gallery-form__two-col {
  display: flex;
  width: 100%;
  gap: 0;
}

.gallery-form__two-col > div {
  flex: 1;
  min-width: 0;
  padding: 0 4px;
  text-align: center;
}

.gallery-form__two-col > div + div {
  border-left: 1px solid #000000;
}

@media (max-width: 1023px) {
  .app-sidebar {
    width: min(88vw, 20rem);
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  }
}

@media (max-width: 640px) {
  .app-main {
    padding: 0.9rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }

  .app-topbar {
    padding-left: max(1rem, env(safe-area-inset-left, 0px));
    padding-right: max(1rem, env(safe-area-inset-right, 0px));
  }

  .app-topbar__subtitle {
    display: none;
  }

  .app-modal__viewport {
    align-items: flex-end;
    padding: 0;
  }

  .app-modal__panel {
    max-width: none !important;
    min-height: calc(100vh - 0.5rem);
    max-height: calc(100vh - 0.25rem);
    border-radius: 1.25rem 1.25rem 0 0 !important;
  }

  .app-modal__header {
    position: sticky;
    top: 0;
    z-index: 2;
    background: #ffffff;
  }

  .app-modal__body {
    padding: 1rem;
  }

  .app-modal__footer {
    padding-bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  }

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

  .gallery-card__body {
    padding: 0.65rem 0.6rem 0.75rem;
  }

  .gallery-card__title {
    font-size: 0.8rem;
  }

  .gallery-card__subtitle {
    font-size: 0.58rem;
    letter-spacing: 0.06em;
  }

  .gallery-modal__actions {
    width: 100%;
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .gallery-modal__actions > button {
    display: inline-flex;
    align-items: center;
    flex: 1 1 calc(50% - 0.5rem);
    justify-content: center;
  }

  .gallery-form {
    max-width: none;
  }
}
