* { box-sizing: border-box; }
:root { color-scheme: light; font-family: "Segoe UI", Arial, sans-serif; color: #17212b; background: #f3f5f7; }
body { margin: 0; min-height: 100vh; }
.page { width: min(100% - 32px, 960px); margin: 0 auto; padding: 48px 0; }
.header { border-top: 5px solid #24394b; background: #fff; padding: 32px 40px; box-shadow: 0 2px 10px rgba(18,35,49,.06); }
.header-compact { padding-top: 28px; padding-bottom: 28px; }
.eyebrow { margin: 0 0 10px; color: #526474; font-size: .78rem; font-weight: 700; letter-spacing: .12em; }
h1 { margin: 0; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.15; }
h2 { margin: 0; font-size: 1.35rem; }
h3 { margin: 0; font-size: 1.05rem; }
.subtitle { margin: 14px 0 0; color: #526474; font-size: 1rem; }
.panel { margin-top: 24px; padding: 28px 32px; background: #fff; box-shadow: 0 2px 10px rgba(18,35,49,.06); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 22px; }
.section-heading .eyebrow { margin-bottom: 6px; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 42px; padding: 10px 16px; border: 1px solid transparent; border-radius: 4px; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.button-primary { color: #fff; background: #24394b; }
.button-primary:hover { background: #182a39; }
.button-secondary { color: #24394b; background: #fff; border-color: #aebbc6; }
.button-secondary:hover { background: #f3f5f7; }
.competition-list { display: grid; gap: 12px; }
.competition-item { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 18px; border: 1px solid #d8e0e6; border-radius: 4px; }
.competition-info p { margin: 7px 0; color: #526474; }
.status { display: inline-block; color: #405466; font-size: .82rem; }
.status-large { margin-top: 12px; }
.empty-state { padding: 28px 20px; text-align: center; background: #f7f9fa; border: 1px dashed #c6d0d8; }
.empty-state p { margin-bottom: 0; color: #526474; }
.form-panel { max-width: 720px; }
.form-field { display: grid; gap: 7px; margin-bottom: 20px; }
.form-field label { font-weight: 600; }
.form-field input { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #aebbc6; border-radius: 4px; font: inherit; background: #fff; }
.form-field input:focus { outline: 2px solid #526f86; outline-offset: 1px; }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 28px; }
.message { padding: 12px 14px; border-radius: 4px; }
.message-error { color: #842029; background: #f8d7da; }
.message-success { color: #0f5132; background: #d1e7dd; }
.notice { padding: 14px; color: #526474; background: #f3f5f7; border-left: 3px solid #8b9ba8; }
@media (max-width: 620px) { .page { padding: 24px 0; } .header { padding: 26px 22px; } .panel { padding: 22px 18px; } .section-heading, .competition-item { align-items: stretch; flex-direction: column; } .section-heading .button, .competition-item .button { width: 100%; } .form-actions { flex-direction: column-reverse; } .form-actions .button { width: 100%; } }

/* Identidade institucional da competição — alteração solicitada em 09/10/2026 */
.header { border-top: 5px solid #24394b; background: #fff; padding: 30px 40px 32px; box-shadow: 0 2px 10px rgba(18,35,49,.06); }
.circuit-name { margin: 0 0 10px; color: #34495a; font-size: clamp(.95rem, 1.6vw, 1.08rem); font-weight: 600; letter-spacing: .055em; line-height: 1.35; }
.regatta-name { margin: 0; color: #17365d; font-size: clamp(1.85rem, 4vw, 2.65rem); font-weight: 700; line-height: 1.12; }
.app-identity { margin-top: 24px; padding-top: 18px; border-top: 1px solid #d8e0e6; }
.app-identity h2 { margin: 0; color: #17212b; font-size: 1.3rem; font-weight: 700; }
.app-identity .subtitle { margin-top: 7px; }
.page-heading { margin-bottom: 24px; }
.page-heading .eyebrow { margin-bottom: 7px; }
.page-heading h2 { margin: 0; }
.page-heading > p:not(.eyebrow):not(.status) { color: #526474; }
@media (max-width: 620px) {
    .header { padding: 25px 22px 27px; }
    .app-identity { margin-top: 20px; padding-top: 15px; }
}

.competition-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; }
.competition-actions form, .form-actions form { margin: 0; }
.button-danger { color: #fff; background: #8b2e2e; border: 1px solid #8b2e2e; }
.button-danger:hover { background: #702323; border-color: #702323; }
@media (max-width: 620px) {
    .competition-actions { justify-content: flex-start; }
}


/* Menu operacional homologado — etapa de codificação */
.operational-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 22px; }
.operation-option { display: flex; align-items: center; justify-content: center; min-height: 64px; padding: 16px; border: 1px solid #24394b; border-radius: 4px; background: #24394b; color: #fff; font: inherit; font-weight: 700; letter-spacing: .035em; text-align: center; text-decoration: none; cursor: pointer; }
.operation-option:hover { background: #182a39; }
.operation-option-disabled { grid-column: 1 / -1; border-color: #aebbc6; background: #e7ebee; color: #526474; cursor: not-allowed; }
.operation-option-disabled:hover { background: #e7ebee; }
.secondary-actions { margin-top: 24px; border-top: 1px solid #d8e0e6; padding-top: 16px; }
.secondary-actions summary { color: #526474; cursor: pointer; font-weight: 600; }
@media (max-width: 620px) { .operational-menu { grid-template-columns: 1fr; } .operation-option-disabled { grid-column: auto; } }

/* Cadastro de equipes — alterações pendentes até SALVAR */
.team-heading { margin-top: 28px; }
.team-heading .subtitle { margin-top: 6px; }
.team-list { display: grid; gap: 12px; }
.team-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 14px; padding: 16px; border: 1px solid #d8e0e6; border-radius: 4px; }
.team-name-label { display: grid; gap: 7px; font-weight: 600; }
.team-name { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #aebbc6; border-radius: 4px; font: inherit; }
.team-name:focus { outline: 2px solid #526f86; outline-offset: 1px; }
.team-actions { display: flex; gap: 8px; }
.publication-status { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.status-published { color: #0f5132; font-weight: 600; }
.status-unpublished { color: #526474; }
.publish-panel { margin-top: 28px; padding-top: 22px; border-top: 1px solid #d8e0e6; }
.publish-panel p { color: #526474; }
.publish-panel form { display: flex; justify-content: flex-end; }
.team-form-actions { justify-content: flex-end; }
@media (max-width: 620px) { .team-row { grid-template-columns: 1fr; } .team-actions { flex-direction: column; } .publish-panel form .button { width: 100%; } }

/* Tela pública — base visual institucional aprovada para a exibição ao público. */
.public-screen { min-height: 100vh; color: #09294d; background: linear-gradient(180deg, #dceaf3 0%, #f6f8fa 44%, #e6edf2 100%); }
.public-shell { width: min(100% - 36px, 1500px); margin: 0 auto; padding: 28px 0 22px; }
.public-hero { position: relative; display: grid; grid-template-columns: 125px minmax(0,1fr); align-items: center; gap: 24px; overflow: hidden; min-height: 220px; padding: 28px 34px; border-top: 6px solid #09294d; background: linear-gradient(110deg, rgba(255,255,255,.98), rgba(229,239,246,.94)); box-shadow: 0 5px 18px rgba(9,41,77,.10); }
.public-crest { z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; width: 112px; min-height: 155px; padding: 14px 8px; color: #f0bd4a; background: #09294d; text-align: center; border-bottom: 8px solid #d7a537; }
.public-crest span { font-size: 3.1rem; line-height: 1; }
.public-crest small { color: white; font-size: .7rem; font-weight: 800; letter-spacing: .08em; }
.public-brand { z-index: 1; text-align: center; }
.public-circuit { margin: 0 0 12px; color: #09294d; font-size: clamp(.8rem,1.5vw,1.2rem); font-weight: 800; letter-spacing: .17em; }
.public-brand h1 { color: #09294d; font-size: clamp(2rem,4.5vw,4rem); font-weight: 800; line-height: 1.1; }
.public-subtitle { margin: 16px 0 0; font-size: clamp(.75rem,1.4vw,1.15rem); letter-spacing: .17em; }
.public-competition { margin: 10px 0 0; color: #526b81; font-weight: 600; }
.public-watermark { position: absolute; right: 12px; bottom: -74px; color: rgba(9,41,77,.07); font-size: 20rem; line-height: 1; pointer-events: none; }
.public-results { margin-top: 22px; overflow: hidden; border: 3px solid white; border-radius: 12px; background: rgba(255,255,255,.96); box-shadow: 0 8px 26px rgba(9,41,77,.12); }
.public-results-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 28px; color: #fff; background: linear-gradient(100deg,#061e3c,#0d3e70); }
.public-title-group { display: flex; align-items: center; gap: 20px; }
.public-people-icon { display: block; min-width: 56px; color: #fff; font-size: 1.25rem; font-weight: 900; line-height: .8; letter-spacing: -.1em; text-align: center; }
.public-title-group h2 { font-size: clamp(1.35rem,2.7vw,2.35rem); line-height: 1.15; }
.public-title-group p { margin: 8px 0 0; color: #e2ebf3; font-size: clamp(.65rem,1.1vw,.95rem); letter-spacing: .17em; }
.public-updated { display: grid; gap: 5px; min-width: max-content; text-align: right; }
.public-updated span { font-size: .72rem; letter-spacing: .12em; }
.public-updated strong { font-size: clamp(.85rem,1.4vw,1.15rem); }
.public-table-wrap { padding: 16px 22px 24px; }
.public-table { width: 100%; border-collapse: separate; border-spacing: 0 4px; font-size: clamp(1rem,2vw,1.65rem); }
.public-table th { padding: 12px 18px; color: #09294d; background: #e1e8ee; font-size: .82em; text-align: left; }
.public-table th:first-child { width: 115px; border-radius: 6px 0 0 6px; text-align: center; }
.public-table th:last-child { border-radius: 0 6px 6px 0; }
.public-table td { padding: 7px 18px; background: #f0f4f7; font-weight: 800; }
.public-table tbody tr:nth-child(odd) td { background: #f8fafb; }
.public-table td:first-child { width: 115px; text-align: center; }
.public-number { display: inline-flex; align-items: center; justify-content: center; width: 66px; min-height: 42px; border-radius: 5px; color: white; background: #09294d; }
.public-empty { padding: 55px 20px; color: #09294d; text-align: center; }
.public-empty h3 { font-size: 1.35rem; }
.public-empty p { color: #526b81; }
.public-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 22px; padding: 20px 28px; color: white; background: #061e3c; }
.public-footer p { margin: 0; text-align: center; font-size: clamp(.7rem,1.4vw,1rem); letter-spacing: .2em; }
.public-footer i { padding: 0 8px; color: #e0ae3d; font-style: normal; }
.public-wave,.public-ship { color: #d7a537; font-size: 2rem; }
@media (max-width: 700px) { .public-shell { width: min(100% - 20px,1500px); padding-top: 10px; } .public-hero { grid-template-columns: 1fr; gap: 16px; padding: 20px 14px; } .public-crest { width: 74px; min-height: 92px; justify-self: center; } .public-crest span { font-size: 2rem; } .public-crest small { font-size: .55rem; } .public-circuit { letter-spacing: .08em; } .public-subtitle { letter-spacing: .08em; } .public-results-heading { align-items: flex-start; flex-direction: column; padding: 18px 16px; } .public-updated { text-align: left; } .public-table-wrap { padding: 10px 8px 16px; } .public-table th,.public-table td { padding: 9px 8px; } .public-table th:first-child,.public-table td:first-child { width: 66px; } .public-number { width: 42px; min-height: 36px; } .public-footer { padding: 16px 10px; } .public-footer p { letter-spacing: .06em; } .public-wave,.public-ship { font-size: 1.2rem; } }


/* Cadastro de provas — formulário organizado e ações alinhadas. */
.proof-form { margin: 0 0 24px; padding: 22px 24px; border: 1px solid #d8e0e6; border-top: 3px solid #24394b; background: #f8fafb; }
.proof-form h3 { margin-bottom: 20px; }
.proof-fields { display: grid; grid-template-columns: minmax(120px, .7fr) minmax(220px, 1.6fr) minmax(150px, 1fr); gap: 18px; align-items: start; }
.proof-fields label { display: grid; gap: 8px; color: #263746; font-size: .92rem; font-weight: 600; }
.proof-fields input { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #aebbc6; border-radius: 4px; background: #fff; color: #17212b; font: inherit; }
.proof-fields input:focus { outline: 2px solid #526f86; outline-offset: 1px; }
.proof-form .form-actions { margin-top: 22px; padding-top: 16px; border-top: 1px solid #d8e0e6; }
.proof-table-wrap { margin-top: 8px; }
.proof-row-actions { min-width: 190px; }
.proof-row-actions .button { min-height: 36px; padding: 7px 12px; }
.proof-row-actions form { display: inline-flex; margin: 6px 0 0; }
.panel > .message { margin: 0 0 20px; }
@media (max-width: 700px) {
  .proof-fields { grid-template-columns: 1fr; gap: 14px; }
  .proof-form { padding: 18px; }
  .proof-form .form-actions { flex-direction: row; }
  .proof-row-actions { min-width: 0; }
}
@media (max-width: 420px) {
  .proof-form .form-actions { flex-direction: column-reverse; }
  .proof-form .form-actions .button { width: 100%; }
}

/* Operação da prova — seleção e registro direto na tela da prova. */
.proof-row-actions { display:flex; flex-wrap:wrap; gap:6px; align-items:center; min-width:260px; }
.proof-row-actions .button { min-height:36px; padding:8px 10px; font-size:.82rem; }
.operation-team-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; margin-top:18px; }
.operation-team { display:flex; align-items:center; gap:12px; padding:14px 16px; border:1px solid #d8e0e6; border-radius:4px; }
.operation-team input { width:18px; height:18px; }
.operation-table { width:100%; border-collapse:collapse; }
.operation-table th,.operation-table td { padding:12px 10px; border-bottom:1px solid #d8e0e6; text-align:left; }
.operation-table input,.operation-table select { width:100%; min-width:90px; min-height:40px; padding:7px 9px; border:1px solid #aebbc6; border-radius:4px; font:inherit; }
.public-proof-result { margin-top:22px; }
@media (max-width:620px) { .operation-team-list { grid-template-columns:1fr; } .proof-row-actions { min-width:0; } }


/* Identidade visual institucional — símbolos oficiais nas páginas públicas. */
.public-hero {
    grid-template-columns: 116px minmax(0, 1fr) 116px;
}
.public-logo {
    position: relative;
    z-index: 1;
    display: block;
    justify-self: center;
    align-self: center;
    width: 100%;
    max-width: 116px;
    height: 154px;
    object-fit: contain;
}
.public-logo-marinha {
    width: 112px;
    height: 112px;
}
.public-logo-bacs {
    width: 108px;
    height: 154px;
}
@media (max-width: 700px) {
    .public-hero {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 12px;
        padding: 18px 14px 22px;
    }
    .public-logo-marinha {
        grid-column: 1;
        grid-row: 1;
        width: 76px;
        height: 76px;
    }
    .public-logo-bacs {
        grid-column: 2;
        grid-row: 1;
        width: 64px;
        height: 92px;
    }
    .public-brand {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    .public-brand h1 {
        font-size: clamp(1.7rem, 7vw, 2.4rem);
    }
}


/* Consulta administrativa de resultados e histórico de publicações. */
.result-history-card { margin: 22px 0; padding: 20px 22px; border: 1px solid #d8e0e6; border-top: 3px solid #24394b; background: #fff; }
.result-history-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:16px; flex-wrap:wrap; }
.result-history-heading h3 { margin:0 0 6px; color:#082b50; }
.result-history-heading .subtitle { margin:0; }
.result-history-label { margin:18px 0 8px; font-weight:600; color:#263746; }
.result-publication-history { margin-top:18px; padding-top:14px; border-top:1px solid #d8e0e6; }
.result-publication-history h4 { margin:0 0 8px; }
.result-publication-history ul { margin:0; padding-left:22px; }
.result-publication-history li { margin:6px 0; }

.result-version { margin: 12px 0 18px; padding: 12px; background: #f8fafb; border-left: 3px solid #526f86; }
.result-version > p { margin: 0 0 8px; }

/* Resultado final: ajuste explícito dos pontos pelo operador. */
.result-history-card input[type="number"], .panel input[type="number"] { min-width: 5rem; max-width: 8rem; padding: .55rem; border: 1px solid #8796a5; border-radius: 4px; font: inherit; }
.panel button:disabled { opacity: .55; cursor: not-allowed; }

/* Histórico de publicações recolhido por padrão; expandir somente sob solicitação. */
.result-publication-history > summary { cursor: pointer; font-weight: 700; color: #082b50; padding: 8px 0; list-style-position: inside; }
.result-publication-history > summary:focus-visible { outline: 2px solid #526f86; outline-offset: 3px; }
.result-publication-history[open] > summary { margin-bottom: 10px; }


/* Resultado final — botões padronizados e telas de classificação. */
.result-choice-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin:18px 0 24px; }
.result-choice { display:flex; align-items:center; justify-content:center; box-sizing:border-box; width:100%; min-height:64px; padding:16px; text-align:center; white-space:normal; }
.result-choice-grid .button { width:100%; }
.final-classification-form select { width:100%; min-width:170px; min-height:40px; padding:7px 9px; border:1px solid #aebbc6; border-radius:4px; font:inherit; background:#fff; }
.final-classification-form input[type="number"] { width:82px; min-width:70px; max-width:100%; box-sizing:border-box; padding:7px; border:1px solid #aebbc6; border-radius:4px; font:inherit; }
.final-classification-form .category-score { width:76px; }
.final-classification-form .table-wrap { overflow-x:auto; }
@media (max-width:700px) { .result-choice-grid { grid-template-columns:1fr; } }

/* O botão de encerramento usa a mesma largura de célula e altura das demais opções. */
.operational-menu form { width:100%; margin:0; }
.operational-menu form .operation-option { width:100%; box-sizing:border-box; }

/* Correção V2: autorização explícita para empate oficial. */
.tie-authorization { display: flex; align-items: flex-start; gap: .65rem; margin: 1rem 0 .5rem; padding: .8rem; border: 1px solid #c7d2dc; border-radius: .35rem; background: #f5f8fa; }
.tie-authorization input { margin-top: .2rem; flex: 0 0 auto; }
.tie-authorization span { line-height: 1.45; }

/* Histórico de publicações: ações compactas e legíveis. */
.inline-form { display: inline-flex; margin: 0.35rem 0 0.35rem 0.65rem; vertical-align: middle; }
.result-publication-history li { margin-bottom: 0.7rem; }
.result-publication-history .button { font-size: 0.78rem; padding: 0.45rem 0.7rem; }


/* Configurações do sistema */
.section-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.form-group label { font-weight: 600; }
.form-group input:not([type="file"]) { max-width: 620px; padding: 10px; border: 1px solid #b8c6d4; border-radius: 4px; font: inherit; }
.form-group input[type="file"] { max-width: 620px; padding: 8px 0; }
.panel hr { border: 0; border-top: 1px solid #d7e0e8; margin: 26px 0; }
.app-about { display: grid; grid-template-columns: minmax(190px, 260px) 1fr; gap: 10px 18px; }
.app-about dt { font-weight: 700; }
.app-about dd { margin: 0; }
.logo-preview { margin: 12px 0; padding: 12px; background: #f3f6f8; border: 1px solid #d7e0e8; border-radius: 6px; width: fit-content; }
@media (max-width: 600px) { .app-about { grid-template-columns: 1fr; gap: 4px; } .app-about dd { margin-bottom: 10px; } .section-actions { justify-content: flex-start; } }

/* Configuração de conectividade e publicação da V12 */
.settings-subsection { padding: 4px 0 8px; }
.settings-subsection h3 { margin-bottom: 8px; color: #24394b; }
.settings-subsection .subtitle { margin: 6px 0 18px; }
.form-group label:has(input[type="checkbox"]) { display: flex; flex-direction: row; align-items: center; gap: 10px; }
.form-group input[type="checkbox"] { width: 18px; height: 18px; margin: 0; accent-color: #24394b; }
.settings-subsection .form-actions { justify-content: flex-start; flex-wrap: wrap; }
