:root {
    --ink: #173126;
    --muted: #66766d;
    --canvas: #f3f6f3;
    --surface: #ffffff;
    --surface-2: #eef3ef;
    --line: #dbe5de;
    --primary: #1c6b49;
    --primary-dark: #124a33;
    --primary-soft: #dff1e7;
    --accent: #c8923d;
    --danger: #b53e3e;
    --danger-soft: #fbe8e8;
    --warning-soft: #fff3d8;
    --sidebar: #153f2d;
    --sidebar-2: #0f3324;
    --shadow: 0 12px 35px rgba(20, 55, 38, .08);
    --radius: 18px;
    --radius-sm: 11px;
    --sidebar-width: 250px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--ink);
    background: var(--canvas);
    font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--canvas); }
body { margin: 0; min-height: 100vh; background: var(--canvas); color: var(--ink); }
body, input, select, textarea, button { font: inherit; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { max-width: 100%; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0 0 8px; font-size: clamp(1.75rem, 3vw, 2.35rem); line-height: 1.12; letter-spacing: -.035em; }
h2 { margin: 0; font-size: 1.25rem; letter-spacing: -.02em; }
h3 { margin: 0; font-size: 1rem; }
p { margin: 0; }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.app-shell { min-height: 100vh; }
.sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar-width); padding: 24px 18px 18px;
    display: flex; flex-direction: column; background: linear-gradient(180deg, var(--sidebar), var(--sidebar-2)); color: #fff;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-mark {
    display: inline-grid; flex: 0 0 38px; width: 38px; height: 38px; place-items: center; border-radius: 12px;
    background: #e4f2e9; color: var(--primary-dark); font-size: .72rem; font-weight: 900; letter-spacing: -.04em;
}
.brand > span:last-child { display: grid; min-width: 0; }
.brand strong { font-size: 1rem; }
.brand small { margin-top: 1px; color: #b9d1c3; font-size: .7rem; }
.sidebar-nav { display: grid; gap: 3px; margin: 28px 0; overflow-y: auto; scrollbar-width: thin; }
.sidebar-nav a, .sidebar-footer a {
    display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 8px 10px; border-radius: 10px;
    color: #d4e4da; font-size: .88rem; font-weight: 650; transition: .15s ease;
}
.sidebar-nav a:hover, .sidebar-nav a.active, .sidebar-footer a:hover, .sidebar-footer a.active { background: rgba(255,255,255,.11); color: #fff; }
.nav-icon {
    display: inline-grid; flex: 0 0 27px; width: 27px; height: 27px; place-items: center; border-radius: 8px;
    background: rgba(255,255,255,.09); font-size: .72rem; font-weight: 850;
}
.sidebar-nav a.active .nav-icon { background: #d9f0e3; color: var(--primary-dark); }
.sidebar-footer { margin-top: auto; border-top: 1px solid rgba(255,255,255,.12); padding-top: 15px; }
.sidebar-footer a { padding: 7px; }
.sidebar-footer a > span:nth-child(2) { display: grid; min-width: 0; }
.sidebar-footer a strong { max-width: 135px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-footer a small { color: #b9d1c3; font-size: .7rem; }
.sidebar-footer p { margin: 12px 7px 0; color: #93ad9d; font-size: .68rem; }
.avatar { display: inline-grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary-dark); font-weight: 850; }

.main-column { min-height: 100vh; margin-left: var(--sidebar-width); }
.topbar {
    position: sticky; top: 0; z-index: 20; height: 68px; display: flex; align-items: center; justify-content: space-between;
    padding: 0 clamp(22px, 4vw, 54px); border-bottom: 1px solid rgba(219,229,222,.85); background: rgba(243,246,243,.92); backdrop-filter: blur(14px);
}
.topbar-context { color: var(--muted); font-size: .82rem; }
.profile-link { display: flex; align-items: center; gap: 10px; font-size: .82rem; font-weight: 700; }
.mobile-brand { display: none; align-items: center; gap: 9px; }
.mobile-brand .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
.content { width: min(1400px, 100%); margin: 0 auto; padding: 36px clamp(22px, 4vw, 54px) 64px; }

.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 25px; }
.page-header > div:first-child { min-width: 0; }
.page-header p:not(.eyebrow) { max-width: 650px; color: var(--muted); }
.page-header--compact { align-items: flex-start; }
.header-actions { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
.eyebrow { margin-bottom: 7px; color: var(--primary); font-size: .69rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.back-link { display: inline-block; margin-bottom: 12px; color: var(--primary); font-size: .82rem; font-weight: 750; }

.card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.button {
    display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 9px 15px;
    border: 1px solid transparent; border-radius: 10px; font-weight: 750; font-size: .84rem; line-height: 1.15; text-align: center; transition: .15s ease;
}
.button:hover { transform: translateY(-1px); }
.button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, .icon-button:focus-visible { outline: 3px solid rgba(28,107,73,.22); outline-offset: 2px; }
.button--primary { background: var(--primary); color: #fff; }
.button--primary:hover { background: var(--primary-dark); }
.button--secondary { border-color: #b9d4c4; background: var(--primary-soft); color: var(--primary-dark); }
.button--ghost { border-color: var(--line); background: #fff; color: var(--ink); }
.button--danger { border-color: #efc3c3; background: var(--danger-soft); color: var(--danger); }
.button--small { min-height: 34px; padding: 6px 10px; font-size: .75rem; }
.button--block { width: 100%; }
.icon-button { min-height: 32px; padding: 5px 9px; border: 0; border-radius: 8px; background: var(--surface-2); color: var(--ink); font-size: .75rem; font-weight: 750; }

.alert { margin-bottom: 18px; padding: 13px 16px; border: 1px solid; border-radius: 12px; font-size: .88rem; }
.alert--success { border-color: #b8dcc7; background: #e7f5ec; color: #175638; }
.alert--danger { border-color: #efc4c4; background: var(--danger-soft); color: #842e2e; }
.alert--warning { border-color: #ead49c; background: var(--warning-soft); color: #73530b; }
.alert > div + div { margin-top: 5px; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 17px; padding: 13px; box-shadow: none; }
.filter-form { display: flex; align-items: center; flex: 1; gap: 8px; }
.filter-form .search-field { flex: 1; max-width: 420px; }
.result-count { flex: 0 0 auto; color: var(--muted); font-size: .78rem; }
input, select, textarea {
    width: 100%; min-height: 44px; border: 1px solid #cad8cf; border-radius: 10px; background: #fff; color: var(--ink);
    padding: 9px 11px; transition: border-color .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: #8b9b92; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(28,107,73,.1); outline: none; }
textarea { resize: vertical; line-height: 1.5; }

.data-card { overflow: hidden; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .82rem; }
th { padding: 13px 15px; border-bottom: 1px solid var(--line); background: #f7f9f7; color: var(--muted); font-size: .7rem; letter-spacing: .04em; text-align: left; text-transform: uppercase; white-space: nowrap; }
td { padding: 14px 15px; border-bottom: 1px solid #e8eee9; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcfb; }
tr.is-archived { opacity: .62; }
.table-title { color: var(--primary-dark); font-weight: 800; }
.table-title:hover { text-decoration: underline; }
.table-actions { display: flex; justify-content: flex-end; gap: 6px; white-space: nowrap; }
.table-actions form { margin: 0; }
.badge { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: #476055; font-size: .69rem; font-weight: 800; white-space: nowrap; }
.badge--activo, .badge--activa, .badge--completada, .badge--resuelta, .badge--baja { background: #e1f3e8; color: #17603c; }
.badge--alta, .badge--critica, .badge--abierta, .badge--descartada { background: #fbe5e5; color: #963838; }
.badge--media, .badge--observacion, .badge--pausado, .badge--pendiente { background: #fff0cf; color: #77560c; }
.badge--floracion, .badge--en_progreso, .badge--en_seguimiento { background: #e8e5f8; color: #55439a; }
.empty-state { padding: clamp(38px, 7vw, 76px) 24px; text-align: center; }
.empty-state h2 { margin: 12px 0 7px; }
.empty-state p { margin-bottom: 18px; color: var(--muted); }
.empty-icon { display: inline-grid; width: 48px; height: 48px; place-items: center; border-radius: 50%; background: var(--primary-soft); color: var(--primary); font-size: 1.5rem; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 15px; margin-top: 20px; color: var(--muted); font-size: .82rem; }

.form-card { padding: clamp(18px, 3vw, 30px); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 19px; }
.field { display: grid; align-content: start; gap: 7px; min-width: 0; }
.field > span:first-child { font-size: .78rem; font-weight: 800; }
.field small { color: var(--muted); font-size: .71rem; line-height: 1.4; }
.field--wide { grid-column: 1 / -1; }
.form-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 27px; padding-top: 20px; border-top: 1px solid var(--line); }

.detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 250px; align-items: start; gap: 18px; }
.detail-card, .action-card, .section-card { padding: clamp(18px, 3vw, 28px); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 21px; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; }
.detail-grid > div { padding: 15px 0; border-top: 1px solid var(--line); }
.detail-grid > div:nth-child(odd) { padding-right: 20px; }
.detail-wide { grid-column: 1 / -1; padding-right: 0 !important; }
.detail-grid dt { margin-bottom: 6px; color: var(--muted); font-size: .71rem; font-weight: 750; text-transform: uppercase; letter-spacing: .04em; }
.detail-grid dd { margin: 0; line-height: 1.55; }
.action-card { position: sticky; top: 86px; display: grid; gap: 10px; }
.action-card h2 { margin-bottom: 6px; }
.action-card form { margin: 0; }
.inline-action { margin-top: 20px; }
.section-card { margin-top: 18px; }
.attachment-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.attachment-item { display: grid; gap: 5px; padding: 13px; border: 1px solid var(--line); border-radius: 11px; }
.attachment-item:hover { border-color: var(--primary); }
.attachment-item span, .attachment-item small { color: var(--muted); font-size: .7rem; }
.timeline { position: relative; display: grid; gap: 0; margin: 0; padding: 0; list-style: none; }
.timeline::before { content: ""; position: absolute; top: 10px; bottom: 10px; left: 125px; width: 1px; background: var(--line); }
.timeline li { display: grid; grid-template-columns: 108px 1fr; gap: 35px; position: relative; padding: 0 0 25px; }
.timeline li::before { content: ""; position: absolute; left: 120px; top: 7px; width: 11px; height: 11px; border: 3px solid var(--surface); border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.timeline time { color: var(--muted); font-size: .72rem; }
.timeline h3 { margin: 7px 0 5px; }
.timeline p { color: var(--muted); font-size: .84rem; line-height: 1.5; }

.bottom-nav, .mobile-more, .mobile-more-backdrop { display: none; }

.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.stat-card { position: relative; display: flex; align-items: center; gap: 14px; min-height: 108px; padding: 18px; box-shadow: none; }
.stat-card:hover { border-color: #b9d3c3; box-shadow: var(--shadow); }
.stat-icon { display: inline-grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: var(--primary-soft); color: var(--primary-dark); font-weight: 900; }
.stat-card > div { display: grid; min-width: 0; }
.stat-card strong { font-size: 1.75rem; letter-spacing: -.04em; }
.stat-card span:last-child { color: var(--muted); font-size: .75rem; }
.stat-card > small { position: absolute; right: 13px; top: 12px; padding: 3px 6px; border-radius: 999px; background: var(--danger-soft); color: var(--danger); font-size: .62rem; font-weight: 800; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, .8fr); gap: 18px; }
.dashboard-card { min-width: 0; padding: 22px; }
.dashboard-card--wide { min-width: 0; }
.text-link { color: var(--primary); font-size: .76rem; font-weight: 800; white-space: nowrap; }
.compact-empty { display: grid; place-items: start; gap: 7px; padding: 17px; border-radius: 11px; background: var(--surface-2); color: var(--muted); font-size: .83rem; }
.compact-empty a { color: var(--primary); font-weight: 800; }
.task-list, .activity-list { display: grid; }
.task-row { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.task-row:first-child { border-top: 0; padding-top: 0; }
.task-row:last-child { padding-bottom: 0; }
.task-row form { margin: 0; }
.task-check { display: block; width: 23px; height: 23px; border: 2px solid #aec5b6; border-radius: 7px; background: #fff; }
.task-check:hover { border-color: var(--primary); background: var(--primary-soft); }
.task-row > div { display: grid; gap: 3px; min-width: 0; }
.task-row a { overflow: hidden; font-size: .83rem; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.task-row div span { color: var(--muted); font-size: .69rem; }
.text-danger { color: var(--danger) !important; font-weight: 700; }
.reminder-list { display: grid; gap: 9px; }
.reminder-list > a { display: flex; align-items: center; gap: 12px; padding: 9px; border-radius: 10px; background: var(--surface-2); }
.reminder-list time { display: grid; flex: 0 0 43px; place-items: center; width: 43px; height: 45px; border-radius: 9px; background: #fff; line-height: 1; }
.reminder-list time strong { font-size: 1rem; }
.reminder-list time span { color: var(--primary); font-size: .55rem; font-weight: 850; }
.reminder-list > a > span { display: grid; gap: 3px; min-width: 0; }
.reminder-list > a > span strong { overflow: hidden; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }
.reminder-list small { color: var(--muted); font-size: .65rem; }
.activity-list > a { display: grid; grid-template-columns: 15px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.activity-list > a:first-child { padding-top: 0; border-top: 0; }
.activity-list > a:last-child { padding-bottom: 0; }
.activity-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.activity-list > a > span:nth-child(2) { display: grid; gap: 4px; min-width: 0; }
.activity-list strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
.activity-list small { color: var(--muted); font-size: .68rem; }
.money-total { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 10px 0; border-top: 1px solid var(--line); }
.money-total strong { font-size: 1.55rem; letter-spacing: -.04em; }
.money-total span { color: var(--muted); font-size: .72rem; font-weight: 800; }
.expense-summary > .button { margin-top: 14px; }
.calendar-card { overflow: hidden; padding: 20px; }
.calendar-toolbar { display: flex; align-items: center; justify-content: center; gap: 20px; }
.calendar-toolbar > div { min-width: 210px; text-align: center; }
.calendar-toolbar h2 { margin-bottom: 2px; font-size: 1.45rem; text-transform: capitalize; }
.calendar-toolbar a:not(.calendar-nav) { color: var(--primary); font-size: .69rem; font-weight: 750; }
.calendar-nav { display: inline-grid; width: 36px; height: 36px; place-items: center; }
.calendar-filter { display: flex; justify-content: flex-end; margin: 14px 0 5px; }
.calendar-filter label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .7rem; font-weight: 750; }
.calendar-filter select { min-height: 36px; width: auto; padding-block: 5px; font-size: .75rem; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 13px; color: var(--muted); font-size: .67rem; }
.calendar-legend span { display: flex; align-items: center; gap: 5px; }
.legend-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.legend-dot--reminder { background: var(--accent); }
.legend-dot--complete { background: #9ba9a0; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(105px, 1fr)); }
.calendar-scroll { overflow-x: auto; border: 1px solid var(--line); border-radius: 11px; }
.calendar-weekdays { min-width: 735px; background: #f3f6f3; }
.calendar-weekdays div { padding: 8px; color: var(--muted); font-size: .65rem; font-weight: 800; text-align: center; text-transform: uppercase; }
.calendar-days { min-width: 735px; }
.calendar-day { min-height: 118px; padding: 7px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); background: #fff; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside { background: #f8faf8; color: #9aa69f; }
.calendar-day header { display: flex; justify-content: flex-end; margin-bottom: 6px; }
.calendar-day header time { display: inline-grid; width: 25px; height: 25px; place-items: center; border-radius: 50%; font-size: .7rem; font-weight: 750; }
.calendar-day.today header time { background: var(--primary); color: #fff; }
.day-events { display: grid; gap: 4px; }
.calendar-event { display: flex; gap: 5px; min-width: 0; padding: 5px 6px; border-left: 3px solid var(--primary); border-radius: 5px; background: #e7f4ec; color: #1b573b; font-size: .62rem; }
.calendar-event--reminder { border-left-color: var(--accent); background: #fff3dc; color: #72520d; }
.calendar-event.is-done { border-left-color: #aab4ad; background: #f0f2f0; color: #7a857e; text-decoration: line-through; }
.calendar-event time { flex: 0 0 auto; font-weight: 850; }
.calendar-event span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mobile-agenda { display: none; }
.files-layout { display: grid; grid-template-columns: 315px minmax(0, 1fr); align-items: start; gap: 18px; }
.upload-card { position: sticky; top: 86px; padding: 21px; }
.link-fields { border: 1px solid var(--line); border-radius: 10px; }
.link-fields summary { padding: 11px; color: var(--primary); cursor: pointer; font-size: .76rem; font-weight: 800; }
.link-fields[open] { padding-bottom: 12px; }
.link-fields[open] summary { margin-bottom: 4px; }
.link-fields .field { padding: 5px 11px; }
.file-picker input { padding: 7px; font-size: .72rem; }
.files-main { min-width: 0; }
.file-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.file-card { display: flex; min-width: 0; overflow: hidden; flex-direction: column; box-shadow: none; }
.file-preview { display: grid; height: 130px; place-items: center; background: linear-gradient(145deg, #e4ece6, #f6f8f6); color: var(--primary); font-size: 1rem; font-weight: 900; }
.file-preview--image { background: #e5eae6; }
.file-preview img { width: 100%; height: 100%; object-fit: cover; }
.file-info { display: grid; gap: 6px; min-width: 0; padding: 14px; }
.file-info .badge { justify-self: start; }
.file-info h2 { overflow: hidden; font-size: .9rem; text-overflow: ellipsis; white-space: nowrap; }
.file-info p { overflow: hidden; color: var(--muted); font-size: .7rem; text-overflow: ellipsis; white-space: nowrap; }
.file-info small { color: var(--muted); font-size: .64rem; }
.file-actions { display: flex; gap: 6px; margin-top: auto; padding: 0 14px 14px; }
.file-actions .button { flex: 1; }
.file-actions form { display: flex; flex: 1; margin: 0; }
.report-filters { display: grid; grid-template-columns: 1fr 1fr minmax(190px, 1.3fr) auto; align-items: end; gap: 12px; margin-bottom: 15px; padding: 15px; box-shadow: none; }
.report-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 15px; }
.report-kpi { display: grid; gap: 4px; padding: 17px; box-shadow: none; }
.report-kpi > span { color: var(--muted); font-size: .7rem; font-weight: 750; }
.report-kpi strong { font-size: 1.65rem; letter-spacing: -.04em; }
.report-kpi small { color: var(--muted); font-size: .65rem; }
.report-grid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(260px, .75fr); gap: 15px; }
.report-card { min-width: 0; padding: 21px; }
.chart-block + .chart-block { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.chart-block h3 { margin-bottom: 10px; color: var(--muted); font-size: .72rem; }
.bar-chart { display: flex; align-items: flex-end; gap: clamp(7px, 2vw, 20px); height: 205px; overflow-x: auto; padding: 22px 5px 0; }
.bar-column { display: grid; flex: 1 0 42px; grid-template-rows: 18px 145px 20px; gap: 4px; height: 100%; text-align: center; }
.bar-value { overflow: hidden; color: var(--muted); font-size: .57rem; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { display: flex; align-items: flex-end; width: 100%; height: 100%; border-radius: 7px 7px 3px 3px; background: #edf2ee; overflow: hidden; }
.bar-track i { display: block; width: 100%; min-height: 4px; border-radius: 7px 7px 3px 3px; background: linear-gradient(180deg, #4b9a72, var(--primary)); }
.bar-label { color: var(--muted); font-size: .61rem; font-weight: 750; }
.progress-list { display: grid; gap: 15px; }
.progress-list > div { display: grid; gap: 6px; }
.progress-list span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.progress-list strong { font-size: .73rem; }
.progress-list small { color: var(--muted); font-size: .64rem; }
.progress-track { height: 7px; overflow: hidden; border-radius: 999px; background: #e9efeb; }
.progress-track i { display: block; height: 100%; border-radius: 999px; background: var(--primary); }
.category-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px; }
.category-columns h3 { margin-bottom: 16px; }
.environment-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin: 0 0 20px; }
.environment-card dl div { padding: 13px; border-radius: 10px; background: var(--surface-2); }
.environment-card dt { color: var(--muted); font-size: .65rem; }
.environment-card dd { margin: 5px 0 0; font-size: 1.1rem; font-weight: 850; }
.profile-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: 15px; }
.profile-card { padding: 23px; }
.profile-card--session, .profile-card--version { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.profile-card--session form { margin: 0; }
.profile-card--version > strong { padding: 8px 12px; border-radius: 9px; background: var(--primary-soft); color: var(--primary-dark); }

.auth-page { background: #e8eee9; }
.auth-shell { display: grid; grid-template-columns: minmax(340px, .8fr) minmax(480px, 1.2fr); min-height: 100vh; }
.auth-brand { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(32px, 6vw, 76px); background: linear-gradient(145deg, #164631, #0b2b1e); color: #fff; }
.auth-brand h1 { max-width: 590px; margin-bottom: 18px; font-size: clamp(2.2rem, 5vw, 4.1rem); }
.auth-brand > div p:last-child { max-width: 540px; color: #c6d9ce; font-size: 1.05rem; line-height: 1.65; }
.auth-brand .eyebrow { color: #99c8ac; }
.auth-version { color: #92ab9c; font-size: .74rem; }
.auth-panel { display: grid; place-items: center; padding: clamp(24px, 6vw, 80px); background: var(--surface); }
.auth-form-wrap { width: min(450px, 100%); }
.auth-form-wrap h2 { margin-bottom: 7px; font-size: 2rem; }
.auth-form-wrap > .muted { margin-bottom: 25px; }
.stack-form { display: grid; gap: 17px; }
.password-input { display: flex; gap: 7px; }
.password-input input { flex: 1; }
.auth-switch { margin-top: 22px; color: var(--muted); text-align: center; }
.auth-switch a { color: var(--primary); font-weight: 800; }

@media (max-width: 1000px) {
    :root { --sidebar-width: 218px; }
    .sidebar { padding-inline: 12px; }
    .sidebar-nav a { font-size: .82rem; }
    .content { padding-inline: 28px; }
    .attachment-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .auth-shell { grid-template-columns: minmax(300px, .75fr) minmax(420px, 1.25fr); }
    .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .files-layout { grid-template-columns: 280px minmax(0, 1fr); }
    .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    body.app-page { padding-bottom: calc(70px + env(safe-area-inset-bottom)); }
    .sidebar { display: none; }
    .main-column { margin-left: 0; }
    .topbar { height: 58px; padding: 0 16px; }
    .mobile-brand { display: flex; }
    .topbar-context, .profile-link > span:first-child { display: none; }
    .profile-link .avatar { width: 32px; height: 32px; flex-basis: 32px; }
    .content { padding: 22px 14px 32px; }
    .page-header { align-items: stretch; flex-direction: column; gap: 16px; margin-bottom: 19px; }
    .page-header > .button { width: 100%; }
    .header-actions { justify-content: stretch; }
    .header-actions .button { flex: 1; }
    .toolbar { align-items: stretch; flex-direction: column; padding: 11px; }
    .filter-form { display: grid; grid-template-columns: 1fr 1fr; }
    .filter-form .search-field { grid-column: 1 / -1; max-width: none; }
    .filter-form .button { min-width: 0; }
    .result-count { padding-left: 2px; }
    .data-card { background: transparent; border: 0; box-shadow: none; overflow: visible; }
    .table-wrap { overflow: visible; }
    table, tbody, tr, td { display: block; width: 100%; }
    thead { display: none; }
    tbody { display: grid; gap: 11px; }
    tbody tr { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); box-shadow: 0 7px 24px rgba(20,55,38,.06); }
    tbody tr:hover { background: var(--surface); }
    td { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 7px 0; border: 0; text-align: right; }
    td::before { content: attr(data-label); color: var(--muted); font-size: .69rem; font-weight: 750; letter-spacing: .02em; text-align: left; text-transform: uppercase; }
    td:first-child { padding-top: 0; font-size: 1rem; }
    td:last-child { padding-bottom: 0; }
    .table-actions { justify-content: flex-end; margin-top: 7px; padding-top: 12px; border-top: 1px solid var(--line); }
    .table-actions::before { display: none; }
    .table-actions .button { min-height: 37px; }
    .form-grid { grid-template-columns: 1fr; }
    .field--wide { grid-column: auto; }
    .form-actions { position: sticky; bottom: calc(70px + env(safe-area-inset-bottom)); z-index: 8; margin: 24px -18px -18px; padding: 12px 18px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.96); box-shadow: 0 -8px 20px rgba(20,55,38,.07); }
    .form-actions .button { flex: 1; }
    .detail-layout { grid-template-columns: 1fr; }
    .action-card { position: static; }
    .detail-grid { grid-template-columns: 1fr; }
    .detail-grid > div:nth-child(odd) { padding-right: 0; }
    .detail-wide { grid-column: auto; }
    .attachment-grid { grid-template-columns: 1fr; }
    .section-heading { align-items: stretch; flex-direction: column; }
    .section-heading .button { width: 100%; }
    .timeline::before { left: 7px; }
    .timeline li { grid-template-columns: 1fr; gap: 7px; padding-left: 28px; }
    .timeline li::before { left: 2px; }
    .timeline time { order: 2; }
    .bottom-nav {
        position: fixed; inset: auto 0 0; z-index: 50; display: grid; grid-template-columns: repeat(5, 1fr);
        height: calc(66px + env(safe-area-inset-bottom)); padding: 5px 7px env(safe-area-inset-bottom); border-top: 1px solid var(--line);
        background: rgba(255,255,255,.97); box-shadow: 0 -10px 30px rgba(20,55,38,.1); backdrop-filter: blur(14px);
    }
    .bottom-nav a, .bottom-nav button {
        display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 2px; min-width: 0; border: 0;
        border-radius: 9px; background: transparent; color: var(--muted); font-size: .61rem; font-weight: 750;
    }
    .bottom-nav .nav-icon { width: 26px; height: 26px; flex-basis: 26px; background: transparent; }
    .bottom-nav .active { color: var(--primary); }
    .bottom-nav .active .nav-icon { background: var(--primary-soft); }
    .mobile-more-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(8,29,20,.45); }
    .mobile-more-backdrop.is-open { display: block; }
    .mobile-more {
        position: fixed; inset: auto 0 0; z-index: 60; display: block; max-height: 82vh; padding: 7px 15px calc(22px + env(safe-area-inset-bottom));
        border-radius: 22px 22px 0 0; background: #fff; box-shadow: 0 -20px 60px rgba(9,36,24,.2); transform: translateY(105%); transition: transform .22s ease;
    }
    .mobile-more.is-open { transform: translateY(0); }
    .mobile-more-handle { width: 42px; height: 4px; margin: 3px auto 15px; border-radius: 999px; background: #ccd8d0; }
    .mobile-more header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
    .mobile-more-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .mobile-more-grid a { display: flex; align-items: center; flex-direction: column; gap: 7px; min-width: 0; padding: 13px 5px; border: 1px solid var(--line); border-radius: 12px; color: var(--muted); font-size: .69rem; text-align: center; }
    .mobile-more-grid a.active { border-color: #9cc5ac; background: var(--primary-soft); color: var(--primary-dark); }
    .auth-shell { display: block; min-height: 100vh; background: var(--surface); }
    .auth-brand { min-height: auto; padding: 24px 20px 30px; }
    .auth-brand > div { margin-top: 38px; }
    .auth-brand h1 { font-size: 2.15rem; }
    .auth-brand > div p:last-child { font-size: .9rem; }
    .auth-version { display: none; }
    .auth-panel { display: block; padding: 28px 20px 40px; }
    .stat-grid { gap: 9px; }
    .stat-card { min-height: 95px; padding: 13px; }
    .stat-icon { width: 36px; height: 36px; flex-basis: 36px; }
    .stat-card strong { font-size: 1.45rem; }
    .dashboard-grid { grid-template-columns: 1fr; gap: 12px; }
    .dashboard-card { padding: 17px; }
    .activity-list > a { grid-template-columns: 15px minmax(0, 1fr); }
    .activity-list .badge { grid-column: 2; justify-self: start; }
    .calendar-card { padding: 14px; }
    .calendar-scroll, .calendar-legend { display: none; }
    .calendar-filter { justify-content: stretch; }
    .calendar-filter label { width: 100%; justify-content: space-between; }
    .calendar-filter select { width: min(240px, 70%); }
    .mobile-agenda { display: block; margin-top: 12px; padding: 17px; }
    .mobile-agenda h2 { margin-bottom: 13px; }
    .agenda-day { display: grid; grid-template-columns: 44px 1fr; gap: 10px; padding: 13px 0; border-top: 1px solid var(--line); }
    .agenda-day > time { display: grid; align-content: center; place-items: center; width: 42px; height: 46px; border-radius: 9px; background: var(--surface-2); }
    .agenda-day > time strong { font-size: 1rem; }
    .agenda-day > time span { color: var(--muted); font-size: .58rem; }
    .agenda-day > div { display: grid; gap: 7px; }
    .agenda-day a { display: grid; grid-template-columns: 10px 1fr; align-items: center; gap: 8px; }
    .agenda-day a > span { display: grid; gap: 2px; }
    .agenda-day a strong { font-size: .78rem; }
    .agenda-day a small { color: var(--muted); font-size: .65rem; }
    .files-layout { grid-template-columns: 1fr; }
    .upload-card { position: static; }
    .file-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .report-filters { grid-template-columns: 1fr 1fr; }
    .report-filters .field:nth-of-type(3), .report-filters .button { grid-column: 1 / -1; }
    .report-grid { grid-template-columns: 1fr; }
    .category-columns { grid-template-columns: 1fr; }
    .profile-grid { grid-template-columns: 1fr; }
}

@media (max-width: 390px) {
    .content { padding-inline: 10px; }
    .form-card, .detail-card, .action-card, .section-card { padding-inline: 15px; }
    .filter-form { grid-template-columns: 1fr; }
    .filter-form .search-field { grid-column: auto; }
    .mobile-more-grid { grid-template-columns: repeat(2, 1fr); }
    .stat-grid { grid-template-columns: 1fr 1fr; }
    .stat-card { align-items: flex-start; flex-direction: column; gap: 8px; min-height: 118px; }
    .file-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
