:root {
    --bg: #f7f5f2;
    --panel: #ffffff;
    --text: #251b20;
    --muted: #6f6670;
    --line: #ded7dc;
    --brand: #7a1f38;
    --brand-dark: #4b1223;
    --brand-soft: #f3e4e9;
    --gold: #b88a32;
    --green: #2f6d54;
    --danger: #a22b22;
    --ok: #1e7a54;
    --radius: 8px;
    --sidebar-bg: #251b20;
    --sidebar-width: 250px;
    --app-font: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--app-font); color: var(--text); background: var(--bg); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; }
.button.primary { background: var(--brand); color: #fff; border-color: var(--brand); }
.button.small { min-height: 34px; padding: 0 12px; }
.muted { color: var(--muted); }
.eyebrow { display: block; color: var(--gold); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0; margin-bottom: 6px; }

.public-body { background: #fff; }
.public-header { position: sticky; top: 0; z-index: 10; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 6vw; background: rgba(255,255,255,.94); border-bottom: 1px solid var(--line); }
.public-brand, .brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; }
.public-brand span, .brand span { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; background: var(--brand); color: #fff; }
.public-header nav { display: flex; align-items: center; gap: 18px; color: #3b3037; }

.hero { position: relative; min-height: calc(100vh - 72px); display: grid; align-items: end; overflow: hidden; }
.hero-media { position: absolute; inset: 0; background-size: cover; background-position: center; }
.hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(35,17,24,.86), rgba(35,17,24,.38) 58%, rgba(35,17,24,.08)); }
.hero-content { position: relative; width: min(760px, 88vw); margin: 0 0 12vh 6vw; color: #fff; }
.hero-content span { color: #f0c77b; font-weight: 700; }
.hero-content h1 { margin: 12px 0 14px; font-size: clamp(38px, 6vw, 76px); line-height: 1.02; letter-spacing: 0; }
.hero-content p { max-width: 660px; margin: 0 0 24px; font-size: 18px; line-height: 1.55; color: #f8eef2; }

.public-section { width: min(1120px, 88vw); margin: 0 auto; padding: 72px 0; }
.public-section h2, .public-band h2 { margin: 0 0 12px; font-size: 32px; line-height: 1.15; }
.news-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 24px; }
.news-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; }
.news-card span { color: var(--gold); font-size: 13px; font-weight: 700; }
.news-card h3 { margin: 10px 0; font-size: 20px; line-height: 1.2; }
.news-card p { color: var(--muted); line-height: 1.5; margin: 0; }
.public-band { background: var(--brand-soft); border-block: 1px solid #ead0d9; padding: 54px 6vw; }
.public-band p { max-width: 720px; color: var(--muted); }

.guest-body { min-height: 100vh; display: grid; place-items: center; background: linear-gradient(135deg, #f7f1f3, #eef5f0); padding: 20px; }
.login-panel { width: min(420px, 100%); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; }
.login-brand { margin-bottom: 24px; }
.login-panel h1 { margin: 0 0 8px; font-size: 28px; }
.login-panel p { color: var(--muted); margin: 0 0 22px; }
.form { display: grid; gap: 14px; }
.form label { display: grid; gap: 6px; font-weight: 700; color: #3e3037; }
input, select, textarea { width: 100%; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; background: #fff; color: var(--text); }
.floating { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 20; }

.admin-body { min-height: 100vh; background: var(--bg); }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); background: var(--sidebar-bg); color: #fff; padding: 20px; display: flex; flex-direction: column; gap: 24px; }
.sidebar nav { display: grid; gap: 4px; }
.sidebar nav a, .link-button, .nav-group > span { color: #f1e8ed; padding: 10px 12px; border-radius: 6px; background: transparent; border: 0; text-align: left; cursor: pointer; }
.sidebar nav a:hover, .link-button:hover { background: rgba(255,255,255,.1); }
.nav-group { display: grid; gap: 2px; }
.nav-group > span { color: #d9b166; font-weight: 700; cursor: default; }
.nav-group a { margin-left: 10px; }
.sidebar-footer { display: grid; gap: 3px; margin-top: auto; }
.sidebar-footer form { margin: 0; }
.settings-link { display: flex; align-items: center; gap: 9px; padding: 10px 12px; border-radius: 6px; color: #f1e8ed; }
.settings-link:hover { background: rgba(255,255,255,.1); }
.main { margin-left: var(--sidebar-width); padding: 28px; }
.density-compact .main { padding: 18px; }
.density-compact th, .density-compact td { padding-block: 7px; }
.density-compact .panel { padding: 14px; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 22px; }
.topbar h1 { margin: 0; font-size: 30px; }
.icon-button { display: none; width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.user-chip { padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); }
.grid { display: grid; gap: 16px; }
.cards-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card, .panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.card span { display: block; color: var(--muted); margin-bottom: 10px; }
.card strong { font-size: 30px; }
.panel { margin-top: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 20px; }
.actions { display: flex; justify-content: flex-end; margin-bottom: 14px; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 11px 8px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 13px; font-weight: 700; }
.alert { padding: 12px 14px; border-radius: 6px; margin-bottom: 14px; border: 1px solid; }
.alert.success { background: #edf8f1; color: var(--ok); border-color: #b9dfc7; }
.alert.error { background: #fff1ef; color: var(--danger); border-color: #f0c3bd; }
.settings-head { display: flex; justify-content: space-between; }
.settings-form { max-width: 980px; }
.settings-users-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.settings-user-editor { padding-left: 20px; border-left: 1px solid var(--line); }
.settings-user-editor h2 { margin-bottom: 14px; }
.color-control, .range-control { display: flex; align-items: center; gap: 10px; min-height: 42px; }
.color-control input { flex: 0 0 54px; width: 54px; height: 40px; padding: 3px; }
.color-control code, .range-control output { color: var(--muted); }
.range-control input { padding-inline: 0; }
.sinapi-status { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.sinapi-status > div:last-child { display: grid; gap: 5px; text-align: right; }
.sinapi-status small { color: var(--muted); }
.directory-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; margin-top: 22px; }
.directory-section + .directory-section { padding-left: 28px; border-left: 1px solid var(--line); }
.directory-form { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.directory-form h3 { margin: 0; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.theme-dark {
    --bg: #171518;
    --panel: #242126;
    --text: #f4eff2;
    --muted: #bcb2b9;
    --line: #454047;
    --brand-soft: #3b2930;
    --green: #79bd9c;
    --danger: #f08a80;
    --ok: #78c9a4;
    color-scheme: dark;
}
.theme-dark input, .theme-dark select, .theme-dark textarea, .theme-dark .button, .theme-dark .icon-button,
.theme-dark .user-chip, .theme-dark .wbs-control button, .theme-dark .combobox-control button,
.theme-dark .combobox-options, .theme-dark .combobox-options button, .theme-dark .planning-toolbar details > div,
.theme-dark dialog { background: #2b272d; color: var(--text); }
.theme-dark .planning-table tbody tr, .theme-dark .step-row, .theme-dark .phase-block,
.theme-dark .finance-kpis span, .theme-dark .diary-list article { background: var(--panel); }
.theme-dark .subform, .theme-dark .resource-composition-form input[readonly], .theme-dark .resource-create-form input[readonly] { background: #211e22; }
.theme-dark .composition-resource > span { background: #21372c; }
.theme-dark .composition-resource[data-resource-type="Servico"] > span { background: #282f3d; color: #9eb9e8; }
.theme-dark .composition-resource[data-resource-type="Equipamento"] > span { background: #3b3220; color: #e3bd70; }
.theme-dark .planning-action-icon.danger:hover, .theme-dark .resource-edit-icon.danger:hover { background: #442623; }
.theme-dark .alert.success { background: #21372c; border-color: #39634c; }
.theme-dark .alert.error { background: #442623; border-color: #74413b; }
.theme-dark .compact-form label, .theme-dark .resource-create-form > label, .theme-dark .sinapi-combobox > label { color: var(--text); }
.theme-dark .module-tabs a:hover { background: #2b272d; color: #f0c77b; }
.theme-dark .module-tabs a[aria-selected="true"] { color: #f0c77b; }

@media (max-width: 900px) {
    .public-header { position: static; align-items: flex-start; flex-direction: column; padding: 18px 6vw; }
    .public-header nav { flex-wrap: wrap; gap: 12px; }
    .hero { min-height: 680px; }
    .hero-content { margin: 0 auto 56px; }
    .news-grid, .cards-3 { grid-template-columns: 1fr; }
    .sidebar { transform: translateX(-100%); transition: transform .18s ease; z-index: 30; }
    .sidebar.open { transform: translateX(0); }
    .main { margin-left: 0; padding: 18px; }
    .icon-button { display: inline-grid; place-items: center; }
    .topbar { justify-content: flex-start; }
    .user-chip { margin-left: auto; }
    .settings-users-grid { grid-template-columns: 1fr; }
    .settings-user-editor { padding: 18px 0 0; border-top: 1px solid var(--line); border-left: 0; }
    .directory-grid { grid-template-columns: 1fr; }
    .directory-section + .directory-section { padding: 24px 0 0; border-top: 1px solid var(--line); border-left: 0; }
    .sinapi-status { align-items: flex-start; flex-direction: column; }
    .sinapi-status > div:last-child { text-align: left; }
}

.no-margin { margin-top: 0; }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
.agenda-toolbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; }
.agenda-toolbar h2 { font-size: 28px; margin: 0 0 6px; }
.agenda-summary { margin-top: 16px; }
.agenda-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; margin-top: 16px; align-items: start; }
.agenda-side { display: grid; gap: 16px; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.calendar-weekdays span { padding: 0 8px 10px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.calendar-grid { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--line); gap: 1px; }
.calendar-day { min-height: 142px; background: #fff; padding: 10px; display: flex; flex-direction: column; gap: 8px; }
.calendar-day.empty { background: #faf8f6; }
.calendar-day.today { box-shadow: inset 0 0 0 2px var(--gold); }
.day-head { display: flex; align-items: center; justify-content: space-between; }
.day-head strong { font-size: 14px; }
.day-head a { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 6px; color: var(--brand); background: var(--brand-soft); font-weight: 700; }
.day-events { display: grid; gap: 6px; min-width: 0; }
.event-pill { border-left: 4px solid var(--event-color); background: #f9f6f7; border-radius: 6px; padding: 7px 8px; font-size: 12px; line-height: 1.25; color: var(--text); display: grid; gap: 2px; min-width: 0; }
.event-pill span { color: var(--muted); font-size: 11px; }
.status-cancelada { opacity: .62; text-decoration: line-through; }
.upcoming-list { display: grid; gap: 10px; }
.upcoming-item { display: grid; grid-template-columns: 14px minmax(0, 1fr); gap: 10px; align-items: start; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.upcoming-item strong { display: block; line-height: 1.2; }
.upcoming-item small { display: block; color: var(--muted); margin-top: 4px; }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.14); margin-top: 2px; }
.compact-form { display: grid; gap: 10px; }
.compact-form label { display: grid; gap: 5px; font-weight: 700; color: #3e3037; }
.checkbox { display: flex !important; align-items: center; gap: 8px !important; font-weight: 700; }
.checkbox input { width: auto; }
.activity-list { display: flex; flex-wrap: wrap; gap: 8px; }
.activity-chip { display: inline-flex; align-items: center; gap: 7px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 13px; }
.agenda-form-shell { max-width: 1040px; }
.form-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; margin-bottom: 18px; }
.form-header h2 { font-size: 28px; margin: 0 0 6px; }
.form-grid { display: grid; gap: 14px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.form-actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; }
.delete-form { margin-top: 14px; display: flex; justify-content: flex-end; }
.button.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.button:disabled { opacity: .5; cursor: not-allowed; }

@media (max-width: 1180px) {
    .agenda-layout { grid-template-columns: 1fr; }
    .agenda-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .agenda-side .panel:first-child { grid-column: 1 / -1; }
}

@media (max-width: 760px) {
    .agenda-toolbar, .form-header { flex-direction: column; }
    .toolbar-actions { justify-content: flex-start; }
    .calendar-weekdays { display: none; }
    .calendar-grid { display: grid; grid-template-columns: 1fr; background: transparent; border: 0; gap: 10px; }
    .calendar-day.empty { display: none; }
    .calendar-day { min-height: auto; border: 1px solid var(--line); border-radius: var(--radius); }
    .agenda-side, .form-grid.two, .form-grid.four { grid-template-columns: 1fr; }
}

.obra-hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px; align-items: center; }
.obra-hero h2, .obra-detail-head h2 { margin: 0 0 8px; font-size: 30px; }
.obra-kpis { display: grid; grid-template-columns: repeat(3, minmax(96px, 1fr)); gap: 10px; }
.obra-kpis article { background: var(--brand-soft); border: 1px solid #ead0d9; border-radius: var(--radius); padding: 14px; }
.obra-kpis span { display: block; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.obra-kpis strong { font-size: 26px; }
.obra-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 16px; margin-top: 16px; align-items: start; }
.section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 14px; }
.section-head h2 { margin: 0 0 6px; font-size: 22px; }
.obra-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.obra-card { display: grid; gap: 10px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 16px; }
.obra-card:hover { border-color: #c9b6c0; box-shadow: 0 8px 24px rgba(75, 18, 35, .08); }
.obra-card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.obra-card-top strong { font-size: 18px; line-height: 1.2; }
.status-badge { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; white-space: nowrap; }
.progress { height: 8px; border-radius: 999px; background: #ece7ea; overflow: hidden; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--gold)); }
.obra-card-meta, .money-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 13px; }
.money-row strong { color: var(--text); }
.compact-two { gap: 10px; }
.obra-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.module-tabs { display: flex; gap: 0; overflow-x: auto; margin: 16px 0; border-bottom: 1px solid var(--line); }
.module-tabs a { flex: 0 0 auto; padding: 11px 14px; border-bottom: 3px solid transparent; color: var(--muted); font-weight: 700; font-size: 14px; white-space: nowrap; }
.module-tabs a:hover { color: var(--brand-dark); background: #fff; }
.module-tabs a[aria-selected="true"] { color: var(--brand); border-bottom-color: var(--brand); background: var(--panel); }
.module-tabs a:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.obra-tab-panel[hidden] { display: none; }
.obra-tab-panel.panel { margin-top: 0; }
.obra-summary-grid { margin-top: 0; }
.obra-section { scroll-margin-top: 14px; }
.planning-dialog { position: fixed; inset: 0; width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 32px); margin: auto; padding: 0; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); box-shadow: 0 24px 64px rgba(37, 27, 32, .24); }
.planning-dialog::backdrop { background: rgba(37, 27, 32, .56); }
.planning-dialog-header { position: sticky; top: 0; z-index: 2; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 18px 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.planning-dialog-header h2 { margin: 0; font-size: 22px; }
.dialog-close { display: inline-grid; place-items: center; flex: 0 0 40px; width: 40px; height: 40px; padding: 0; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); cursor: pointer; font-size: 26px; line-height: 1; }
.planning-editor { padding: 20px; }
.planning-editor-actions { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
.predecessor-picker { min-width: 0; margin: 0; padding: 0; border: 0; }
.predecessor-picker legend { margin-bottom: 5px; padding: 0; color: #3e3037; font-weight: 700; }
.predecessor-picker input[type="search"] { margin-bottom: 8px; }
.predecessor-options { max-height: 176px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.predecessor-option { display: flex !important; align-items: flex-start; gap: 9px !important; padding: 8px 10px; border-bottom: 1px solid #eee8ec; cursor: pointer; font-weight: 500 !important; line-height: 1.3; }
.predecessor-option:last-child { border-bottom: 0; }
.predecessor-option:hover { background: var(--brand-soft); }
.predecessor-option input { flex: 0 0 auto; width: auto; margin: 2px 0 0; }
.predecessor-option[hidden] { display: none !important; }
.planning-view-toolbar { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.planning-view-toolbar > label { display: grid; width: min(230px, 100%); gap: 5px; color: #3e3037; font-size: 13px; font-weight: 700; }
.planning-view-actions { display: flex; gap: 8px; }
.column-picker { position: relative; }
.column-picker > summary { list-style: none; }
.column-picker > summary::-webkit-details-marker { display: none; }
.column-picker-menu { position: absolute; z-index: 9; top: calc(100% + 6px); right: 0; display: grid; width: 210px; max-height: 340px; overflow-y: auto; padding: 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 14px 34px rgba(37, 27, 32, .16); }
.column-picker-menu label { display: flex; align-items: center; gap: 8px; padding: 7px; color: var(--text); font-size: 13px; cursor: pointer; }
.column-picker-menu input { width: auto; }
.planning-root-drop { display: none; margin-bottom: 8px; padding: 10px; border: 1px dashed var(--brand); border-radius: 6px; color: var(--brand); background: var(--brand-soft); font-size: 12px; font-weight: 700; text-align: center; }
[data-planning-tree]:has(.dragging) .planning-root-drop { display: block; }
.planning-root-drop.drop-target { background: #dcefe3; border-color: var(--green); color: var(--green); }
.planning-table-wrap { border: 1px solid var(--line); border-radius: 6px; }
.planning-table { min-width: 1180px; background: #fff; }
.planning-table th { position: sticky; top: 0; z-index: 1; background: #f7f5f2; white-space: nowrap; }
.planning-table td { font-size: 13px; }
.planning-table tr.summary-item td { background: #faf8f6; }
.planning-table tr.summary-item .tree-item strong { font-weight: 700; }
.planning-table tr.dragging { opacity: .38; }
.planning-table tr.drop-target td { background: #edf8f1; box-shadow: inset 0 2px 0 var(--green), inset 0 -2px 0 var(--green); }
.wbs-cell { width: 92px; color: var(--muted); font-variant-numeric: tabular-nums; }
.wbs-control { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.wbs-control button, .wbs-spacer { flex: 0 0 24px; width: 24px; height: 24px; }
.wbs-control button { display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: #fff; color: var(--brand); cursor: pointer; line-height: 1; }
.wbs-control button:hover { background: var(--brand-soft); }
.wbs-control .drag-handle { border-color: transparent; color: var(--muted); cursor: grab; font-size: 20px; }
.wbs-control .drag-handle:active { cursor: grabbing; }
.tree-item { display: grid; gap: 6px; min-width: 320px; padding-left: min(calc(var(--tree-depth) * 22px), 286px); }
.tree-item-title { display: flex; align-items: center; gap: 8px; }
.tree-item strong { font-weight: 500; line-height: 1.3; }
.tree-item-title > span { flex: 0 0 auto; padding: 2px 6px; border: 1px solid #d9b166; border-radius: 4px; color: #795717; font-size: 10px; font-weight: 700; }
.planning-composition { width: min(520px, 100%); color: var(--muted); }
.planning-composition summary { width: fit-content; cursor: pointer; color: var(--brand); font-size: 11px; font-weight: 700; }
.composition-resources { display: grid; gap: 5px; margin-top: 7px; padding-left: 10px; border-left: 2px solid var(--line); }
.composition-resource { display: grid; grid-template-columns: 76px minmax(0, 1fr) 58px; gap: 7px; align-items: start; }
.composition-resource > span { padding: 2px 5px; border-radius: 4px; background: #edf8f1; color: var(--green); font-size: 9px; font-weight: 700; text-align: center; }
.composition-resource[data-resource-type="Servico"] > span { background: #eef1f8; color: #405a86; }
.composition-resource[data-resource-type="Equipamento"] > span { background: #fff5df; color: #7b5916; }
.composition-resource div { min-width: 0; }
.composition-resource strong, .composition-resource small { display: block; overflow-wrap: anywhere; }
.composition-resource strong { font-size: 11px; }
.composition-resource small { margin-top: 2px; color: var(--muted); font-size: 10px; }
.resource-edit-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 4px; color: var(--brand); font-size: 14px; }
.resource-edit-icon:hover { background: var(--brand-soft); }
.resource-edit-icon.danger { border: 0; background: transparent; color: var(--danger); cursor: pointer; }
.resource-edit-icon.danger:hover { background: #fff1ef; }
.resource-actions { display: flex; min-width: 58px; }
.resource-actions form { margin: 0; }
.composition-empty { margin: 0; color: var(--muted); font-size: 11px; }
.resource-composition-form { display: grid; gap: 16px; }
.resource-composition-form input[readonly] { background: #f4f1f3; color: var(--muted); }
.composition-values { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.predecessor-cell { max-width: 220px; color: var(--muted); }
.planning-actions { display: flex; align-items: center; gap: 5px; white-space: nowrap; }
.planning-actions form { margin: 0; }
.planning-action-icon { display: inline-grid; place-items: center; flex: 0 0 32px; width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: 5px; background: transparent; color: var(--brand); cursor: pointer; font-size: 19px; font-weight: 700; line-height: 1; }
.planning-action-icon:hover { border-color: var(--line); background: var(--brand-soft); }
.planning-action-icon:focus-visible { outline: 2px solid var(--gold); outline-offset: 1px; }
.planning-action-icon.danger { color: var(--danger); }
.planning-action-icon.danger:hover { border-color: #f0c3bd; background: #fff1ef; }
.planning-bottom-actions { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.planning-bottom-actions > strong { color: var(--text); font-size: 13px; }
.planning-bottom-actions > div { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.planning-mode-tabs { display: flex; overflow-x: auto; margin: 4px 0 20px; border-bottom: 1px solid var(--line); }
.planning-mode-tabs button { flex: 0 0 auto; padding: 11px 14px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.planning-mode-tabs button:hover { background: var(--brand-soft); color: var(--brand); }
.planning-mode-tabs button.active { border-bottom-color: var(--brand); color: var(--brand); }
.planning-mode-panel[hidden] { display: none; }
.obra-tab-panel:focus { outline: none; }
.planning-subhead { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.planning-subhead h3 { margin: 0 0 5px; font-size: 20px; }
.planning-subhead p { margin: 0; }
.planning-calendar .calendar-day { min-height: 128px; }
.memorial-form { gap: 18px; }
.memorial-switch { display: flex !important; align-items: center; gap: 12px !important; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--brand-soft); cursor: pointer; }
.memorial-switch input { flex: 0 0 auto; width: 20px; height: 20px; }
.memorial-switch span, .memorial-switch strong, .memorial-switch small { display: block; }
.memorial-switch small { margin-top: 3px; color: var(--muted); font-weight: 400; }
.memorial-form [data-memorial-questionnaire] { display: grid; gap: 18px; }
.memorial-form [data-memorial-questionnaire][hidden] { display: none; }
.memorial-form fieldset { margin: 0; padding: 16px; border: 1px solid var(--line); border-radius: 6px; }
.memorial-form legend { padding: 0 7px; color: var(--brand); font-weight: 700; }
.memorial-options { display: flex; flex-wrap: wrap; gap: 20px; margin: 14px 0; }
.memorial-results { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); border-block: 1px solid var(--line); }
.memorial-results article { padding: 15px; border-right: 1px solid var(--line); }
.memorial-results article:last-child { border-right: 0; }
.memorial-results span,.memorial-results small { display: block; color: var(--muted); }
.memorial-results strong { display: block; margin: 6px 0; font-size: 20px; }
.memorial-links { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); }
.memorial-specialties { display: grid; gap: 8px; }
.memorial-section { border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.memorial-section > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px; cursor: pointer; color: var(--brand); font-weight: 700; }
.memorial-section > summary span { color: var(--muted); font-size: 12px; font-weight: 500; }
.memorial-section[open] > summary { border-bottom: 1px solid var(--line); }
.memorial-section > .form-grid { padding: 16px; }
.composition-audit { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin: 0 0 14px; padding: 11px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--brand-soft); font-size: 13px; }
.composition-audit > span strong { margin-right: 3px; color: var(--brand); }
.composition-audit details { margin-left: auto; position: relative; }
.composition-audit summary { cursor: pointer; color: var(--brand); font-weight: 700; }
.composition-audit details > div { position: absolute; z-index: 10; right: 0; top: 28px; width: min(540px,80vw); max-height: 340px; overflow: auto; padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.composition-audit p { margin: 7px 0; padding-bottom: 7px; border-bottom: 1px solid var(--line); }
.composition-audit p:last-child { border-bottom: 0; }
.composition-audit p small { display: block; margin-top: 2px; color: var(--muted); }
.memorial-association { margin-top: 8px; color: var(--brand) !important; }
.gantt { min-width: 820px; overflow: hidden; border: 1px solid var(--line); border-radius: 6px; }
.planning-mode-panel[data-planning-panel="gantt"] { overflow-x: auto; }
.gantt-head,.gantt-row { display: grid; grid-template-columns: minmax(260px,34%) minmax(540px,66%); }
.gantt-head { background: #f4f1f3; color: var(--muted); font-size: 12px; font-weight: 700; }
.gantt-head > span,.gantt-head > div,.gantt-row > div { padding: 9px 12px; border-bottom: 1px solid var(--line); }
.gantt-head > div { display: flex; justify-content: space-between; }
.gantt-row > div:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.gantt-track { position: relative; min-height: 38px; border-left: 1px solid var(--line); background-image: repeating-linear-gradient(90deg,transparent 0,transparent calc(10% - 1px),var(--line) 10%); }
.gantt-bar { position: absolute; left: var(--gantt-left); top: 9px; width: var(--gantt-width); min-width: 5px; height: 20px; overflow: hidden; border-radius: 4px; background: #967080; }
.gantt-bar > span { display: block; height: 100%; background: var(--brand); }
.gantt-bar.status-concluida { background: #8cbba5; }
.gantt-bar.status-concluida > span { background: var(--green); }
.gantt-bar.status-bloqueada { background: #d98980; }
.theme-dark .gantt-head { background: #211e22; }
.theme-dark .calendar-day,.theme-dark .event-pill { background: var(--panel); }
.small-dialog { width: min(560px, calc(100vw - 32px)); }
.soft-tooltip { position: fixed; z-index: 100; max-width: 190px; padding: 6px 8px; border-radius: 5px; background: #251b20; color: #fff; box-shadow: 0 6px 18px rgba(37, 27, 32, .18); font-size: 12px; line-height: 1.2; pointer-events: none; opacity: 0; transform: translateY(3px); transition: opacity 140ms ease, transform 140ms ease; }
.soft-tooltip.visible { opacity: .96; transform: translateY(0); }
.text-danger { padding: 0; border: 0; background: transparent; color: var(--danger); cursor: pointer; font-weight: 700; }
.planning-list { display: grid; gap: 12px; }
.phase-block { border: 1px solid var(--line); border-radius: var(--radius); background: #fff; padding: 14px; }
.phase-head { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 10px; color: var(--muted); }
.phase-head strong { display: block; color: var(--text); font-size: 17px; margin-bottom: 4px; }
.steps-table { display: grid; gap: 1px; margin-top: 10px; background: var(--line); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.step-row { display: grid; grid-template-columns: minmax(220px, 1fr) 128px 170px 70px 110px; gap: 10px; background: #fff; padding: 10px; align-items: center; font-size: 13px; }
.step-row span { display: block; color: var(--muted); margin-top: 3px; }
.obra-forms-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.subform { border: 1px solid var(--line); border-radius: var(--radius); background: #faf8f6; padding: 14px; }
.subform h3 { margin: 0 0 4px; }
.responsive-table { overflow-x: auto; }
.responsive-table small { color: var(--muted); }
.inline-create-form { display: grid; grid-template-columns: repeat(7, minmax(120px, 1fr)) auto; gap: 10px; align-items: end; margin-top: 14px; }
.resource-create-form { display: grid; grid-template-columns: repeat(4, minmax(150px, 1fr)); gap: 12px; align-items: end; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.resource-create-form > label, .sinapi-combobox > label { display: grid; gap: 6px; color: #3e3037; font-size: 13px; font-weight: 700; }
.resource-create-form input[readonly] { background: #f4f1f3; color: var(--muted); }
.form-span-2 { grid-column: span 2; }
.reference-badge { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border: 1px solid #c9dfd2; border-radius: 999px; background: #edf8f1; color: var(--green); font-size: 12px; font-weight: 700; white-space: nowrap; }
.sinapi-combobox { position: relative; min-width: 0; }
.combobox-control { display: grid; grid-template-columns: minmax(0, 1fr) 42px; margin-top: 6px; }
.combobox-control input { border-radius: 6px 0 0 6px; }
.combobox-control button { display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-left: 0; border-radius: 0 6px 6px 0; background: #fff; color: var(--muted); cursor: pointer; font-size: 16px; }
.combobox-control:focus-within { outline: 2px solid rgba(122, 31, 56, .18); border-radius: 6px; }
.combobox-options { position: absolute; z-index: 8; top: calc(100% + 5px); left: 0; right: 0; max-height: 310px; overflow-y: auto; border: 1px solid var(--line); border-radius: 6px; background: #fff; box-shadow: 0 14px 34px rgba(37, 27, 32, .16); }
.combobox-options button { display: grid; width: 100%; gap: 4px; padding: 10px 12px; border: 0; border-bottom: 1px solid #eee8ec; border-radius: 0; background: #fff; color: var(--text); text-align: left; cursor: pointer; }
.combobox-options button:last-child { border-bottom: 0; }
.combobox-options button:hover, .combobox-options button.active { background: var(--brand-soft); }
.combobox-options strong { font-size: 13px; line-height: 1.35; }
.combobox-options small { color: var(--muted); font-size: 12px; }
.combobox-empty { margin: 0; padding: 13px; color: var(--muted); font-size: 13px; }
.combobox-footer { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; border-top: 1px solid var(--line); background: #f7f5f2; color: var(--muted); font-size: 12px; }
.combobox-options .combobox-more { width: auto; padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; color: var(--brand); font-weight: 700; }
.finance-form { grid-template-columns: minmax(180px, 2fr) repeat(6, minmax(110px, 1fr)) auto; }
.finance-kpis { display: flex; gap: 8px; flex-wrap: wrap; }
.finance-kpis span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 999px; background: #fff; color: var(--muted); font-size: 13px; }
.diary-list { display: grid; gap: 10px; margin-bottom: 14px; }
.diary-list article { border: 1px solid var(--line); border-radius: 6px; background: #fff; padding: 12px; }
.diary-list p { margin: 8px 0; color: var(--text); line-height: 1.45; }
.diary-list small { color: var(--muted); }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }

@media (max-width: 1180px) {
    .obra-layout, .obra-hero { grid-template-columns: 1fr; }
    .obra-cards, .obra-forms-grid { grid-template-columns: 1fr; }
    .inline-create-form, .finance-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .resource-create-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .step-row { grid-template-columns: 1fr 120px; }
}

@media (max-width: 760px) {
    .obra-kpis, .inline-create-form, .finance-form, .resource-create-form, .form-grid.three, .composition-values, .memorial-results { grid-template-columns: 1fr; }
    .form-span-2 { grid-column: span 1; }
    .obra-detail-head, .phase-head, .section-head { flex-direction: column; }
    .planning-view-toolbar { align-items: stretch; flex-direction: column; }
    .planning-view-actions { display: grid; grid-template-columns: 1fr 1fr; }
    .step-row { grid-template-columns: 1fr; }
    .planning-dialog { width: calc(100vw - 20px); max-height: calc(100vh - 20px); }
    .planning-dialog-header { padding: 14px 16px; }
    .planning-editor { padding: 16px; }
    .planning-editor-actions { align-items: stretch; flex-direction: column; }
    .planning-editor-actions .form-actions { width: 100%; flex-direction: column-reverse; }
    .planning-editor-actions .button { width: 100%; }
    .planning-bottom-actions { align-items: stretch; flex-direction: column; }
    .planning-bottom-actions > div { display: grid; grid-template-columns: 1fr; }
    .planning-subhead { flex-direction: column; }
    .memorial-results article { border-right: 0; border-bottom: 1px solid var(--line); }
    .planning-mode-tabs { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
    .planning-mode-tabs button { min-height: 44px; padding: 8px; white-space: normal; }
}

.commission-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.commission-head h2 { margin-bottom: 6px; }
.commission-head p { max-width: 720px; margin: 0; line-height: 1.5; }
.commission-nav { display: flex; flex-wrap: wrap; gap: 6px; }
.commission-nav a { min-height: 42px; display: inline-flex; align-items: center; justify-content: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--muted); font-weight: 700; }
.commission-nav a[aria-current="page"] { border-color: var(--brand); background: var(--brand); color: #fff; }
.commission-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.registry-panel { min-width: 0; }
.registry-title { display: flex; align-items: start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.registry-title h2, .registry-title p { margin: 0; }
.registry-title-actions { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.registry-list { display: grid; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.registry-header, .registry-item { display: grid; align-items: center; gap: 14px; padding: 11px 12px; }
.people-list .registry-header, .people-list .registry-item { grid-template-columns: minmax(180px, 1fr) 160px; }
.commissions-list .registry-header, .commissions-list .registry-item { grid-template-columns: minmax(180px, 1fr) minmax(180px, .8fr) 110px 260px; }
.offices-list .registry-header, .offices-list .registry-item { grid-template-columns: minmax(220px, 1fr) 100px 160px; }
.registry-header { background: #f7f5f2; color: var(--muted); font-size: 13px; font-weight: 700; }
.registry-item { background: var(--panel); border-top: 1px solid var(--line); }
.registry-item:nth-child(odd) { background: #fcfbfa; }
.registry-item small { display: none; color: var(--muted); font-weight: 700; }
.registry-item strong { line-height: 1.3; }
.registry-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; }
.registry-actions form { margin: 0; }
.registry-actions .button { min-width: 70px; }
.registry-dialog .form-actions { padding-top: 4px; }
.form-help { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.empty-state { margin: 0; padding: 28px 16px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); text-align: center; }
.status-badge { display: inline-flex; width: max-content; align-items: center; min-height: 28px; padding: 0 9px; border-radius: 999px; background: #f2eff1; color: var(--muted); font-size: 12px; font-weight: 700; }
.status-ativo, .status-iniciada { background: #e7f4ec; color: var(--ok); }
.status-inativo, .status-finalizada { background: #efedef; color: #675e64; }
.status-aguardando { background: #fbf1dc; color: #805c18; }
.theme-dark .registry-header, .theme-dark .registry-item:nth-child(odd) { background: #211e22; }
.theme-dark .status-ativo, .theme-dark .status-iniciada { background: #21372c; }
.theme-dark .status-aguardando { background: #3b3220; color: #e3bd70; }
.theme-dark .status-inativo, .theme-dark .status-finalizada { background: #343036; color: var(--muted); }
.commission-office-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.commission-office-head h2 { margin: 0 0 9px; font-size: 28px; }
.commission-office-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; color: var(--muted); }
.commission-office-panel { max-width: 1180px; }
.commission-report-filter { max-width: 1180px; }
.commission-report-form { display: grid; grid-template-columns: minmax(260px, 1fr) auto; align-items: end; gap: 12px; }
.commission-report-form label { margin: 0; }
.commission-report-form .button { min-height: 42px; }
.commission-report-summary { display: flex; align-items: center; justify-content: space-between; gap: 18px; max-width: 1180px; }
.commission-report-summary h2 { margin: 3px 0 5px; }
.commission-report-summary p { margin: 0; color: var(--muted); }
.commission-report-actions { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.report-export-button { display: inline-flex; align-items: center; gap: 7px; }
.report-export-button svg { width: 17px; height: 17px; flex: 0 0 auto; }
.commission-report-list { display: grid; gap: 14px; max-width: 1180px; }
.commission-report-office { margin: 0; }
.commission-report-office > header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.commission-report-office > header h2 { margin: 0; font-size: 21px; }
.commission-report-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.commission-report-columns > section { padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #faf8f6; }
.commission-report-columns h3 { margin: 0 0 2px; font-size: 17px; }
.commission-report-columns section > small { color: var(--muted); }
.commission-report-columns ul { display: grid; gap: 7px; margin: 12px 0 0; padding: 0; list-style: none; }
.commission-report-columns li { padding: 8px 10px; border-radius: 7px; background: #fff; font-weight: 700; }
.commission-report-indication { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vote-count-badge { flex: 0 0 auto; padding: 4px 8px; border-radius: 999px; background: #e8edf7; color: #33466c; font-size: 11px; font-weight: 800; }
.commission-report-classified li { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.commission-office-list .registry-header, .commission-office-list .registry-item { grid-template-columns: minmax(220px, 1fr) 430px; }
.commission-office-list .registry-item > div:first-child { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.commission-office-list .registry-actions { flex-wrap: wrap; }
.office-order-number { display: inline-grid; place-items: center; flex: 0 0 30px; width: 30px; height: 30px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); font-size: 12px; font-weight: 700; }
.office-order-actions { display: flex; align-items: center; gap: 5px; }
.office-order-actions form { margin: 0; }
.order-button { min-width: 38px !important; width: 38px; padding: 0; font-size: 20px; font-weight: 700; }
.order-button:disabled { opacity: .35; cursor: not-allowed; }
.commission-readonly { background: #f7f5f2; color: var(--muted); border-color: var(--line); }
.form-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.form-divider::before, .form-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.vote-flag { display: inline-flex; align-items: center; min-height: 30px; padding: 0 10px; border-radius: 999px; background: #e7f4ec; color: #17603a; font-size: 12px; font-weight: 800; }
.vote-dialog { width: min(820px, calc(100vw - 32px)); }
.vote-dialog-content { display: grid; gap: 18px; padding: 18px 20px 20px; }
.vote-indications-panel { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--brand-soft); }
.vote-indications-panel > div { min-width: 0; }
.vote-indications-panel form { flex: 0 0 auto; margin: 0; }
.vote-indications-panel p { max-width: 580px; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.vote-indications-title { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.vote-indications-action { display: flex; align-items: end; gap: 8px; }
.vote-indications-action label { width: 126px; margin: 0; font-size: 12px; }
.vote-indications-action input { margin-top: 5px; text-align: center; }
.vote-indications-action .button { white-space: nowrap; }
.vote-stage-actions { display: flex; flex: 0 0 auto; flex-wrap: wrap; align-items: end; justify-content: flex-end; gap: 8px; }
.vote-stage-actions form { margin: 0; }
.vote-stage-message { border-color: #e9c271; background: #fff8e8; color: #71501a; }
.vote-flow-status { display: inline-flex; align-items: center; min-height: 26px; padding: 0 9px; border: 1px solid; border-radius: 999px; font-size: 11px; font-weight: 800; }
.vote-flow-limit { color: var(--muted); font-size: 12px; font-weight: 700; }
.vote-flow-status.flow-aguardando { border-color: #c7ccd1; background: #f1f3f5; color: #495057; }
.vote-flow-status.flow-indicacao { border-color: #87b8d6; background: #e6f3fb; color: #215d82; }
.vote-flow-status.flow-votando { border-color: #e9c271; background: #fff0d4; color: #80510b; }
.vote-flow-status.flow-encerrado { border-color: #a8d2b9; background: #e7f4ec; color: #17603a; }
.vote-add-person { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #faf8f6; }
.vote-add-person .form-actions { justify-content: flex-end; }
.vote-person-list { display: grid; gap: 8px; }
.vote-person-row { display: grid; grid-template-columns: minmax(190px, 1fr) 110px 170px; gap: 12px; align-items: end; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.vote-form .vote-person-row { grid-template-columns: minmax(190px, 1fr) 110px 170px 42px; }
.vote-person-row > strong { align-self: center; line-height: 1.35; }
.vote-person-row label { margin: 0; }
.vote-person-row input, .vote-person-row select { margin-top: 5px; }
.vote-remove-candidate { display: grid; place-items: center; width: 42px; min-width: 42px; min-height: 42px; padding: 0; }
.vote-person-list.readonly .vote-person-row { align-items: center; }
.vote-person-list.readonly .vote-person-row > span { display: grid; gap: 4px; }
.vote-person-list.readonly small { display: block; color: var(--muted); font-size: 11px; font-weight: 700; }
.vote-role-select, .vote-role-badge { font-weight: 700; }
.vote-role-badge { display: inline-flex; width: max-content; align-items: center; min-height: 30px; padding: 0 10px; border: 1px solid; border-radius: 999px; font-size: 12px; }
.vote-role-select.role-votado, .vote-role-badge.role-votado { border-color: #a8d2b9; background: #e7f4ec; color: #17603a; }
.vote-role-select.role-associado, .vote-role-badge.role-associado { border-color: #e9c271; background: #fff0d4; color: #80510b; }
.vote-role-select.role-candidato, .vote-role-badge.role-candidato { border-color: #cbc7ca; background: #efedef; color: #5f585d; }
.vote-role-select.role-secretario, .vote-role-badge.role-secretario { border-color: #87b8d6; background: #e6f3fb; color: #215d82; }
.vote-form-actions, .vote-dialog-footer { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.vote-dialog-footer { padding-top: 4px; border-top: 1px solid var(--line); }
.vote-dialog-footer form { margin: 0; }
.vote-closed-message { border-color: #a8d2b9; background: #e7f4ec; color: #17603a; }
.indication-monitor { display: grid; gap: 12px; padding: 15px; border: 1px solid var(--line); border-radius: var(--radius); background: #faf8f6; }
.indication-monitor-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.indication-monitor-head > div:first-child { display: grid; gap: 3px; }
.participation-pending-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.participation-pending-block { display: grid; align-content: start; gap: 9px; padding: 12px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.participation-pending-block > small { color: var(--muted); line-height: 1.4; }
.participation-member-list { display: grid; gap: 6px; }
.participation-member-list > span { display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 8px 9px; border-radius: 7px; background: #fff3df; color: #744b09; }
.participation-member-list small { flex: 0 0 auto; color: #8b6b38; font-size: 11px; font-weight: 700; }
.participation-complete { margin: 0; padding: 8px 9px; border-radius: 7px; background: #e7f4ec; color: #17603a; font-size: 12px; font-weight: 700; }
.indication-monitor > small { color: var(--muted); line-height: 1.4; }

@media (min-width: 1200px) and (min-aspect-ratio: 3/2) {
    .vote-dialog { width: min(1500px, calc(100vw - 32px)); max-height: calc(100vh - 24px); }
    .vote-dialog .planning-dialog-header { padding: 13px 18px; }
    .vote-dialog-content { grid-template-columns: minmax(360px, 420px) minmax(0, 1fr); align-items: start; gap: 12px 16px; padding: 14px 18px 16px; }
    .vote-indications-panel { grid-column: 1 / -1; padding: 12px 14px; }
    .vote-dialog .indication-monitor, .vote-dialog .vote-add-person, .vote-dialog .vote-stage-message { grid-column: 1; }
    .vote-dialog .vote-results-panel, .vote-dialog .vote-results-empty { grid-column: 2; grid-row: 2 / span 4; }
    .vote-dialog .vote-dialog-footer { grid-column: 1 / -1; }
    .vote-results-panel .vote-person-list, .vote-person-list.vote-results-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .vote-results-panel.vote-form .vote-person-row { grid-template-columns: minmax(120px, 1fr) 76px 135px 40px; gap: 8px; padding: 9px; }
    .vote-person-list.vote-results-panel .vote-person-row { grid-template-columns: minmax(130px, 1fr) 82px 145px; gap: 8px; padding: 9px; }
    .vote-results-panel .vote-person-row input, .vote-results-panel .vote-person-row select { min-height: 38px; padding: 7px 8px; }
    .vote-dialog .participation-pending-block { padding: 9px; }
    .vote-dialog .participation-member-list > span { padding: 6px 8px; }
}

.members-dialog { width: min(820px, calc(100vw - 32px)); }
.members-dialog-content { display: grid; gap: 18px; padding: 18px 20px 20px; }
.commission-member-form { padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: #faf8f6; }
.commission-member-form .form-actions { justify-content: flex-end; }
.members-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.members-list-head span { color: var(--muted); font-size: 13px; }
.commission-members-list { display: grid; gap: 8px; }
.commission-member-row { display: grid; grid-template-columns: minmax(180px, 1fr) auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.commission-member-actions, .commission-member-actions form { display: flex; align-items: center; gap: 7px; }
.commission-member-actions form { margin: 0; }
.commission-member-actions select { min-width: 145px; }
.commission-member-identity { display: grid; gap: 6px; }
.commission-member-identity > div { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.commission-member-identity span { color: var(--muted); font-size: 12px; font-weight: 700; }
.commission-member-identity code { padding: 4px 7px; border: 1px solid #d1aab6; border-radius: 5px; background: var(--brand-soft); color: var(--brand); font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 13px; font-weight: 800; letter-spacing: 1px; }
.member-role-badge { display: inline-flex; align-items: center; min-height: 28px; padding: 0 9px; border: 1px solid; border-radius: 999px; font-size: 12px; font-weight: 800; }
.member-role-badge.role-presidente { border-color: #d1aab6; background: var(--brand-soft); color: var(--brand); }
.member-role-badge.role-secretario { border-color: #87b8d6; background: #e6f3fb; color: #215d82; }
.member-role-badge.role-membro { border-color: #cbc7ca; background: #efedef; color: #5f585d; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
.theme-dark .commission-readonly { background: #211e22; }
.theme-dark .vote-add-person { background: #211e22; }
.theme-dark .commission-member-form { background: #211e22; }

.commission-member-body { min-height: 100vh; background: linear-gradient(155deg, #f8f1f3 0%, #f7f5f2 48%, #edf5f0 100%); }
.live-voting-display-shell { display: grid; align-content: start; gap: 22px; width: min(1180px, 100%); min-height: 100vh; margin: 0 auto; padding: 28px 24px 36px; }
.live-voting-display-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.live-voting-display-header h1 { margin: 0 0 6px; font-size: clamp(28px, 4vw, 46px); line-height: 1.1; }
.live-voting-display-header p { margin: 0; color: var(--muted); }
.live-voting-refresh { flex: 0 0 auto; min-height: 46px; font-weight: 800; }
.live-voting-current, .live-voting-waiting { padding: clamp(22px, 4vw, 42px); border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 18px 50px rgba(60, 35, 45, .09); }
.live-voting-title { display: grid; justify-items: center; gap: 10px; margin-bottom: 28px; text-align: center; }
.live-voting-title h2 { margin: 0; font-size: clamp(34px, 6vw, 64px); line-height: 1.08; }
.live-voting-title p { margin: 0; color: var(--muted); font-size: 16px; }
.live-voting-status { display: inline-flex; width: max-content; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 999px; font-size: 12px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; }
.live-voting-status.active { background: #e7f4ec; color: #17603a; }
.live-voting-status.active i { width: 9px; height: 9px; border-radius: 50%; background: #24a862; box-shadow: 0 0 0 5px rgba(36, 168, 98, .14); }
.live-voting-status.indications { background: #e6f3fb; color: #215d82; }
.live-voting-status.indications i { width: 9px; height: 9px; border-radius: 50%; background: #2f91ca; box-shadow: 0 0 0 5px rgba(47, 145, 202, .14); }
.live-voting-status.result { background: #eee8ea; color: #613341; }
.live-voting-status.waiting { background: #f1eff0; color: var(--muted); }
.live-voting-candidate-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 13px; }
.live-voting-candidate-list article { display: grid; place-items: center; min-height: 86px; padding: 16px 18px; border: 2px solid #d8d2d5; border-radius: 12px; background: #faf8f9; text-align: center; }
.live-voting-candidate-list strong { font-size: clamp(18px, 2.2vw, 25px); line-height: 1.25; }
.live-voting-result-list { display: grid; gap: 12px; }
.live-voting-result-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 76px; padding: 14px 18px; border: 2px solid #d8d2d5; border-radius: 12px; background: #faf8f9; }
.live-voting-result-card > strong { font-size: clamp(18px, 2.2vw, 25px); line-height: 1.25; }
.live-voting-result-details { display: flex; flex: 0 0 auto; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 9px; }
.live-voting-result-votes { color: #3d383b; font-size: 17px; font-weight: 900; }
.live-voting-result-badge { display: inline-flex; align-items: center; min-height: 32px; padding: 0 11px; border: 1px solid; border-radius: 999px; font-size: 12px; font-weight: 900; text-transform: uppercase; }
.live-voting-result-badge.role-votado { border-color: #71b18d; background: #e7f4ec; color: #17603a; }
.live-voting-result-badge.role-secretario { border-color: #87b8d6; background: #e6f3fb; color: #215d82; }
.live-voting-result-badge.role-associado { border-color: #dba45a; background: #fff1dc; color: #8a5310; }
.live-voting-waiting { display: grid; place-items: center; min-height: 390px; text-align: center; }
.live-voting-waiting h2 { margin: 14px 0 8px; font-size: clamp(28px, 5vw, 48px); }
.live-voting-waiting p { max-width: 620px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.55; }
.live-voting-display-footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 12px; }
.member-flash { position: fixed; z-index: 30; top: 12px; left: 50%; width: min(520px, calc(100vw - 24px)); transform: translateX(-50%); box-shadow: 0 10px 28px rgba(37, 27, 32, .14); }
.member-access-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.member-login-card { width: min(420px, 100%); padding: 28px; border: 1px solid var(--line); border-radius: 14px; background: #fff; box-shadow: 0 20px 55px rgba(60, 35, 45, .12); }
.member-access-brand { display: grid; place-items: center; width: 48px; height: 48px; margin-bottom: 22px; border-radius: 12px; background: var(--brand); color: #fff; font-size: 18px; font-weight: 800; }
.member-login-card h1 { margin: 0 0 8px; font-size: 30px; }
.member-login-card > p { margin: 0 0 24px; color: var(--muted); line-height: 1.5; }
.member-login-card > small { display: block; margin-top: 18px; color: var(--muted); line-height: 1.45; text-align: center; }
.member-code-form { gap: 10px; }
.member-code-form input { min-height: 58px; font-size: 28px; font-weight: 800; letter-spacing: 8px; text-align: center; }
.member-code-form .button { min-height: 50px; margin-top: 6px; font-weight: 800; }
.member-area-shell { width: min(760px, 100%); min-height: 100vh; margin: 0 auto; padding: 18px 16px 40px; }
.member-area-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 10px 2px 18px; }
.member-area-header h1 { margin: 0 0 5px; font-size: clamp(24px, 7vw, 34px); line-height: 1.12; }
.member-area-header p { margin: 0; color: var(--muted); }
.member-header-name { display: block; margin-bottom: 4px; font-size: 15px; line-height: 1.3; }
.member-header-actions { display: flex; flex: 0 0 auto; align-items: center; gap: 8px; }
.member-header-actions form { margin: 0; }
.member-stages-section { margin-top: 10px; }
.member-section-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.member-section-title h2 { margin: 0; font-size: 22px; }
.member-section-title > span { color: var(--muted); font-size: 12px; white-space: nowrap; }
.member-stage-list { display: grid; gap: 10px; }
.member-stage-card { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-left-width: 4px; border-radius: 10px; background: #fff; }
.member-stage-card > div:first-child { display: grid; gap: 6px; min-width: 0; }
.member-stage-card strong { line-height: 1.3; overflow-wrap: anywhere; }
.member-stage-card p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.member-stage-status { width: max-content; padding: 3px 7px; border-radius: 999px; background: #f2eff1; color: var(--muted); font-size: 11px; font-weight: 800; }
.member-stage-card.stage-indication { border-left-color: #397da5; }
.member-stage-card.stage-indication .member-stage-status { background: #e6f3fb; color: #215d82; }
.member-stage-card.stage-voting { border-left-color: #c1851c; }
.member-stage-card.stage-voting .member-stage-status { background: #fff0d4; color: #80510b; }
.member-stage-card.stage-paused { border-left-color: #8a8187; }
.member-stage-card.stage-closed { border-left-color: #31815c; }
.member-stage-card.stage-closed .member-stage-status { background: #e7f4ec; color: #17603a; }
.member-stage-results { display: grid; gap: 6px; margin-top: 3px; padding-top: 9px; border-top: 1px solid var(--line); }
.member-stage-results > span { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.member-stage-results > span > strong { font-size: 13px; }
.member-stage-results .vote-role-badge { flex: 0 0 auto; min-height: 25px; padding: 0 8px; font-size: 10px; }
.member-stage-action { min-width: 92px; font-weight: 800; }
.member-stage-shell { padding-top: 22px; }
.member-back-link { display: inline-flex; margin-bottom: 22px; color: var(--brand); font-size: 14px; font-weight: 800; }
.member-stage-page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.member-stage-page-header h1 { margin: 0 0 7px; font-size: clamp(28px, 8vw, 40px); line-height: 1.12; }
.member-stage-page-header p { margin: 0; color: var(--muted); line-height: 1.4; }
.member-stage-refresh { flex: 0 0 auto; }
.member-stage-focus-card { padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: #fff; box-shadow: 0 8px 24px rgba(60, 35, 45, .06); }
.member-stage-focus-card h2 { margin: 0 0 9px; font-size: 22px; }
.member-stage-focus-card > p { margin: 0 0 18px; color: var(--muted); line-height: 1.5; }
.member-indication-counter { display: flex; align-items: baseline; gap: 7px; margin-bottom: 14px; color: var(--muted); font-size: 13px; }
.member-indication-counter strong { color: var(--brand); font-size: 20px; }
.member-indication-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 10px; margin-bottom: 10px; }
.member-indication-form label { margin: 0; }
.member-refresh-button { display: grid; place-items: center; width: 44px; min-height: 44px; margin: 0 0 18px auto; padding: 0; font-size: 21px; }
.member-indication-list { display: grid; gap: 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.member-indication-list-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 2px; }
.member-indication-list-head span { color: var(--muted); font-size: 12px; }
.member-indication-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px; background: #faf8f6; }
.member-indication-row form { flex: 0 0 auto; margin: 0; }
.member-finish-indication-form { margin-top: 18px; }
.member-finish-indication-form .button { width: 100%; min-height: 48px; font-weight: 800; }
.member-indication-finished { margin-bottom: 16px; }
.member-vote-confirmed { margin-bottom: 16px; }
.member-ballot { display: grid; gap: 14px; }
.member-ballot-counter { display: flex; align-items: baseline; gap: 7px; color: var(--muted); font-size: 13px; }
.member-ballot-counter strong { color: #147a3f; font-size: 22px; }
.member-vote-candidate-list { display: grid; gap: 9px; }
.member-vote-option { position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr); align-items: center; gap: 11px; min-height: 58px; padding: 11px 13px; border: 2px solid var(--line); border-radius: 10px; background: #fff; cursor: pointer; transition: border-color .15s ease, background .15s ease, opacity .15s ease; }
.member-vote-option.selected { border-color: #19954d; background: #e9f7ef; }
.member-vote-option.not-selected { opacity: .55; }
.member-vote-check { display: grid; place-items: center; width: 30px; height: 30px; border: 2px solid #9aa3a0; border-radius: 7px; background: #fff; }
.member-vote-option input:checked + .member-vote-check { border-color: #138a44; background: #18a653; box-shadow: 0 0 0 3px rgba(24, 166, 83, .14); }
.member-vote-option input:checked + .member-vote-check::after { content: '\2713'; color: #fff; font-size: 21px; font-weight: 900; line-height: 1; }
.member-vote-option input:focus-visible + .member-vote-check { outline: 3px solid rgba(33, 93, 130, .24); outline-offset: 2px; }
.member-vote-option input:disabled ~ * { cursor: default; }
.member-confirm-vote-button { width: 100%; min-height: 50px; font-size: 16px; font-weight: 800; }
.member-incomplete-vote-dialog { width: min(430px, calc(100vw - 28px)); padding: 22px; border: 0; border-radius: 13px; background: #fff; color: var(--text); box-shadow: 0 22px 65px rgba(35, 24, 29, .28); }
.member-incomplete-vote-dialog::backdrop { background: rgba(31, 24, 28, .58); }
.member-incomplete-vote-dialog h2 { margin: 0 0 10px; font-size: 22px; }
.member-incomplete-vote-dialog p { margin: 0; color: var(--muted); line-height: 1.55; }
.member-incomplete-vote-dialog p strong { color: var(--brand); }
.member-incomplete-vote-actions { display: grid; gap: 9px; margin-top: 20px; }
.member-incomplete-vote-actions .button { width: 100%; min-height: 46px; }

@media (max-width: 1100px) {
    .commission-head { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 700px) {
    .commission-nav { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
    .commission-nav a { padding-inline: 8px; }
    .registry-list { gap: 10px; border: 0; overflow: visible; }
    .registry-header { display: none; }
    .people-list .registry-item, .commissions-list .registry-item, .offices-list .registry-item { grid-template-columns: 1fr; gap: 10px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); }
    .registry-item small { display: block; margin-bottom: 3px; }
    .registry-actions { justify-content: stretch; padding-top: 4px; }
    .registry-actions > *, .registry-actions .button { flex: 1; width: 100%; min-height: 44px; }
    .registry-title { align-items: stretch; flex-direction: column; }
    .registry-title > .button { width: 100%; }
    .registry-title-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
    .registry-title-actions .button { width: 100%; min-height: 44px; }
    .registry-dialog .form-grid.two { grid-template-columns: 1fr; }
    .registry-dialog .form-actions { align-items: stretch; flex-direction: column-reverse; }
    .registry-dialog .form-actions .button { width: 100%; min-height: 44px; }
    .commission-office-head { flex-direction: column; }
    .commission-office-head > .button { width: 100%; }
    .commission-office-list .registry-item { grid-template-columns: 1fr; }
    .commission-office-list .registry-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .commission-office-list .registry-actions .vote-flag { justify-content: center; min-height: 44px; }
    .commission-office-list .office-order-actions { grid-column: 1 / -1; }
    .commission-office-list .office-order-actions form { flex: 1; }
    .commission-report-form, .commission-report-columns { grid-template-columns: 1fr; }
    .commission-report-summary { align-items: flex-start; flex-direction: column; }
    .commission-report-actions { justify-content: flex-start; width: 100%; }
    .vote-dialog { width: calc(100vw - 20px); }
    .vote-dialog-content { padding: 14px; }
    .vote-indications-panel { align-items: stretch; flex-direction: column; }
    .vote-indications-panel .button, .vote-indications-panel form { width: 100%; min-height: 44px; }
    .vote-stage-actions { width: 100%; align-items: stretch; flex-direction: column; }
    .vote-indications-action { align-items: stretch; flex-direction: column; }
    .vote-indications-action label { width: 100%; }
    .indication-monitor-head { flex-direction: column; }
    .participation-pending-grid { grid-template-columns: 1fr; }
    .vote-person-row { grid-template-columns: 1fr; align-items: stretch; }
    .vote-form .vote-person-row { grid-template-columns: 1fr; }
    .vote-remove-candidate { justify-self: end; }
    .vote-person-list.readonly .vote-person-row { align-items: stretch; }
    .vote-form-actions, .vote-dialog-footer { align-items: stretch; flex-direction: column-reverse; }
    .vote-form-actions .button, .vote-dialog-footer .button, .vote-dialog-footer form { width: 100%; min-height: 44px; }
    .members-dialog { width: calc(100vw - 20px); }
    .members-dialog-content { padding: 14px; }
    .commission-member-row { grid-template-columns: 1fr; align-items: stretch; }
    .commission-member-actions { align-items: stretch; flex-direction: column; }
    .commission-member-actions form { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; }
    .commission-member-actions form:last-child { grid-template-columns: 1fr; }
    .commission-member-actions .button { min-height: 44px; }
    .member-login-card { padding: 24px 20px; }
    .live-voting-display-shell { padding: 18px 12px 28px; }
    .live-voting-display-header { flex-direction: column; }
    .live-voting-refresh { width: 100%; }
    .live-voting-candidate-list { grid-template-columns: 1fr; }
    .live-voting-result-card { align-items: flex-start; flex-direction: column; }
    .live-voting-result-details { justify-content: flex-start; }
    .live-voting-display-footer { align-items: flex-start; flex-direction: column; }
    .member-area-shell { padding: 12px 12px 30px; }
    .member-area-header { padding-top: 6px; }
    .member-area-header, .member-stage-page-header { align-items: stretch; flex-direction: column; }
    .member-header-actions, .member-stage-refresh { width: 100%; }
    .member-header-actions > *, .member-header-actions .button { flex: 1 1 0; }
    .member-stage-refresh { justify-content: center; min-height: 44px; }
    .member-stage-card { grid-template-columns: 1fr; }
    .member-stage-action { width: 100%; min-height: 46px; }
    .member-indication-form { grid-template-columns: 1fr; }
    .member-indication-form .button { min-height: 46px; }
}
