﻿:root {
  color-scheme: light;
  --ink: #182c2a;
  --muted: #526761;
  --line: #dce6e1;
  --paper: #ffffff;
  --canvas: #f3f7f4;
  --green: #12634f;
  --teal: #0c4f40;
  --mint: #def0e8;
  --rail: #102e2a;
  --focus: #2f9b7d;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 16px;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--canvas); color: var(--ink); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 4vw, 2.85rem); line-height: 1.07; letter-spacing: -.05em; }
h2 { font-size: 1.25rem; letter-spacing: -.025em; }
h3 { font-size: 1rem; }
a { color: var(--green); font-weight: 650; text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .56; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
svg { width: 20px; height: 20px; flex: none; vertical-align: middle; }
button, .button {
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 9px;
  display: inline-flex; gap: 8px; align-items: center; justify-content: center;
  min-height: 42px; padding: 9px 15px; font-weight: 650; font-size: .875rem; text-decoration: none;
}
button:hover:not(:disabled), .button:hover { background: #edf5f0; }
button.primary, .button.primary { background: var(--green); border-color: var(--green); color: white; }
button.primary:hover:not(:disabled) { background: var(--teal); }
button.subtle { background: transparent; border-color: transparent; }
button.icon-only { padding: 8px; }
input, select, textarea {
  min-width: 0; width: 100%; padding: 10px 11px; min-height: 42px; border-radius: 8px;
  border: 1px solid #c9d9d1; background: var(--paper); color: var(--ink);
}
select { appearance: none; padding-right: 30px; background-image: url("/static/chevron.svg"); background-repeat: no-repeat; background-position: right 10px center; background-size: 14px; }
textarea { resize: vertical; }
input[type=checkbox] { width: 18px; min-height: 0; height: 18px; accent-color: var(--green); }
label { display: grid; min-width: 0; gap: 6px; font-weight: 650; font-size: .875rem; }
label.check { display: flex; align-items: center; gap: 8px; }
.loading { text-align: center; margin-top: 15vh; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.help { color: var(--muted); font-size: .875rem; line-height: 1.5; }
.error { background: #fff0ee; color: #883222; border: 1px solid #f0cfc9; }
.notice { background: #e9f4ed; color: #235244; border: 1px solid #c5e1d4; }
.error, .notice { border-radius: 9px; padding: 10px 13px; font-size: .875rem; line-height: 1.45; overflow-wrap: anywhere; }
.toolbar, .actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar { justify-content: space-between; }
.stack { display: grid; gap: 16px; }
.fields { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 15px; }
.fields .wide { grid-column: 1/-1; }
.brand { display: flex; align-items: center; gap: 11px; font-size: 1.36rem; font-weight: 750; letter-spacing: -.035em; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; color: #113b2e; background: #a5e5c5; }
.brand-mark svg { width: 23px; height: 23px; }
.auth { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-aside { padding: clamp(32px, 7vw, 90px); background: var(--rail); color: white; display: flex; flex-direction: column; justify-content: space-between; gap: 48px; }
.auth-aside h1 { color: #d9f3e6; max-width: 460px; font-size: clamp(2.7rem, 6vw, 5rem); margin-bottom: 20px; }
.auth-aside p { color: #b7d5ca; max-width: 430px; line-height: 1.6; }
.auth-main { display: grid; align-content: center; justify-items: center; padding: 30px; }
.auth-card { width: min(100%, 405px); display: grid; gap: 20px; }
.auth-card h1 { font-size: 2.15rem; }
.auth-card .primary { width: 100%; }
.shell { min-height: 100vh; display: grid; grid-template-columns: 220px minmax(0,1fr); }
.sidebar { color: #ecf7f2; background: var(--rail); display: flex; flex-direction: column; gap: 32px; padding: 26px 15px 18px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand { margin: 0 8px; }
.nav { display: grid; gap: 4px; }
.nav button { justify-content: flex-start; text-align: left; color: #d3e7de; background: transparent; border-color: transparent; padding: 10px 12px; width: 100%; }
.nav button:hover:not(:disabled), .nav button[aria-current=page] { color: #fff; background: #245043; border-color: #316053; }
.nav button svg { opacity: .85; }
.sidebar-footer { margin-top: auto; border-top: 1px solid #315149; padding-top: 12px; }
.profile { display: flex; align-items: center; gap: 9px; margin: 4px 6px 10px; min-width: 0; }
.profile button { display: grid; gap: 2px; align-content: center; justify-content: stretch; color: inherit; background: transparent; padding: 3px 5px; border: 0; text-align: left; min-width: 0; line-height: 1.25; }
.profile button:hover:not(:disabled) { background: transparent; }
.profile button > * { display: block; max-width: 136px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.profile small { font-weight: 400; color: #a9c9bb; }
.avatar { display: grid; place-items: center; width: 33px; height: 33px; flex: none; background: #28574a; color: #e1f6eb; border-radius: 50%; font-size: .8rem; font-weight: 750; }
.main { width: min(100%, 1450px); margin: 0 auto; padding: 34px clamp(20px,4vw,55px) 54px; }
.topbar { border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 26px; font-size: .875rem; }
.hero { position: relative; overflow: hidden; isolation: isolate; background: #d9eee3; border: 1px solid #c5e4d4; border-radius: 18px; padding: clamp(22px, 4vw, 37px); }
.hero::after { content: ""; position: absolute; z-index: -1; width: 330px; height: 330px; border: 1px solid #a5d1bb; box-shadow: 0 0 0 22px #d9eee3, 0 0 0 23px #b0d8c4, 0 0 0 44px #d9eee3, 0 0 0 45px #b9ddcc; border-radius: 50%; bottom: -240px; right: 8%; pointer-events: none; }
.hero p, .page-heading p { margin-top: 9px; color: #365d50; line-height: 1.5; }
.hero .actions { margin-top: 19px; }
.page-heading { margin-bottom: 5px; }
.section { margin-top: 24px; }
.stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; }
.stat { padding: 17px 18px; background: white; border: 1px solid var(--line); border-radius: 13px; min-width: 0; }
.stat svg { color: var(--green); width: 17px; height: 17px; }
.stat p { font-size: .875rem; color: var(--muted); display: flex; gap: 7px; align-items: center; }
.stat strong { display: block; font-size: clamp(1.26rem,2.6vw,1.82rem); margin-top: 6px; letter-spacing: -.04em; overflow-wrap: anywhere; }
.panel { background: white; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
.panel-head { padding: 16px 19px; border-bottom: 1px solid var(--line); }
.panel-body { padding: 19px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: .875rem; }
thead { color: #39534a; background: #edf4ef; }
th, td { padding: 11px 14px; border-bottom: 1px solid #e4ebe7; }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
td small { display: block; margin-top: 4px; color: var(--muted); font-size: .8125rem; }
.date-cell { white-space: nowrap; }
.empty { display: grid; place-items: center; text-align: center; gap: 8px; padding: 32px 16px 36px; }
.empty-mark { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; color: var(--green); background: var(--mint); margin-bottom: 3px; }
.pill { padding: 4px 8px; display: inline-block; border-radius: 6px; color: #235b4b; background: #e8f4ed; font-weight: 650; font-size: .8125rem; }
.month-control { display: flex; align-items: center; gap: 8px; }
.month-control input { width: auto; max-width: 100%; }
.admin-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 17px; }
.department-list { display: flex; flex-wrap: wrap; gap: 7px; }
.model-meta { background: #f1f7f4; border-radius: 8px; padding: 10px 12px; }
dialog { border: 1px solid var(--line); border-radius: 15px; color: var(--ink); background: white; padding: 0; width: min(560px,100% - 28px); max-height: calc(100dvh - 28px); box-shadow: 0 20px 70px #102e2a42; }
dialog.receipt-dialog { width: min(1050px, 100% - 28px); }
dialog::backdrop { background: #101e1ac0; }
.dialog-head, .dialog-foot { padding: 14px 20px; background: white; }
.dialog-head { border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 1; }
.dialog-foot { border-top: 1px solid var(--line); }
.dialog-body { padding: 18px 20px; }
.upload-layout { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 6fr); gap: 20px; align-items: start; }
.receipt-preview { background: #f0f5f1; border: 1px solid var(--line); border-radius: 10px; padding: 11px; }
.receipt-preview img { display: block; max-width: 100%; max-height: 53vh; margin: 7px auto; object-fit: contain; background: white; }
.receipt-name { overflow-wrap: anywhere; }
.drop { display: grid; justify-items: center; text-align: center; background: #f2f8f5; border: 2px dashed #adcdbf; padding: 29px 14px; border-radius: 10px; }
.drop.drag { background: #d9eee3; border-color: var(--green); }
.drop input { width: min(100%,390px); background: white; }
#toast { position: fixed; bottom: 20px; right: 20px; max-width: min(420px,calc(100% - 40px)); z-index: 2; background: var(--rail); color: #fff; border-radius: 9px; padding: 12px 16px; box-shadow: 0 8px 30px #102e2a33; }
.report-options { padding: 17px 18px; margin-bottom: 15px; }
.report-paper { background: white; padding: 18px; border: 1px solid var(--line); border-radius: 9px; }
.report-sheet { color: #132634; }
.report-banner { padding: 10px 12px; background: #c7dcef; border: 1px solid #687d8d; }
.report-banner strong { font-size: .875rem; letter-spacing: .035em; }
.report-meta { background: #eef4eb; border: 1px solid #687d8d; border-top: 0; padding: 10px 12px; display: grid; grid-template-columns: 1fr auto; gap: 10px 16px; font-size: .875rem; }
.report-meta p { margin-bottom: 5px; overflow-wrap: anywhere; }
.report-table { font-size: .76rem; table-layout: fixed; margin-top: 10px; }
.report-table th, .report-table td { border: 1px solid #73818c !important; padding: 5px 4px; overflow-wrap: anywhere; }
.report-table .description-column { width: 22%; }
.report-table .date-cell { width: 9%; }
.report-table thead { background: #193c57; color: white; }
.report-table tfoot { background: #e4edf3; font-weight: 700; }
.report-table td.num, .report-table th.num { white-space: normal; }
.report-total { margin: 9px 0 15px auto; width: min(100%, 230px); display: grid; grid-template-columns: 1fr auto; gap: 5px 14px; font-size: .875rem; }
.report-total span { text-align: right; }
.signatures { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); }
.report-block { border: 1px solid #73818c; margin-top: 11px; }
.report-block h3 { font-size: .85rem; background: #c7dcef; padding: 4px 8px; }
.report-block p { padding: 6px 8px; min-height: 27px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .85rem; }
.signatures .report-block + .report-block { border-left: 0; }
.attachments { margin-top: 20px; display: grid; gap: 10px; }
.attachment { border: 1px solid var(--line); padding: 12px; background: white; }
.attachment img { display: block; max-width: 100%; max-height: 680px; margin: 12px auto 0; }
@media (max-width: 830px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: static; display: grid; grid-template-columns: 1fr auto; gap: 14px; padding: 13px; }
  .sidebar .nav { display: flex; grid-row: 2; grid-column: 1/-1; flex-wrap: wrap; }
  .sidebar .nav button { width: auto; }
  .sidebar-footer { margin: 0; border: 0; padding: 0; }
  .sidebar-footer .nav { display: none; }
  .profile { margin: 0; }
  .sidebar .brand { margin: 0; }
  .main { padding-top: 22px; }
}
@media (max-width: 620px) {
  .auth, .admin-grid, .upload-layout { grid-template-columns: 1fr; }
  .auth-aside { padding: 23px; gap: 24px; }
  .auth-aside h1 { font-size: 2.4rem; }
  .auth-main { align-content: start; }
  .main { padding-inline: 13px; }
  .stats { gap: 6px; }
  .stat { padding: 10px 7px; }
  .stat p { font-size: .8125rem; }
  .stat p svg { display: none; }
  .profile button > * { max-width: 95px; }
  .report-meta { grid-template-columns: 1fr; }
  .report-table { min-width: 700px; }
}
@page { size: A4 landscape; margin: 10mm; }
@media print {
  body { background: white; }
  body:not(.printing) #app { display: none; }
  .printing .shell { display: block; min-height: 0; }
  .sidebar, .topbar, .report-options, .screen-only, #toast, dialog { display: none !important; }
  .main, .report-paper { border: 0; margin: 0; padding: 0; width: auto; max-width: none; }
  .report-meta { grid-template-columns: 1fr auto; }
  .report-paper, .attachment { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .table-scroll { overflow: visible; }
  .report-table { min-width: 0; }
  .report-table thead { display: table-header-group; }
  .report-table tfoot { display: table-row-group; }
  .report-table tr, .report-total, .report-block, .signatures { break-inside: avoid; }
  .attachment { break-before: page; break-inside: avoid; border: 0; padding: 0; }
  .attachment img { max-height: 170mm; }
  .attachments { display: block; margin: 0; }
}
