:root{--ink:#142231;--muted:#6b7682;--line:#dfe5ea;--brand:#164e63;--brand2:#0e7490;--bg:#f4f7f9;--danger:#b42318;--good:#16794b;--sidebar:#0f1d2a}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,Segoe UI,Arial,sans-serif;font-size:14px}a{color:var(--brand2);text-decoration:none}.app-shell{display:flex;min-height:100vh}.sidebar{position:fixed;left:0;top:0;bottom:0;width:245px;background:var(--sidebar);color:#fff;padding:22px 16px;display:flex;flex-direction:column;z-index:20}.brand-block{padding:6px 10px 22px;border-bottom:1px solid rgba(255,255,255,.12);display:flex;flex-direction:column}.brand-block strong{letter-spacing:.06em;font-size:15px}.brand-block span{font-size:11px;color:#a9bac6;margin-top:4px}.side-nav{display:flex;flex-direction:column;gap:6px;margin-top:18px}.side-nav a{color:#dbe7ee;font-weight:650;padding:11px 12px;border-radius:8px}.side-nav a:hover{background:rgba(255,255,255,.09);color:#fff}.sidebar-bottom{margin-top:auto;border-top:1px solid rgba(255,255,255,.12);padding-top:14px}.userchip{display:flex;flex-direction:column;font-size:12px;color:#fff;padding:4px 8px 10px}.userchip span{font-size:10px;color:#9eb0bd;margin-top:3px}.logoutbtn{width:100%;background:rgba(255,255,255,.1)!important;color:#fff!important}.content-shell{margin-left:245px;width:calc(100% - 245px);min-height:100vh;display:flex;flex-direction:column}.wrap{width:100%;max-width:1440px;margin:0 auto;padding:30px 30px 10px;flex:1}.titlebar{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:18px}.titlebar h1{margin:0 0 5px;font-size:27px}.titlebar p{margin:0;color:var(--muted)}.actions,.row-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}.inline-delete{display:inline}.card{background:#fff;border:1px solid var(--line);border-radius:10px;padding:18px;box-shadow:0 1px 2px rgba(10,30,50,.04)}.kpis{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:18px}.kpis .card{display:flex;flex-direction:column;gap:8px}.kpis small{color:var(--muted);text-transform:uppercase;font-size:10px;font-weight:700;letter-spacing:.06em}.kpis b{font-size:22px}.grid2{display:grid;grid-template-columns:1.4fr 1fr;gap:18px}.export-grid{grid-template-columns:1fr 1fr}.card h2{font-size:16px;margin:0 0 14px}table{width:100%;border-collapse:collapse}th{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:var(--muted);text-align:left;border-bottom:1px solid var(--line);padding:9px 8px}td{border-bottom:1px solid #edf1f4;padding:10px 8px;vertical-align:top}.right{text-align:right}.bad{color:var(--danger);font-weight:700}.good{color:var(--good);font-weight:700}.sub{display:block;color:var(--muted);margin-top:3px}.button,button{display:inline-block;background:var(--brand);color:#fff;border:0;border-radius:7px;padding:10px 14px;font-weight:700;cursor:pointer}.button.mini{padding:7px 10px;font-size:12px}.button.secondary{background:#e9f1f4;color:var(--brand)}.button.warn{background:#8a4b08}.dangerbtn{background:var(--danger)!important;color:#fff!important}.cycle{display:flex;justify-content:space-between;align-items:center;padding:12px 0;border-bottom:1px solid var(--line);color:var(--ink)}.cycle span{display:flex;flex-direction:column}.cycle small{color:var(--muted);margin-top:4px}.notice{margin-top:18px;background:#fff8db;border:1px solid #eedb8b;border-radius:8px;padding:12px}.badge{display:inline-block;background:#edf2f6;border-radius:999px;padding:4px 8px;font-size:10px;font-weight:800}.formgrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;max-width:800px}.formgrid.singlecol{grid-template-columns:1fr;max-width:none}.formgrid label{display:flex;flex-direction:column;gap:6px;font-weight:700}.span2{grid-column:span 2}input,select,textarea{border:1px solid #cdd6de;border-radius:6px;padding:9px;font:inherit;background:#fff}.wide{max-width:none}.table-scroll{overflow:auto;margin:0 -5px 15px}.compact{min-width:1050px}.compact td,.compact th{padding:7px 6px}.moneyinput{width:115px;text-align:right}.inlineform{margin:14px 0}.muted{color:var(--muted)}.invoice-preview{max-width:780px;margin:auto}.invhead{text-align:center;border-bottom:2px solid var(--ink);padding-bottom:12px}.invhead h2{font-size:20px;margin:0}.invhead p{margin:4px}.invmeta{display:flex;justify-content:space-between;margin:24px 0;line-height:1.6}.total{font-weight:700}.grand{font-weight:800;font-size:16px;background:#f1f5f7}.loginbody{display:grid;place-items:center;min-height:100vh}.login{width:360px}.login h1{margin-bottom:5px}.login label{display:flex;flex-direction:column;gap:7px;margin:22px 0}.error{color:var(--danger)}footer{max-width:1440px;width:100%;margin:20px auto 30px;padding:0 30px;color:var(--muted);font-size:11px}.permission-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0 18px}.perm{display:flex;gap:10px;align-items:flex-start;border:1px solid var(--line);border-radius:8px;padding:10px;background:#fafcfd}.perm input{margin-top:3px}.perm span{display:flex;flex-direction:column}.perm small{color:var(--muted);margin-top:3px}.check{display:flex!important;flex-direction:row!important;align-items:center;gap:8px!important}.checkgroup{display:flex;align-items:center;gap:20px}.wideinput{min-width:280px}.qtyinput{width:115px;margin-bottom:4px;text-align:right}.stack{margin-top:18px}.rulebox{border-bottom:1px solid var(--line);padding:14px 0}.rulebox:last-child{border-bottom:0}.invoice-notes{margin-top:28px;font-size:12px}.invoice-notes h4{margin:0 0 8px}.invoice-notes p{margin:5px 0}@media(max-width:900px){.sidebar{position:relative;width:100%;height:auto}.app-shell{display:block}.content-shell{margin-left:0;width:100%}.side-nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.sidebar-bottom{margin-top:18px}.kpis{grid-template-columns:1fr 1fr}.grid2,.export-grid{grid-template-columns:1fr}.wrap{padding:20px 12px 8px}.formgrid{grid-template-columns:1fr}.span2{grid-column:span 1}.titlebar{align-items:flex-start;flex-direction:column}.actions{flex-wrap:wrap}.permission-grid{grid-template-columns:1fr}footer{padding:0 12px}}


/* v4 — library-style fixed sidebar */
:root{--sidebar:#183650;--sidebar-soft:#294966;--sidebar-text:#eef4f8;--sidebar-muted:#b7c7d5;--active-icon:#2369e8}
.library-sidebar{width:300px;padding:26px 18px 20px;background:var(--sidebar)}
.content-shell{margin-left:300px;width:calc(100% - 300px)}
.library-brand{border:0;padding:4px 10px 25px;display:flex;flex-direction:row;align-items:center;gap:14px}
.library-brand .brand-icon{width:58px;height:58px;min-width:58px;border-radius:16px;background:#fff;display:grid;place-items:center}
.library-brand .brand-icon svg{width:35px;height:35px;fill:none;stroke:#183650;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.library-brand>div:last-child{display:flex;flex-direction:column}
.library-brand strong{font-size:22px;letter-spacing:0;text-transform:none;line-height:1.15}
.library-brand span{font-size:15px;color:var(--sidebar-muted);margin-top:4px}
.library-nav{gap:7px;margin-top:2px}
.library-nav a{display:flex;align-items:center;gap:15px;color:var(--sidebar-text);font-size:17px;font-weight:560;padding:13px 14px;border-radius:12px;min-height:51px}
.library-nav a:hover{background:rgba(255,255,255,.08)}
.library-nav a.active{background:#fff;color:#183650;box-shadow:0 1px 3px rgba(0,0,0,.08)}
.nav-icon{width:27px;height:27px;display:grid;place-items:center;flex:0 0 27px;color:#7590a6}
.nav-icon svg{width:25px;height:25px;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round}
.library-nav a.active .nav-icon{color:var(--active-icon)}
.library-user-bottom{border-top:0;padding:0 10px}
.library-user-bottom .userchip{background:var(--sidebar-soft);border-radius:14px;padding:14px 16px;margin-bottom:10px}
.library-user-bottom .userchip strong{font-size:17px}.library-user-bottom .userchip span{font-size:14px;color:var(--sidebar-muted)}
.library-user-bottom .logoutbtn{display:flex;align-items:center;gap:10px;background:transparent!important;font-size:17px;text-align:left;padding:12px 8px}
.logout-symbol{font-size:24px}.quarter-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin:12px 0 16px}.quarter-actions .inlineform{margin:0}.repair-button{background:#6b4f13}.full-label{display:flex;flex-direction:column;gap:7px;font-weight:700}.compact-title{margin-bottom:8px}
@media(max-width:900px){.library-sidebar{position:fixed;width:230px;height:100vh;padding:18px 10px}.content-shell{margin-left:230px;width:calc(100% - 230px)}.library-brand .brand-icon{width:44px;height:44px;min-width:44px}.library-brand strong{font-size:17px}.library-brand span{font-size:11px}.library-nav{display:flex;grid-template-columns:none}.library-nav a{font-size:14px;padding:10px;min-height:43px}.nav-icon{width:22px;height:22px;flex-basis:22px}.nav-icon svg{width:21px;height:21px}.sidebar-bottom{margin-top:auto}.wrap{padding:18px 12px 8px}}
.repair-config{max-width:900px}.repair-config small{font-weight:400}.picker-disabled{opacity:.55}.picker-disabled:after{content:'All active offices selected';display:block;margin-top:8px;color:var(--muted);font-size:12px}.library-sidebar{overflow-y:auto}.library-nav{padding-bottom:14px}
