:root {
    color-scheme: light;
    --ink: #20332d;
    --muted: #5f6e67;
    --brand: #286449;
    --brand-dark: #184c34;
    --line: #d8dfda;
    --surface: #ffffff;
    --background: #f5f7f4;
    font-family: "Segoe UI", Arial, sans-serif;
    font-size: 15px;
    color: var(--ink);
    background: var(--background);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--brand-dark); text-underline-offset: 3px; }
a:hover { color: #123924; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { touch-action: manipulation; }
:focus-visible { outline: 3px solid #c48724; outline-offset: 3px; }
h1 { margin: 0; font-size: 1.8rem; line-height: 1.25; font-weight: 650; }
h2 { font-size: 1.1rem; line-height: 1.5; margin: 0 0 12px; font-weight: 650; }
p { line-height: 1.6; margin: 0 0 14px; }
.muted, .help { color: var(--muted); }
.help { font-size: .88rem; margin-top: 14px; }
.app { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { background: #183e2f; color: #fff; padding: 28px 20px; display: flex; flex-direction: column; gap: 32px; }
.brand { color: #fff; text-decoration: none; font-size: 1.5rem; font-weight: 700; }
.brand span { display: block; font-size: .88rem; font-weight: 400; margin-top: 6px; color: #d2e3d7; }
.brand:hover { color: #fff; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { color: #e4ede7; text-decoration: none; padding: 12px; border-radius: 6px; }
.sidebar nav a:hover, .sidebar nav a[aria-current="page"] { color: #fff; background: #2d5643; }
.session { margin-top: auto; display: grid; gap: 14px; font-size: .9rem; }
.session span { overflow-wrap: anywhere; }
.session .subtle { color: #fff; border-color: #6d8b7c; background: transparent; }
main { min-width: 0; padding: 32px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 26px; flex-wrap: wrap; }
.page-heading p { margin: 6px 0 0; }
.button { display: inline-flex; align-items: center; justify-content: center; padding: 10px 16px; min-height: 42px; border: 1px solid #aebdb2; border-radius: 6px; background: white; color: var(--ink); font-weight: 600; text-decoration: none; cursor: pointer; white-space: nowrap; }
.button:hover { background: #edf2ed; }
.button.primary { color: #fff; background: var(--brand); border-color: var(--brand); }
.button.primary:hover { background: var(--brand-dark); }
.button:disabled { opacity: .55; cursor: default; }
label { display: grid; gap: 7px; font-size: .9rem; font-weight: 600; }
input, select, textarea { min-width: 0; width: 100%; min-height: 42px; padding: 9px 11px; border: 1px solid #acb9af; border-radius: 5px; color: var(--ink); background: #fff; }
input[readonly] { background: #edf1ec; }
textarea { resize: vertical; line-height: 1.5; }
.check { display: flex; align-items: center; gap: 9px; font-weight: 400; }
.check input { width: 20px; height: 20px; min-height: auto; accent-color: var(--brand); }
.filters { display: flex; align-items: end; gap: 14px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 22px; margin-bottom: 24px; }
.filters label { min-width: 120px; flex: 1 1 140px; max-width: 320px; }
.filters label:first-of-type { flex-basis: 230px; }
.filters input[type="number"] { max-width: 130px; }
.form-stack { display: grid; gap: 18px; }
.form-stack .help { margin: -8px 0 0; }
.edit-panel, .detail-panel { max-width: 760px; background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 26px; margin-bottom: 28px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.table-scroll { width: 100%; overflow-x: auto; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .92rem; }
caption { padding: 14px 16px; text-align: left; color: var(--muted); font-size: .9rem; }
th, td { padding: 13px 16px; vertical-align: top; border-bottom: 1px solid var(--line); }
thead th { background: #edf2ed; font-weight: 600; white-space: nowrap; }
tbody tr:last-child td, tbody tr:last-child th { border-bottom: 0; }
tfoot th, tfoot td { background: #f2f5f1; border-top: 1px solid var(--line); }
.number { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.report-table { min-width: 1680px; font-size: .86rem; }
.report-table th, .report-table td { border-right: 1px solid var(--line); padding: 12px; }
.report-table thead th { white-space: normal; min-width: 100px; }
.report-table td:nth-child(2), .report-table td:nth-child(3), .report-table td:nth-child(4) { min-width: 190px; }
.signal { font-weight: 650; text-align: center; }
.signal.verde { color: #175034; background: #dcefe0; }
.signal.amarillo { color: #694e0f; background: #fff0bd; }
.signal.rojo { color: #8e2421; background: #fbe0dd; }
.signal.sin-dato { color: var(--muted); background: #edf0ec; }
.notice { padding: 14px 16px; background: #edf2ed; border-left: 4px solid #6e8573; border-radius: 3px; margin-bottom: 22px; line-height: 1.55; }
.notice.success { background: #e4f1e6; border-color: #387748; }
.notice.warning { background: #fff4d7; border-color: #a27721; }
.notice.error, .validation { color: #8d2925; }
.notice.error { background: #fbe9e6; border-color: #aa433a; }
.validation ul { padding-left: 20px; margin: 0; }
.validation-summary-valid { display: none; }
.empty { border: 1px dashed var(--line); padding: 40px 24px; text-align: center; background: #fff; }
.empty p { color: var(--muted); margin: 0; }
.description { min-width: 250px; max-width: 460px; overflow-wrap: anywhere; }
.facts { display: flex; flex-wrap: wrap; gap: 24px; margin: 20px 0 0; }
dt { font-size: .85rem; color: var(--muted); }
dd { margin: 6px 0 0; }
.event { background: #fff; border-top: 1px solid var(--line); padding: 22px 0; max-width: 960px; }
.event-meta { color: var(--muted); font-size: .88rem; }
.pre-wrap { white-space: pre-wrap; overflow-wrap: anywhere; }
.evidence-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.evidence-grid img { width: 100%; height: 180px; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; }
.pagination { display: flex; align-items: center; justify-content: end; gap: 20px; margin-top: 24px; }
.configuration-list { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 0 22px; }
.configuration-row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(130px, .7fr) minmax(200px, 1.2fr) auto; gap: 18px; align-items: end; padding: 22px 0; border-bottom: 1px solid var(--line); }
.configuration-row:last-child { border: 0; }
.configuration-row h2 { margin: 0; align-self: center; font-size: 1rem; }
.access { min-height: 100dvh; display: grid; place-items: center; }
.access main { width: 100%; max-width: 500px; padding: 22px; }
.login-panel { background: #fff; padding: 32px; border: 1px solid var(--line); border-radius: 8px; }
.login-brand { color: var(--brand-dark); font-weight: 650; margin-bottom: 28px; }
.login-panel h1 { margin-bottom: 12px; }
.login-panel form { margin-top: 26px; }
.skip-link { position: fixed; left: 12px; top: -100px; background: #fff; padding: 10px; z-index: 100; }
.skip-link:focus { top: 12px; }
.sr-only { position: absolute; left: 0; top: 0; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
@media (max-width: 1000px) {
    .app { grid-template-columns: 210px minmax(0,1fr); }
    main { padding: 24px; }
    .configuration-row { grid-template-columns: 1fr 1fr; }
    .configuration-row h2 { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
    .app { display: block; }
    .sidebar { padding: 18px; gap: 18px; }
    .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
    .sidebar nav a { padding: 9px 10px; }
    .brand { font-size: 1.25rem; }
    .brand span { display: inline; margin-left: 8px; }
    .session { display: flex; align-items: center; justify-content: space-between; }
    main { padding: 20px 16px; }
    .page-heading { align-items: start; }
    h1 { font-size: 1.55rem; }
    .edit-panel, .detail-panel, .login-panel { padding: 20px; }
    .form-row, .configuration-row { grid-template-columns: 1fr; }
    .configuration-list { padding: 0 16px; }
    .filters label, .filters label:first-of-type { flex-basis: 140px; max-width: none; }
    .filters .button { width: 100%; }
    .facts { gap: 18px; }
}
