:root {
    --bg: #0a0d12;
    --bg-soft: #131821;
    --panel: rgba(16, 22, 32, 0.84);
    --panel-strong: #121926;
    --line: rgba(255, 255, 255, 0.1);
    --text: #edf2f7;
    --muted: #a6b0c3;
    --gold: #d4a017;
    --gold-soft: #f3d27a;
    --red: #b91c1c;
}

* {
    box-sizing: border-box;
}

/* Ensure the hidden attribute always wins over component display rules */
[hidden] {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
    text-decoration: none;
}

.site-header,
.sub-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 18px;
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(14px);
    background: rgba(10, 13, 18, 0.78);
    border-bottom: 1px solid var(--line);
}

.site-header {
    padding-top: 12px;
    padding-bottom: 12px;
}

.site-header-shell {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
}

.sub-header {
    align-items: flex-start;
    justify-content: space-between;
    flex-direction: column;
    gap: 14px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.sub-header-main,
.header-actions {
    width: 100%;
}

.sub-header-main {
    min-width: 0;
}

.brand {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
}

.header-brand {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    width: 100%;
}

.header-brand > div,
.brand-copy {
    min-width: 0;
}

.brand-logo {
    width: 54px;
    height: 54px;
    object-fit: contain;
    flex: 0 0 auto;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 4px;
}

.site-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    flex-wrap: nowrap;
    width: 100%;
    padding: 0;
    font-size: 14px;
    color: var(--muted);
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
}

.site-nav a:hover,
.back-link:hover {
    color: var(--text);
}

.site-nav a {
    flex: 0 0 auto;
}

.site-nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0;
    color: var(--muted);
    border: 0;
    background: transparent;
    font-weight: 600;
    letter-spacing: 0.02em;
    position: relative;
    transition: color 140ms ease, transform 140ms ease;
}

.site-nav-link:hover,
.site-nav-link:focus-visible {
    color: var(--text);
    transform: translateY(-1px);
}

.site-nav-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 2px;
    border-radius: 999px;
    background: var(--gold);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 140ms ease;
}

.site-nav-link:hover::after,
.site-nav-link:focus-visible::after {
    transform: scaleX(1);
}

.site-nav-link-accent {
    color: var(--gold-soft);
}

.site-nav-link-accent:hover,
.site-nav-link-accent:focus-visible {
    color: #fff2c7;
}

.site-nav-link-accent::after {
    background: linear-gradient(90deg, var(--gold) 0%, var(--gold-soft) 100%);
}

.brand-subtitle {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
}

.hero {
    position: relative;
    min-height: calc(100vh - 92px);
    display: flex;
    align-items: flex-end;
    padding: 88px 18px 28px;
    background-image: url('../img/intial_page_image.png');
    background-size: cover;
    background-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(10, 13, 18, 0.08) 0%, rgba(10, 13, 18, 0.38) 54%, rgba(10, 13, 18, 0.7) 100%),
        linear-gradient(90deg, rgba(10, 13, 18, 0.54) 0%, rgba(10, 13, 18, 0.16) 52%, rgba(10, 13, 18, 0.46) 100%);
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 780px;
}

.eyebrow,
.section-kicker {
    margin: 0 0 10px;
    color: var(--gold-soft);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.hero h1,
.sub-header h1,
.intro h2,
.rules-band h2 {
    margin: 0;
    font-size: 34px;
    line-height: 1.04;
}

.hero-copy,
.intro p,
.rules-band p,
.site-footer p,
.module-card li,
.clean-list li {
    color: var(--muted);
    line-height: 1.6;
}

.hero-copy {
    max-width: 36rem;
    margin: 18px 0 0;
    font-size: 16px;
}

.hero-actions {
    display: flex;
    gap: 12px;
    flex-direction: column;
    margin-top: 28px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    width: 100%;
    cursor: pointer;
}

.compact-action {
    width: auto;
    min-width: 108px;
}

.button.primary {
    background: var(--gold);
    color: #18130a;
}

.button.secondary {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--line);
    color: var(--text);
}

.button.danger {
    background: rgba(185, 28, 28, 0.16);
    border: 1px solid rgba(185, 28, 28, 0.42);
    color: #fecaca;
}

.header-button {
    width: 100%;
    min-height: 40px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
}

.header-button-ghost {
    background: transparent;
}

.hero-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 22px;
    font-size: 13px;
}

.status {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    min-height: 34px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
}

.status.ok {
    color: #d1fae5;
    border-color: rgba(16, 185, 129, 0.35);
    background: rgba(6, 78, 59, 0.35);
}

.status.warn {
    color: #b91c1c;
    border-color: rgba(185, 28, 28, 0.28);
    background: #ffffff;
}

.status-block {
    align-items: flex-start;
    border-radius: 12px;
    padding: 14px 16px;
}

.band {
    padding: 52px 18px;
}

.container {
    width: min(1180px, 100%);
    margin: 0 auto;
}

.admin-app .container {
    width: min(1440px, 100%);
}

.two-col,
.split {
    display: grid;
    gap: 28px;
    grid-template-columns: 1fr;
}

.metric-grid,
.module-grid,
.timeline {
    display: grid;
    gap: 16px;
}

.metric-grid {
    grid-template-columns: 1fr;
}

.metric,
.module-card,
.timeline-item {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
}

.metric strong {
    display: block;
    margin-bottom: 8px;
    font-size: 34px;
    color: var(--gold);
}

.metric span {
    color: var(--muted);
    line-height: 1.5;
}

.form-grid {
    display: grid;
    gap: 14px;
}

.password-reset-form {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
}

.field {
    display: grid;
    gap: 6px;
}

.field span,
.field-label {
    color: var(--muted);
    font-size: 14px;
}

.field-label {
    display: block;
    margin-bottom: 6px;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: #0f1622;
    color: var(--text);
}

.field input[type="file"] {
    padding: 8px 12px;
    cursor: pointer;
    color: var(--muted);
    font-size: 13px;
}

/* Theme the native "Escolher arquivo" button to match the layout.
   Standard and legacy WebKit pseudo-elements must stay in SEPARATE rules,
   otherwise an unknown selector invalidates the whole declaration. */
.field input[type="file"]::file-selector-button {
    margin-right: 12px;
    padding: 8px 16px;
    border: 1px solid rgba(212, 160, 23, 0.35);
    border-radius: 8px;
    background: rgba(212, 160, 23, 0.12);
    color: var(--gold-soft);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

.field input[type="file"]::file-selector-button:hover {
    background: rgba(212, 160, 23, 0.2);
    border-color: rgba(212, 160, 23, 0.5);
}

.field input[type="file"]::-webkit-file-upload-button {
    margin-right: 12px;
    padding: 8px 16px;
    border: 1px solid rgba(212, 160, 23, 0.35);
    border-radius: 8px;
    background: rgba(212, 160, 23, 0.12);
    color: var(--gold-soft);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.photo-field .photo-capture-trigger {
    width: 100%;
    min-height: 46px;
    min-width: 0;
}

.photo-field-hint {
    color: var(--muted);
    font-size: 12px;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: rgba(212, 160, 23, 0.45);
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.12);
}

.login-mark {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.login-logo {
    width: 128px;
    max-width: 40vw;
    height: auto;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px;
}

.identity-panel {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px;
    align-items: center;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    background: rgba(16, 22, 32, 0.82);
}

.identity-panel .section-kicker {
    margin-bottom: 0;
    font-size: 11px;
}

.identity-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(212, 160, 23, 0.18);
    color: var(--gold-soft);
    font-size: 18px;
    font-weight: 700;
    border: 1px solid rgba(212, 160, 23, 0.22);
}

.identity-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
    flex: 1 1 auto;
}

.identity-copy h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.15;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.identity-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 2px;
    color: var(--muted);
    font-size: 12px;
    min-width: 0;
}

.identity-meta span {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.identity-pill {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid rgba(212, 160, 23, 0.25);
    background: rgba(212, 160, 23, 0.12);
    color: var(--gold-soft);
}

.admin-main {
    gap: 22px;
}

.admin-grid,
.data-grid,
.form-split {
    display: grid;
    gap: 18px;
}

.admin-shell {
    display: grid;
    gap: 18px;
}

.admin-sidebar,
.admin-content {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(15, 20, 30, 0.94);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.admin-sidebar {
    padding: 18px 16px;
    background:
        linear-gradient(180deg, rgba(212, 160, 23, 0.1) 0%, rgba(15, 20, 30, 0.96) 18%, rgba(15, 20, 30, 0.98) 100%),
        rgba(15, 20, 30, 0.96);
}

.sidebar-nav {
    display: grid;
    gap: 16px;
}

.sidebar-group {
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-group:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.sidebar-group-items {
    display: grid;
    gap: 6px;
    margin-top: 6px;
}

/* Clickable group header (collapsible submenu) */
.sidebar-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    color: var(--gold-soft);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    user-select: none;
    list-style: none;
    transition: background-color 120ms ease, color 120ms ease;
}

.sidebar-title::-webkit-details-marker {
    display: none;
}

.sidebar-title:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
}

.sidebar-title::after {
    content: "";
    flex: 0 0 auto;
    width: 7px;
    height: 7px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 160ms ease;
    opacity: 0.75;
}

.sidebar-group[open] > .sidebar-title::after {
    transform: rotate(45deg);
}

.sidebar-link {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 10px;
    color: var(--muted);
    border: 1px solid transparent;
    transition: background-color 120ms ease, border-color 120ms ease, color 120ms ease;
}

.sidebar-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
}

.sidebar-link.active {
    color: var(--text);
    background: rgba(212, 160, 23, 0.12);
    border-color: rgba(212, 160, 23, 0.2);
}

.admin-content {
    padding: 18px;
}

.admin-search {
    display: grid;
    gap: 10px;
    width: 100%;
}

.admin-search input {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: #0f1622;
    color: var(--text);
}

.admin-search select {
    width: 100%;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: #0f1622;
    color: var(--text);
}

.list-toolbar {
    display: grid;
    gap: 12px;
    padding: 14px 16px;
    margin-bottom: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.list-toolbar-copy {
    display: grid;
    gap: 4px;
}

.list-toolbar-copy strong {
    font-size: 15px;
}

.list-toolbar-copy span {
    color: var(--muted);
    font-size: 13px;
}

.admin-filter-grid {
    display: grid;
    gap: 10px;
    grid-template-columns: 1fr;
}

.compact-field {
    gap: 6px;
}

.compact-field span {
    font-size: 12px;
}

.filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.desktop-only {
    display: none;
}

.mobile-card-list {
    display: grid;
    gap: 14px;
}

.mobile-record-card {
    display: grid;
    gap: 14px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.03) 0%, rgba(255, 255, 255, 0.02) 100%),
        rgba(255, 255, 255, 0.02);
}

.mobile-record-main {
    display: grid;
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.empty-state {
    padding: 18px;
    border: 1px dashed rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.02);
    color: var(--muted);
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.dashboard-stack {
    display: grid;
    gap: 20px;
    padding-bottom: 6px;
}

/* Dashboard KPI cards: pack to the left instead of stretching full width */
.dashboard-stack .metric-grid {
    justify-content: start;
}

@media (min-width: 720px) {
    .dashboard-stack .metric-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 240px));
    }
}

.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 16px;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    transition: background-color 140ms ease, border-color 140ms ease;
}

.pagination-link:hover {
    background: rgba(212, 160, 23, 0.14);
    border-color: rgba(212, 160, 23, 0.35);
}

.pagination-link.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.pagination-status {
    color: var(--muted);
    font-size: 13px;
}

.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Let the delete button sit as a direct flex sibling of the edit link so
   both align identically — the wrapping <form> box is collapsed away. */
.inline-actions .delete-form,
.table-actions .delete-form {
    display: contents;
}

.dashboard-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 18px;
}

.inline-actions form,
.delete-form {
    margin: 0;
}

.challenge-checkin-form {
    flex: 1 1 260px;
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
}

.js-loading-button {
    gap: 10px;
}

.button-spinner {
    display: none;
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
}

.js-upload-form.is-submitting {
    opacity: 0.82;
}

.js-upload-form.is-submitting .js-loading-button {
    cursor: progress;
    filter: saturate(0.92);
}

.js-upload-form.is-submitting .button-spinner {
    display: inline-block;
    animation: button-spinner-rotate 0.8s linear infinite;
}

.js-upload-form.is-submitting .photo-capture-trigger,
.js-upload-form.is-submitting input,
.js-upload-form.is-submitting textarea,
.js-upload-form.is-submitting select,
.js-upload-form.is-submitting button {
    pointer-events: none;
}

@keyframes button-spinner-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.delete-form {
    margin-top: 14px;
}

.file-chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    width: fit-content;
}

.content-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}

.content-head h2 {
    margin: 0;
    font-size: 28px;
    line-height: 1.1;
}

.table-wrap {
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
}

.data-table {
    width: 100%;
    min-width: 760px;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.data-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #111823;
    color: var(--gold-soft);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.data-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
}

.assessment-section {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

.assessment-section h3 {
    margin: 0;
    font-size: 20px;
}

.assessment-hint {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.comparison-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.comparison-card {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid rgba(212, 160, 23, 0.16);
    border-radius: 12px;
    background: rgba(212, 160, 23, 0.08);
}

.comparison-card span,
.comparison-card small {
    color: var(--muted);
}

.comparison-card strong {
    font-size: 18px;
}

.ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.ranking-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.ranking-list li strong {
    min-width: 0;
    overflow-wrap: anywhere;
}

.ranking-list li > span {
    flex: 0 0 auto;
    font-weight: 700;
    color: var(--brand-soft);
}

.dashboard-pie-panel {
    display: grid;
    gap: 20px;
}

.dashboard-pie-chart {
    position: relative;
    width: min(100%, 260px);
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.dashboard-pie-chart::after {
    content: "";
    position: absolute;
    inset: 19%;
    border-radius: 50%;
    background: rgba(15, 20, 30, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.dashboard-pie-center {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: grid;
    place-content: center;
    text-align: center;
    gap: 4px;
}

.dashboard-pie-center strong {
    font-size: 32px;
    color: var(--gold);
}

.dashboard-pie-center span {
    color: var(--muted);
    font-size: 13px;
}

.dashboard-pie-legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.dashboard-pie-legend li {
    display: grid;
    grid-template-columns: 14px minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.dashboard-pie-legend li.empty {
    grid-template-columns: 1fr;
    color: var(--muted);
}

.dashboard-pie-legend strong,
.dashboard-pie-legend span,
.dashboard-pie-legend small {
    min-width: 0;
    overflow-wrap: anywhere;
}

.dashboard-pie-legend span,
.dashboard-pie-legend small {
    color: var(--muted);
}

.dashboard-pie-swatch {
    width: 14px;
    height: 14px;
    border-radius: 999px;
}

.score-bar {
    flex: 0 0 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.score-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--brand), var(--accent));
}

.report-sheet {
    display: grid;
    gap: 18px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
    font-size: 14px;
}

.checkbox-row input {
    width: 18px;
    height: 18px;
    margin: 0;
}

.team-media-row {
    align-items: end;
}

.team-icon-preview-wrap {
    display: grid;
    gap: 6px;
}

.team-icon-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 92px;
    border: 1px dashed var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    overflow: hidden;
}

.team-icon-preview img,
.team-listing-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.team-listing {
    display: grid;
    grid-template-columns: 52px 1fr;
    gap: 12px;
    align-items: center;
}

.team-listing-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--gold-soft);
    overflow: hidden;
}

.team-listing-icon.large {
    width: 56px;
    height: 56px;
    border-radius: 12px;
}

.stack-list {
    display: grid;
    gap: 12px;
}

.data-row {
    display: grid;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.meta-line {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
    margin-top: 4px;
    word-break: break-word;
}

.participant-hero,
.assessment-overview {
    padding: 14px 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(16, 22, 32, 0.88);
}

.participant-hero-main,
.detail-list,
.participant-grid {
    display: grid;
    gap: 16px;
}

.participant-hero-main {
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: center;
    gap: 12px;
}

.participant-hero .section-kicker {
    margin-bottom: 2px;
    font-size: 11px;
}

.participant-hero h2 {
    margin: 0;
    font-size: 18px;
    line-height: 1.15;
}

.detail-list > div {
    display: grid;
    gap: 4px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.detail-list > div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.detail-list span {
    color: var(--muted);
    font-size: 13px;
}

.detail-list strong {
    font-size: 15px;
}

.participant-section-nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: -4px;
}

.participant-action-focus {
    display: grid;
    gap: 12px;
    grid-template-columns: 1fr;
}

.participant-return-action {
    display: flex;
    justify-content: center;
}

.participant-secondary-menu {
    display: grid;
    gap: 14px;
    padding: 18px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02)),
        rgba(255, 255, 255, 0.02);
}

.participant-secondary-head {
    display: grid;
    gap: 8px;
}

.participant-secondary-head h2 {
    margin: 0;
    font-size: 20px;
}

.participant-secondary-head > span {
    color: var(--muted);
    font-size: 13px;
}

.participant-secondary-groups {
    display: grid;
    gap: 10px;
}

.participant-menu-group {
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    background: rgba(15, 22, 34, 0.72);
}

.participant-menu-group summary {
    cursor: pointer;
    padding: 14px 16px;
    color: var(--text);
    font-weight: 800;
}

.participant-menu-links {
    display: grid;
    gap: 8px;
    padding: 0 12px 12px;
}

.participant-menu-links a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.06);
}

.participant-menu-links a:hover {
    color: var(--text);
    border-color: rgba(212, 160, 23, 0.25);
    background: rgba(212, 160, 23, 0.08);
}

.participant-action-card {
    position: relative;
    display: grid;
    gap: 7px;
    min-height: 132px;
    padding: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 18px;
    background:
        radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.12), transparent 34%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02));
    color: var(--text);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
}

.participant-action-card::after {
    content: "";
    position: absolute;
    right: -30px;
    bottom: -42px;
    width: 112px;
    height: 112px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
}

.participant-action-card.primary {
    border-color: rgba(212, 160, 23, 0.42);
    background:
        radial-gradient(circle at 88% 8%, rgba(250, 204, 21, 0.32), transparent 34%),
        linear-gradient(135deg, rgba(212, 160, 23, 0.28), rgba(127, 29, 29, 0.12)),
        rgba(255, 255, 255, 0.04);
}

.participant-action-card.score-card {
    border-color: rgba(56, 189, 248, 0.28);
    background:
        radial-gradient(circle at 88% 8%, rgba(56, 189, 248, 0.22), transparent 34%),
        linear-gradient(135deg, rgba(14, 165, 233, 0.14), rgba(255, 255, 255, 0.03));
}

.participant-action-card.active {
    outline: 2px solid rgba(250, 204, 21, 0.35);
    outline-offset: 2px;
}

.participant-action-card strong {
    position: relative;
    z-index: 1;
    font-size: 26px;
    line-height: 1;
}

.participant-action-card small,
.action-card-kicker {
    position: relative;
    z-index: 1;
}

.participant-action-card small {
    color: var(--muted);
    line-height: 1.35;
}

.participant-action-card.primary small {
    color: rgba(255, 255, 255, 0.84);
}

.action-card-kicker {
    color: var(--gold-soft);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.participant-section-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.03);
    color: var(--muted);
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    width: 100%;
}

.participant-section-link.active {
    border-color: rgba(212, 160, 23, 0.32);
    background: rgba(212, 160, 23, 0.14);
    color: var(--gold-soft);
}

.participant-points-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
}

.participant-inline-actions {
    align-items: stretch;
}

.participant-table-wrap {
    width: 100%;
}

.participant-data-table {
    min-width: 560px;
}

.participant-points-list .mobile-record-card {
    grid-template-columns: minmax(0, 1fr);
}

.points-pill,
.points-positive,
.points-negative {
    font-weight: 700;
}

.points-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 0 14px;
    border-radius: 999px;
    width: fit-content;
}

.points-pill.positive,
.points-positive {
    color: #bbf7d0;
}

.points-pill.negative,
.points-negative {
    color: #fecaca;
}

.points-pill.positive {
    background: rgba(16, 185, 129, 0.16);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.points-pill.negative {
    background: rgba(185, 28, 28, 0.16);
    border: 1px solid rgba(185, 28, 28, 0.32);
}

.feedback-card {
    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.feedback-response-card {
    display: grid;
    gap: 8px;
    margin-top: 14px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.feedback-question {
    gap: 8px;
}

.feedback-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    background: #0f1622;
}

.feedback-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
}

.narrow {
    max-width: 720px;
}

.timeline {
    grid-template-columns: 1fr;
}

.timeline-date {
    display: inline-block;
    margin-bottom: 10px;
    color: var(--gold-soft);
    font-size: 12px;
    font-weight: 700;
}

.timeline-item h3,
.module-card h3,
.module-card h2 {
    margin: 0 0 12px;
    font-size: 20px;
}

.clean-list {
    margin: 0;
    padding-left: 18px;
}

/* Expressive workout cards in the participant area */
.workout-list {
    display: grid;
    gap: 14px;
}

.workout-card {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid rgba(212, 160, 23, 0.18);
    border-radius: 14px;
    background:
        linear-gradient(135deg, rgba(212, 160, 23, 0.1) 0%, rgba(18, 25, 38, 0.6) 60%),
        rgba(255, 255, 255, 0.02);
}

.workout-card-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.workout-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: 0 0 auto;
    border-radius: 12px;
    font-size: 22px;
    background: rgba(212, 160, 23, 0.16);
    border: 1px solid rgba(212, 160, 23, 0.25);
}

.workout-card-title {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.workout-card-title h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.workout-level-badge {
    align-self: flex-start;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--gold-soft);
    background: rgba(212, 160, 23, 0.14);
    border: 1px solid rgba(212, 160, 23, 0.3);
}

.workout-card-meta {
    color: var(--muted);
    font-size: 13px;
}

.workout-card-desc {
    margin: 0;
    color: var(--text);
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.workout-card-action {
    width: 100%;
}

.clean-list.compact li + li {
    margin-top: 8px;
}

.module-grid {
    grid-template-columns: 1fr;
}

.site-footer {
    padding: 24px 18px 36px;
    border-top: 1px solid var(--line);
}

.inner-page {
    background: linear-gradient(180deg, #0a0d12 0%, #121926 100%);
}

.stacked {
    display: grid;
    gap: 18px;
    padding: 34px 0 60px;
}

.wide {
    width: 100%;
}

.sub-header h1 {
    font-size: 30px;
}

.participant-page .sub-header h1 {
    font-size: 22px;
    line-height: 1.1;
}

@media (min-width: 720px) {
    .sub-header {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .sub-header-main,
    .header-actions {
        width: auto;
    }

    .header-actions {
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    .header-button {
        width: auto;
        min-width: 104px;
    }

    .admin-grid,
    .data-grid,
    .form-split {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-search {
        grid-template-columns: minmax(220px, 340px) auto auto;
        justify-content: end;
        align-items: center;
        width: auto;
    }

    .admin-filter-grid {
        grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
        align-items: end;
    }

    .dashboard-toolbar {
        justify-content: flex-start;
    }

    .list-toolbar {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .desktop-only {
        display: block;
    }

    .mobile-card-list {
        display: none;
    }

    .admin-shell {
        grid-template-columns: 280px minmax(0, 1fr);
        align-items: start;
    }

    .data-row {
        grid-template-columns: 1fr auto;
        align-items: center;
    }

    .button {
        width: auto;
    }

    .hero-actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .comparison-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .participant-grid,
    .participant-points-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .participant-section-nav {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .participant-action-focus {
        grid-template-columns: 1.35fr 1fr 1fr 1fr;
    }
}

@media (min-width: 920px) {
    .two-col,
    .split,
    .timeline,
    .module-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .timeline {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .module-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .site-header,
    .sub-header {
        padding-left: 28px;
        padding-right: 28px;
    }

    .site-header {
        align-items: center;
    }

    .site-header-shell {
        max-width: 1280px;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        gap: 24px;
    }

    .sub-header {
        align-items: center;
        flex-direction: row;
    }

    .band,
    .hero,
    .site-footer {
        padding-left: 28px;
        padding-right: 28px;
    }

    .hero {
        min-height: calc(100vh - 72px);
        padding-top: 56px;
        padding-bottom: 42px;
    }

    .hero h1,
    .intro h2,
    .rules-band h2 {
        font-size: clamp(42px, 5vw, 64px);
    }

    .sub-header h1 {
        font-size: clamp(26px, 4vw, 42px);
    }

    .participant-page .sub-header h1 {
        font-size: clamp(20px, 2.2vw, 28px);
    }

    .hero-copy {
        font-size: 18px;
    }

    .site-nav {
        width: auto;
        flex-wrap: nowrap;
        overflow: visible;
        justify-content: flex-end;
        white-space: normal;
    }

    .admin-sidebar {
        position: sticky;
        top: 96px;
    }

    .dashboard-pie-panel {
        grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
        align-items: center;
    }
}

@media (max-width: 719px) {
    .identity-panel {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .identity-copy h2 {
        font-size: 17px;
        line-height: 1.15;
    }

    .header-brand {
        align-items: flex-start;
    }

    .brand-logo {
        width: 48px;
        height: 48px;
    }

    .compact-action {
        min-width: 0;
    }

    .dashboard-toolbar .button,
    .participant-inline-actions .button,
    .participant-inline-actions form,
    .challenge-checkin-form {
        width: 100%;
    }

    .participant-hero,
    .assessment-overview,
    .module-card,
    .metric,
    .mobile-record-card {
        padding: 16px;
    }

    .participant-hero-main {
        grid-template-columns: 1fr;
    }

    .team-listing-icon.large {
        width: 52px;
        height: 52px;
    }

    .participant-section-nav {
        grid-template-columns: 1fr 1fr;
    }

    .dashboard-pie-legend li {
        grid-template-columns: 14px minmax(0, 1fr);
    }

    .dashboard-pie-legend span,
    .dashboard-pie-legend small {
        justify-self: start;
    }

    .participant-data-table {
        min-width: 0;
    }
}

/* ----------------------------------------------------------------------------
   Modern interaction polish (additive — hover/active feedback, accessible focus)
   ---------------------------------------------------------------------------- */

.button {
    transition: transform 140ms ease, box-shadow 140ms ease, filter 140ms ease,
        background-color 140ms ease, border-color 140ms ease;
}

.button:hover {
    transform: translateY(-1px);
}

.button:active {
    transform: translateY(0);
    filter: brightness(0.96);
}

.button.primary:hover {
    box-shadow: 0 8px 20px rgba(212, 160, 23, 0.28);
    filter: brightness(1.04);
}

.button.secondary:hover,
.header-button:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(212, 160, 23, 0.35);
}

.button.danger:hover {
    background: rgba(185, 28, 28, 0.26);
}

.module-card,
.comparison-card,
.mobile-record-card,
.timeline-item {
    transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.module-card:hover,
.comparison-card:hover,
.mobile-record-card:hover {
    transform: translateY(-2px);
    border-color: rgba(212, 160, 23, 0.28);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

a:not(.button),
.identity-pill {
    transition: color 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

/* Visible keyboard focus for accessibility */
a:focus-visible,
button:focus-visible,
.button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--gold-soft);
    outline-offset: 2px;
}

/* Respect users who prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
    }

    .button:hover,
    .module-card:hover,
    .comparison-card:hover,
    .mobile-record-card:hover {
        transform: none;
    }
}

/* ----------------------------------------------------------------------------
   Bulk assignment screen (Vínculos de treino) — list every participant with a
   per-row treino + desafio selector for a fast, save-once workflow.
   ---------------------------------------------------------------------------- */

.bulk-assign-apply {
    padding: 14px;
    border: 1px dashed rgba(212, 160, 23, 0.3);
    border-radius: 12px;
    background: rgba(212, 160, 23, 0.06);
}

.bulk-assign-list {
    display: grid;
    gap: 10px;
}

.bulk-assign-team {
    margin-top: 6px;
    color: var(--gold-soft);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bulk-assign-row {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 20, 30, 0.6);
}

.bulk-assign-head {
    background: transparent;
    border: 0;
    padding: 0 12px;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bulk-assign-person strong {
    display: block;
}

.bulk-assign-field {
    margin: 0;
}

.bulk-assign-field-label {
    color: var(--muted);
    font-size: 13px;
}

@media (min-width: 920px) {
    .bulk-assign-row {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr);
        align-items: center;
        gap: 14px;
    }

    .bulk-assign-person {
        display: flex;
        flex-direction: column;
        gap: 2px;
    }

    /* Header row supplies the column labels on desktop, so hide per-field ones */
    .bulk-assign-row:not(.bulk-assign-head) .bulk-assign-field-label {
        display: none;
    }
}

/* Checkbox participant picker (select treino/desafio, then check people) */
.bulk-select-list {
    display: grid;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 12px;
    background: rgba(15, 20, 30, 0.6);
}

.bulk-select-all {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 4px 10px;
    border-bottom: 1px solid var(--line);
    font-weight: 700;
    cursor: pointer;
}

/* Modern checkbox styling for the participant picker */
.bulk-select-list input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    margin: 0;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 7px;
    background: #0f1622;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.bulk-select-list input[type="checkbox"]:hover {
    border-color: rgba(212, 160, 23, 0.5);
}

.bulk-select-list input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #d4a017 0%, #f3d27a 100%);
    border-color: transparent;
}

.bulk-select-list input[type="checkbox"]:checked::after {
    content: "";
    width: 6px;
    height: 11px;
    margin-top: -2px;
    border: solid #18130a;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.bulk-select-list input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(212, 160, 23, 0.3);
}

.bulk-select-row {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 12px;
    align-items: center;
    padding: 10px 8px;
    border-radius: 10px;
}

.bulk-select-row.js-participant-row {
    cursor: pointer;
}

.bulk-select-row.js-participant-row:hover {
    background: rgba(255, 255, 255, 0.04);
}

.bulk-select-head {
    display: none;
    color: var(--muted);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.bulk-cell[data-label]::before {
    content: attr(data-label) ": ";
    color: var(--muted);
    font-size: 12px;
}

@media (min-width: 920px) {
    .bulk-select-row {
        grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.9fr);
        gap: 12px;
    }

    .bulk-select-head {
        display: grid;
    }

    .bulk-cell[data-label]::before {
        content: none;
    }
}
