/* Settings: the club's team, seasons and teams. */

.settings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--text-small);
}

.settings-row:last-child {
  border-bottom: 0;
}

.settings-row>span:first-child {
  color: var(--muted);
}

.settings-row strong {
  font-weight: 500;
  color: var(--navy-3);
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: var(--space-5);
}

.settings-panel {
  padding: var(--space-5);
  margin-bottom: 25px;
  padding-bottom: var(--space-5);
}

.settings-panel .form-section {
  font-size: var(--text-body);
}

.settings-panel form {
  margin-top: 20px;
}

.settings-panel .settings-row {
  font-size: var(--text-small);
  flex-wrap: wrap;
}

.staff-title {
  margin: 14px 0 6px;
  font-size: var(--text-small);
  font-weight: 600;
  color: var(--navy-3);
}

/* A coach's teams in the people list. */
.member-teams {
  flex-basis: 100%;
}

.staff-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: var(--text-small);
}

.staff-row>:first-child {
  flex: 1;
}

.staff-row form {
  margin: 0;
}

.settings-panel .staff-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  gap: var(--space-3);
  margin-top: 10px;
}

.staff-form label {
  margin: 0;
  font-size: var(--text-label);
}

.staff-form .btn {
  width: auto;
  margin: 0;
  min-height: var(--control-height);
}

@media (max-width: 960px) {
  .settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .settings-row strong {
    max-width: 70%;
    text-align: right;
  }

  .settings-row {
    gap: 15px;
    flex-wrap: wrap;
    font-size: var(--text-small);
  }

  .settings-panel .staff-form {
    grid-template-columns: 1fr 1fr;
  }

  .staff-form .btn {
    grid-column: 1/-1;
  }
}

/* Fee settings: one box per age group whose fees can differ from the club's. */
.fee-age-group legend {
  font-weight: 700;
  padding: 0 6px;
}

.staff-team-editor {
  border-top: 1px solid var(--line);
  padding-top: 18px;
  margin-top: 20px;
}

.staff-team-editor h3 { font-size: var(--text-subheading); margin: 0 0 var(--space-2); }
.staff-team-editor label { font-size: var(--text-label); line-height: 1.5; }
.modal .staff-team-help { font-size: var(--text-small); line-height: 1.6; color: var(--muted); }
.staff-team-editor .error { font-size: var(--text-body); line-height: 1.5; }

.modal .staff-team-editor>label { margin: var(--space-3) 0 var(--space-2); }
.staff-team-editor .btn { margin-top: var(--space-3); }

.settings-panel>.form-section:first-child { margin-top: 0; }
.settings-panel .staff-form input[type=submit], .settings-panel .staff-form>.helper { grid-column: 1 / -1; }
.settings-panel .staff-form input[type=submit] { justify-self: start; }
.staff-row { flex-wrap: wrap; }
@media (max-width: 700px) {
  .settings-panel { padding: var(--space-4); }
  .settings-panel .staff-form { grid-template-columns: minmax(0, 1fr); }
}

/* Club settings page (settings/show): the short panels in an even grid, then
   people, history and teams at full width. Every panel opens with the shared
   section head. */
.settings-grid>.settings-panel { margin-bottom: 0; }
.settings-panel .section-head h2 { font-size: var(--text-heading); }
.settings-panel .settings-subhead { margin: var(--space-5) 0 var(--space-2); font-size: var(--text-subheading); }
.settings-panel .section-head+.helper, .settings-panel .settings-subhead+.helper { margin-top: 0; }

/* A role per line, as many ticked as the person holds. */
.role-choices { display: grid; grid-column: 1 / -1; gap: var(--space-2); min-width: 0; margin: 0 0 var(--space-3); padding: 0; border: 0; }
.role-choices legend { margin-bottom: var(--space-2); padding: 0; }

@media (max-width: 480px) {
  .settings-panel .staff-form input[type=submit] { width: 100%; }
}

/* Staff team assignments (staff_team_assignments/edit): each team's save
   button follows its role choice without a second divider. */
.staff-team-editor .form-actions { margin-top: var(--space-3); padding-top: 0; border-top: 0; }

/* Settings sections: tabs on a laptop; on a phone the same links wrap as
   plain labels, the open one a navy chip (A-Definicoes-P), under a link back
   to the Mais page that stands in for the club's name. */
.settings-phone-back { display: none; }

@media (max-width: 700px) {
  .settings-phone-back { display: inline-flex; }
  .settings-head .page-head .eyebrow { display: none; }
  .settings-tabs { flex-wrap: wrap; gap: var(--space-2); overflow: visible; border-bottom: 0; }
  .settings-tabs a { min-height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: none; color: var(--muted); font-size: var(--text-label); }
  .settings-tabs a.selected { background: var(--navy); box-shadow: none; color: var(--on-navy); }
}

/* The office's review pages (correction_requests, document_requests): a
   family's request beside the data it changes, one row per field, the
   requested value in bold. Long values wrap; the table scrolls only if it
   must. */
.correction-table-wrap { margin-top: var(--space-3); overflow-x: auto; }
.correction-table { white-space: normal; }
.correction-table th, .correction-table td { padding: 10px var(--space-3); vertical-align: top; overflow-wrap: anywhere; }
.correction-table tbody th { width: 30%; background: var(--surface); border-bottom: 1px solid var(--line); color: var(--muted); font-size: var(--text-small); font-weight: 500; }
.correction-table td { color: var(--ink); }
.correction-table td.is-proposed { font-weight: 650; }
