:root {
    --navy: #173856;
    --deep: #0f2c46;
    --blue: #2f89c7;
    --cyan: #17a9b1;
    --surface: #ffffff;
    --muted: #6b7b8c;
    --line: #dbe5ed;
    --bg: #f4f8fb;
    --danger: #b42318;
    --success: #067647;
    --warning: #b54708;
    --shadow: 0 12px 30px rgba(15, 44, 70, .12);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, Arial, sans-serif; background: var(--bg); color: #172b3a; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
code { background: #eef4f8; padding: 2px 5px; border-radius: 6px; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: 270px; background: var(--deep); color: #fff; padding: 24px; display: flex; flex-direction: column; gap: 26px; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand.center { justify-content: center; }
.brand-mark { width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(135deg, var(--blue), var(--cyan)); display: inline-flex; align-items: center; justify-content: center; font-weight: 800; color: #fff; box-shadow: 0 10px 20px rgba(0,0,0,.18); }
.brand small { display: block; opacity: .78; margin-top: 3px; }
.sidebar nav { display: grid; gap: 8px; }
.sidebar nav a { color: #dcecf7; padding: 12px 14px; border-radius: 12px; }
.sidebar nav a:hover, .sidebar nav a.active { background: rgba(255,255,255,.12); color: #fff; text-decoration: none; }
.sidebar-footer { margin-top: auto; display: grid; gap: 6px; border-top: 1px solid rgba(255,255,255,.14); padding-top: 18px; }
.link-button { border: 0; background: none; color: #bfe9ff; padding: 0; cursor: pointer; text-align: left; font: inherit; }
.main { margin-left: 270px; padding: 28px; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 24px; }
.topbar h1 { margin: 0 0 6px; color: var(--deep); font-size: 30px; }
.topbar p { margin: 0; color: var(--muted); }
.card, .report-header-card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 22px; }
.report-header-card { display: flex; justify-content: space-between; align-items: center; gap: 20px; }
.report-header-card h2 { margin: 10px 0 4px; font-size: 28px; color: var(--deep); }
.card h2 { margin-top: 0; color: var(--deep); }
.card h3 { color: var(--deep); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }
.card-head h2 { margin: 0; }
.grid { display: grid; gap: 22px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stats-grid { display: grid; grid-template-columns: repeat(6, minmax(120px, 1fr)); gap: 16px; margin-bottom: 22px; }
.stat-card { background: linear-gradient(160deg, var(--navy), #24486b); color: #fff; border-radius: 18px; padding: 20px; box-shadow: var(--shadow); min-height: 112px; display: flex; flex-direction: column; justify-content: center; }
.stat-card span { font-size: 32px; font-weight: 800; }
.stat-card small { color: #dcecf7; }
.btn { appearance: none; border: 1px solid var(--line); background: #fff; color: var(--deep); padding: 10px 14px; border-radius: 11px; cursor: pointer; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn:hover { text-decoration: none; border-color: #b9c8d4; }
.btn-primary { background: linear-gradient(135deg, var(--blue), var(--cyan)); border: 0; color: #fff; }
.btn.small { padding: 7px 10px; font-size: 12px; }
.btn.full { width: 100%; }
.btn.danger, .danger { color: var(--danger); border-color: #ffd1cf; background: #fff5f5; }
.badge { display: inline-flex; align-items: center; padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; background: #eef4f8; color: var(--deep); }
.badge.reviewed { background: #ecfdf3; color: var(--success); }
.badge.generated { background: #e7f5ff; color: #175cd3; }
.badge.draft { background: #fff6ed; color: var(--warning); }
.notice { padding: 13px 15px; border-radius: 12px; margin: 12px 0 18px; border: 1px solid var(--line); background: #f8fbfd; }
.notice.success { background: #ecfdf3; border-color: #abefc6; color: var(--success); }
.notice.error { background: #fff1f3; border-color: #fecdd3; color: var(--danger); }
.notice.warning { background: #fff6ed; border-color: #fedf89; color: var(--warning); }
.notice.info { background: #eaf6ff; border-color: #c9e7ff; color: #184e77; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { background: #f3f8fb; color: var(--deep); }
tr:last-child td { border-bottom: 0; }
td input, td select { min-width: 120px; }
.row-actions { display: flex; gap: 6px; align-items: center; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; }
.stack { display: grid; gap: 14px; }
label { display: grid; gap: 7px; font-weight: 700; color: var(--deep); }
input, select, textarea { width: 100%; border: 1px solid #cfdce5; border-radius: 11px; padding: 11px 12px; font: inherit; color: #172b3a; background: #fff; }
textarea { resize: vertical; }
.inline-form { display: grid; grid-template-columns: 120px 1.5fr 1fr 150px 160px 1fr auto; gap: 10px; margin-bottom: 15px; align-items: center; }
.inline-form.monthly { grid-template-columns: repeat(6, minmax(100px, 1fr)); }
.inline-form.monthly .btn { grid-column: span 1; }
.narrow { max-width: 900px; }
.search-row { display: flex; gap: 10px; margin-bottom: 14px; }
.search-row input { max-width: 440px; }
.timeline { margin: 0; padding-left: 20px; }
.timeline li { margin-bottom: 14px; }
.timeline span, .file-list span, .activity-list span { display: block; color: var(--muted); margin-top: 4px; }
.activity-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.file-list { display: grid; gap: 12px; }
.file-list.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.file-list.compact a { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #f8fbfd; }
.file-item { display: grid; grid-template-columns: 74px 1fr auto auto; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.file-item img { width: 74px; height: 58px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); }
.file-icon { width: 74px; height: 58px; border-radius: 10px; background: #eef4f8; display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--deep); }
.chart { width: 100%; height: 300px; border: 1px solid var(--line); border-radius: 14px; margin-bottom: 14px; background: #fff; }
.small-note { margin-top: 14px; color: var(--muted); font-size: 13px; }
.centered-card { max-width: 680px; margin: 80px auto; text-align: center; }
.danger-zone { border-color: #ffd1cf; }
.login-screen, .install-screen { background: var(--deep); min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login-hero { position: relative; width: min(100%, 520px); }
.login-card, .install-card { position: relative; z-index: 1; background: #fff; border-radius: 24px; padding: 32px; box-shadow: 0 30px 90px rgba(0,0,0,.25); }
.login-card h1 { text-align: center; color: var(--deep); margin-bottom: 6px; }
.login-card p { text-align: center; color: var(--muted); }
.circle { position: absolute; border-radius: 50%; opacity: .8; }
.circle-one { width: 210px; height: 210px; background: var(--blue); top: -70px; left: -80px; }
.circle-two { width: 260px; height: 260px; background: var(--cyan); bottom: -90px; right: -100px; }
.print-actions { position: sticky; top: 0; background: #fff; padding: 12px; display: flex; justify-content: center; gap: 10px; z-index: 5; box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.print-body { background: #d8e2ea; }
.cover-page, .pdf-page { width: 210mm; min-height: 297mm; margin: 18px auto; background: #fff; position: relative; overflow: hidden; box-shadow: 0 15px 60px rgba(0,0,0,.22); page-break-after: always; }
.cover-page { background: var(--deep); color: #fff; display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 52px; }
.cover-content { text-align: center; position: relative; z-index: 1; max-width: 780px; }
.cover-content h1 { font-size: 38px; line-height: 1.15; margin: 24px 0 10px; }
.cover-content h2, .cover-content h3 { font-weight: 500; }
.overline { font-weight: 800; letter-spacing: .14em; }
.cover-circle { position: absolute; border-radius: 50%; }
.cover-circle.top { width: 260px; height: 260px; background: var(--blue); left: -90px; top: 50px; }
.cover-circle.bottom { width: 390px; height: 390px; background: var(--cyan); right: -80px; bottom: -60px; }
.cover-kpis { position: absolute; left: 52px; right: 52px; bottom: 80px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; z-index: 2; }
.cover-kpis div { background: rgba(37, 74, 112, .92); border-radius: 10px; padding: 16px 12px; text-align: center; }
.cover-kpis strong { display: block; font-size: 28px; }
.cover-kpis span { display: block; font-size: 11px; opacity: .9; }
.pdf-page { padding: 66px 54px 48px; }
.pdf-header { position: absolute; top: 0; left: 0; right: 0; height: 34px; background: var(--deep); color: #fff; display: flex; justify-content: space-between; align-items: center; padding: 0 54px; font-size: 11px; }
.pdf-footer { position: absolute; bottom: 24px; left: 54px; right: 54px; border-top: 1px solid var(--line); padding-top: 10px; color: var(--muted); font-size: 11px; }
.pdf-page h2 { font-size: 28px; color: var(--deep); }
.pdf-page h3 { color: var(--deep); }
.pdf-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); margin: 22px 0; }
.pdf-kpi-grid div { text-align: center; padding: 16px 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.pdf-kpi-grid strong { display: block; font-size: 24px; color: var(--deep); }
.pdf-kpi-grid span { display: block; color: var(--muted); font-size: 11px; }
.pdf-table { font-size: 12px; }
.pdf-table.small { font-size: 10px; }
.data-note { background: #edf7fc; border: 1px solid #cfe2ec; padding: 14px; margin-top: 18px; }
.checklist li { margin-bottom: 8px; }
.appendix-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.appendix-grid figure { margin: 0; border: 1px solid var(--line); padding: 10px; border-radius: 12px; break-inside: avoid; }
.appendix-grid img { width: 100%; max-height: 260px; object-fit: contain; display: block; }
.appendix-grid figcaption { font-size: 11px; color: var(--muted); margin-top: 8px; }
@media (max-width: 1100px) {
    .sidebar { position: static; width: auto; }
    .main { margin-left: 0; }
    .stats-grid, .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .inline-form, .inline-form.monthly { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .file-item { grid-template-columns: 64px 1fr; }
    .actions { justify-content: flex-start; }
}
@media (max-width: 640px) {
    .main { padding: 16px; }
    .topbar, .report-header-card { flex-direction: column; align-items: flex-start; }
    .stats-grid, .grid.two, .form-grid, .file-list.compact { grid-template-columns: 1fr; }
    .form-grid .wide { grid-column: auto; }
}
@media print {
    @page { size: A4; margin: 0; }
    .no-print { display: none !important; }
    body.print-body { background: #fff; }
    .cover-page, .pdf-page { margin: 0; box-shadow: none; width: 210mm; min-height: 297mm; }
    .cover-page, .pdf-page { page-break-after: always; }
}
