/* NO CORRE — identidade visual herdada do protótipo: preto, prata e laranja. */
:root {
  --bg: #090909; --panel: #151515; --panel2: #202020; --line: #363636;
  --text: #f4f4f4; --muted: #b7b7b7; --orange: #ff6a00; --orange-soft: #ff9a54;
  --silver: #c9c9c9; --green: #3bd181; --yellow: #ffc857; --red: #ff5b5b; --blue: #79baff;
  --radius: 15px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; line-height: 1.4;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
a { color: var(--orange-soft); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 11px; }
h3 { font-size: 14px; margin: 14px 0 7px; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.small-text { font-size: 12px; font-weight: 400; }
.center { text-align: center; }
.warn { color: var(--yellow); }
.bad { color: var(--red); }
.good { color: var(--green); }
.error-text { color: var(--red); }

/* Cabeçalho e navegação */
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 16px; background: #050505;
  border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 4;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brandname { display: block; font-size: 21px; font-weight: 900; letter-spacing: 1.4px; font-style: italic; }
.tag { display: block; font-size: 9px; letter-spacing: 1.8px; color: var(--orange); margin-top: 2px; }
.who { text-align: right; font-size: 12px; min-width: 0; }
.who-name { display: block; max-width: 40vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-role { color: var(--orange-soft); font-size: 10px; letter-spacing: 1px; text-transform: uppercase; }
main { max-width: 820px; margin: auto; padding: 15px 13px 110px; }
main.narrow { max-width: 460px; padding-bottom: 40px; }
body.public { background: #040404; }
.public-brand { text-align: center; margin: 16px 0 18px; }
.login-logo { display: block; width: 100%; max-width: 340px; height: auto; margin: 0 auto 6px; border-radius: 12px; }
.public-brand .tag { font-size: 10px; }
.brand-logo { height: 46px; width: auto; display: block; flex-shrink: 0; }
.bottom {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 5;
  background: #101010f5; border-top: 1px solid #333; display: flex; justify-content: center; gap: 2px;
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.bottom a {
  flex: 1; max-width: 120px; min-height: 48px; text-align: center; color: #aaa; font-size: 10px;
  padding: 6px 1px; text-decoration: none; border-radius: 10px;
}
.bottom a span { display: block; font-size: 19px; margin-bottom: 2px; }
.bottom a.active { color: var(--orange); }
.foot { font-size: 11px; color: #777; text-align: center; padding: 20px 8px; }
.foot a { color: #999; }

/* Blocos */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px; margin-bottom: 12px;
}
.panel.highlight { border-color: var(--orange); box-shadow: inset 3px 0 var(--orange); }
.panel.empty { color: var(--muted); text-align: center; padding: 28px 15px; }
.panel.muted-panel { background: transparent; border-style: dashed; }
.link-panel { display: block; color: var(--text); text-decoration: none; }
.danger-zone { border-color: #5a2626; }
.hero {
  padding: 17px; border: 1px solid var(--line); border-radius: 17px;
  background: linear-gradient(130deg, #222, #111); margin-bottom: 13px;
}
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin-top: 14px; }
.stat { background: #0d0d0d; border: 1px solid #303030; border-radius: 11px; padding: 10px; color: var(--text); text-decoration: none; }
.stat small { display: block; color: var(--muted); font-size: 10px; }
.stat strong { display: block; font-size: 19px; margin-top: 4px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin: 4px 0 13px; }
.page-head .btn { flex-shrink: 0; }
.sub { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0 0 8px; }
.hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.45; }
.notice {
  border: 1px solid #60401e; background: #24180f; border-radius: 10px; padding: 11px;
  color: #ead8c9; font-size: 12.5px; line-height: 1.5; margin: 10px 0;
}
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.metric { background: #0d0d0d; border: 1px solid #333; border-radius: 10px; padding: 10px; }
.metric small { font-size: 10px; color: var(--muted); display: block; }
.metric b { display: block; font-size: 17px; margin-top: 4px; }
.big-number { font-size: 34px; font-weight: 800; color: var(--orange); margin: 4px 0 6px; }
.big-number small { font-size: 14px; color: var(--muted); font-weight: 400; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 12px; font-size: 13px; margin: 12px 0 0; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; }
.quick { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.quick .btn { flex: 1 1 auto; text-align: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.actions form { margin: 0; }
.actions-panel form + form { margin-top: 8px; }
.status-actions form + form { margin-top: 8px; }

/* Mensagens */
.flash { border-radius: 10px; padding: 11px 12px; margin-bottom: 12px; font-size: 13px; border: 1px solid; }
.flash-success { background: #10241a; border-color: #23573a; color: #bff0d4; }
.flash-error { background: #2a1212; border-color: #6b2b2b; color: #ffd0d0; }
.flash-info { background: #111d2a; border-color: #29486b; color: #cfe4ff; }
.flash-warn { background: #2a2310; border-color: #6b5a23; color: #ffe9b0; }

/* Formulários */
.field { margin: 10px 0; border: 0; padding: 0; min-width: 0; }
.field label, .field legend { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
input, select, textarea {
  width: 100%; background: #0d0d0d; border: 1px solid #424242; border-radius: 9px;
  padding: 11px; color: var(--text); font-size: 16px; min-height: 44px;
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--orange); outline-offset: 1px; border-color: var(--orange); }
input[disabled] { opacity: .65; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; accent-color: var(--orange); flex-shrink: 0; margin: 1px 0 0; }
textarea { min-height: 68px; resize: vertical; }
.row, .row3 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.row3 { grid-template-columns: 1fr 1fr 1fr; }
.check { display: flex; gap: 9px; align-items: flex-start; font-size: 13px; margin: 10px 0; cursor: pointer; color: var(--text) !important; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: flex; align-items: center; gap: 7px; border: 1px solid #444; border-radius: 20px; padding: 8px 12px; font-size: 13px; color: var(--text) !important; margin: 0 !important; }
.inline-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; }
.inline-form .field { margin: 0; }
.copy-row { display: flex; gap: 8px; }
.copy-row input { font-size: 13px; }
.search { margin-bottom: 12px; }
.btn, .primary {
  display: inline-block; border: 1px solid #444; border-radius: 10px; padding: 11px 14px; min-height: 44px;
  background: #202020; color: #f4f4f4; font-size: 14px; text-decoration: none; text-align: center; line-height: 1.4;
}
.primary { background: var(--orange); border-color: var(--orange); color: #111; font-weight: 800; }
.btn.danger { border-color: #7a3030; color: #ffb4b4; background: #1d1010; }
.btn.subtle { background: transparent; border-color: #333; color: var(--muted); }
.btn.small, .small { font-size: 12px; padding: 7px 10px; min-height: 36px; }
.full { width: 100%; display: block; }
button:disabled { opacity: .55; cursor: default; }
.loading { position: relative; color: transparent !important; }
.loading::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px;
  border: 2px solid #111; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite;
}
.btn.loading::after { border-color: #ddd; border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.sticky-save { position: sticky; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 3; box-shadow: 0 4px 20px #000; }

/* Listas */
.list { display: flex; flex-direction: column; gap: 7px; }
.item {
  display: block; padding: 12px; background: #101010; border: 1px solid #393939; border-radius: 11px;
  color: var(--text); text-decoration: none;
}
a.item:active { border-color: var(--orange); }
.item strong { display: block; font-size: 14px; }
.item > span { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; line-height: 1.4; }
.item .item-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; color: var(--text); margin: 0; }
.item.flagged { border-color: #6b5a23; }
.item .warn { color: var(--yellow); }
.clip { overflow: hidden; text-overflow: ellipsis; }
.badge {
  display: inline-block; font-size: 10.5px; font-weight: 600; color: var(--orange-soft); background: #2a1b11;
  padding: 3px 7px; border-radius: 6px; white-space: nowrap; vertical-align: middle; margin-left: 4px;
}
.badge.muted { color: var(--muted); background: #222; }
.badge.bad { color: #ffb4b4; background: #2a1212; }
.badge.warn { color: var(--yellow); background: #2a2310; }
.badge.st-completed { color: var(--green); background: #10241a; }
.badge.st-started { color: var(--blue); background: #111d2a; }
.badge.st-missed { color: var(--yellow); background: #2a2310; }
.badge.st-cancelled { color: var(--muted); background: #222; text-decoration: line-through; }
.log { list-style: none; padding: 0; margin: 0 0 10px; font-size: 12.5px; }
.log li { padding: 7px 0; border-bottom: 1px solid #262626; }
.group-title { color: var(--orange-soft); font-size: 13px; margin: 16px 0 7px; }

/* Calendário semanal */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.week-nav .btn { font-size: 20px; min-width: 48px; }
.week-label { text-align: center; font-size: 13px; }
.week-label strong, .week-label a, .week-label span { display: block; }
.week-label a, .week-label span { font-size: 11px; margin-top: 2px; }
.calendar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.day { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 10px 11px; }
.day.today { border-color: var(--orange); }
.day-title { font-size: 13px; margin: 0 0 6px; color: var(--silver); }
.day-title span { color: var(--muted); font-weight: 400; }
.day-title em { color: var(--orange); font-style: normal; font-size: 11px; margin-left: 4px; }
.day .item + .item { margin-top: 6px; }
.day-empty { color: #666; font-size: 12px; margin: 0; }

/* Sessão */
.pills { margin-bottom: 8px; }
.pill { display: inline-block; border-radius: 6px; background: #322015; color: var(--orange-soft); padding: 5px 8px; font-size: 12px; margin: 0 4px 5px 0; }
.objective { font-size: 13.5px; }
.section { border-left: 3px solid var(--orange); padding: 9px 11px; margin: 10px 0; background: #101010; border-radius: 0 8px 8px 0; }
.section h3 { font-size: 12px; color: var(--orange-soft); margin: 0 0 5px; text-transform: uppercase; letter-spacing: .5px; }
.section p { font-size: 14px; line-height: 1.55; color: #e6e6e6; margin: 0; }
.section.suggested { border-left-color: var(--blue); }
.section.suggested h3 { color: var(--blue); }
.section.notes { border-left-color: var(--silver); }
details.source summary { cursor: pointer; font-size: 13px; color: var(--muted); }
details.source pre { white-space: pre-wrap; font-size: 12px; color: var(--silver); margin: 10px 0 0; }

/* Tabelas */
.table { width: 100%; border-collapse: collapse; font-size: 12.5px; margin: 8px 0; }
.table th, .table td { text-align: left; padding: 7px 6px; border-bottom: 1px solid #2a2a2a; vertical-align: top; }
.table thead th { color: var(--muted); font-weight: 600; font-size: 11px; }
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; }
.table.raw td, .table.raw th { white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.table.raw tr.header-row td { background: #2a1b11; color: var(--orange-soft); font-weight: 700; }
.table.result tbody tr:first-child td { border-bottom: 0; padding-bottom: 2px; white-space: nowrap; }
.table.result tr.detail td { color: var(--muted); font-size: 12px; padding-top: 0; }
.table.result tr.detail .warn { display: block; margin-top: 3px; }
.table.result tbody.flagged td { background: #1c180c; }
.table.diff .before { color: #ffb4b4; }
.table.diff .after { color: #bff0d4; }
.map-grid { display: flex; flex-direction: column; gap: 6px; }
.map-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid #262626; }
.map-row strong { display: block; font-size: 13px; }
.map-row span { display: block; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
canvas.spark { width: 100%; height: 140px; display: block; margin: 6px 0 10px; }

/* Ajustes */
.warmup-edit { padding: 10px 0; border-bottom: 1px solid #262626; }
.warmup-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 6px; }
.warmup-head .check { margin: 0; }

/* Biblioteca */
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0; }
.filters button { border: 1px solid #414141; background: #171717; color: #ddd; border-radius: 20px; padding: 8px 12px; font-size: 12px; min-height: 36px; }
.filters button.active { background: var(--orange); color: #111; border-color: var(--orange); }
details.exercise { background: #101010; border: 1px solid #393939; border-radius: 11px; padding: 12px; }
details.exercise summary { cursor: pointer; list-style: none; }
details.exercise summary::-webkit-details-marker { display: none; }
details.exercise summary strong { display: block; font-size: 14px; }
details.exercise summary span { display: block; color: var(--muted); font-size: 12px; margin-top: 3px; }
details.exercise p { font-size: 13px; line-height: 1.5; margin: 8px 0 0; }
.caution { color: #ead8c9; }
.prose h2 { margin-top: 18px; }
.prose p, .prose li { font-size: 14px; line-height: 1.6; }

@media (max-width: 520px) {
  .row3 { grid-template-columns: 1fr 1fr; }
  .inline-form { grid-template-columns: 1fr 1fr; }
  .inline-form button { grid-column: 1 / -1; }
  .map-row { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
}
@media (min-width: 640px) {
  main { padding: 22px 18px 110px; }
  .panel { padding: 18px; }
  .brandname { font-size: 25px; }
}
@media (min-width: 900px) {
  .calendar { display: grid; grid-template-columns: repeat(7, 1fr); }
  main:has(.calendar) { max-width: 1180px; }
}

/* Etapa 3 — questionário, semáforo, evolução */
.scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.scale-opt input, .choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.scale-opt span {
  display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1px solid #444;
  border-radius: 10px; background: #1a1a1a; font-size: 17px; font-weight: 700; cursor: pointer;
}
.scale-opt input:checked + span, .choice input:checked + span { background: var(--orange); border-color: var(--orange); color: #111; }
.scale-opt input:focus-visible + span, .choice input:focus-visible + span { outline: 2px solid var(--orange); outline-offset: 2px; }
.scale-legend { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 6px; }
.choices { display: flex; flex-direction: column; gap: 7px; }
.choice span { display: block; padding: 13px 14px; border: 1px solid #444; border-radius: 10px; background: #1a1a1a; cursor: pointer; font-size: 15px; }
.choice-warn input:checked + span { background: var(--red); border-color: var(--red); }
.dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; vertical-align: middle; margin-right: 2px; }
.dot-green { background: var(--green); }
.dot-yellow { background: var(--yellow); }
.dot-red { background: var(--red); box-shadow: 0 0 0 3px #ff5b5b33; }
.alert-red { border-color: #6b2b2b !important; }
.alert-yellow { border-color: #6b5a23 !important; }
.filters a { border: 1px solid #414141; background: #171717; color: #ddd; border-radius: 20px; padding: 8px 12px; font-size: 12px; text-decoration: none; min-height: 36px; display: inline-flex; align-items: center; }
.filters a.active { background: var(--orange); color: #111; border-color: var(--orange); }
canvas.bars { width: 100%; height: 150px; display: block; margin: 10px 0 4px; }
.legend { font-size: 11px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.legend span { display: inline-block; width: 10px; height: 10px; border-radius: 2px; }
.lg-planned { background: #3a3a3a; }
.lg-done { background: var(--green); margin-left: 8px; }
.empty-data { font-style: italic; }
.review-form { display: flex; gap: 6px; margin-top: 8px; }
.review-form input { min-height: 36px; padding: 7px 9px; font-size: 14px; }
details.rules summary { cursor: pointer; font-weight: 600; font-size: 14px; }
details.rules ul, details.rules ol { font-size: 13px; line-height: 1.6; padding-left: 20px; }
.feedback-item > span { display: block; }
.status-actions a.full + a.full, .status-actions form + a, .status-actions a + form { margin-top: 8px; }

/* Administração */
.checks { list-style: none; padding: 0; margin: 0 0 10px; }
.checks li { display: flex; gap: 10px; padding: 8px 0; border-bottom: 1px solid #262626; font-size: 13px; }
.checks small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; word-break: break-word; }

/* Etapa 4 — Tênis do mês */
.shoe-head { display: flex; gap: 12px; align-items: flex-start; }
.shoe-head h2 { margin: 0 0 4px; }
.rank { font-size: 22px; font-weight: 900; color: var(--orange); min-width: 36px; }
.price { font-size: 14px; }
.price strong { font-size: 19px; color: var(--text); }
.price s { margin-left: 6px; font-size: 12px; }
.shoe-img { display: block; width: 100%; max-height: 220px; object-fit: contain; background: #fff; border-radius: 10px; margin: 10px 0; }
.shoe h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; margin: 10px 0 4px; }
.shoe ul { margin: 0; padding-left: 18px; font-size: 13px; line-height: 1.5; }
.pros h3 { color: var(--green); }
.cons h3 { color: var(--yellow); }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.row-actions form { margin: 0; }
.inline-form.two { grid-template-columns: 1fr auto; }

/* Cabeçalho em telas estreitas: logo + nome, sem subtítulo */
.who { max-width: 38vw; }
.who-role { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 480px) {
  .topbar .tag { display: none; }
  .topbar .brandname { font-size: 18px; }
  .brand-logo { height: 40px; }
  .brand { gap: 8px; }
}

/* Botão Sair no topo */
.who-box { display: flex; align-items: center; gap: 10px; min-width: 0; }
.who-box form { margin: 0; }
.logout {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 44px; min-height: 44px; padding: 4px 8px; border: 1px solid #444; border-radius: 10px;
  background: #1a1a1a; color: var(--orange-soft); font-size: 16px; line-height: 1;
}
.logout span { font-size: 10px; color: var(--muted); }
.logout:hover, .logout:focus-visible { border-color: var(--orange); }
@media (max-width: 480px) {
  .who { max-width: 30vw; }
}
.brandname { white-space: nowrap; }
@media (max-width: 400px) { .topbar .brandname { font-size: 16px; letter-spacing: .6px; } .brand-logo { height: 36px; } }

/* Menu lateral (☰) */
.menu-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  min-width: 44px; min-height: 44px; padding: 4px 8px; border: 1px solid var(--orange); border-radius: 10px;
  background: #1a1a1a; color: var(--orange); font-size: 18px; line-height: 1; text-decoration: none;
}
.menu-btn span { font-size: 10px; color: var(--text); }
.menu {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(86vw, 340px); z-index: 20;
  background: #0e0e0e; border-left: 1px solid var(--line); overflow-y: auto;
  padding: calc(14px + env(safe-area-inset-top)) 14px calc(20px + env(safe-area-inset-bottom));
  transform: translateX(105%); transition: transform .2s ease; visibility: hidden;
}
.menu.open, .menu:target { transform: none; visibility: visible; box-shadow: -10px 0 40px #000; }
.menu-backdrop { position: fixed; inset: 0; background: #000a; z-index: 19; }
body.menu-open { overflow: hidden; }
.menu-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding-bottom: 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-head strong { display: block; font-size: 15px; }
.menu-head span { font-size: 11px; color: var(--orange-soft); letter-spacing: .5px; text-transform: uppercase; }
.menu-close { color: var(--muted); text-decoration: none; font-size: 20px; padding: 6px 10px; border-radius: 8px; border: 1px solid #333; }
.menu-section h2 { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.2px; margin: 16px 4px 6px; }
.menu-section ul { list-style: none; margin: 0; padding: 0; }
.menu-section a {
  display: flex; align-items: center; gap: 12px; min-height: 46px; padding: 8px 10px; border-radius: 10px;
  color: var(--text); text-decoration: none; font-size: 15px;
}
.menu-section a span { width: 22px; text-align: center; color: var(--muted); }
.menu-section a:hover, .menu-section a:focus-visible { background: #1a1a1a; }
.menu-section a.active { background: #2a1b11; color: var(--orange-soft); font-weight: 700; }
.menu-section a.active span { color: var(--orange); }
.menu-logout { margin-top: 18px; }
@media (max-width: 480px) {
  .who { display: none; }
}
@media (prefers-reduced-motion: reduce) { .menu { transition: none; } }
code.break, .break { word-break: break-all; }
