/* U.S. Soccer–inspired palette: deep navy fields, crest red accents, crisp type */
:root {
  color-scheme: dark;
  --ussf-navy: #1f2742;
  --ussf-navy-deep: #0d1018;
  --ussf-navy-mid: #151b2e;
  --ussf-panel: #1a2235;
  --ussf-panel-raised: #232d45;
  --ussf-red: #bb2533;
  --ussf-red-bright: #d12d3d;
  --ussf-red-dim: #8f1d28;
  --ussf-white: #f8f8f6;
  --ussf-muted: #9aa3b8;
  --ussf-border: rgba(255, 255, 255, 0.08);
  --ussf-border-strong: rgba(255, 255, 255, 0.14);
  --font-body: "Barlow", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Barlow Semi Condensed", "Barlow", sans-serif;

  --bg: var(--ussf-navy-deep);
  --panel: var(--ussf-panel);
  --panel-2: var(--ussf-panel-raised);
  --text: var(--ussf-white);
  --muted: var(--ussf-muted);
  --primary: var(--ussf-red);
  --danger: #e85d5d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  background-image: radial-gradient(ellipse 120% 80% at 50% -20%, rgba(31, 39, 66, 0.85), transparent 55%),
    linear-gradient(180deg, #0f1422 0%, var(--bg) 45%);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 1.25rem;
  background: linear-gradient(180deg, var(--ussf-navy-mid) 0%, #121826 100%);
  border-bottom: 3px solid var(--ussf-red);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.app-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ussf-white);
}

.header-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 2.5rem;
}

.auth-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.header-profile {
  position: relative;
  display: flex;
  align-items: center;
}

.header-avatar {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border-radius: 50%;
  border: 2px solid var(--ussf-border-strong);
  background: var(--ussf-panel-raised);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.header-avatar:hover {
  border-color: var(--ussf-red);
  box-shadow: 0 0 0 2px rgba(187, 37, 51, 0.35);
}

.header-avatar:focus-visible {
  outline: 2px solid var(--ussf-red);
  outline-offset: 2px;
}

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

.header-avatar-initials {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ussf-white);
  user-select: none;
}

.header-dropdown {
  position: absolute;
  top: calc(100% + 0.45rem);
  right: 0;
  min-width: 11rem;
  padding: 0.35rem 0;
  background: var(--ussf-panel);
  border: 1px solid var(--ussf-border-strong);
  border-radius: 4px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  z-index: 50;
}

.header-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.55rem 0.9rem;
  margin: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.12s ease, color 0.12s ease;
}

.header-dropdown-item:hover {
  background: rgba(187, 37, 51, 0.12);
  color: var(--ussf-white);
}

.header-dropdown-item-admin {
  color: #b8c5e0;
  border-top: 1px solid var(--ussf-border);
  margin-top: 0.2rem;
  padding-top: 0.65rem;
}

.header-dropdown-item-admin:hover {
  color: var(--ussf-white);
}

.header-dropdown-logout {
  color: #f0a8a8;
  border-top: 1px solid var(--ussf-border);
  margin-top: 0.2rem;
  padding-top: 0.65rem;
}

.header-dropdown-logout:hover {
  background: rgba(187, 37, 51, 0.18);
  color: #fff;
}

.profile-fields {
  margin: 0;
  display: grid;
  gap: 1rem;
}

.profile-fields dt {
  margin: 0 0 0.2rem;
  font-size: 0.75rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.profile-fields dd {
  margin: 0;
  font-size: 1rem;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.25rem 1rem;
  display: grid;
  gap: 1rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--ussf-border-strong);
  border-radius: 4px;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.card h2,
.card h3 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.04em;
}

.card h2 {
  font-size: 1.35rem;
  text-transform: uppercase;
  margin-top: 0;
  border-left: 4px solid var(--ussf-red);
  padding-left: 0.65rem;
  margin-bottom: 1rem;
}

.card h3 {
  font-size: 1rem;
  color: var(--ussf-white);
  margin-top: 1.25rem;
}

.form {
  display: grid;
  gap: 0.75rem;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  border-radius: 3px;
  border: 1px solid var(--ussf-border-strong);
  background: rgba(13, 16, 24, 0.55);
  color: var(--text);
  padding: 0.65rem 0.8rem;
  font-family: var(--font-body);
  font-size: 1rem;
}

.form input::placeholder,
.form textarea::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--ussf-red);
  box-shadow: 0 0 0 1px rgba(187, 37, 51, 0.35);
}

.form button[type="submit"] {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.75rem 1rem;
  border-radius: 3px;
  border: none;
  background: var(--ussf-red);
  color: var(--ussf-white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.form button[type="submit"]:hover {
  background: var(--ussf-red-bright);
}

.form button[type="submit"]:active {
  transform: scale(0.99);
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--ussf-border);
}

button {
  cursor: pointer;
  font-family: var(--font-body);
}

.tabs button {
  padding: 0.5rem 0.85rem;
  border-radius: 3px;
  border: 1px solid var(--ussf-border-strong);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.tabs button:hover:not(.active):not(.hidden) {
  color: var(--ussf-white);
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.04);
}

.tabs button.active {
  background: var(--ussf-red);
  border-color: var(--ussf-red);
  color: var(--ussf-white);
}

.auth-toggle {
  display: flex;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.auth-toggle button {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border-radius: 3px;
  border: 1px solid var(--ussf-border-strong);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.auth-toggle button:hover:not(.active) {
  color: var(--ussf-white);
  background: rgba(255, 255, 255, 0.05);
}

.auth-toggle button.active {
  background: var(--ussf-red);
  border-color: var(--ussf-red);
  color: var(--ussf-white);
}

.auth-bar button {
  padding: 0.5rem 1.1rem;
  border-radius: 3px;
  border: 1px solid var(--ussf-white);
  background: transparent;
  color: var(--ussf-white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.auth-bar button:hover {
  background: var(--ussf-white);
  color: var(--ussf-navy-deep);
  border-color: var(--ussf-white);
}

.hidden {
  display: none !important;
}

.grid-2 {
  display: grid;
  gap: 1rem;
}

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.75rem;
}

.stat {
  background: var(--panel-2);
  border: 1px solid var(--ussf-border-strong);
  border-radius: 4px;
  padding: 0.85rem;
}

.stat strong {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ussf-white);
}

.muted {
  color: var(--muted);
}

.list {
  display: grid;
  gap: 0.65rem;
}

.list-item {
  background: var(--panel-2);
  border: 1px solid var(--ussf-border-strong);
  border-left: 3px solid var(--ussf-red);
  border-radius: 3px;
  padding: 0.7rem 0.85rem;
}

.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  background: var(--ussf-panel);
  color: var(--ussf-white);
  border: 1px solid var(--ussf-border-strong);
  border-left: 4px solid var(--ussf-red);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  font-weight: 500;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.4);
}

@media (max-width: 768px) {
  .app-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.65rem;
  }

  .header-nav {
    width: 100%;
    justify-content: flex-start;
  }
}

/* ------------------------------------------------------------------ */
/* Schedule tab refresh: Coach Cisco inspired card and modal design.  */
/* ------------------------------------------------------------------ */
.schedule-shell {
  display: grid;
  gap: 1rem;
}

.schedule-hero {
  background: #002b5c;
  border-radius: 16px;
  color: #ffffff;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.schedule-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
}

.schedule-hero h2 {
  margin: 0;
  color: #ffffff;
}

.schedule-hero .muted {
  margin: 0.2rem 0 0;
  color: rgba(255, 255, 255, 0.82);
}

.schedule-add-btn {
  background: #ffffff;
  color: #002b5c;
  border-color: rgba(255, 255, 255, 0.45);
}

.schedule-add-btn:hover {
  background: #eef4ff;
}

.schedule-toolbar {
  display: grid;
  gap: 0.75rem;
}

.schedule-team-select {
  margin: 0;
}

.schedule-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.schedule-filters button {
  border: 1px solid #ccd7e6;
  background: #ffffff;
  color: #234067;
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
}

.schedule-filters button.active {
  background: #002b5c;
  color: #ffffff;
  border-color: #002b5c;
}

.schedule-list {
  display: grid;
  gap: 0.75rem;
}

.schedule-card {
  width: 100%;
  text-align: left;
  cursor: pointer;
  border: 1px solid #d8e2ef;
  background: #ffffff;
  border-radius: 18px;
  padding: 0.9rem;
  display: grid;
  grid-template-columns: 82px 1fr;
  gap: 0.85rem;
  box-shadow: 0 8px 24px rgba(18, 43, 76, 0.08);
}

.schedule-card:hover {
  border-color: #aec4e8;
  box-shadow: 0 12px 28px rgba(18, 43, 76, 0.12);
}

.schedule-card:focus-visible {
  outline: 2px solid #7aa2e3;
  outline-offset: 2px;
}

.schedule-card-date {
  border-radius: 14px;
  background: #f2f7ff;
  border: 1px solid #d9e6fb;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 0.12rem;
  min-height: 104px;
}

.schedule-card-day-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2rem;
  line-height: 1;
  color: #0f3568;
}

.schedule-card-day-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: #38557b;
}

.schedule-card-main {
  min-width: 0;
  display: grid;
  gap: 0.28rem;
}

.schedule-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
}

.schedule-time-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #e9f1ff;
  color: #163f72;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.24rem 0.56rem;
}

.schedule-type-badge {
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 0.24rem 0.56rem;
}

.schedule-type-game {
  background: #ffe8eb;
  color: #93223b;
}

.schedule-type-training {
  background: #e9f9f3;
  color: #0f6d4b;
}

.schedule-type-event {
  background: #ecefff;
  color: #334fa0;
}

.schedule-card-title {
  margin: 0.18rem 0 0;
  font-size: 1.02rem;
  color: #132f54;
}

.schedule-meta {
  color: #567092;
  font-size: 0.87rem;
}

.schedule-notes {
  margin-top: 0.28rem;
  background: #f8fbff;
  border: 1px solid #e1e9f4;
  border-radius: 10px;
  padding: 0.5rem 0.6rem;
  color: #354d6d;
  font-size: 0.86rem;
}

.schedule-card-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.45rem;
}

.schedule-attendance-btn {
  min-height: 2rem;
  padding: 0.35rem 0.75rem;
}

.weather-widget {
  border-radius: 12px;
  border: 1px solid #dbe6f5;
  background: #f7faff;
  color: #1e3f66;
}

.weather-widget-compact {
  margin-top: 0.4rem;
  padding: 0.45rem 0.6rem;
}

.weather-compact-top {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
}

.weather-compact-bottom {
  margin-top: 0.1rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.2rem;
  font-size: 0.79rem;
  color: #557395;
}

.weather-icon {
  line-height: 1;
  font-size: 1.1rem;
}

.weather-temp-range {
  font-size: 0.92rem;
}

.weather-widget-detail {
  margin-top: 0.8rem;
  padding: 0.75rem;
}

.weather-detail-meta p {
  margin: 0 0 0.28rem;
}

.weather-detail-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin: 0.4rem 0 0.5rem;
}

.weather-icon-lg {
  font-size: 2rem;
}

.weather-detail-condition {
  font-weight: 700;
  color: #17385e;
}

.weather-detail-temp {
  color: #365d8a;
  font-weight: 700;
}

.weather-detail-grid {
  display: grid;
  gap: 0.5rem;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}

.weather-detail-grid div {
  border-radius: 10px;
  border: 1px solid #dce8f7;
  background: #ffffff;
  padding: 0.45rem 0.55rem;
  display: grid;
  gap: 0.1rem;
}

.weather-detail-grid span {
  color: #6782a3;
  font-size: 0.75rem;
}

.weather-detail-grid strong {
  color: #214a78;
  font-size: 0.84rem;
}

.weather-widget-unavailable {
  margin-top: 0.45rem;
  padding: 0.48rem 0.58rem;
  font-size: 0.82rem;
  color: #5f7796;
}

.weather-widget-loading {
  margin-top: 0.4rem;
  padding: 0.48rem 0.58rem;
  display: grid;
  gap: 0.38rem;
}

.weather-skeleton {
  border-radius: 999px;
  background: linear-gradient(90deg, #e2ebf8 20%, #f0f6ff 45%, #e2ebf8 70%);
  background-size: 200% 100%;
  animation: weather-shimmer 1.2s ease infinite;
}

.weather-skeleton-line {
  height: 0.62rem;
}

.weather-skeleton-line-short {
  width: 72%;
}

@keyframes weather-shimmer {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.schedule-empty {
  border: 1px dashed #cbd8eb;
  border-radius: 14px;
  background: #f8fbff;
  padding: 1.1rem;
  color: #49678f;
}

.schedule-modal {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.schedule-modal-nested {
  z-index: 260;
}

.schedule-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 31, 54, 0.52);
}

.schedule-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 34rem;
  max-height: min(90vh, 760px);
  overflow: auto;
  background: #ffffff;
  border: 1px solid #dce5f2;
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -16px 36px rgba(18, 43, 76, 0.24);
}

.schedule-modal-head {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid #e0e8f4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.schedule-modal-head h3 {
  margin: 0;
}

.schedule-modal-body {
  padding: 1rem;
}

.schedule-modal-subtitle {
  margin: 0 0 0.8rem;
  color: #5f7898;
}

.schedule-manage-row {
  border: 1px solid #d8e3f2;
  border-radius: 12px;
  background: #f9fbff;
  padding: 0.65rem;
  margin-bottom: 0.65rem;
}

.schedule-address-suggestions {
  margin-top: 0.4rem;
  border: 1px solid #d5e2f4;
  border-radius: 10px;
  background: #ffffff;
  max-height: 220px;
  overflow-y: auto;
}

.schedule-address-option {
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  padding: 0.55rem 0.65rem;
  display: grid;
  gap: 0.12rem;
}

.schedule-address-option + .schedule-address-option {
  border-top: 1px solid #edf2fa;
}

.schedule-address-option:hover {
  background: #f5f9ff;
}

.schedule-address-option small {
  color: #607a9c;
  font-size: 0.78rem;
}

.schedule-address-hint {
  padding: 0.55rem 0.65rem;
  color: #607a9c;
  font-size: 0.85rem;
}

.schedule-location-preview {
  border: 1px solid #d9e5f5;
  border-radius: 12px;
  padding: 0.65rem;
  background: #f8fbff;
  display: grid;
  gap: 0.5rem;
}

.schedule-location-preview-text strong {
  color: #17385e;
}

.schedule-location-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.45rem;
}

.schedule-location-preview-actions .roster-btn-secondary {
  min-height: 2rem;
  padding: 0.35rem 0.6rem;
}

.schedule-open-maps-link {
  display: inline-flex;
  align-items: center;
  font-size: 0.82rem;
  color: #1a5cc2;
  text-decoration: none;
  font-weight: 600;
}

.schedule-open-maps-link:hover {
  text-decoration: underline;
}

.schedule-open-maps-link-sm {
  margin-top: 0.15rem;
}

.schedule-location-map,
.schedule-detail-map {
  width: 100%;
  height: 170px;
  border: 1px solid #dbe6f6;
  border-radius: 12px;
  background: #eef3fb;
}

.schedule-detail-map-wrap {
  display: grid;
  gap: 0.45rem;
  margin: 0.5rem 0;
}

.schedule-detail-map {
  height: 220px;
}

.schedule-type-picker {
  display: grid;
  gap: 0.55rem;
}

.schedule-type-choice {
  width: 100%;
  border: 1px solid #d2deed;
  background: #f8fbff;
  color: #173f73;
  padding: 0.75rem 0.8rem;
  border-radius: 12px;
  font-weight: 700;
}

.schedule-type-choice:hover {
  background: #edf4ff;
}

.schedule-form {
  display: grid;
  gap: 0.72rem;
  padding: 1rem;
}

.schedule-form-actions {
  display: flex;
  gap: 0.5rem;
}

.schedule-form-actions .roster-btn-primary,
.schedule-form-actions .roster-btn-secondary {
  flex: 1;
}

.schedule-checkbox-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
}

.schedule-inline-error {
  margin: 0;
  padding: 0.75rem 1rem 0;
  color: #9e2f2f;
  font-size: 0.9rem;
}

.schedule-detail-body {
  padding: 1rem;
}

.schedule-detail-body p {
  margin: 0 0 0.45rem;
  color: #2b4364;
}

.schedule-attendance-modal-panel {
  max-width: 46rem;
}

.attendance-modal-actions {
  border-top: 1px solid #e0e8f4;
  border-bottom: none;
}

.attendance-mode-pill {
  margin-left: auto;
  margin-right: 0.45rem;
  border-radius: 999px;
  border: 1px solid #d6e3f3;
  background: #f3f8ff;
  color: #355c8d;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.55rem;
}

.attendance-inline-message {
  padding: 0;
  margin-bottom: 0.8rem;
}

.attendance-inline-success {
  margin: 0 0 0.8rem;
  border: 1px solid #b9e9d2;
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  background: #edfdf4;
  color: #1f7d4f;
  font-size: 0.88rem;
}

.attendance-player-list {
  display: grid;
  gap: 0.65rem;
}

.attendance-player-row {
  border: 1px solid #d9e6f5;
  border-radius: 12px;
  background: #f9fbff;
  padding: 0.65rem;
}

.attendance-player-main {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.6rem;
  align-items: center;
}

.attendance-player-headshot {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  overflow: hidden;
  border: 1px solid #d1deef;
  background: #e8f0fd;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.attendance-player-headshot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.attendance-player-fallback {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #224976;
}

.attendance-player-meta {
  min-width: 0;
}

.attendance-player-name {
  font-weight: 700;
  color: #193d67;
}

.attendance-player-number {
  color: #5b7596;
  font-size: 0.82rem;
}

.attendance-status-actions {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.attendance-status-btn {
  border-radius: 999px;
  border: 1px solid transparent;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.4rem 0.58rem;
}

.attendance-status-btn-attended {
  background: #e5f8ec;
  color: #1c7b4b;
}

.attendance-status-btn-absent {
  background: #ffe7ea;
  color: #99223d;
}

.attendance-status-btn-sick {
  background: #e6f3ff;
  color: #2e5f99;
}

.attendance-status-btn-available {
  background: #e5f8ec;
  color: #1c7b4b;
}

.attendance-status-btn-not-available {
  background: #ffe7ea;
  color: #99223d;
}

.attendance-status-btn.active {
  border-color: #133966;
  box-shadow: inset 0 0 0 1px rgba(19, 57, 102, 0.2);
}

.attendance-player-detail {
  margin-top: 0.6rem;
  border-top: 1px dashed #cfdeef;
  padding-top: 0.55rem;
  display: grid;
  gap: 0.45rem;
}

.attendance-inline-choice {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

.attendance-detail-label {
  font-size: 0.84rem;
  color: #526f92;
  font-weight: 600;
}

.attendance-mini-btn {
  border-radius: 999px;
  border: 1px solid #c8d9ed;
  background: #fff;
  color: #264871;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.28rem 0.62rem;
}

.attendance-mini-btn.active {
  background: #0f3b72;
  border-color: #0f3b72;
  color: #fff;
}

.attendance-reason-text {
  margin-top: 0.25rem;
  color: #405d82;
  font-size: 0.85rem;
  border-left: 2px solid #c8d9ed;
  padding-left: 0.55rem;
}

.attendance-reason-panel {
  max-width: 28rem;
}

.attendance-date-field input,
.attendance-notes-field textarea {
  width: 100%;
}

@media (min-width: 620px) {
  .schedule-modal {
    align-items: center;
    padding: 1rem;
  }

  .schedule-modal-panel {
    border-radius: 16px;
    box-shadow: 0 20px 42px rgba(18, 43, 76, 0.22);
  }
}

@media (max-width: 560px) {
  .schedule-card {
    grid-template-columns: 64px 1fr;
    gap: 0.7rem;
    padding: 0.7rem;
  }

  .schedule-card-day-num {
    font-size: 1.65rem;
  }

  .schedule-form-actions {
    flex-direction: column;
  }

  .attendance-status-actions {
    grid-template-columns: 1fr;
  }
}

/* ——— Roster tab ——— */
#rosters.card {
  padding: 1rem 1.1rem;
}

#rosters .roster-gate,
#rosters .roster-empty {
  margin: 0.5rem 0 0;
  font-size: 1rem;
}

.roster-api-message {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: 3px;
  border: 1px solid rgba(232, 93, 93, 0.45);
  background: rgba(232, 93, 93, 0.12);
  color: #f5c4c4;
  font-size: 0.95rem;
}

.roster-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.roster-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-left: 4px solid var(--ussf-red);
  padding-left: 0.65rem;
}

.roster-btn-primary,
.roster-btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5rem;
  padding: 0.55rem 1rem;
  border-radius: 3px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.roster-btn-primary {
  background: var(--ussf-red);
  color: var(--ussf-white);
}

.roster-btn-primary:hover {
  background: var(--ussf-red-bright);
}

.roster-btn-secondary {
  background: transparent;
  color: var(--muted);
  border-color: var(--ussf-border-strong);
}

.roster-btn-secondary:hover {
  color: var(--ussf-white);
  border-color: rgba(255, 255, 255, 0.22);
}

.roster-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-top: 0.75rem;
}

.roster-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  margin: 0;
  border: 1px solid var(--ussf-border-strong);
  border-radius: 4px;
  border-left: 3px solid var(--ussf-red);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.roster-card:hover {
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(35, 45, 69, 0.95);
}

.roster-card:focus-visible {
  outline: 2px solid var(--ussf-red);
  outline-offset: 2px;
}

.roster-avatar {
  flex-shrink: 0;
  border-radius: 4px;
  overflow: hidden;
  background: var(--ussf-panel-raised);
  border: 1px solid var(--ussf-border-strong);
  display: flex;
  align-items: center;
  justify-content: center;
}

.roster-avatar--sm {
  width: 50px;
  height: 50px;
}

.roster-avatar--sm img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  display: block;
}

.roster-avatar--lg {
  width: 96px;
  height: 96px;
  border-radius: 8px;
  margin-top: -2.5rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.roster-avatar--lg img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  display: block;
}

.roster-avatar-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 0.04em;
  color: var(--ussf-white);
}

.roster-avatar--lg .roster-avatar-fallback {
  font-size: 1.75rem;
}

.roster-card-body {
  flex: 1;
  min-width: 0;
}

.roster-card-name {
  font-size: 1rem;
  line-height: 1.25;
}

.roster-card-meta {
  margin-top: 0.2rem;
  font-size: 0.85rem;
  color: var(--muted);
}

.roster-meta-sep {
  margin: 0 0.25rem;
  opacity: 0.65;
}

.roster-card-number {
  flex-shrink: 0;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--ussf-white);
  min-width: 2rem;
  text-align: center;
}

.roster-placeholder {
  color: var(--muted);
  font-style: italic;
}

.roster-back-btn {
  display: inline-flex;
  align-items: center;
  margin: 0 0 0.75rem;
  padding: 0.4rem 0;
  border: none;
  background: none;
  color: var(--muted);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.15s ease;
}

.roster-back-btn:hover {
  color: var(--ussf-white);
}

.roster-profile-header-wrap {
  margin: 0 -1.1rem 0;
}

.roster-profile-header-wrap .roster-profile-header {
  margin: 0;
}

.roster-profile-header {
  height: 7.5rem;
  margin: 0 -1.1rem 0;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(135deg, var(--ussf-navy-mid) 0%, #1f2742 50%, var(--ussf-red-dim) 100%);
  background-size: cover;
  background-position: center top;
}

.roster-profile-header-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
  padding: 0.35rem 0.25rem 0.15rem;
}

.roster-btn-sm {
  font-size: 0.78rem;
  padding: 0.28rem 0.65rem;
}

.roster-profile-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 0.5rem 1rem;
}

.roster-profile-name {
  margin: 0.65rem 0 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: none;
  border: none;
  padding: 0;
}

.roster-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.75rem 0 1rem;
}

.roster-profile-fields {
  margin: 0;
  display: grid;
  gap: 0.85rem;
}

.roster-profile-fields dt {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.roster-profile-fields dd {
  margin: 0;
  font-size: 0.98rem;
  word-break: break-word;
}

.roster-family-section {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--ussf-border);
}

.roster-family-section h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1rem;
}

.roster-family-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  margin-bottom: 0.75rem;
}

.roster-family-list {
  display: grid;
  gap: 0.55rem;
}

.roster-family-card {
  padding: 0.65rem 0.8rem;
  background: var(--panel-2);
  border: 1px solid var(--ussf-border-strong);
  border-radius: 3px;
  border-left: 3px solid var(--ussf-red);
}

.roster-family-name {
  font-weight: 600;
}

.roster-family-type {
  font-size: 0.8rem;
  margin-top: 0.15rem;
}

.roster-family-contact {
  font-size: 0.85rem;
  margin-top: 0.35rem;
  color: var(--muted);
}

.roster-family-empty {
  margin: 0;
}

.roster-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

@media (min-width: 540px) {
  .roster-modal {
    align-items: center;
    padding: 1rem;
  }
}

.roster-modal.hidden {
  display: none !important;
}

.roster-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 8, 14, 0.72);
  cursor: pointer;
}

.roster-modal-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  max-height: min(92vh, 640px);
  overflow: auto;
  margin: 0;
  padding: 0;
  background: var(--ussf-panel);
  border: 1px solid var(--ussf-border-strong);
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.5);
}

@media (min-width: 540px) {
  .roster-modal-panel {
    border-radius: 8px;
  }
}

.roster-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--ussf-border);
}

.roster-modal-head h3 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border: none;
  padding: 0;
}

.roster-modal-close {
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  border-radius: 3px;
  background: transparent;
  color: var(--muted);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.roster-modal-close:hover {
  color: var(--ussf-white);
  background: rgba(255, 255, 255, 0.06);
}

.roster-modal-form {
  display: grid;
  gap: 0.5rem;
  padding: 1rem;
}

.roster-field-label {
  font-size: 0.72rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 0.25rem;
}

.roster-upload-hint {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  line-height: 1.35;
}

.roster-modal-form input,
.roster-modal-form select {
  width: 100%;
  border-radius: 3px;
  border: 1px solid var(--ussf-border-strong);
  background: rgba(13, 16, 24, 0.55);
  color: var(--text);
  padding: 0.6rem 0.75rem;
  font-family: var(--font-body);
  font-size: 1rem;
}

.roster-modal-form input:focus,
.roster-modal-form select:focus {
  outline: none;
  border-color: var(--ussf-red);
  box-shadow: 0 0 0 1px rgba(187, 37, 51, 0.35);
}

.roster-photo-preview {
  margin: 0.25rem 0 0.5rem;
  border-radius: 4px;
  border: 1px dashed var(--ussf-border-strong);
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(13, 16, 24, 0.35);
}

.roster-photo-preview img {
  max-width: 100%;
  max-height: 200px;
  object-fit: contain;
}

.roster-photo-preview--empty {
  padding: 1rem;
  text-align: center;
  font-size: 0.9rem;
}

.roster-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.roster-modal-actions .roster-btn-primary,
.roster-modal-actions .roster-btn-secondary {
  flex: 1;
  min-width: 7rem;
}

.image-crop-modal-panel {
  max-width: min(52rem, 96vw);
  max-height: min(94vh, 760px);
}

.image-crop-body {
  display: grid;
  gap: 0.85rem;
  padding: 0.9rem 1rem 0.35rem;
}

.image-crop-stage-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #0c1322;
  overflow: hidden;
  min-height: min(58vw, 340px);
}

.image-crop-stage {
  --crop-width: 100%;
  --crop-height: 100%;
  --crop-radius: 12px;
  position: relative;
  width: 100%;
  height: min(58vw, 340px);
  overflow: hidden;
  cursor: grab;
  touch-action: none;
}

.image-crop-stage:active {
  cursor: grabbing;
}

.image-crop-stage > img {
  position: absolute;
  user-select: none;
  -webkit-user-drag: none;
}

.image-crop-mask {
  pointer-events: none;
  position: absolute;
  inset: 0;
}

.image-crop-mask::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: var(--crop-width);
  height: var(--crop-height);
  transform: translate(-50%, -50%);
  border-radius: var(--crop-radius);
  box-shadow: 0 0 0 100vmax rgba(8, 12, 24, 0.62);
  border: 2px solid rgba(255, 255, 255, 0.92);
}

.image-crop-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
}

.image-crop-zoom-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.image-crop-controls input[type="range"] {
  width: 100%;
  margin: 0;
}

.image-crop-preview-wrap {
  display: flex;
  justify-content: flex-end;
}

.image-crop-preview {
  width: 110px;
  height: 110px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  background: #f4f8ff;
}

.image-crop-preview--round {
  border-radius: 999px;
}

.image-crop-preview-image {
  width: 100%;
  height: 100%;
  background-repeat: no-repeat;
}

.image-crop-error {
  margin: 0;
  font-size: 0.85rem;
  color: #b42828;
}

.image-crop-actions {
  padding: 0.35rem 1rem 1rem;
  margin-top: 0;
}

/* ── Responsive improvements ─────────────────────────────────────── */

/* Two-column layout for .grid-2 on wider viewports */
@media (min-width: 640px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}

/* Scrollable tab bar — prevents awkward wrapping with long labels */
@media (max-width: 600px) {
  .tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 0.5rem;
    margin-bottom: 0.85rem;
  }

  .tabs::-webkit-scrollbar {
    display: none;
  }

  .tabs button {
    flex-shrink: 0;
    white-space: nowrap;
  }
}

/* Condensed spacing on small phones (≤ 480 px) */
@media (max-width: 480px) {
  .container {
    padding: 0.65rem;
    gap: 0.75rem;
  }

  .card {
    padding: 0.9rem 0.85rem;
  }

  #rosters.card {
    padding: 0.85rem;
  }

  .image-crop-body {
    padding: 0.75rem 0.8rem 0.25rem;
  }

  .image-crop-stage-wrap,
  .image-crop-stage {
    min-height: min(70vw, 300px);
    height: min(70vw, 300px);
  }

  .image-crop-actions {
    padding: 0.3rem 0.8rem 0.8rem;
  }

  /* Keep the hero banner flush with the card edges after padding change */
  .roster-profile-header-wrap {
    margin-left: -0.85rem;
    margin-right: -0.85rem;
  }
}

/* Toast spans screen width on small phones */
@media (max-width: 480px) {
  .toast {
    left: 0.75rem;
    right: 0.75rem;
    bottom: max(0.75rem, env(safe-area-inset-bottom, 0.75rem));
  }
}

/* Safe-area insets: notch, Dynamic Island, home indicator */
.app-header {
  padding-left: max(1.25rem, calc(0.75rem + env(safe-area-inset-left, 0px)));
  padding-right: max(1.25rem, calc(0.75rem + env(safe-area-inset-right, 0px)));
}

/* ------------------------------------------------------------------ */
/* Major design refresh: light, card-first, mobile-first UI system.   */
/* This section intentionally overrides the earlier dark defaults.     */
/* ------------------------------------------------------------------ */
:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --text: #162235;
  --muted: #5f6f86;
  --primary: #2a66f6;
  --primary-soft: #ebf2ff;
  --primary-border: #bed2ff;
  --danger: #d94242;
  --success: #127a57;
  --border: #dbe4f0;
  --border-strong: #cad8ea;
  --shadow-sm: 0 4px 16px rgba(22, 34, 53, 0.06);
  --shadow-md: 0 14px 32px rgba(22, 34, 53, 0.1);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
}

body {
  background: linear-gradient(180deg, #f8fbff 0%, #f4f7fb 36%, #eff4fa 100%);
  color: var(--text);
}

.app-header {
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(22, 34, 53, 0.03);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-brand {
  display: grid;
  gap: 0.1rem;
}

.app-title {
  color: var(--text);
  font-size: 1.25rem;
  text-transform: none;
  letter-spacing: 0.01em;
}

.app-subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.container {
  max-width: 1200px;
  padding: 1rem;
  gap: 1rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1rem;
}

.card h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
  border-left: 0;
  padding-left: 0;
  color: var(--text);
}

.card h3 {
  color: var(--text);
  font-size: 1rem;
  margin: 0;
}

.tab-shell,
.section-stack {
  display: grid;
  gap: 1rem;
}

.content-block {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.95rem;
  display: grid;
  gap: 0.7rem;
}

.tabs {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.5rem;
  gap: 0.45rem;
  margin-bottom: 0.9rem;
}

.tabs button {
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.88rem;
}

.tabs button:hover:not(.active):not(.hidden) {
  color: var(--text);
  border-color: var(--border);
  background: #f3f7ff;
}

.tabs button.active {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: #1746bc;
}

.auth-toggle {
  background: #f6f9ff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.35rem;
  gap: 0.35rem;
}

.auth-toggle button {
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--muted);
  text-transform: none;
}

.auth-toggle button.active {
  background: var(--primary-soft);
  border-color: var(--primary-border);
  color: #1746bc;
}

.form {
  gap: 0.85rem;
}

.form-field {
  display: grid;
  gap: 0.4rem;
}

.form-field > span {
  font-size: 0.82rem;
  font-weight: 600;
  color: #30445f;
}

.form input,
.form select,
.form textarea,
.roster-modal-form input,
.roster-modal-form select {
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--text);
  padding: 0.68rem 0.8rem;
}

.form input::placeholder,
.form textarea::placeholder {
  color: #8ea0ba;
}

.form input:focus,
.form select:focus,
.form textarea:focus,
.roster-modal-form input:focus,
.roster-modal-form select:focus {
  border-color: #8fb0ff;
  box-shadow: 0 0 0 3px rgba(42, 102, 246, 0.14);
}

/* Major button treatment update for consistent primary/secondary actions. */
button,
.roster-btn-primary,
.roster-btn-secondary,
.form button[type="submit"],
.auth-bar button {
  border-radius: 10px;
}

.form button[type="submit"],
.roster-btn-primary {
  background: var(--primary);
  color: #ffffff;
  border: 1px solid transparent;
  text-transform: none;
  letter-spacing: 0.01em;
  font-size: 0.92rem;
}

.form button[type="submit"]:hover,
.roster-btn-primary:hover {
  background: #1f57dc;
}

.roster-btn-secondary {
  background: #ffffff;
  color: #29466f;
  border: 1px solid var(--border-strong);
  text-transform: none;
  letter-spacing: 0.01em;
}

.roster-btn-secondary:hover {
  background: #f6f9ff;
  color: #18345d;
}

.auth-bar button {
  border: 1px solid var(--border-strong);
  color: #29466f;
  background: #ffffff;
  text-transform: none;
  font-size: 0.88rem;
  letter-spacing: 0.01em;
}

.auth-bar button:hover {
  background: #f3f7ff;
  color: #1d355b;
  border-color: #c1d5fb;
}

.header-avatar {
  border: 1px solid var(--border-strong);
  background: #ffffff;
}

.header-avatar:hover {
  border-color: #9ebcf9;
  box-shadow: 0 0 0 3px rgba(42, 102, 246, 0.1);
}

.header-avatar-initials {
  color: #1f3c67;
}

.header-dropdown {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

.header-dropdown-item {
  color: #264567;
}

.header-dropdown-item:hover {
  background: #f3f7ff;
  color: #15345f;
}

.header-dropdown-item-admin,
.header-dropdown-logout {
  border-top-color: var(--border);
}

.header-dropdown-logout {
  color: #9d2b2b;
}

.header-dropdown-logout:hover {
  background: #fff0f0;
  color: #7f1b1b;
}

.muted {
  color: var(--muted);
}

.stats {
  gap: 0.7rem;
}

.stat {
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.stat strong {
  color: #1746bc;
  font-size: 1.4rem;
}

.list {
  gap: 0.55rem;
}

.list-item {
  background: #ffffff;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
}

.profile-fields dt {
  color: #5f7190;
}

/* Major roster visual update: keeps behavior, modernizes card readability. */
.roster-title {
  border-left: 0;
  padding-left: 0;
  text-transform: none;
  letter-spacing: 0.01em;
}

.roster-card {
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 0 rgba(22, 34, 53, 0.03);
  padding: 0.62rem 0.72rem;
}

.roster-card:hover {
  background: #f8fbff;
  border-color: #c8daf6;
  box-shadow: 0 6px 18px rgba(33, 68, 125, 0.08);
}

.roster-card-name {
  font-weight: 700;
  color: #172d4a;
}

.roster-card-meta {
  color: #6a7b93;
}

.roster-card-number {
  color: #1746bc;
  background: #edf3ff;
  border: 1px solid #ccdcfa;
  min-width: 2.35rem;
  border-radius: 10px;
  padding: 0.25rem 0.35rem;
}

.roster-avatar {
  border-radius: 12px;
  background: #eff4fb;
  border: 1px solid var(--border);
}

.roster-avatar-fallback {
  color: #37557f;
}

.roster-back-btn {
  color: #39567f;
}

.roster-back-btn:hover {
  color: #193a66;
}

.roster-profile-header {
  background: linear-gradient(135deg, #dce8ff 0%, #f0f5ff 45%, #dceef9 100%);
}

.roster-family-section {
  border-top-color: var(--border);
}

.roster-family-card {
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 12px;
  background: #ffffff;
}

.roster-family-contact {
  color: #6f8099;
}

.roster-api-message {
  border: 1px solid #f2c5c5;
  background: #fff2f2;
  color: #922c2c;
}

.roster-modal-backdrop {
  background: rgba(31, 44, 64, 0.45);
}

.roster-modal-panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -8px 32px rgba(31, 44, 64, 0.18);
}

.roster-modal-head {
  border-bottom: 1px solid var(--border);
}

.roster-field-label {
  color: #425774;
}

.roster-photo-preview {
  border: 1px dashed #c9d7eb;
  background: #f7faff;
}

.roster-modal-close {
  color: #6a7e9a;
}

.roster-modal-close:hover {
  color: #1e3c68;
  background: #f2f7ff;
}

.toast {
  background: #ffffff;
  color: #173155;
  border: 1px solid var(--border);
  border-left: 0;
  border-radius: 12px;
  box-shadow: var(--shadow-md);
}

@media (max-width: 768px) {
  .app-header {
    align-items: stretch;
  }

  .header-nav {
    justify-content: space-between;
  }
}

/* Tablet and desktop: wider spacing and richer content density. */
@media (min-width: 768px) {
  .container {
    padding: 1.35rem 1.25rem 1.6rem;
    gap: 1.2rem;
  }

  .card {
    padding: 1.2rem;
  }

  .section-stack {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

@media (min-width: 1024px) {
  .container {
    padding-top: 1.5rem;
  }

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

  .roster-list {
    gap: 0.7rem;
  }
}

@media (max-width: 480px) {
  .app-subtitle {
    font-size: 0.76rem;
  }

  .card {
    border-radius: 14px;
  }

  .content-block {
    border-radius: 12px;
    padding: 0.82rem;
  }
}

/* Major mobile navigation redesign: popup menu behavior on small viewports. */
.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: #29466f;
  min-height: 2.25rem;
  padding: 0.5rem 0.85rem;
  font-size: 0.86rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
  border-radius: 999px;
}

.mobile-menu-toggle:hover {
  background: #f3f7ff;
}

.mobile-menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(22, 33, 49, 0.34);
  backdrop-filter: blur(2px);
}

@media (max-width: 768px) {
  .app-header {
    gap: 0.6rem;
    align-items: center;
  }

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

  .mobile-menu-toggle {
    display: inline-flex;
    flex-shrink: 0;
  }

  .header-nav {
    width: 100%;
    min-width: 0;
  }

  .auth-bar {
    width: 100%;
    justify-content: stretch;
    gap: 0.45rem;
  }

  .auth-bar button {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.55rem 0.7rem;
  }

  .tabs {
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    top: calc(4.2rem + env(safe-area-inset-top, 0px));
    z-index: 130;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.45rem;
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    max-height: min(72vh, 520px);
    overflow: auto;
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.16s ease, transform 0.16s ease;
  }

  .tabs button {
    width: 100%;
    min-width: 0;
    white-space: normal;
    text-align: left;
    line-height: 1.25;
    padding: 0.62rem 0.72rem;
    font-size: 0.86rem;
  }

  body.mobile-menu-open .tabs {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  body.mobile-menu-open {
    overflow: hidden;
  }
}
