:root {
    --app-accent: #1f4e79;
    --app-accent-soft: #e8eef5;
}

html { font-size: 15px; }
body { background: #f5f6f8; }

.app-nav { background: var(--app-accent); }
.app-nav .nav-link.active { font-weight: 600; text-decoration: underline; text-underline-offset: 6px; }

.page-head { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.page-head h1 { font-size: 1.45rem; margin: 0; }

.card { border: 0; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card-header { background: var(--app-accent-soft); font-weight: 600; }

.stat { padding: 1rem 1.2rem; }
.stat .v { font-size: 1.6rem; font-weight: 600; color: var(--app-accent); }
.stat .l { color: #666; font-size: .9rem; }

.table thead th { background: var(--app-accent-soft); white-space: nowrap; }
.table td.num, .table th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.qty-pos { color: #146c43; }
.qty-neg { color: #b02a37; }
tr.cancelled td { text-decoration: line-through; color: #888; }

.form-label { font-weight: 500; margin-bottom: .2rem; }
.req::after { content: " *"; color: #b02a37; }

.ac-wrap { position: relative; }
.ac-list { position: absolute; z-index: 1000; left: 0; right: 0; max-height: 280px; overflow-y: auto; background: #fff; border: 1px solid #ccc; border-radius: .25rem; box-shadow: 0 4px 10px rgba(0,0,0,.12); }
.ac-list div { padding: .35rem .6rem; cursor: pointer; }
.ac-list div:hover, .ac-list div.sel { background: var(--app-accent-soft); }
.ac-list small { color: #666; }

/* Printouts */
.print-page { background: #fff; max-width: 210mm; margin: 0 auto; padding: 12mm; box-shadow: 0 1px 4px rgba(0,0,0,.15); }
.print-page.landscape { max-width: 297mm; }
.print-head { display: flex; justify-content: space-between; border-bottom: 2px solid #000; padding-bottom: 4px; margin-bottom: 10px; }
.print-head .co { font-weight: 700; font-size: 1.05rem; }
.print-title { text-align: center; font-size: 1.25rem; font-weight: 700; margin: 10px 0 14px; }
.print-page table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.print-page th, .print-page td { border: 1px solid #999; padding: 3px 5px; vertical-align: top; }
.print-page th { background: #eee; }
.print-page .num { text-align: right; white-space: nowrap; }
.sign-row { display: flex; justify-content: space-around; gap: 2rem; margin-top: 50px; text-align: center; }
.sign-row > div { flex: 1; max-width: 45%; }
.sign-row .line { border-top: 1px solid #000; margin-top: 60px; padding-top: 4px; }
.print-foot { margin-top: 12px; font-size: .75rem; color: #555; display: flex; justify-content: space-between; }

@media print {
    @page { size: A4; margin: 12mm; }
    body { background: #fff; }
    .no-print { display: none !important; }
    .app-main { padding: 0 !important; }
    .print-page { box-shadow: none; padding: 0; max-width: none; }
    .print-page table { page-break-inside: auto; }
    .print-page tr { page-break-inside: avoid; }
    thead { display: table-header-group; }
    /* Totals print once, after the last row — browsers otherwise repeat tfoot on every page. */
    tfoot { display: table-row-group; }
    .page-break { page-break-before: always; }
}
