/* MBC Treinador — estilos base. Mesmos tokens da MBC (cores, raios, letra) para as duas apps parecerem uma. */
:root {
  --bg: #FAF9F7; --surface: #FFFFFF; --surface-2: #F4F3F0; --border: #E8E8E8;
  --text: #1F2937; --text-2: #6B7280; --text-3: #9CA3AF;
  --p-50: #EEF6F8; --p-100: #D7EAF0; --p-200: #B7D8E3; --p-500: #3B82A0; --p-600: #316D86; --p-700: #28576B;
  --btn: #316D86; --on-btn: #FFFFFF; --acc-text: #316D86; --chip-fg: #28576B;
  --ok: #8CDEC5; --ok-text: #0F5040; --warn: #E7C87A; --warn-text: #7A5500; --alert: #E7A4A4; --alert-text: #7A1E1E;
  --shadow-1: 0 2px 8px rgba(0,0,0,.06); --shadow-2: 0 4px 16px rgba(0,0,0,.08);
  --r-btn: 12px; --r-card: 16px; --r-modal: 20px;
  --court: #EFE5D0; --court-out: #E8DCC4; --ball: #E07B39;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111827; --surface: #1F2937; --surface-2: #273244; --border: #374151;
    --text: #F9FAFB; --text-2: #9CA3AF; --text-3: #6B7280;
    --p-50: #1C2F38; --p-100: #234150; --p-200: #2F5D72; --acc-text: #92C2D2; --chip-fg: #E6F2F6;
    --shadow-1: 0 2px 8px rgba(0,0,0,.35); --shadow-2: 0 4px 16px rgba(0,0,0,.45);
    --court: #3A3428; --court-out: #2F2A20;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.boot { padding: 24px; color: var(--text-2); }
.ic { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.ic.s { width: 20px; height: 20px; } .ic.xs { width: 16px; height: 16px; } .ic.lg { width: 32px; height: 32px; }
.h1 { font-size: 22px; font-weight: 700; margin: 0; line-height: 1.25; }
.h2 { font-size: 17px; font-weight: 700; margin: 0; line-height: 1.3; }
.sec { color: var(--text-2); margin: 0; } .mut { color: var(--text-2); } .sm { font-size: 13px; }
.row { display: flex; align-items: center; gap: 12px; } .row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; } .g16 { gap: 16px; } .g8 { gap: 8px; } .grow { flex: 1; min-width: 0; }
.center { align-items: center; text-align: center; }
.link { color: var(--acc-text); font-weight: 600; }

/* estrutura: telemóvel = barra de baixo; tablet = carril; computador = barra lateral */
.app { display: flex; flex-direction: column; height: 100dvh; }
.view { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 16px 24px; }
.nav { order: 2; flex: none; display: flex; align-items: flex-end; justify-content: space-around; height: calc(76px + var(--safe-b)); padding: 8px 8px calc(14px + var(--safe-b)); background: var(--surface); border-top: 1px solid var(--border); }
.nav .brand, .nav .nav-foot { display: none; }
.nav-i { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--text-2); }
.nav-i .pill { width: 56px; height: 30px; border-radius: 999px; display: flex; align-items: center; justify-content: center; }
.nav-i.on { color: var(--p-600); } .nav-i.on .pill { background: var(--p-100); }
.nav-i.main .pill { width: 56px; height: 56px; border-radius: 18px; background: var(--p-600); color: #fff; margin-top: -22px; box-shadow: var(--shadow-2); }
.nav-i .soon { display: none; }
body.in-board .app.bare .nav { display: none; }
body.in-board .app.bare .view { padding: 0; overflow: hidden; }
@media (min-width: 768px) {
  .app { flex-direction: row; }
  .nav { order: 0; flex-direction: column; align-items: center; justify-content: flex-start; gap: 6px; width: 84px; height: auto; padding: 14px 0; border-top: 0; border-right: 1px solid var(--border); }
  .nav .brand { display: flex; margin-bottom: 10px; } .nav .brand-t { display: none; }
  .nav-i { flex: none; width: 68px; padding: 6px 0; }
  .nav-i .pill { width: 44px; } .nav-i.main .pill { margin-top: 0; width: 44px; height: 44px; border-radius: 14px; box-shadow: none; }
  body.in-board .app.bare .nav { display: flex; }
  .view { padding: 24px 28px; }
  body.in-board .app.bare .view { padding: 0; }
}
@media (min-width: 1280px) {
  .nav { width: 232px; align-items: stretch; padding: 16px 12px; }
  .nav .brand { gap: 10px; align-items: center; padding: 4px 8px 16px; } .nav .brand-t { display: flex; flex-direction: column; line-height: 1.25; font-size: 13px; } .nav .brand-t b { font-size: 15px; }
  .nav-i { width: auto; flex-direction: row; gap: 10px; min-height: 44px; padding: 0 12px; border-radius: 12px; font-size: 15px; }
  .nav-i .pill, .nav-i.main .pill { width: auto; height: auto; background: none; color: inherit; border-radius: 0; margin: 0; }
  .nav-i.on { background: var(--p-100); color: var(--p-700); font-weight: 700; }
  .nav-i .soon { display: inline-flex; margin-left: auto; font-size: 11px; font-weight: 600; color: var(--warn-text); background: #F8ECCB; border-radius: 999px; padding: 1px 8px; }
  .nav-foot { display: block; margin-top: auto; padding: 8px; font-size: 13px; } .nav-foot .who { display: flex; flex-direction: column; gap: 2px; }
}
.logo { width: 44px; height: 44px; border-radius: 14px; background: var(--p-600); color: #fff; display: inline-flex; align-items: center; justify-content: center; flex: none; }
.logo.lg { width: 64px; height: 64px; border-radius: 20px; }

/* componentes */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--r-btn); border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: 15px; cursor: pointer; }
.btn.pri { background: var(--btn); border-color: var(--btn); color: var(--on-btn); }
.btn.sm { min-height: 36px; padding: 0 12px; font-size: 14px; }
.btn:disabled { opacity: .5; cursor: default; }
.ibtn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; flex: none; }
.ibtn.on { background: var(--btn); border-color: var(--btn); color: #fff; }
.ibtn.flat { border: 0; background: transparent; }
.ibtn:disabled { opacity: .4; cursor: default; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; }
.chip.on { background: var(--p-100); border-color: var(--p-200); color: var(--chip-fg); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.tag { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: 999px; background: var(--p-50); color: var(--chip-fg); font-size: 12px; font-weight: 600; white-space: nowrap; }
.tag.ok { background: #DDF5EC; color: var(--ok-text); } .tag.warn { background: #F8ECCB; color: var(--warn-text); } .tag.gray { background: var(--surface-2); color: var(--text-2); } .tag.err { background: #F8DADA; color: var(--alert-text); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow-1); padding: 16px; }
.link-card { display: flex; align-items: center; gap: 14px; } .link-card.dim { opacity: .65; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 48px 16px; color: var(--text-2); }
.entry { max-width: 440px; margin: 8vh auto 0; }
.sep { height: 1px; background: var(--border); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.inp, .field input, .field textarea, .field select, input.inp, select.inp, textarea.inp { min-height: 44px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); font-size: 15px; font-weight: 400; width: 100%; }
textarea.inp { min-height: 88px; resize: vertical; }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-2); font-size: 14px; }
.toast.err { background: #7A1E1E; color: #fff; } .toast.ok { background: #0F5040; color: #fff; }
#toasts { position: fixed; left: 12px; right: 12px; bottom: calc(92px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px; align-items: center; z-index: 80; pointer-events: none; }
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 70; }
.modal { background: var(--surface); border-radius: var(--r-modal) var(--r-modal) 0 0; padding: 20px; width: 100%; max-width: 520px; max-height: 90dvh; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
@media (min-width: 768px) { .backdrop { align-items: center; } .modal { border-radius: var(--r-modal); } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
