/* Albano Trainer Web-Cockpit (https://trainer.albano-rowing.com) */
:root {
  --bg: #eef3f8;
  --surface: #ffffff;
  --ink: #0b2035;
  --ink-2: #50657a;
  --line: #d4dfea;
  --water-deep: #0a2f4f;
  --water-mid: #164973;
  --orange: #f28a1e;
  --orange-hover: #e27a0e;
  --orange-ink: #a14e00;
  --buoy: #e5383b;
  --ok-bg: #e7f6ed;
  --ok-ink: #166534;
  --warn-bg: #fdebd3;
  --warn-ink: #9a4700;
  --muted-bg: #edf2f7;
  --selected-bg: #eef6fd;
  --e2e-bg: #e8f5ed;
  --e2e-border: #b7dec5;
  --e2e-ink: #165c32;
  --shadow: 0 8px 26px rgba(10, 47, 79, 0.08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 3px solid var(--orange);
  outline-offset: 2px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--orange);
  color: #0b2035;
  padding: 0.5rem 1rem;
  font-weight: 700;
  z-index: 50;
}
.skip:focus { left: 0.75rem; top: 0.75rem; }

.cockpit-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.cockpit-header {
  background: var(--water-deep);
  color: #ffffff;
}
.cockpit-header-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 0 1.5rem;
  min-height: 58px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
}
.header-left {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}
.brand-mark {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 800;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
}
.group-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.group-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 0.34rem 2rem 0.34rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 650;
  cursor: pointer;
}
.group-select option, .lang-select option { color: var(--ink); background: #ffffff; }
.group-caret {
  position: absolute;
  right: 0.72rem;
  color: #ffffff;
  font-size: 0.98rem;
  pointer-events: none;
}
.header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.lang-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.lang-select {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 0.28rem 1.85rem 0.28rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.cockpit-tabs {
  display: flex;
  align-items: stretch;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.tab-btn {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #c2d7ea;
  padding: 1rem 0.1rem 0.85rem;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
}
.tab-btn:hover { color: #ffffff; }
.tab-btn.is-active {
  color: #ffffff;
  font-weight: 700;
  border-bottom-color: var(--orange);
}

.buoys {
  height: 14px;
  background:
    radial-gradient(circle, var(--buoy) 0 3.8px, transparent 4.3px) 18px 50%/116px 14px repeat-x,
    radial-gradient(circle, #c8d5e3 0 2px, transparent 2.5px) 42px 50%/29px 14px repeat-x;
  border-bottom: 1px solid #e1e8f0;
}

.cockpit-main {
  flex: 1;
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  padding: 1.3rem 1.5rem 1rem;
}

.cockpit-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.56fr) minmax(330px, 0.92fr);
  gap: 1.25rem;
  align-items: stretch;
}

.two-col-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(300px, 0.9fr);
  gap: 1.25rem;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.25rem 1.3rem;
  box-shadow: var(--shadow);
}

.matrix-head {
  display: flex;
  flex-wrap: nowrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}
.matrix-title {
  margin: 0;
  font-size: 1.04rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: nowrap;
}
.kw-arrow {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.15rem;
  line-height: 1;
  padding: 0.1rem 0.25rem;
  color: var(--ink);
}
.kw-arrow:hover { background: var(--muted-bg); }
.matrix-sub {
  margin: 0.22rem 0 0;
  color: var(--ink-2);
  font-size: 0.81rem;
}

.btn-orange {
  background: var(--orange);
  color: #0b2035;
  border: 0;
  border-radius: 999px;
  padding: 0.48rem 0.88rem;
  font-weight: 750;
  font-size: 0.81rem;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}
.btn-orange:hover { background: var(--orange-hover); }
.btn-orange:disabled { opacity: 0.6; cursor: wait; }

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
  margin-bottom: 0.95rem;
}
.chip {
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.68rem;
  font-size: 0.77rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
}
.chip:hover { border-color: var(--water-deep); }
.chip.is-active {
  background: var(--water-deep);
  color: #ffffff;
  border-color: var(--water-deep);
}

.matrix-table-wrap { overflow-x: auto; }
.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.matrix-table thead th {
  text-align: left;
  padding: 0.5rem 0.45rem;
  color: var(--ink-2);
  font-weight: 700;
  font-size: 0.78rem;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.matrix-table tbody tr {
  border-bottom: 1px solid #ebf0f6;
}
.matrix-table tbody tr.is-selected {
  background: var(--selected-bg);
}
.ath-cell {
  text-align: left;
  padding: 0.65rem 0.5rem 0.65rem 0.35rem;
  vertical-align: middle;
}
.athlete-row-btn {
  background: transparent;
  border: 0;
  padding: 0;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.ath-name { font-weight: 750; color: var(--ink); font-size: 0.88rem; }
.ath-meta { color: var(--ink-2); font-size: 0.76rem; font-weight: 500; }

.matrix-td, .noconsent-cell {
  padding: 0.5rem 0.35rem;
  vertical-align: middle;
}
.cell-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.77rem;
  font-weight: 700;
  border: 1px solid transparent;
  white-space: nowrap;
}
button.cell-pill { cursor: pointer; }
button.cell-pill.is-selected {
  box-shadow: 0 0 0 2px rgba(240, 125, 26, 0.34), 0 2px 8px rgba(10, 47, 79, 0.1);
  border-color: rgba(240, 125, 26, 0.65);
}
.pill-ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill-warn { background: var(--warn-bg); color: var(--warn-ink); }
.pill-planned { background: var(--muted-bg); color: var(--ink-2); }
.pill-free { background: #f5f8fb; color: #7c8ea0; font-weight: 600; }
.pill-muted {
  display: flex;
  width: 100%;
  background: var(--muted-bg);
  color: var(--ink-2);
  font-weight: 600;
  padding: 0.4rem 0.8rem;
}

.dossier-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.dossier-box {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  background: #ffffff;
}
.dossier-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.dossier-title { margin: 0; font-size: 0.98rem; font-weight: 800; }
.badge-active {
  background: var(--ok-bg);
  color: var(--ok-ink);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-warn {
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
  white-space: nowrap;
}
.badge-muted {
  background: var(--muted-bg);
  color: var(--ink-2);
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: 999px;
}
.dossier-sub {
  margin: 0.3rem 0 0.7rem;
  color: var(--ink-2);
  font-size: 0.8rem;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}
.chart-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.45rem 0.55rem 0.3rem;
  background: #fbfdff;
}
.chart-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.15rem;
}
.mini-chart-svg { width: 100%; height: auto; display: block; }

.splits-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-bottom: 0.75rem;
}
.splits-table th {
  text-align: left;
  color: var(--ink-2);
  font-weight: 650;
  padding: 0.3rem 0.3rem;
  border-bottom: 1px solid var(--line);
}
.splits-table td {
  padding: 0.28rem 0.3rem;
  border-bottom: 1px solid #f0f4f8;
}

.athlete-note {
  margin: 0 0 0.75rem;
  padding: 0.55rem 0.75rem;
  background: #f5f9fd;
  border-left: 3px solid #1c6fb8;
  border-radius: 0 8px 8px 0;
  font-size: 0.8rem;
  color: var(--ink);
}

.fb-form {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.fb-input, .text-input, .shorthand-textarea, .seat-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.48rem 0.7rem;
  font-size: 0.82rem;
  background: #ffffff;
}
.seat-input { max-width: 160px; padding: 0.32rem 0.55rem; }

.btn-navy-sm {
  background: var(--water-deep);
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}
.btn-navy-sm:hover { background: var(--water-mid); }

.export-block { display: flex; flex-direction: column; gap: 0.5rem; }
.export-title { margin: 0 0 0.15rem; font-size: 0.9rem; font-weight: 800; }
.btn-export-primary {
  width: 100%;
  background: var(--water-deep);
  color: #ffffff;
  border: 0;
  border-radius: 999px;
  padding: 0.62rem 1rem;
  font-size: 0.84rem;
  font-weight: 750;
  cursor: pointer;
}
.btn-export-primary:hover { background: var(--water-mid); }
.btn-export-secondary {
  width: 100%;
  background: #ffffff;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.56rem 1rem;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
}
.btn-export-secondary:hover { border-color: var(--water-deep); }

.e2e-notice {
  background: var(--e2e-bg);
  border: 1px solid var(--e2e-border);
  color: var(--e2e-ink);
  border-radius: 12px;
  padding: 0.75rem 0.9rem;
  font-size: 0.79rem;
  line-height: 1.4;
}

.cockpit-footer {
  max-width: 1380px;
  width: 100%;
  margin: 0 auto;
  padding: 0.55rem 1.5rem 1.2rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  color: var(--ink-2);
  font-size: 0.82rem;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.9rem;
}
.footer-link {
  color: var(--water-deep);
  text-decoration: underline;
  font-weight: 600;
}
.footer-link:hover { color: var(--ink); }

.panel-title { margin: 0 0 0.35rem; font-size: 1.12rem; font-weight: 800; }
.stack-form { display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.8rem; }
.field-label { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.82rem; font-weight: 650; }
.builder-actions, .crew-actions, .modal-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.btn-ghost-danger {
  background: transparent;
  border: 1px solid #e7b5b5;
  color: #9e1c1c;
  border-radius: 999px;
  padding: 0.42rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
}
.crew-card, .tpl-row {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  margin-top: 0.75rem;
}
.crew-card-head, .tpl-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.crew-name { margin: 0; font-size: 0.96rem; font-weight: 750; }
.crew-class, .tpl-sub { display: block; font-size: 0.8rem; color: var(--ink-2); }
.crew-members-list { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.75rem; }
.crew-member-row { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; }
.crew-member-label { display: flex; align-items: center; gap: 0.45rem; font-size: 0.85rem; }

.preview-canonical {
  background: var(--selected-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.8rem;
  font-size: 0.84rem;
  font-weight: 650;
}
.error-box, .error-text { color: #a81c1c; font-weight: 650; font-size: 0.84rem; }
.info-banner {
  background: var(--selected-bg);
  border: 1px solid #bed7ef;
  color: var(--water-deep);
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  font-size: 0.82rem;
  font-weight: 600;
}
.syntax-list { padding-left: 1.2rem; font-size: 0.82rem; color: var(--ink-2); }
.syntax-list li { margin: 0.3rem 0; }

.auth-card { max-width: 540px; margin: 2rem auto; }
.auth-footer { margin-top: 1rem; display: flex; flex-direction: column; gap: 0.6rem; }
.auth-oauth-actions { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.65rem; }
.uuid-row {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--ink-2);
}
.uuid-text { word-break: break-all; }
.btn-copy-xs {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.18rem 0.55rem;
  font-size: 0.74rem;
  font-weight: 650;
  cursor: pointer;
}
.btn-copy-xs:hover { border-color: var(--water-deep); }
.copy-status { font-size: 0.74rem; color: var(--ok-ink); font-weight: 650; }
.qr-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 12px;
  margin: 0.8rem 0;
}
.qr-svg { width: 196px; height: 196px; display: block; }
.pairing-code-big { margin: 0; font-size: 1.2rem; font-weight: 800; letter-spacing: 0.08em; }
.key-facts { display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 0.9rem; font-size: 0.82rem; }
.key-facts dt { color: var(--ink-2); font-weight: 650; }
.key-facts dd { margin: 0; font-weight: 600; word-break: break-all; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(6, 20, 36, 0.55);
  display: grid;
  place-items: center;
  padding: 1rem;
  z-index: 60;
}
.modal-dialog {
  background: #ffffff;
  border-radius: 16px;
  max-width: 620px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  padding: 1.3rem 1.4rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}
.modal-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.check-grid { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.check-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.82rem;
}
.modal-sub-wrap { display: flex; flex-direction: column; gap: 0.5rem; }
.is-hidden { display: none; }
.noscript-box { max-width: 600px; margin: 3rem auto; padding: 1.5rem; background: #ffffff; border-radius: 14px; }

@media (max-width: 980px) {
  .cockpit-grid, .two-col-panel { grid-template-columns: 1fr; }
}

.btn-header-invite {
  background: var(--orange);
  color: #0b2035;
  border: 0;
  border-radius: 999px;
  padding: 0.34rem 0.8rem;
  font-size: 0.8rem;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}
.btn-header-invite:hover { background: var(--orange-hover); }

.matrix-head-actions, .panel-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.modal-dialog-wide { max-width: 720px; }
.invite-section {
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  margin-top: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.invite-sec-title { margin: 0; font-size: 0.95rem; font-weight: 800; }
.invite-sec-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.invite-list-wrap { display: flex; flex-direction: column; gap: 0.45rem; }
.invite-cand-row, .invite-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.75rem;
  background: #ffffff;
}
.invite-cand-row { justify-content: flex-start; cursor: pointer; }
.invite-cand-row.is-disabled { opacity: 0.72; cursor: default; background: #f7fafd; }
.invite-cand-info { display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.invite-cand-name { font-size: 0.88rem; }
.invite-tags-row { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; }
.invite-tag {
  background: var(--selected-bg);
  color: var(--water-deep);
  border: 1px solid #c7dcf0;
  border-radius: 999px;
  padding: 0.14rem 0.52rem;
  font-size: 0.73rem;
  font-weight: 650;
}
.invite-warn-box {
  background: var(--warn-bg);
  color: var(--warn-ink);
  border: 1px solid #f5c898;
  border-radius: 10px;
  padding: 0.55rem 0.8rem;
  margin: 0;
  font-size: 0.82rem;
  font-weight: 650;
}
.invite-qr-wrap { margin-top: 0.25rem; }

