/* App styles on top of Pico.css. Pages must work at 375px wide. */

:root {
  --short-staffed: #f59e0b;
}

.brand {
  text-decoration: none;
}

footer {
  padding-block: 2rem;
  color: var(--pico-muted-color);
}

/* Session cards turn amber when fewer coaches are assigned than needed. */
.short-staffed {
  border-left: 4px solid var(--short-staffed);
}

@media (max-width: 480px) {
  main.container {
    padding-inline: 0.75rem;
  }
}

/* Sign-in and other single-form pages. */
.narrow {
  max-width: 28rem;
  margin-inline: auto;
}

/* Sign-out button sitting in the nav bar. */
.inline-form {
  margin: 0;
}
.inline-form button {
  margin: 0;
  padding: 0.35rem 0.8rem;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
}
.page-head > * {
  margin: 0;
}

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

tr.muted td {
  color: var(--pico-muted-color);
}

.error-note {
  padding: 0.75rem 1rem;
  border-left: 4px solid var(--pico-del-color);
  background: var(--pico-card-sectioning-background-color);
}

.copy-link {
  font-family: var(--pico-font-family-monospace);
  font-size: 0.85rem;
}

/* Import preview. */
.badge {
  display: inline-block;
  padding: 0.05rem 0.5rem;
  border-radius: 1rem;
  font-size: 0.8em;
  font-weight: 600;
  white-space: nowrap;
}
.badge-new {
  background: #d1fae5;
  color: #065f46;
}
.badge-update {
  background: #dbeafe;
  color: #1e40af;
}
.badge-duplicate,
.badge-unchanged {
  background: #e5e7eb;
  color: #374151;
}
.badge-error {
  background: #fee2e2;
  color: #991b1b;
}
tr.row-duplicate td,
tr.row-unchanged td {
  color: var(--pico-muted-color);
}
tr.row-error td:first-child {
  border-left: 4px solid #dc2626;
}
.reasons {
  margin: 0.25rem 0 0;
  padding-left: 1rem;
  font-size: 0.85em;
}
.reasons li {
  margin: 0;
}
ul.summary {
  list-style: none;
  padding: 0;
}
ul.summary li {
  list-style: none;
}
table.example {
  font-size: 0.85em;
}

/* Roster. */
.week-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
  margin-bottom: 1rem;
}
.week-nav [role='button'] {
  padding: 0.3rem 0.8rem;
}
.view-toggle {
  display: flex;
  gap: 1rem;
}
.view-toggle a[aria-current='page'] {
  font-weight: 700;
  text-decoration: underline;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.filters select,
.filters button {
  width: auto;
  margin: 0;
}
.copy-week button {
  width: auto;
}
.week-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}
@media (min-width: 1100px) {
  .week-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
}
.day h2 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}
.session-card {
  padding: 0.75rem;
  margin-bottom: 0.75rem;
  font-size: 0.9rem;
}
.session-card > header,
.session-card > footer {
  margin: -0.75rem -0.75rem 0.5rem;
  padding: 0.5rem 0.75rem;
}
.session-card > footer {
  margin: 0.5rem -0.75rem -0.75rem;
}
.session-card .count {
  float: right;
  font-weight: 600;
}
.count-short,
.short-text {
  color: #b45309;
}
.coach-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem;
}
.coach-list li {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
}
.coach-list .actions {
  display: flex;
  gap: 0.25rem;
}
.small-btn {
  padding: 0.15rem 0.5rem;
  font-size: 0.8rem;
  width: auto;
  margin: 0;
}
.assign-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0;
}
.assign-form select {
  flex: 1 1 8rem;
  margin: 0;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
}
.lead-check {
  margin: 0;
  font-size: 0.85rem;
}
.clash {
  flex-basis: 100%;
  color: #b45309;
}
.warn-note {
  padding: 0.5rem 0.75rem;
  border-left: 4px solid var(--short-staffed);
  background: #fffbeb;
  color: #78350f;
  font-size: 0.85rem;
}
.none,
.notes {
  color: var(--pico-muted-color);
}
tr.row-short td:first-child {
  border-left: 4px solid var(--short-staffed);
}
.badge-lead {
  background: #ede9fe;
  color: #5b21b6;
  margin-left: 0.35rem;
}
.badge-assistant {
  background: #e5e7eb;
  color: #374151;
}
.badge-confirmed {
  background: #d1fae5;
  color: #065f46;
}
.badge-requested {
  background: #fef3c7;
  color: #92400e;
}
.badge-meet {
  background: #dbeafe;
  color: #1e40af;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* My shifts. */
.shift-day h2 {
  font-size: 1.05rem;
  margin: 1.25rem 0 0.5rem;
}
.shifts {
  list-style: none;
  padding: 0;
}
.shifts li {
  list-style: none;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: var(--pico-border-radius);
  background: var(--pico-card-background-color);
  box-shadow: var(--pico-card-box-shadow);
}
.session-card.mine {
  outline: 2px solid var(--pico-primary-border);
}
.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.admin-actions > * {
  margin: 0;
  width: auto;
}

/* Meets. */
.meet-grid th,
.meet-grid td {
  font-size: 0.85rem;
  vertical-align: top;
  min-width: 7.5rem;
}
.meet-grid th[scope='row'] {
  white-space: nowrap;
  min-width: 8rem;
}
.meet-grid .cell .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.25rem;
}
.meet-grid .cell .notes {
  display: block;
}
.cell-confirmed {
  background: #ecfdf5;
}
.cell-requested {
  background: #fffbeb;
}
.cell-declined {
  background: #f3f4f6;
}
.badge-draft {
  background: #e5e7eb;
  color: #374151;
}
.badge-open {
  background: #d1fae5;
  color: #065f46;
}
.badge-closed,
.badge-declined {
  background: #f3f4f6;
  color: #6b7280;
}
.meet-sessions {
  list-style: none;
  padding: 0;
}
.meet-sessions li {
  list-style: none;
  padding: 0.6rem 0.75rem;
  margin-bottom: 0.5rem;
  border: 1px solid var(--pico-muted-border-color);
  border-radius: var(--pico-border-radius);
}
.signup-choice {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}
.signup-choice > span:first-of-type {
  flex: 1;
}
.meet-sessions input[type='text'] {
  margin: 0.4rem 0 0;
}
.sheet-session h2 {
  font-size: 1.05rem;
  margin-top: 1.25rem;
}

@media print {
  body > header,
  body > footer,
  .no-print {
    display: none;
  }
  .sheet-session {
    break-inside: avoid;
  }
}
.grid-edit {
  font-size: 0.8rem;
  font-weight: normal;
}

/* Seasons. */
.season-status {
  margin-bottom: 1.5rem;
}
.season-group > header h3 {
  margin: 0;
}
.slot-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  gap: 0 0.75rem;
}
.add-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}
.add-group > * {
  flex: 1 1 10rem;
  margin: 0;
}
.add-group button {
  flex: 0 0 auto;
  width: auto;
}
.skips {
  padding-left: 1rem;
}
.skips .inline-form {
  display: inline;
}

/* Top menu: on narrow screens the links wrap onto extra rows instead of
   pushing the page wider than the screen. */
@media (max-width: 760px) {
  body > header nav {
    flex-wrap: wrap;
  }
  body > header nav ul {
    flex-wrap: wrap;
    margin-left: 0;
  }
  body > header nav ul:last-child {
    margin-right: 0;
  }
  body > header nav li {
    padding: 0.3rem 0.45rem;
  }
  body > header nav .inline-form button {
    padding: 0.25rem 0.6rem;
  }
}
.slot-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.75rem;
}
.slot-list li {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

/* Hours. */
.hours-table td {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.hours-table thead th:not(:first-child) {
  text-align: right;
}
.hours-table .total-row th,
.hours-table .total-row td {
  font-weight: 700;
  border-top: 2px solid var(--pico-muted-border-color);
}
.entry-list {
  list-style: none;
  padding: 0;
}
.entry-list li {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
}

/* Field hints and errors sit just below their label (see Field). */
label:has(+ .field-help) {
  margin-bottom: 0;
}
label:has(+ .field-help) > input {
  margin-bottom: 0.25rem;
}
.field-help {
  display: block;
  margin-bottom: var(--pico-spacing);
  color: var(--pico-muted-color);
}
.field-error {
  color: var(--pico-del-color);
}
.report-table tfoot th,
.report-table tfoot td {
  font-weight: 700;
}
.report-table .total-cell {
  font-weight: 600;
}
.detail-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}
/* The report's five columns must fit a phone without sideways scrolling. */
@media (max-width: 480px) {
  .report-table th,
  .report-table td {
    padding: 0.45rem 0.3rem;
    font-size: 0.82rem;
  }
  .report-table th[scope='row'] {
    max-width: 7.5rem;
  }
}

/* Club admin tabs and pages. */
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--pico-muted-border-color);
}
.admin-tabs a[aria-current='page'] {
  font-weight: 700;
  text-decoration: underline;
}
.squad-list {
  list-style: none;
  padding: 0;
}
.squad-list li {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
}
.squad-rename {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex: 1 1 14rem;
  margin: 0;
}
.squad-rename input {
  margin: 0;
  padding: 0.3rem 0.6rem;
}
.squad-list .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.audit-list {
  list-style: none;
  padding: 0;
}
.audit-list li {
  list-style: none;
  display: grid;
  grid-template-columns: 10.5rem 1fr;
  gap: 0.25rem 0.75rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
  font-size: 0.9rem;
}
.audit-list .notes {
  overflow-wrap: anywhere;
}
.audit-when {
  color: var(--pico-muted-color);
  font-variant-numeric: tabular-nums;
}
@media (max-width: 480px) {
  .audit-list li {
    grid-template-columns: 1fr;
  }
}
nav.admin-tabs {
  justify-content: flex-start;
}
/* Buttons in a row of actions: Pico gives form buttons a bottom margin (for
   spacing below form fields), which made them sit higher than link buttons. */
.admin-actions button {
  margin-bottom: 0;
}
/* Pico spreads the items of every <nav> apart; keep these together. */
nav.week-nav {
  justify-content: flex-start;
}
/* Leave room for the dropdown arrow in the small "Add coach…" selects. */
.assign-form select {
  padding-right: 2rem;
  background-position: center right 0.5rem;
}
.filters {
  margin-bottom: 0.75rem;
}

/* Workout plans and notes. */
.workout-link {
  font-size: 0.85rem;
  font-weight: 600;
}
.card-details {
  margin: 0.4rem 0 0;
}
.card-details summary {
  font-size: 0.85rem;
}
.card-details textarea,
.card-details input {
  font-size: 0.85rem;
  padding: 0.35rem 0.5rem;
  margin-bottom: 0.4rem;
}
.weekly-plans {
  margin-bottom: 1rem;
}
.weekly-plans h2 {
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}
.weekly-plans ul {
  list-style: none;
  padding: 0;
  margin: 0 0 0.3rem;
}
.weekly-plans li {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.75rem;
  align-items: center;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--pico-muted-border-color);
}
.plan-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
  margin: 0;
  flex: 1 1 18rem;
}
.plan-form input {
  flex: 1 1 12rem;
  margin: 0;
  padding: 0.3rem 0.5rem;
  font-size: 0.85rem;
}
.plan-form button {
  margin: 0;
}
.card-details {
  margin-bottom: 0.6rem;
}
/* A practice whose group is not set yet (from a calendar import). */
.no-group {
  color: #b45309;
  font-style: italic;
}
.replace-summary {
  border-left: 4px solid var(--short-staffed);
}

/* Help page (/help) */
nav.help-toc { display: block; }
nav.help-toc ul { display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 0 1.25rem; padding: 0; margin: 0 0 1.5rem; }
nav.help-toc li { list-style: none; padding: 0.25rem 0; }
.help-section { margin-bottom: 2.5rem; }
.help-topic { margin: 0 0 1.25rem; padding: 1rem; }
.help-topic h3 { margin-bottom: 0.5rem; }
.help-shot { margin: 0.75rem 0 0; }
.help-shot img { display: block; width: 100%; max-width: 375px; height: auto; border: 1px solid var(--pico-muted-border-color); border-radius: 6px; }
.help-shot.help-wide img { max-width: 100%; }
.help-shot figcaption { font-size: 0.85em; color: var(--pico-muted-color); }
.help-answers dt { font-weight: 600; margin-top: 0.75rem; }
.help-answers dd { margin: 0.25rem 0 0; }

/* My account: calendar feed */
#calendar { margin-top: 2rem; }
.cal-howto { padding-left: 1.1rem; }
.cal-howto li { margin-bottom: 0.5rem; }

/* Leaving close to the start: the optional reason above the button */
.leave-late input[name="reason"] { flex: 1 1 100%; margin: 0; padding: 0.3rem 0.5rem; font-size: 0.85rem; }
.leave-late button { flex: 1 1 100%; }
