:root {
    --primary: #e30613;
    --primary-deep: #8f0010;
    --primary-soft: #fff0f1;
    --red: #e30613;
    --ink: #251b1d;
    --muted: #627184;
    --line: #dbe3eb;
    --surface: #ffffff;
    --canvas: #f8f7f7;
    --green: #21834b;
    --shadow: 0 18px 45px rgba(100, 0, 12, .10);
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; }
body { margin: 0; color: var(--ink); background: var(--canvas); font-size: 15px; line-height: 1.5; }
a { color: var(--primary); text-decoration: none; font-weight: 700; }
a:hover { color: var(--primary-deep); }
button, input, select { font: inherit; }
button { cursor: pointer; }

.site-header { min-height: 78px; display: flex; align-items: center; justify-content: space-between; padding: 0 5vw; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 72px; height: 36px; color: #fff; background: var(--primary); font-size: 19px; font-weight: 900; letter-spacing: -.7px; transform: skew(-9deg); }
.brand-copy { display: grid; line-height: 1.05; }
.brand-copy strong { color: var(--primary-deep); font-size: 16px; }
.brand-copy small { color: var(--muted); font-size: 11px; margin-top: 4px; }
.top-nav { display: flex; align-items: center; gap: 25px; }
.top-nav a { font-size: 14px; }
.nav-cta { color: #fff !important; padding: 10px 17px; background: var(--red); }
.nav-exit { color: var(--muted) !important; }
.user-chip { display: flex; align-items: center; gap: 7px; font-weight: 700; }
.user-chip small { color: var(--muted); font-size: 11px; font-weight: 400; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.page-shell { width: min(1180px, calc(100% - 40px)); min-height: calc(100vh - 142px); margin: 0 auto; padding: 58px 0 80px; }
.site-footer { display: flex; justify-content: space-between; padding: 22px 5vw; color: var(--muted); background: #eaf0f5; font-size: 12px; }

.flash-stack { display: grid; gap: 10px; margin-bottom: 25px; }
.flash { display: flex; gap: 10px; align-items: center; padding: 13px 16px; background: var(--surface); border-left: 4px solid var(--primary); box-shadow: 0 5px 15px rgba(100, 0, 12, .06); }
.flash span { color: var(--primary); font-weight: 900; }
.flash-erro { border-color: var(--red); }
.flash-erro span { color: var(--red); }
.flash-ok { border-color: var(--green); }
.flash-ok span { color: var(--green); }

.eyebrow, .panel-kicker { color: var(--red); text-transform: uppercase; font-size: 11px; font-weight: 900; letter-spacing: 1.5px; }
.auth-layout { display: grid; grid-template-columns: minmax(0, 1fr) 430px; align-items: stretch; min-height: 560px; background: var(--surface); box-shadow: var(--shadow); }
.auth-intro { display: flex; flex-direction: column; justify-content: center; padding: 65px 9%; color: #fff; background: var(--primary-deep); position: relative; overflow: hidden; }
.auth-intro::after { content: ""; position: absolute; width: 230px; height: 230px; right: -75px; bottom: -90px; border: 28px solid rgba(255,255,255,.08); transform: rotate(45deg); }
.auth-intro h1 { margin: 18px 0; max-width: 470px; font-size: clamp(38px, 5vw, 64px); line-height: .98; letter-spacing: -2px; }
.auth-intro h1 em { color: #ffcc00; font-style: normal; }
.auth-intro p { max-width: 430px; margin: 0; color: #ffe2e4; font-size: 17px; }
.intro-rule { width: 48px; height: 5px; margin: 45px 0 14px; background: #ffcc00; }
.intro-note { color: #f6bec3; font-size: 12px; }
.form-panel, .list-panel, .table-panel, .report-section { padding: 29px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(100, 0, 12, .04); }
.auth-layout .form-panel { border: 0; box-shadow: none; padding: 64px 48px; }
.form-panel h2, .list-panel h2, .table-panel h2, .report-section h2 { margin: 5px 0 8px; font-size: 24px; letter-spacing: -.5px; }
.muted, .section-heading p, .page-heading p { color: var(--muted); }
.form-grid { display: grid; gap: 18px; margin-top: 28px; }
.two-col { grid-template-columns: 1fr 1fr; }
.span-2 { grid-column: span 2; }
.form-grid label { display: grid; gap: 7px; color: var(--ink); font-weight: 700; font-size: 13px; }
input, select { width: 100%; padding: 12px 13px; color: var(--ink); background: #fbfcfd; border: 1px solid #cbd7e2; outline: 0; }
input:focus, select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(227, 6, 19, .12); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 43px; padding: 10px 17px; border: 0; font-weight: 800; text-decoration: none; }
.button-primary { color: #fff; background: var(--red); }
.button-primary:hover { color: #fff; background: #bd0010; }
.button-small { min-height: 35px; padding: 7px 12px; font-size: 12px; }
.button-quiet { color: var(--primary); background: var(--primary-soft); }
.form-foot { margin-top: 24px; color: var(--muted); font-size: 13px; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 8px; }
.lgpd-consent { display: flex !important; grid-template-columns: auto 1fr; align-items: center; gap: 9px; margin-top: 4px; color: var(--muted) !important; font-size: 12px !important; font-weight: 400 !important; }
.lgpd-consent input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }
.lgpd-consent span { line-height: 1.4; }
.policy-link { padding: 0; color: var(--primary); background: transparent; border: 0; font-weight: 800; text-decoration: underline; }
.policy-modal { position: fixed; z-index: 10; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(37, 27, 29, .55); }
.policy-content { width: min(620px, 100%); max-height: min(720px, 90vh); overflow-y: auto; padding: 29px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.policy-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.policy-header h2 { margin: 5px 0 0; color: var(--primary-deep); font-size: 25px; }
.policy-close { padding: 0 5px; color: var(--muted); background: transparent; border: 0; font-size: 28px; line-height: 1; }
.policy-body { margin: 22px 0; color: var(--muted); font-size: 14px; }
.policy-body p { margin: 0 0 15px; }
.narrow-page { max-width: 800px; margin: 0 auto; }
.section-heading { margin-bottom: 28px; }
.section-heading h1, .page-heading h1 { margin: 7px 0; color: var(--primary-deep); font-size: clamp(32px, 5vw, 48px); line-height: 1.05; letter-spacing: -1.5px; }
.wide-panel { padding: 38px; }

.page-heading { display: flex; justify-content: space-between; align-items: end; gap: 25px; margin-bottom: 34px; }
.role-label, .count-badge, .status-pill, .course-tag { display: inline-flex; width: fit-content; align-items: center; padding: 5px 10px; color: var(--primary); background: var(--primary-soft); font-size: 11px; font-weight: 900; text-transform: uppercase; letter-spacing: .5px; }
.metric-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 17px; margin-bottom: 26px; }
.metric-card { display: grid; gap: 4px; min-height: 155px; padding: 23px; background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--primary); }
.metric-card.accent { border-top-color: var(--red); }
.metric-label, .metric-card small { color: var(--muted); font-size: 12px; }
.metric-card strong { color: var(--primary-deep); font-size: 39px; line-height: 1; margin: 10px 0; }
.metric-link { align-self: center; font-size: 18px; }
.content-grid { display: grid; grid-template-columns: .8fr 1.2fr; gap: 20px; }
.panel-title { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 20px; }
.icon-box, .selection-mark { display: grid; place-items: center; width: 36px; height: 36px; color: #fff; background: var(--primary); font-size: 22px; }
.list-item { display: flex; align-items: center; gap: 11px; padding: 13px 0; border-top: 1px solid var(--line); }
.course-badge { display: grid; place-items: center; width: 42px; height: 30px; color: var(--primary); background: var(--primary-soft); font-size: 11px; font-weight: 900; }
.list-status { margin-left: auto; color: var(--green); font-size: 12px; }
.notice-bar { display: flex; align-items: center; gap: 14px; margin-bottom: 23px; padding: 15px 18px; background: #fff8df; border-left: 4px solid #e5b400; }
.notice-bar p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.notice-icon { display: grid; place-items: center; width: 23px; height: 23px; border-radius: 50%; color: #fff; background: #d49d00; font-weight: 900; }
.table-panel, .report-section { padding: 0; overflow: hidden; }
.candidate-management { background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(100, 0, 12, .04); }
.management-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 27px 29px 19px; }
.management-heading h2 { margin: 5px 0 0; font-size: 24px; letter-spacing: -.5px; }
.candidate-tabs { display: flex; gap: 7px; padding: 0 29px; border-bottom: 1px solid var(--line); }
.candidate-tab { display: inline-flex; align-items: center; gap: 9px; padding: 14px 15px 13px; color: var(--muted); background: transparent; border: 0; border-bottom: 3px solid transparent; font-size: 13px; font-weight: 800; }
.candidate-tab.active { color: var(--primary-deep); border-bottom-color: var(--primary); }
.candidate-tab strong { min-width: 22px; padding: 2px 6px; color: var(--muted); background: #eef2f5; border-radius: 12px; font-size: 11px; text-align: center; }
.candidate-tab.active strong { color: var(--primary); background: var(--primary-soft); }
.tab-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); }
.selected-dot { background: var(--green); }
.waiting-dot { background: #d49d00; }
.candidate-tab-panel { padding: 0 29px; }
.candidate-filter { display: flex; align-items: center; gap: 12px; padding: 18px 0 13px; }
.candidate-filter label { color: var(--muted); font-size: 13px; font-weight: 800; }
.candidate-filter select { width: min(100%, 320px); padding: 9px 11px; }
.candidate-row { display: grid; grid-template-columns: minmax(230px, 1fr) minmax(150px, .55fr) auto; align-items: center; gap: 22px; padding: 16px 0; border-top: 1px solid var(--line); }
.candidate-row:first-child { border-top: 0; }
.candidate-row .person-cell { min-width: 0; }
.candidate-row .person-cell > div { display: grid; gap: 2px; }
.candidate-row .person-cell strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.candidate-row .person-cell small { color: var(--muted); font-size: 12px; }
.course-list { display: flex; flex-wrap: wrap; gap: 6px; }
.selected-avatar { background: var(--green); }
.candidate-row .course-tag { justify-self: start; }
.candidate-row form { justify-self: end; }
.table-panel .panel-title, .report-section .panel-title { margin: 0; padding: 27px 29px 19px; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 600px; }
th { color: var(--muted); background: #f8fafc; font-size: 11px; text-transform: uppercase; letter-spacing: .8px; }
th, td { padding: 15px 29px; text-align: left; border-top: 1px solid var(--line); }
td { color: var(--muted); }
td strong { color: var(--ink); }
.person-cell { display: flex; align-items: center; gap: 11px; }
.avatar { display: grid; place-items: center; width: 31px; height: 31px; color: #fff; background: var(--primary); font-weight: 900; }
.course-tag { color: var(--ink); background: #f1f4f7; text-transform: none; letter-spacing: 0; font-weight: 700; }
.status-pill { color: var(--green); background: #e9f5ee; }
.status-off { color: var(--red); background: #fff0f1; }
.empty-state { padding: 32px !important; color: var(--muted); text-align: center; }
.candidate-hero { display: flex; justify-content: space-between; align-items: center; min-height: 245px; padding: 45px 55px; color: #fff; background: var(--primary-deep); }
.candidate-hero h1 { margin: 10px 0; font-size: 46px; letter-spacing: -1.5px; }
.candidate-hero p { margin: 0; color: #ffe2e4; }
.candidate-symbol { color: #ffcc00; font-size: 90px; }
.selection-card, .waiting-card { display: flex; align-items: center; gap: 19px; margin-top: 21px; padding: 28px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--green); box-shadow: var(--shadow); }
.waiting-card { border-left-color: var(--primary); }
.selection-card h2, .waiting-card h2 { margin: 4px 0; color: var(--primary-deep); }
.selection-card p, .waiting-card p { margin: 0; color: var(--muted); }
.selection-state { margin-left: auto; color: var(--green); font-size: 12px; font-weight: 900; text-transform: uppercase; }
.waiting-number { color: var(--primary); font-size: 30px; font-weight: 900; }
.report-section { margin-bottom: 20px; }
.report-filters { display: grid; gap: 12px; margin-bottom: 24px; padding: 20px 24px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(100, 0, 12, .04); }
.filter-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-tab { padding: 10px 14px; color: var(--muted); background: #f8f8f8; border: 1px solid var(--line); font-size: 13px; font-weight: 800; }
.filter-tab:hover { color: var(--primary); border-color: #e4aeb2; }
.filter-tab.active { color: #fff; background: var(--primary); border-color: var(--primary); }
.course-filter { display: flex; align-items: center; gap: 12px; max-width: 560px; margin-top: 4px; }
.course-filter label { color: var(--muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.course-filter select { max-width: 360px; padding: 9px 11px; }
.report-print-header { display: none; }

@media (max-width: 760px) {
    .site-header { align-items: flex-start; gap: 20px; padding: 18px 20px; }
    .top-nav { flex-wrap: wrap; justify-content: end; gap: 12px 16px; }
    .user-chip { display: none; }
    .page-shell { width: min(100% - 24px, 1180px); padding-top: 30px; }
    .auth-layout, .content-grid { grid-template-columns: 1fr; }
    .auth-intro { min-height: 340px; padding: 38px 28px; }
    .auth-intro h1 { font-size: 42px; }
    .auth-layout .form-panel { padding: 36px 28px; }
    .metric-row { grid-template-columns: 1fr; }
    .page-heading { align-items: start; flex-direction: column; }
    .two-col { grid-template-columns: 1fr; }
    .span-2 { grid-column: auto; }
    .wide-panel { padding: 25px 20px; }
    .candidate-hero { padding: 32px 25px; }
    .candidate-hero h1 { font-size: 37px; }
    .candidate-symbol { font-size: 52px; }
    .management-heading { padding: 22px 20px 16px; }
    .candidate-tabs { overflow-x: auto; padding: 0 20px; }
    .candidate-tab { flex: 0 0 auto; padding-inline: 10px; }
    .candidate-tab-panel { padding: 0 20px; }
    .candidate-filter { align-items: stretch; flex-direction: column; gap: 6px; }
    .candidate-filter select { width: 100%; }
    .candidate-row { grid-template-columns: 1fr auto; gap: 12px; }
    .candidate-row .course-tag { grid-column: 1; }
    .candidate-row .course-list { grid-column: 1; }
    .candidate-row form { grid-column: 2; grid-row: 1 / span 2; }
    .selection-card, .waiting-card { align-items: flex-start; flex-wrap: wrap; }
    .selection-state { margin-left: 0; width: 100%; }
    .site-footer { padding: 20px; }
    .course-filter { align-items: stretch; flex-direction: column; }
    .course-filter select { max-width: none; }
}

@media print {
    @page { size: A4; margin: 16mm 14mm 18mm; }
    body { color: #231f20; background: #fff; font-family: Arial, sans-serif; font-size: 10pt; }
    .site-header, .site-footer, .page-heading, .report-filters, .button { display: none; }
    .page-shell { width: 100%; min-height: 0; padding: 0; }
    .report-print-header { display: grid; grid-template-columns: 110px 1fr auto; gap: 20px; align-items: center; padding: 0 0 18px; margin-bottom: 20px; border-bottom: 3px solid #e30613; }
    .report-brand { display: grid; gap: 5px; color: #8f0010; font-size: 9pt; font-weight: 700; text-align: center; }
    .report-brand-mark { display: grid; place-items: center; height: 34px; color: #fff; background: #e30613; font-size: 16pt; font-weight: 900; letter-spacing: -.7px; transform: skew(-9deg); }
    .report-heading h1 { margin: 3px 0; color: #8f0010; font-size: 18pt; line-height: 1.15; }
    .report-heading p { margin: 0; color: #627184; font-size: 9pt; }
    .report-kicker { color: #e30613; font-size: 8pt; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
    .report-details { display: grid; gap: 5px; min-width: 180px; color: #627184; font-size: 8.5pt; text-align: right; }
    .report-details strong { color: #231f20; }
    .report-section { margin-bottom: 18px; border: 1px solid #cfd8df; box-shadow: none; break-inside: avoid; }
    .report-section .panel-title { padding: 12px 15px 9px; border-bottom: 2px solid #e30613; }
    .report-section h2 { margin: 2px 0 0; color: #8f0010; font-size: 13pt; }
    .panel-kicker { color: #e30613; font-size: 8pt; }
    table { min-width: 0; }
    thead { display: table-header-group; }
    tr { break-inside: avoid; }
    th { color: #fff; background: #8f0010; font-size: 8pt; }
    th, td { padding: 8px 10px; border-color: #dbe3eb; }
    td { color: #231f20; }
    td strong { color: #231f20; }
    .count-badge, .status-pill, .course-tag { padding: 3px 7px; font-size: 8pt; }
}
