.book-shell { display: grid; grid-template-columns: 216px minmax(0, 1fr); min-height: 100vh; }
.book-side { background: var(--side); color: #fff; padding: 24px 16px; min-width: 0; }
.book-side .brand { display: flex; align-items: center; gap: 8px; color: inherit; margin-bottom: 26px; overflow-wrap: anywhere; }
.book-side .brand b { font-size: 20px; letter-spacing: .03em; }
.book-side nav { display: grid; gap: 6px; }
.book-side nav a { color: #fff; display: flex; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 4px; }
.book-side a { text-decoration: none; }
.book-side nav a:hover, .book-side nav a[aria-current] { background: #ffffff2b; }
.book-bonsai { display: block; margin: 34px auto 0; }
.book-main { min-width: 0; width: 100%; max-width: 1400px; margin-inline: auto; padding: 22px clamp(14px, 3vw, 36px) 40px; display: grid; align-content: start; gap: 18px; }
.book-top { display: flex; justify-content: end; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 2px solid var(--line); }
.book-menu { display: none; }
.book-main h1, .book-main h2, .book-login h1 { margin: 0; }
.book-main h1 { font-size: clamp(26px, 4vw, 38px); line-height: 1.15; }
.book-main h2 { font-size: 19px; }
.book-main .sub { margin: 6px 0 0; }
.book-hero { display: flex; align-items: center; flex-wrap: wrap; gap: 14px; }
.book-hero .btn { margin-left: auto; }
.book-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.book-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.book-stat { display: flex; align-items: center; gap: 10px; color: inherit; }
.book-stat strong { display: block; font-size: clamp(19px, 2.8vw, 29px); overflow-wrap: anywhere; }
.book-stat img, .book-side img, .book-hero img { object-fit: contain; image-rendering: pixelated; flex-shrink: 0; }
.book-heading, .book-actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.book-form { display: grid; justify-items: start; gap: 12px; margin-top: 12px; }
.book-form > label, .book-form > .book-fields, .book-form > [data-lines] { width: 100%; }
.book-fields, .book-line { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.book-fields > label { flex: 1 1 140px; min-width: 0; }
.book-line { padding: 8px 0; }
.book-line > label:first-child { flex: 2 1 165px; min-width: 0; }
.book-line > label:not(:first-child) { flex: 1 1 104px; min-width: 0; }
.book-form input, .book-form select, .book-form textarea, .book-fields input {
    width: 100%; min-width: 0; min-height: 42px; margin-top: 3px; color: var(--text); font: inherit;
    background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 7px 9px;
}
.book-form textarea { display: block; resize: vertical; }
.book-form button:disabled { opacity: .55; cursor: default; }
.book-main .btn, .book-stat { text-decoration: none; }
.book-table { max-width: 100%; overflow-x: auto; }
.book-table table { width: 100%; min-width: 0; }
.book-table th, .book-table td { text-align: left; padding: 8px; overflow-wrap: anywhere; }
.book-table th { white-space: normal; }
.book-table thead { border-bottom: 1px solid var(--line); }
.book-table th[scope="row"] { background: none; }
.book-report .book-table th:last-child, .book-report .book-table td:last-child { text-align: right; }
.book-total { font-weight: 800; }
.book-message { margin: 0; }
.book-message.error { border-color: #b74848; }
.book-message ul { margin-bottom: 0; }
.book-entry, .book-supplier, .book-recent { border-top: 1px solid var(--grid); margin-top: 12px; padding-top: 12px; overflow-wrap: anywhere; }
.book-entry summary, .book-supplier summary { cursor: pointer; }
.book-entry summary span, .book-recent span { color: var(--muted); margin-right: 6px; }
.book-pagination { display: flex; gap: 8px; padding-top: 12px; }
.book-login { max-width: 440px; width: calc(100% - 32px); margin: min(12vh, 100px) auto 20px; display: grid; gap: 12px; }
.book-invoice-meta { display: flex; gap: 24px; flex-wrap: wrap; }
.book-invoice-meta dd { margin: 0; }
.book-invoice-meta dt { color: var(--muted); }
.book-invoice-total { text-align: right; font-size: 20px; }
.book-footer { white-space: pre-wrap; }
@media (max-width: 820px) {
    .book-shell, .book-grid, .book-grid.three { grid-template-columns: 1fr; }
    .book-side { display: none; }
    .nav-open .book-side { display: block; }
    .book-menu { display: block; margin-right: auto; }
    .book-bonsai { display: none; }
}
@media print {
    .book-side, .book-top, .book-message, .no-print { display: none !important; }
    .book-shell, .book-grid, .book-main { display: block; padding: 0; }
    .book-main .panel { background: none; box-shadow: none; margin: 12px 0; break-inside: auto; }
    .book-table { overflow: visible; }
    .book-report { break-inside: avoid; }
}
