:root{--app-bg:#f3f7fb;--app-surface:#fff;--app-border:#dce5ed;--app-muted:#5b6878;--app-ink:#13202d;--app-brand:#00539b;--app-brand-dark:#003f77;--app-brand-soft:#eaf3fb;--app-accent:#e31f2b;--app-shadow:0 12px 36px rgba(0,63,119,.075);--bs-primary-rgb:0,83,155;--bs-body-font-family:Inter,ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
html{background:var(--app-bg);scroll-behavior:smooth}
body{min-height:100vh;background:radial-gradient(circle at 90% 0,rgba(0,83,155,.07),transparent 28rem),var(--app-bg);color:var(--app-ink);font-feature-settings:"tnum" 1,"cv02" 1;text-rendering:optimizeLegibility}
::selection{background:#cde3f6;color:#002d55}
a{color:var(--app-brand);text-underline-offset:.15em}
a:hover{color:var(--app-brand-dark)}
.app-navbar{position:sticky;top:0;z-index:1030;background:rgba(255,255,255,.97);border-top:3px solid var(--app-accent);border-bottom:1px solid var(--app-border);box-shadow:0 6px 24px rgba(0,45,85,.07);backdrop-filter:saturate(150%) blur(12px);padding-block:.5rem}
.navbar-brand{color:var(--app-ink)}.navbar-brand:hover{color:var(--app-ink)}
.brand-logo{display:block;width:9.15rem;height:auto;object-fit:contain}
.brand-copy{padding-left:.9rem;border-left:1px solid var(--app-border)}
.brand-title{color:var(--app-brand-dark);font-size:.88rem;letter-spacing:.01em}.brand-subtitle{color:var(--app-muted);font-size:.72rem}
.user-menu{--bs-btn-color:var(--app-brand-dark);--bs-btn-border-color:#b8cad9;--bs-btn-hover-color:#fff;--bs-btn-hover-bg:var(--app-brand);--bs-btn-hover-border-color:var(--app-brand);--bs-btn-active-bg:var(--app-brand-dark);--bs-btn-active-border-color:var(--app-brand-dark);border-radius:.7rem}
.user-menu-name{max-width:12rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.surface{background:var(--app-surface);border:1px solid var(--app-border);border-radius:1rem;box-shadow:var(--app-shadow)}
.login-shell{min-height:calc(100vh - 75px);min-height:calc(100dvh - 75px);display:grid;place-items:center;padding:clamp(1.5rem,5vw,4rem) 0}
body{padding-bottom:env(safe-area-inset-bottom)}
.login-card{position:relative;max-width:480px;width:100%;overflow:hidden}.login-card::before{position:absolute;inset:0 0 auto;height:4px;background:linear-gradient(90deg,var(--app-brand) 0 78%,var(--app-accent) 78%);content:""}
.form-label{color:#263747}.form-control,.form-select,.btn{min-height:44px;border-radius:.7rem}.btn{display:inline-flex;align-items:center;justify-content:center}.form-control,.form-select{border-color:#c8d5df;background-color:#fff}.form-control::placeholder{color:#8795a3}.form-control:focus,.form-select:focus{border-color:#5d94c1;box-shadow:0 0 0 .22rem rgba(0,83,155,.13)}
.btn-primary{--bs-btn-bg:var(--app-brand);--bs-btn-border-color:var(--app-brand);--bs-btn-hover-bg:var(--app-brand-dark);--bs-btn-hover-border-color:var(--app-brand-dark);--bs-btn-active-bg:#00345f;--bs-btn-active-border-color:#00345f;box-shadow:0 7px 18px rgba(0,83,155,.16)}
.btn-outline-primary{--bs-btn-color:var(--app-brand);--bs-btn-border-color:#8ab0ce;--bs-btn-hover-bg:var(--app-brand);--bs-btn-hover-border-color:var(--app-brand)}
.btn:focus-visible,.form-control:focus-visible,.form-select:focus-visible,a:focus-visible{outline:3px solid rgba(227,31,43,.28);outline-offset:2px}
.page-heading{color:#102a42;letter-spacing:-.03em;font-weight:720}.page-kicker{color:var(--app-brand);font-size:.75rem;font-weight:750;letter-spacing:.09em;text-transform:uppercase}
.stat-chip{display:inline-flex;align-items:center;gap:.45rem;padding:.48rem .75rem;border:1px solid #ccdeec;border-radius:999px;background:var(--app-brand-soft);color:var(--app-brand-dark);font-weight:650;font-size:.875rem;transition:border-color .15s ease,background-color .15s ease,transform .15s ease}.stat-chip:hover{border-color:#8eb5d3;background:#deedf9;color:var(--app-brand-dark);transform:translateY(-1px)}
.search-wrap{position:relative;width:min(380px,100%)}.search-wrap .bi{position:absolute;left:.95rem;top:50%;transform:translateY(-50%);color:#718294;pointer-events:none}.search-wrap input{padding-left:2.65rem}
.table-responsive{scrollbar-color:#b9c8d5 transparent;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
.crm-table{margin:0}.crm-table th{font-size:.72rem;text-transform:uppercase;letter-spacing:.065em;color:#536476;background:#f5f8fb;border-bottom-color:#d5e0e9;white-space:nowrap}.crm-table td{vertical-align:middle;border-bottom-color:#e8eef3}.crm-table tbody tr{transition:background-color .12s ease}.crm-table tbody tr:hover{background:#f2f7fb}.crm-table tbody tr:last-child td{border-bottom:0}.company-link{text-decoration:none;font-weight:680;color:#14283a}.company-link:hover{color:var(--app-brand)}
.contact-badge{display:inline-flex;align-items:center;justify-content:center;min-width:2rem;height:2rem;border:1px solid #d2e2ee;border-radius:999px;background:var(--app-brand-soft);color:var(--app-brand-dark);font-weight:750;text-decoration:none}.contact-badge:hover{border-color:#8ab0ce;background:#dcecf8;color:var(--app-brand-dark)}
.contact-card{height:100%;border:1px solid var(--app-border);border-radius:1rem;background:#fff;padding:1.1rem;box-shadow:0 5px 18px rgba(0,63,119,.045);transition:border-color .15s ease,box-shadow .15s ease,transform .15s ease}.contact-card:hover{border-color:#b9cfdf;box-shadow:0 10px 28px rgba(0,63,119,.09);transform:translateY(-2px)}.contact-avatar{display:grid;place-items:center;width:2.75rem;height:2.75rem;border-radius:.85rem;background:var(--app-brand-soft);color:var(--app-brand-dark);font-weight:800}.contact-meta{color:var(--app-muted);font-size:.9rem}.contact-action{display:flex;align-items:flex-start;gap:.55rem;color:#344a5d;text-decoration:none;overflow-wrap:anywhere}.contact-action:hover{color:var(--app-brand)}
.invoice-table th{white-space:nowrap}.invoice-table td{vertical-align:middle}.invoice-number{font-weight:680}.invoice-overdue{background:#fff4f4}.invoice-overdue:hover{background:#ffeded!important}.invoice-status i{font-size:1.05rem}.section-anchor{scroll-margin-top:6rem}
.invoice-files-row td{background:#f5f8fb!important}.invoice-files-panel{padding:.35rem 0}.invoice-file-button{display:inline-flex;align-items:center;justify-content:center;gap:.28rem;min-width:2.25rem;height:2.25rem;padding:0 .55rem;border:1px solid #c8d5df;border-radius:.65rem;background:#f7f9fb;color:#8291a0;line-height:1;transition:border-color .15s ease,background-color .15s ease,color .15s ease,transform .15s ease}.invoice-file-button:not(:disabled):hover{border-color:#79a5c7;background:var(--app-brand-soft);color:var(--app-brand);transform:translateY(-1px)}.invoice-file-button.is-loading{opacity:.62}.invoice-file-button.has-files{border-color:#93b7d2;background:var(--app-brand-soft);color:var(--app-brand)}.invoice-file-button.no-files{border-color:#e0e6eb;background:#f1f4f6;color:#adb6bf;cursor:default}.invoice-file-button .file-count{font-size:.72rem;font-weight:800}.file-list{display:grid;gap:.6rem}.file-entry{display:grid;gap:0}.file-item{display:flex;align-items:center;gap:.8rem;padding:.8rem .9rem;border:1px solid var(--app-border);border-radius:.8rem;background:#fff;color:var(--app-ink);text-decoration:none}.file-item:hover{border-color:#a8c4d9;color:var(--app-brand);background:#fbfdff}.file-item.is-loading{opacity:.62;pointer-events:none}.file-icon{display:grid;place-items:center;flex:0 0 2.25rem;height:2.25rem;border-radius:.65rem;background:var(--app-brand-soft);color:var(--app-brand)}.file-name{font-weight:680;overflow-wrap:anywhere}.file-description{color:var(--app-muted);font-size:.82rem;overflow-wrap:anywhere}.file-fallback:empty{display:none}.file-fallback{margin-top:.5rem;padding-left:.1rem}.file-path{display:block;margin-top:.5rem;padding:.45rem .6rem;border-radius:.5rem;background:#eef3f7;color:#30485d;font-size:.78rem;overflow-wrap:anywhere;user-select:all}.file-actions{display:flex;flex-wrap:wrap;gap:.5rem;margin-top:.65rem}
.empty-state{padding:4rem 1rem;text-align:center;color:var(--app-muted)}.empty-state>i{color:#89a2b7}
.alert{border-radius:.85rem}.dropdown-menu{border-radius:.85rem}
.company-mobile-card{display:block;text-decoration:none;color:inherit;padding:1rem;border-bottom:1px solid var(--app-border);transition:background-color .12s ease}.company-mobile-card:last-child{border-bottom:0}.company-mobile-card:active{background:#eef5fa}
@media(max-width:767.98px){.desktop-only{display:none}.mobile-company-list{display:grid!important}.surface{border-radius:.85rem}.page-actions{width:100%}.page-actions .search-wrap{width:100%!important}.invoice-files-panel{max-width:100%}.contact-card:hover{transform:none}.brand-logo{width:8rem}.brand-copy{display:none}.section-anchor{scroll-margin-top:4.5rem}
.invoice-table thead{display:none}
.invoice-table,.invoice-table tbody,.invoice-table tr,.invoice-table td{display:block;width:auto}
.invoice-table tbody tr:not(.invoice-files-row){display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:.15rem .6rem;padding:.85rem 1rem;border-bottom:1px solid var(--app-border)}
.invoice-table tbody tr:last-child{border-bottom:0}
.invoice-cell-doc{order:1}.invoice-cell-status{order:2}.invoice-cell-files{order:3}
.invoice-table tbody td[data-label]{order:4;grid-column:1/-1}
.invoice-table tbody td{padding:.2rem 0!important;border:0;text-align:left!important;white-space:normal!important}
.invoice-table tbody td[data-label]{display:flex;justify-content:space-between;gap:.75rem;font-size:.85rem}
.invoice-table tbody td[data-label]::before{content:attr(data-label);color:var(--app-muted);font-size:.72rem;font-weight:650;letter-spacing:.02em;flex:0 0 auto}
.invoice-table tbody td[data-label]{overflow-wrap:anywhere;text-align:right!important}
.invoice-table tbody td.invoice-cell-desc.is-stacked{flex-direction:column;align-items:flex-start;gap:.1rem;text-align:left!important}
.invoice-cell-desc .cell-value{min-width:0}
.invoice-cell-doc{font-size:.98rem;font-weight:700;color:var(--app-brand-dark)}
.invoice-cell-amount{font-weight:700;font-size:.95rem}
.invoice-table tbody td:empty{display:none}
.invoice-overdue{border-left:3px solid var(--app-accent)}
.invoice-files-row{padding:0 0 .85rem}
.invoice-table .invoice-files-row>td{padding:0 1rem!important;background:transparent!important}
.invoice-table tbody td{--bs-table-bg:transparent;background-color:transparent!important}
.invoice-table tbody tr:not(.invoice-files-row):hover,
.invoice-table tbody tr:not(.invoice-files-row):active,
.invoice-table tbody tr:not(.invoice-files-row):has(+ .invoice-files-row:hover),
.invoice-table tbody tr:not(.invoice-files-row):hover + .invoice-files-row,
.invoice-table tbody .invoice-files-row:hover{background:#f2f7fb}
.invoice-table tbody tr.invoice-overdue:not(.invoice-files-row):hover,
.invoice-table tbody tr.invoice-overdue:not(.invoice-files-row):active,
.invoice-table tbody tr.invoice-overdue:not(.invoice-files-row):has(+ .invoice-files-row:hover),
.invoice-table tbody tr.invoice-overdue:not(.invoice-files-row):hover + .invoice-files-row{background:#ffeded}
.invoice-table tbody tr.is-expanded{border-bottom:0}
.invoice-table tbody .invoice-files-row:not(.d-none){border-bottom:1px solid var(--app-border);padding:0 0 .85rem}
.invoice-table tbody tr:last-child.invoice-files-row{border-bottom:0}
.invoice-overdue.is-expanded + .invoice-files-row:not(.d-none){border-left:3px solid var(--app-accent);background:#fff4f4}
.app-navbar{padding-block:.35rem;border-top-width:2px}
.brand-logo{width:6.75rem}
.user-menu{padding:.25rem .5rem;font-size:.78rem;min-height:38px;gap:.35rem!important}
.user-menu-name{max-width:8.5rem}
.section-anchor{scroll-margin-top:3.75rem}
.login-shell{min-height:calc(100dvh - 58px)}
}
@media(max-width:575.98px){.app-navbar .container-xl{padding-inline:max(.75rem,env(safe-area-inset-left)) max(.75rem,env(safe-area-inset-right))}.app-main{padding-left:max(.75rem,env(safe-area-inset-left));padding-right:max(.75rem,env(safe-area-inset-right))}.brand-logo{width:6rem}.login-shell{align-items:start;padding-top:1.25rem}.login-card{padding:1.5rem!important}.file-item{padding:.7rem;gap:.65rem}.file-actions .btn{width:100%}.stat-chip{padding:.4rem .6rem;font-size:.8rem}.page-heading{overflow-wrap:anywhere}h1.h2{font-size:1.5rem}.company-mobile-card{padding:.9rem 1rem}.company-mobile-card .fw-semibold,.company-mobile-card>div{overflow-wrap:anywhere}.company-mobile-card .d-flex.gap-2{flex-wrap:wrap}.empty-state{padding:2.5rem .75rem}.empty-state>i{font-size:2.5rem}
.app-navbar{padding-block:.3rem}
.user-menu{font-size:.74rem}
.user-menu-name{max-width:7rem}
.invoice-table tbody tr:not(.invoice-files-row){padding:.8rem .85rem}
.section-anchor{scroll-margin-top:3.5rem}
}
@media(max-width:359.98px){.brand-logo{width:5.25rem}
.user-menu-name{max-width:5rem}
}
@media(min-width:768px){.mobile-company-list{display:none!important}}
@media(hover:none){.invoice-file-button{min-width:44px;height:44px}.contact-badge{min-width:2.5rem;height:2.5rem}}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{scroll-behavior:auto!important;transition:none!important}.contact-card:hover,.stat-chip:hover,.invoice-file-button:not(:disabled):hover{transform:none}}
@media(max-width:991.98px) and (max-height:500px) and (orientation:landscape){
.app-navbar{position:static;top:auto;box-shadow:none}
.section-anchor{scroll-margin-top:.75rem}
.login-shell{min-height:auto;padding-block:1.25rem}
}
