
:root{font-family:Inter,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#172033;background:#f5f7fb}
*{box-sizing:border-box}body{margin:0}a{color:#2856c5;text-decoration:none}a:hover{text-decoration:underline}
.topbar{min-height:64px;height:64px;background:#172033;color:#fff;display:flex;align-items:center;gap:20px;padding:0 28px;position:sticky;top:0;z-index:5;overflow:hidden}
.brand{font-size:20px;font-weight:800;color:#fff;white-space:nowrap;flex:0 0 auto}.topbar nav{display:flex;gap:16px;align-items:stretch;flex-wrap:nowrap;min-width:0;flex:1;height:64px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;-ms-overflow-style:none}.topbar nav::-webkit-scrollbar{display:none}.topbar nav a{color:#dce4f5;padding:22px 0 19px;white-space:nowrap;flex:0 0 auto}.topbar nav a.active{color:#fff;font-weight:700;border-bottom:3px solid #fff}
.container{max-width:1180px;margin:0 auto;padding:32px 20px 60px}.page-head{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:24px}
h1{margin:0 0 4px;font-size:32px}h2{margin:0 0 18px}.muted{color:#697386}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;margin-bottom:20px}.card{background:#fff;border:1px solid #e4e8f0;border-radius:14px;padding:22px;box-shadow:0 2px 10px rgba(23,32,51,.04);margin-bottom:20px}
.metric{display:flex;flex-direction:column;gap:8px}.metric span{font-size:14px;color:#697386}.metric strong{font-size:25px}.metric small{color:#697386}.cards{grid-template-columns:repeat(4,minmax(0,1fr))}
.section-head{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:10px}.section-head h2{margin:0}
.table-wrap{overflow:auto}table{width:100%;border-collapse:collapse}th,td{text-align:left;padding:13px 10px;border-bottom:1px solid #edf0f5;vertical-align:middle}th{font-size:13px;color:#697386}td.right,th.right{text-align:right}.positive{color:#147a42}.negative{color:#b42318}.amount{font-weight:700}
.btn{display:inline-block;border:1px solid #ccd3df;border-radius:9px;padding:10px 15px;background:#fff;color:#172033;cursor:pointer;font:inherit}.btn:hover{text-decoration:none;background:#f7f9fc}.btn.primary{background:#2856c5;color:#fff;border-color:#2856c5}.btn.primary:hover{background:#1f46a6}
label{display:block;font-weight:600;margin:15px 0}input,select,textarea{display:block;width:100%;margin-top:7px;border:1px solid #cbd3df;border-radius:8px;padding:10px 11px;font:inherit;background:#fff}textarea{min-height:90px;resize:vertical}small{font-weight:400;color:#697386}.form-card{max-width:700px}.actions{display:flex;gap:10px;margin-top:20px}.actions-inline{display:flex;gap:12px;align-items:center;white-space:nowrap}.actions-inline form{display:inline;margin:0}.link{border:0;background:none;color:#2856c5;padding:0;cursor:pointer;font:inherit}.danger{color:#b42318}
.alert{border-radius:9px;padding:12px 14px;margin:0 0 18px}.alert.error{background:#fff0f0;color:#a61b1b}.alert.success{background:#ecf9f0;color:#176b37}.badge{display:inline-block;border-radius:999px;padding:5px 9px;font-size:12px;font-weight:700}.badge.ok{background:#e7f7ec;color:#176b37}.badge.warn{background:#fff4df;color:#8a5a00}
.login{min-height:100vh;display:grid;place-items:center;padding:20px;background:#f5f7fb}.login-card{width:min(440px,100%)}.login-card .brand{color:#172033;margin-bottom:20px;display:block}
@media(max-width:900px){.grid,.cards{grid-template-columns:repeat(2,minmax(0,1fr))}.topbar{height:auto;min-height:58px;padding:0 16px;gap:14px}.topbar nav{height:58px}.topbar nav a{padding:19px 0 16px}.page-head{align-items:flex-start;flex-direction:column}}
@media(max-width:560px){.topbar{gap:12px}.brand{font-size:18px}.topbar nav{gap:14px}.topbar nav a{font-size:14px}.grid,.cards{grid-template-columns:1fr}.container{padding:22px 12px}.card{padding:16px}h1{font-size:27px}}
.match-row{display:flex;align-items:center;gap:10px;margin:6px 0;flex-wrap:wrap}.match-row span{flex:1;min-width:260px}.actions{flex-wrap:wrap}

/* Invoice processing: keep the review form inside the card without horizontal page scrolling. */
.invoice-table{table-layout:fixed;width:100%;min-width:0}
.invoice-table th:nth-child(1),.invoice-table td:nth-child(1){width:8%}
.invoice-table th:nth-child(2),.invoice-table td:nth-child(2){width:14%}
.invoice-table th:nth-child(3),.invoice-table td:nth-child(3){width:11%}
.invoice-table th:nth-child(4),.invoice-table td:nth-child(4){width:9%}
.invoice-table th:nth-child(5),.invoice-table td:nth-child(5){width:9%}
.invoice-table th:nth-child(6),.invoice-table td:nth-child(6){width:7%}
.invoice-table th:nth-child(7),.invoice-table td:nth-child(7){width:17%}
.invoice-table th:nth-child(8),.invoice-table td:nth-child(8){width:8%}
.invoice-table th:nth-child(9),.invoice-table td:nth-child(9){width:17%}
.invoice-table td,.invoice-table th{overflow-wrap:anywhere;word-break:break-word}
.invoice-actions{vertical-align:top}.inline-action{margin:0 0 8px}.invoice-details summary{list-style:none;cursor:pointer}.invoice-details summary::-webkit-details-marker{display:none}.invoice-details summary:before{content:'▶ ';font-size:11px}.invoice-details[open] summary:before{content:'▼ '}
.invoice-detail-row td{background:#fafbfe;padding:18px 16px 20px}.invoice-details-panel{width:100%}.invoice-details-panel>summary{font-weight:700;cursor:pointer;margin-bottom:12px}.invoice-form{max-width:900px}.invoice-form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:0 18px}.invoice-form-grid label{min-width:0}.invoice-form-grid input,.invoice-form-grid select{max-width:100%;min-width:0}.invoice-form-actions{margin-top:4px}.ignore-form{margin-top:10px}@media(max-width:900px){.invoice-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.invoice-table{min-width:760px}}@media(max-width:560px){.invoice-form-grid{grid-template-columns:1fr}.invoice-table{min-width:700px}}

/* HomeManager 1.16: invoice review panel toggle and compact layout. */
.invoice-table{width:100%;min-width:0;table-layout:fixed}
.invoice-table th,.invoice-table td{min-width:0;white-space:normal}
.invoice-actions{width:17%;vertical-align:top}
.invoice-actions .btn{max-width:100%;white-space:normal}
.review-toggle{display:block;margin-top:6px;background:none;border:0;padding:0;text-align:left;line-height:1.35;cursor:pointer}
.invoice-detail-row[hidden]{display:none}
.invoice-detail-row td{padding:18px 16px 20px;background:#fafbfe}
.invoice-panel-title{font-weight:700;margin-bottom:14px}
.invoice-details-panel{width:100%;min-width:0}
.invoice-form{max-width:none}
.invoice-form-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px 18px}
.invoice-form-grid label{min-width:0}
.invoice-form-grid input,.invoice-form-grid select{width:100%;max-width:100%;min-width:0}
@media(max-width:900px){.invoice-form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.invoice-table{min-width:0}}
@media(max-width:600px){.invoice-form-grid{grid-template-columns:1fr}.invoice-table{min-width:0}}

/* HomeManager 2.0: visible application version and system-status cockpit. */
.brand .version{font-size:11px;font-weight:700;opacity:.65;margin-left:6px;vertical-align:middle}
.status-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
.status-item{display:flex;gap:10px;align-items:flex-start;border:1px solid #e6eaf0;border-radius:10px;padding:13px;background:#fbfcfe}
.status-item>strong{font-size:18px;line-height:1.2}
.status-item b{display:block;font-size:14px}
.status-item small{display:block;margin-top:3px;line-height:1.35}
.footer{margin:22px 0 6px;text-align:center;color:#8992a3;font-size:12px}
@media(max-width:1000px){.status-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:560px){.topbar{gap:12px}.brand{font-size:18px}.topbar nav{gap:14px}.topbar nav a{font-size:14px}.status-grid{grid-template-columns:1fr}}

/* HomeManager 2.1: prominent version badge */
.brand .version{font-size:12px;font-weight:800;opacity:1;margin-left:8px;padding:3px 8px;border:1px solid rgba(255,255,255,.35);border-radius:999px;background:rgba(255,255,255,.12)}
.bank-balance{display:flex;align-items:center;justify-content:space-between;gap:18px}.bank-balance strong{font-size:28px}.bank-balance .muted{margin-top:4px}
