:root { color-scheme: light; --ink: #18332b; --muted: #62736c; --line: #dce5df; --accent: #166348; }
* { box-sizing: border-box; }
body { margin: 0; background: #f4f7f5; color: var(--ink); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: #175b46; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button, .button { display: inline-flex; justify-content: center; align-items: center; min-height: 38px; padding: 8px 14px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: white; cursor: pointer; text-decoration: none; font-weight: 600; white-space: nowrap; }
button:hover, .button:hover { filter: brightness(.95); }
button:disabled { cursor: default; opacity: .55; }
.secondary { background: white; border-color: #bccdc3; color: var(--ink); }
input:not([type=checkbox]), select, textarea { display: block; width: 100%; min-height: 38px; padding: 7px 10px; border: 1px solid #b9c9bf; border-radius: 5px; background: white; color: var(--ink); }
input[readonly], textarea[readonly], input:disabled, select:disabled { background: #f5f7f6; }
input[type=checkbox] { accent-color: var(--accent); width: 18px; height: 18px; }
:focus-visible { outline: 3px solid #e1aa26; outline-offset: 2px; }
label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 13px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 16px 30px; background: white; border-bottom: 1px solid var(--line); }
.brand { display: flex; gap: 18px; align-items: center; font-size: 22px; font-weight: 800; letter-spacing: 1px; text-decoration: none; }
.brand span { font-size: 13px; font-weight: 500; letter-spacing: 0; color: var(--muted); border-left: 1px solid var(--line); padding-left: 18px; }
main { max-width: 1800px; margin: 0 auto; padding: 30px; }
h1 { font-size: 28px; line-height: 1.2; margin: 6px 0 20px; font-weight: 700; letter-spacing: -.5px; }
h2 { font-size: 20px; }
.eyebrow { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 1.4px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.page-heading { display: flex; gap: 20px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.page-heading h1, .page-heading h2 { margin-bottom: 0; }
.panel { padding: 22px; background: white; border: 1px solid var(--line); border-radius: 9px; margin-bottom: 22px; }
.filter-grid { display: grid; grid-template-columns: repeat(5, minmax(150px, 1fr)); gap: 16px; }
.check-label { flex-direction: row; align-items: center; font-weight: 500; }
.button-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.filter-grid .button-row { justify-content: end; align-self: end; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; background: white; padding-bottom: 6px; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th { background: #edf3ef; color: #345146; font-size: 12px; white-space: nowrap; padding: 13px 12px; border-bottom: 1px solid #cbd8ce; }
th a { color: inherit; text-decoration: none; }
td { padding: 12px; border-bottom: 1px solid #d7e0da; vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
.state-red { background: #fce8e6; color: #6e2420; }
.state-green { background: #e8f3e9; color: #234e2d; }
.state-blue { background: #e8f0fa; color: #25486b; }
.clickable { cursor: pointer; }
.clickable:hover { box-shadow: inset 4px 0 0 #365d4c; }
.status-form { display: flex; gap: 5px; min-width: 190px; }
.status-form select { min-width: 125px; }
.status-form button, .compact { padding: 7px 10px; font-size: 12px; }
.empty { text-align: center; padding: 34px; color: var(--muted); }
.pagination { display: flex; align-items: center; gap: 12px; justify-content: end; margin-top: 18px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
dt { color: var(--muted); font-size: 12px; }
dd { margin: 5px 0 0; font-weight: 600; }
.edit-grid { max-width: 950px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.edit-grid .button-row { grid-column: 1 / -1; }
.back-link { display: inline-block; margin-bottom: 18px; }
.login-card { max-width: 400px; margin: 55px auto; background: white; padding: 35px; border: 1px solid var(--line); border-radius: 10px; }
.form-stack { display: grid; gap: 18px; }
.form-stack button { margin-top: 6px; }
.message, .notice { padding: 12px 16px; border-radius: 6px; border: 1px solid #bdcec3; background: #eef4f0; }
.error { background: #fce8e6; color: #6e2420; border-color: #e8beb8; }
.success { background: #e8f3e9; color: #234e2d; }
.notice { background: #fff5d9; border-color: #e8d394; color: #70551c; }
.lookup { position: relative; min-width: 150px; font-weight: 400; }
.lookup-options { position: absolute; top: calc(100% + 3px); left: 0; min-width: 100%; max-width: 320px; max-height: 210px; overflow-y: auto; z-index: 10; background: white; border: 1px solid #a6beb0; box-shadow: 0 4px 14px #203c2920; border-radius: 5px; }
.lookup-options button { border: 0; border-radius: 0; background: white; color: var(--ink); justify-content: start; text-align: left; white-space: normal; width: 100%; font-weight: 400; }
.lookup-options button:hover { background: #edf4ef; }
.lookup-options span { display: block; padding: 10px; color: var(--muted); }
.records-table input[type=number] { min-width: 115px; }
.records-table input[type=date] { min-width: 142px; }
.records-table textarea { min-width: 220px; }
.records-table td:first-child { font-weight: 600; }
.records-table td { padding: 9px; }
.table-wrap:has(.records-table) { padding-bottom: 180px; }
.save-bar { display: flex; justify-content: space-between; align-items: center; padding: 16px 0; gap: 20px; }
[hidden] { display: none !important; }
@media(max-width: 1200px) { .filter-grid { grid-template-columns: repeat(3, 1fr); } }
@media(max-width: 800px) { main { padding: 20px 14px; } .topbar { padding: 14px; } .filter-grid, .edit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .summary-grid { grid-template-columns: repeat(2, 1fr); } .page-heading { align-items: start; flex-direction: column; } .brand span { max-width: 160px; } }
@media(max-width: 480px) { .filter-grid, .edit-grid { grid-template-columns: 1fr; } .login-card { margin: 24px auto; padding: 24px; } .brand { gap: 10px; } .brand span { padding-left: 10px; } }

/* Tabelas de consulta compactas; os campos de edição ficam no formulário. */
main { max-width: 1500px; }
.compact-table { table-layout: fixed; font-size: 13px; }
.compact-table th { white-space: normal; padding: 14px 12px; }
.compact-table td { padding: 15px 12px; vertical-align: middle; overflow-wrap: anywhere; }
.compact-table td:first-child { width: 17%; }
.compact-table small, .cell-line { display: block; margin-top: 4px; }
.compact-table small { color: var(--muted); font-size: 11px; }
.compact-table strong { font-weight: 650; }
.compact-table .state-red { background: #fff5f3; }
.compact-table .state-green { background: #f0f8f2; }
.compact-table .state-blue { background: #f1f6fc; }
.compact-table tr:hover { filter: brightness(.98); }
.badge { display: inline-block; border: 1px solid currentColor; padding: 3px 8px; border-radius: 20px; font-size: 11px; font-weight: 650; }
.table-wrap:has(.records-table) { padding-bottom: 0; }
.table-wrap { padding-bottom: 0; box-shadow: 0 6px 24px #18332b06; }
dialog { border: 1px solid var(--line); border-radius: 16px; color: var(--ink); padding: 24px; box-shadow: 0 24px 90px #18332b30; }
dialog::backdrop { background: #10271f80; backdrop-filter: blur(3px); }
#edit-modal { width: min(780px, calc(100vw - 32px)); max-height: 90vh; overflow-y: auto; }
#confirm-modal { width: min(440px, calc(100vw - 32px)); }
.modal-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.modal-heading h2 { margin: 0; }
.modal-heading button { font-size: 22px; }
.modal-form .edit-grid { max-width: none; gap: 18px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.modal-form .lookup { min-width: 0; }
.modal-form textarea { min-height: 82px; resize: vertical; }
#feedback { position: sticky; top: 12px; z-index: 20; box-shadow: 0 4px 20px #18332b15; }
@media(max-width: 700px) { .compact-table { min-width: 680px; } .modal-actions { flex-wrap: wrap; } }

#edit-modal.report-modal { width: min(1100px, calc(100vw - 32px)); }
.report-summary { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 20px; background: #edf5ef; border-radius: 10px; margin-bottom: 16px; }
.report-total { display: block; font-size: 28px; color: var(--accent); margin-top: 4px; }
@media(max-width: 700px) { .report-summary { align-items: start; flex-direction: column; } }

.report-section { margin-top: 24px; }
.report-section h3 { margin: 0 0 6px; font-size: 16px; }
.report-section tfoot { background: #edf5ef; font-weight: 700; }
.report-section tfoot td { padding: 12px; }

.report-project { margin-top: 18px; }
.report-project h4 { margin: 0 0 8px; color: var(--accent); font-size: 14px; }
