:root {
  --paper: #f4f7f3;
  --white: #fff;
  --ink: #152a24;
  --muted: #4e6359;
  --border: #d9e3db;
  --green: #17543e;
  --dark: #11372b;
  --mint: #e8f3eb;
  --lime: #d8f49c;
  --radius: 18px;
  font-family: "Segoe UI", system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
p, h1, h2, dl, dd { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; }
:focus-visible { outline: 3px solid #468464; outline-offset: 3px; }
.shell { width: min(1240px, calc(100% - 112px)); margin-inline: auto; }
.masthead { background: var(--white); border-bottom: 1px solid var(--border); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-size: 1.46rem; font-weight: 750; letter-spacing: -.055em; }
.brand-accent { color: #367255; }
.brand-mark { width: 37px; height: 37px; border-radius: 10px; background: var(--dark); display: grid; place-items: center; }
.brand-mark::before { content: ""; width: 15px; height: 18px; border: 2px solid var(--lime); border-radius: 3px; background: linear-gradient(var(--lime), var(--lime)) 3px 5px / 5px 1px no-repeat, linear-gradient(var(--lime), var(--lime)) 3px 9px / 6px 1px no-repeat; transform: rotate(-9deg); }
.local { display: inline-flex; gap: 9px; align-items: center; color: #315845; border: 1px solid #dae8de; background: #f4f9f5; padding: 7px 12px; border-radius: 100px; font-size: .875rem; font-weight: 600; }

.page-heading { padding: 54px 0 32px; }
h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); font-weight: 740; line-height: 1.04; letter-spacing: -.065em; }
.page-heading p { color: var(--muted); margin-top: 13px; font-size: 1.125rem; line-height: 1.6; }
h2 { font-size: 1.42rem; line-height: 1.25; font-weight: 720; letter-spacing: -.027em; }
.welcome { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 20px; }
.panel { background: var(--white); border: 1px solid var(--border); border-radius: var(--radius); }
.upload-panel { padding: 26px; }
.upload-panel > p:first-of-type { margin-top: 8px; color: var(--muted); line-height: 1.55; }
.drop-area { margin-top: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 238px; border: 1.5px dashed #99b8a7; border-radius: 14px; padding: 22px; text-align: center; background: #f6faf6; }
.drop-area.is-over { border-color: var(--green); background: #e3f2e7; }
.upload-symbol { background: #e1efe4; color: var(--green); width: 46px; height: 46px; border-radius: 13px; display: grid; place-items: center; margin-bottom: 13px; }
.upload-symbol .file { transform: scale(1.24); }
.drop-title { font-size: 1.095rem; font-weight: 700; }
.drop-hint { color: var(--muted); margin: 5px 0 17px; font-size: .9375rem; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 9px; padding: 10px 15px; min-height: 42px; font-size: .92rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.button.primary { background: var(--green); color: var(--white); }
.button.primary:hover { background: var(--dark); }
.button.secondary { background: var(--white); border-color: #cddad0; color: var(--green); }
.button.secondary:hover { background: var(--mint); }
.button.small { min-height: 36px; padding: 6px 11px; }
.button:disabled { opacity: .49; cursor: default; }
.private-note { color: var(--muted); display: flex; align-items: center; gap: 8px; margin-top: 18px; font-size: .875rem; line-height: 1.5; }
.guide { position: relative; overflow: hidden; isolation: isolate; padding: 31px 28px; border-radius: var(--radius); background: var(--dark); color: var(--white); }
.guide::before { position: absolute; z-index: -1; content: ""; width: 310px; height: 310px; right: -160px; bottom: -185px; border-radius: 50%; border: 1px solid #d8f49c36; box-shadow: 0 0 0 20px #d8f49c10, 0 0 0 40px #d8f49c0b, 0 0 0 60px #d8f49c08; }
.guide ul { list-style: none; padding: 0; margin: 23px 0 0; }
.guide li { display: flex; align-items: start; gap: 13px; padding: 17px 0; border-top: 1px solid #d9f3e328; }
.guide li strong { display: block; font-size: 1rem; margin: 0 0 4px; }
.guide li p { color: #cfdfd5; line-height: 1.45; font-size: .9375rem; }
.guide-icon { display: grid; place-items: center; flex: 0 0 34px; height: 34px; background: #d8f49c19; color: var(--lime); border-radius: 9px; }

.icon { display: inline-block; position: relative; width: 16px; height: 16px; flex: 0 0 16px; }
.icon::before, .icon::after { position: absolute; content: ""; }
.lock::before { width: 11px; height: 8px; border: 1.45px solid currentColor; border-radius: 2px; left: 2.5px; top: 7px; }
.lock::after { width: 7px; height: 6px; border: 1.45px solid currentColor; border-bottom: 0; border-radius: 5px 5px 0 0; left: 4.5px; top: 3px; }
.file::before { inset: 1px 2px; border: 1.5px solid currentColor; border-radius: 3px; }
.file::after { width: 5px; height: 1.5px; top: 6px; left: 5px; background: currentColor; box-shadow: 0 3.5px currentColor; border-radius: 1px; }
.building::before { inset: 1px 2px; border: 1.5px solid currentColor; border-radius: 2px; }
.building::after { width: 2px; height: 2px; top: 5px; left: 5px; background: currentColor; box-shadow: 4px 0 currentColor, 0 4px currentColor, 4px 4px currentColor; }
.list::before { width: 9px; height: 1.5px; background: currentColor; top: 4px; left: 5px; box-shadow: 0 4px currentColor, 0 8px currentColor; }
.list::after { width: 2px; height: 1.5px; background: currentColor; top: 4px; left: 1px; box-shadow: 0 4px currentColor, 0 8px currentColor; }
.totals::before { inset: 2px 1px; border-bottom: 1px solid currentColor; background: linear-gradient(currentColor, currentColor) 2px 7px / 2px 4px no-repeat, linear-gradient(currentColor, currentColor) 6px 4px / 2px 7px no-repeat, linear-gradient(currentColor, currentColor) 10px 1px / 2px 10px no-repeat; }

.notice { padding: 13px 16px; margin: 16px 0; border: 1px solid #cde2d2; border-radius: 10px; background: #eff8ef; color: var(--dark); }
.notice.error { background: #fff2ee; color: #863b2c; border-color: #f0d1c9; }
.report-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 14px 17px; }
.loaded-file { display: flex; align-items: center; gap: 11px; min-width: 0; }
.file-badge { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 10px; background: var(--mint); color: var(--green); flex-shrink: 0; }
.loaded-info { min-width: 0; line-height: 1.4; }
.loaded-info span, .period span { display: block; color: var(--muted); font-size: .875rem; }
.loaded-info strong { display: block; overflow-wrap: anywhere; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.company, .document-section, .summary-section { margin-top: 18px; }
.company { padding: 23px 24px; }
.company-top { display: flex; align-items: start; justify-content: space-between; gap: 18px; }
.company-name { margin-top: 9px; font-weight: 720; font-size: 1.23rem; overflow-wrap: anywhere; }
.period { flex-shrink: 0; background: #edf5ee; border-radius: 10px; padding: 9px 13px; line-height: 1.45; }
.company-details { margin-top: 19px; padding-top: 16px; border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px 22px; }
.company-details dt { font-size: .875rem; color: var(--muted); margin-bottom: 3px; }
.company-details dd { font-weight: 600; overflow-wrap: anywhere; }
.section-header { padding: 22px 24px 18px; }
.section-header p { color: var(--muted); margin-top: 6px; line-height: 1.45; font-size: .9375rem; }
.document-header { display: flex; justify-content: space-between; align-items: end; gap: 14px; }
.filters { display: flex; gap: 8px; }
.filters input, .filters select { min-width: 0; border: 1px solid #cddad0; border-radius: 8px; background-color: var(--white); color: var(--ink); min-height: 40px; font-size: .9rem; padding: 7px 10px; }
.filters select { appearance: none; padding-right: 31px; background: linear-gradient(45deg, transparent 50%, #456454 50%) calc(100% - 15px) 50% / 5px 5px no-repeat, linear-gradient(135deg, #456454 50%, transparent 50%) calc(100% - 10px) 50% / 5px 5px no-repeat; }
.table-scroll { overflow: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; text-align: left; }
thead th { background: #eef4ef; color: #355649; border-block: 1px solid var(--border); font-size: .875rem; vertical-align: bottom; }
th, td { padding: 11px 12px; }
tr > :first-child { padding-left: 23px; }
tr > :last-child { padding-right: 23px; }
tbody td { font-size: .92rem; border-bottom: 1px solid #e6ede7; vertical-align: top; overflow-wrap: anywhere; }
tbody tr:nth-child(even) { background: #fafcf9; }
.table-scroll tbody tr:hover { background: #f0f7f1; }
.num { text-align: right; white-space: nowrap; }
.date { white-space: nowrap; }
.money-head { min-width: 94px; text-align: right; }
.document-no { font-weight: 700; min-width: 127px; }
.muted { color: var(--muted); }
.negative { color: #8a3b30; }
.type-subtext { display: block; margin-top: 3px; color: var(--muted); font-size: .82rem; }
.cancelled { color: #884934; font-weight: 700; }
tfoot th, tfoot td { background: #e7f1e9; color: var(--dark); font-weight: 750; border-top: 1px solid #cbdcd0; white-space: nowrap; }
.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: .875rem; padding: 12px 23px; }
.pagination div { display: flex; gap: 8px; }
.notes { margin: 15px 23px 18px; padding-left: 18px; color: var(--muted); font-size: .875rem; line-height: 1.55; }
.notes li + li { margin-top: 4px; }
.empty-table { padding: 18px 24px 24px; color: var(--muted); }
.footer { display: flex; justify-content: space-between; padding-block: 19px 25px; margin-top: 28px; border-top: 1px solid var(--border); color: var(--muted); font-size: .875rem; }
.footer span:first-child { font-weight: 700; color: var(--green); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
#print-report { display: none; }

@media (max-width: 900px) {
  .shell { width: calc(100% - 48px); }
  .company-details { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .welcome { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); }
  .report-toolbar, .document-header { align-items: start; flex-direction: column; }
}

@media (max-width: 620px) {
  .shell { width: calc(100% - 30px); }
  .masthead-inner { min-height: 65px; }
  .local { font-size: .8rem; padding: 5px 8px; gap: 5px; }
  .page-heading { padding: 31px 0 23px; }
  .page-heading p { font-size: 1rem; }
  .welcome { grid-template-columns: 1fr; gap: 14px; }
  .upload-panel, .guide, .company, .section-header { padding: 18px; }
  .drop-area { min-height: 212px; }
  .company-top { flex-direction: column; gap: 12px; }
  .company-details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { flex-wrap: wrap; width: 100%; }
  .filters input, .filters select { width: 100%; }
  .actions { gap: 6px; }
  .actions .button { min-height: 39px; padding: 8px 10px; font-size: .875rem; }
}

@page { size: A4 landscape; margin: 11mm 10mm; }
@media print {
  :root, body { background: #fff; color: #162923; }
  body > :not(#print-report) { display: none !important; }
  #print-report { display: block; font-size: 9pt; }
  #print-report h1 { font-size: 22pt; letter-spacing: -.03em; margin-bottom: 5pt; }
  #print-report h2 { font-size: 13pt; margin: 12pt 0 5pt; break-after: avoid; }
  #print-report .print-currency { margin: 0 0 5pt; }
  #print-report dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5pt 10pt; margin: 9pt 0; }
  #print-report dt { color: #3d594c; }
  #print-report dd { font-weight: 650; overflow-wrap: anywhere; }
  #print-report table { table-layout: auto; }
  #print-report .print-summary { break-inside: avoid; }
  #print-report thead { display: table-header-group; }
  #print-report tfoot { display: table-row-group; }
  #print-report tr { break-inside: avoid; }
  #print-report td, #print-report th { font-size: 8pt; padding: 3pt 4.5pt; border-bottom: 1px solid #d9e3db; }
  #print-report th, #print-report tfoot td { print-color-adjust: exact; }
  #print-report .document-no { min-width: 0; }
  #print-report .money-head { min-width: 0; }
  #print-report .type-subtext { font-size: 7.5pt; }
  #print-report .notes { margin: 8pt 0; font-size: 8pt; }
}
