:root{
  --navy:#0B1D2D;--teal:#0D6B6E;--emerald:#10A37F;--gold:#D4A43A;--light:#F2F4F7;--white:#FFFFFF;
  --ink:#172534;--muted:#637282;--line:#C9D1D8;--line-dark:#AEB8C2;--panel:#F7F8FA;--header:#E6E9ED;
  --danger:#9F3A38;--warn:#8C6714;--success:#08765D;--shadow:0 6px 18px rgba(11,29,45,.08);
  --heading:Montserrat,Arial,"Segoe UI",sans-serif;--body:Inter,"Segoe UI",Arial,sans-serif;
}
*{box-sizing:border-box}html,body{height:100%;margin:0}body{font-family:var(--body);background:var(--light);color:var(--ink);font-size:13px;overflow:hidden}button,input,select,textarea{font:inherit}.hidden{display:none!important}

/* AUTH */
.auth-gate{min-height:100vh;display:grid;grid-template-columns:minmax(420px,1.15fr) minmax(380px,.85fr);background:var(--light)}
.auth-brand-panel{background:linear-gradient(145deg,#081622 0%,var(--navy) 60%,#113548 100%);color:#fff;padding:70px 8vw;display:flex;flex-direction:column;justify-content:center;position:relative;overflow:hidden}
.auth-brand-panel:after{content:"";position:absolute;right:-150px;bottom:-180px;width:520px;height:520px;border:1px solid rgba(212,164,58,.22);border-radius:50%}
.auth-logo{width:76px;height:76px;margin-bottom:20px}.auth-wordmark{font-family:var(--heading);font-size:34px;font-weight:700;letter-spacing:.08em}.auth-wordmark span{font-weight:500;letter-spacing:.01em;color:#DDE9EC}.auth-subtitle{text-transform:uppercase;letter-spacing:.13em;color:#89C6C8;font-weight:600;margin-top:6px}.auth-line{height:3px;width:92px;background:var(--gold);margin:28px 0}
.auth-brand-panel h1{font-family:var(--heading);font-size:42px;line-height:1.14;margin:0 0 22px;max-width:620px}.auth-brand-panel h1 span{color:#73D7BC}.auth-brand-panel p{max-width:640px;color:#C7D3DB;line-height:1.7;font-size:15px}.auth-badges{display:flex;gap:9px;margin-top:28px}.auth-badges span{border:1px solid rgba(255,255,255,.24);background:rgba(255,255,255,.06);padding:8px 11px;border-radius:5px;font-weight:700;letter-spacing:.06em}
.auth-card-wrap{display:flex;align-items:center;justify-content:center;padding:50px}.auth-card{width:min(430px,100%);background:#fff;border:1px solid #D6DDE3;box-shadow:var(--shadow);padding:32px;border-radius:10px}.auth-card-head{display:flex;align-items:center;gap:12px;border-bottom:1px solid #E1E6EA;padding-bottom:18px;margin-bottom:24px}.mini-logo{width:46px;height:46px}.auth-card-head strong{display:block;font-family:var(--heading);font-size:18px;color:var(--navy)}.auth-card-head small{display:block;color:var(--teal);margin-top:3px}.auth-card h2{font-family:var(--heading);font-size:24px;margin:0 0 4px;color:var(--navy)}.muted{color:var(--muted)}.auth-card label{display:grid;gap:6px;margin:16px 0;font-weight:600;color:#334759}.auth-card input{height:42px;border:1px solid #B8C3CC;border-radius:4px;padding:0 11px;background:#fff}.auth-card input:focus{outline:2px solid rgba(13,107,110,.18);border-color:var(--teal)}.auth-message{min-height:20px;margin-top:14px;color:var(--muted);line-height:1.4}.link-button{background:none;border:0;color:var(--teal);padding:12px 0 0;cursor:pointer;text-decoration:underline}

/* APP CHROME */
.ledger-app{height:100vh;display:grid;grid-template-rows:68px 28px 38px 1fr 26px;background:#D8DDE2}.app-header{display:grid;grid-template-columns:minmax(250px,1fr) auto minmax(240px,1fr);align-items:center;gap:18px;background:#fff;border-bottom:1px solid var(--line-dark);padding:8px 14px}.product-lockup{display:flex;align-items:center;gap:10px}.product-icon{width:46px;height:46px}.product-name{font-family:var(--heading);font-weight:700;font-size:20px;letter-spacing:.05em;color:var(--navy)}.product-name span{font-weight:500;letter-spacing:0}.product-subtitle{font-size:10px;letter-spacing:.09em;text-transform:uppercase;color:var(--teal);font-weight:700;margin-top:2px}
.company-context{display:flex;align-items:end;gap:8px}.company-context label{display:grid;gap:3px;color:#566675;font-size:10px;font-weight:700;text-transform:uppercase;letter-spacing:.05em}.company-context select{height:30px;border:1px solid #AAB5BF;background:#fff;border-radius:2px;padding:0 28px 0 7px;min-width:110px;color:#203446}.company-context label:first-child select{min-width:250px}.user-area{display:flex;justify-content:flex-end;align-items:center;gap:12px;text-align:right}.user-area strong{display:block;font-size:12px}.user-area small{display:block;color:var(--muted);max-width:220px;overflow:hidden;text-overflow:ellipsis}
.menu-bar{display:flex;align-items:center;background:#EEF1F4;border-bottom:1px solid #B5BEC7;padding:0 7px}.menu-bar button{height:27px;border:0;background:transparent;padding:0 10px;color:#2F4050;cursor:pointer}.menu-bar button:hover{background:#D8E2E7}.menu-spacer{flex:1}.connection-state{font-size:10px;color:var(--success);font-weight:700;margin-right:7px}.quick-toolbar{display:flex;align-items:center;gap:4px;background:#F7F8F9;border-bottom:1px solid #AEB7C0;padding:4px 7px;box-shadow:0 1px 0 #fff inset}.quick-toolbar button{height:28px;border:1px solid #B4BEC7;background:linear-gradient(#fff,#E8ECEF);border-radius:2px;padding:0 9px;color:#263949;cursor:pointer}.quick-toolbar button:hover{border-color:var(--teal);background:#EAF5F4}.toolbar-sep{height:22px;width:1px;background:#C2CAD1;margin:0 4px}

.work-area{display:grid;grid-template-columns:290px minmax(0,1fr);min-height:0}.navigation-pane{background:#F4F5F7;border-right:1px solid #9FAAB4;overflow:auto}.nav-pane-title{font-family:var(--heading);font-weight:700;color:#fff;background:var(--navy);padding:9px 12px;border-bottom:2px solid var(--gold)}.module-tree{padding:6px}.tree-module{border:1px solid #C1C9D0;margin-bottom:5px;background:#fff}.tree-module-title{width:100%;display:flex;align-items:center;gap:6px;text-align:left;border:0;border-bottom:1px solid #D4DAE0;background:linear-gradient(#F9FAFB,#E5E9ED);font-weight:700;color:#25394B;padding:7px 8px;cursor:pointer}.tree-module:not(.open) .tree-children{display:none}.tree-module-title:hover{background:#E5F1F0}.tree-children{padding:4px 0}.tree-folder{font-size:10px;text-transform:uppercase;letter-spacing:.06em;color:#758391;background:#F3F5F7;border-top:1px solid #E5E9EC;border-bottom:1px solid #E5E9EC;padding:5px 12px;margin:4px 0}.tree-children button{width:100%;border:0;background:#fff;text-align:left;color:#273A4A;padding:6px 14px 6px 20px;cursor:pointer}.tree-children button:hover,.tree-children button.active{background:#DDEBEA;color:#074F51}.tree-children button.active{font-weight:700;border-left:3px solid var(--teal);padding-left:17px}
.desktop-pane{min-width:0;min-height:0;display:grid;grid-template-rows:30px 1fr;padding:7px;background:#C7CDD3}.workspace-tabs{display:flex;align-items:end}.workspace-tabs button{height:29px;min-width:120px;border:1px solid #98A4AE;border-bottom:0;background:#F8F9FA;color:#273A4A;padding:0 14px;border-radius:3px 3px 0 0}.workspace-tabs button.active{background:#fff;font-weight:700;color:var(--navy)}.window-shell{min-height:0;background:#fff;border:1px solid #98A4AE;box-shadow:0 2px 6px rgba(0,0,0,.12);display:grid;grid-template-rows:32px auto 1fr}.window-titlebar{display:flex;justify-content:space-between;align-items:center;background:linear-gradient(90deg,var(--navy),#173E50);color:#fff;padding:0 8px}.window-titlebar>div{display:flex;align-items:center;gap:7px}.window-icon{color:var(--gold)}.window-controls button{height:24px;width:30px;border:0;background:transparent;color:#fff;cursor:pointer}.window-controls button:hover{background:rgba(255,255,255,.12)}.view-toolbar{display:flex;align-items:center;gap:5px;min-height:40px;background:#EDF0F3;border-bottom:1px solid #BCC5CD;padding:5px 7px}.view-toolbar:empty{display:none}.view-content{min-height:0;overflow:auto;background:#fff;padding:10px}
.status-bar{display:flex;align-items:center;gap:18px;background:#E9ECEF;border-top:1px solid #A8B2BB;padding:0 8px;font-size:10px;color:#475867}.status-grow{flex:1}

/* GENERIC WINDOW CONTENT */
.page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:10px}.page-head h1{font-family:var(--heading);font-size:18px;color:var(--navy);margin:0 0 3px}.page-head p{margin:0;color:var(--muted);font-size:11px}.context-chip{border:1px solid #CCD4DA;background:#F7F9FA;padding:6px 9px;font-size:10px;color:#526271}.context-chip b{color:var(--navy)}
.btn{border:1px solid #A7B1BA;border-radius:3px;height:32px;padding:0 11px;background:linear-gradient(#fff,#E8EBEE);color:#253848;cursor:pointer;font-weight:600}.btn:hover{border-color:var(--teal)}.btn.primary{background:var(--teal);border-color:var(--teal);color:#fff}.btn.positive{background:var(--emerald);border-color:var(--emerald);color:#fff}.btn.warning{background:#FFF7E2;border-color:var(--gold);color:#6F5110}.btn.danger{background:#FFF1F0;border-color:#C77D79;color:#883734}.btn.compact{height:28px;padding:0 8px;font-size:11px}.btn.wide{width:100%;height:40px}.btn:disabled{opacity:.5;cursor:not-allowed}.secondary{background:#fff;color:var(--navy)}
.toolbar-group{display:flex;align-items:center;gap:5px}.toolbar-grow{flex:1}.toolbar-input{height:28px;border:1px solid #B3BDC6;padding:0 7px;min-width:220px}.toolbar-label{font-size:10px;color:#586875;font-weight:700;text-transform:uppercase}

.erp-table-wrap{border:1px solid #B8C1C9;overflow:auto;max-width:100%;background:#fff}.erp-table{border-collapse:collapse;width:100%;min-width:820px;font-size:11px}.erp-table th{position:sticky;top:0;z-index:2;background:linear-gradient(#F4F6F7,#DDE2E6);border-right:1px solid #B7C0C8;border-bottom:1px solid #AEB8C1;text-align:left;padding:6px 7px;color:#263949;white-space:nowrap}.erp-table td{border-right:1px solid #D6DDE2;border-bottom:1px solid #DCE2E6;padding:5px 7px;white-space:nowrap}.erp-table tbody tr:nth-child(even){background:#FAFBFC}.erp-table tbody tr:hover{background:#EAF4F3}.erp-table tbody tr.selected{background:#D7ECEA}.erp-table .num{text-align:right;font-variant-numeric:tabular-nums}.erp-table .center{text-align:center}.erp-table .muted-cell{color:#778692}.erp-table button.link{border:0;background:none;color:#075F62;text-decoration:underline;cursor:pointer;padding:0}.status-pill{display:inline-block;border-radius:10px;padding:2px 7px;font-size:10px;font-weight:700}.status-pill.open,.status-pill.draft{background:#E8EEF4;color:#3D5B72}.status-pill.posted,.status-pill.active,.status-pill.paid,.status-pill.matched{background:#E2F3ED;color:#087059}.status-pill.ready,.status-pill.query{background:#FFF1CF;color:#76570F}.status-pill.inactive,.status-pill.reversed{background:#F2E6E4;color:#88423A}

.form-grid{display:grid;grid-template-columns:repeat(4,minmax(150px,1fr));gap:10px}.form-grid.two{grid-template-columns:repeat(2,minmax(200px,1fr))}.form-field{display:grid;gap:4px}.form-field.span2{grid-column:span 2}.form-field.span4{grid-column:1/-1}.form-field label,.field-label{font-size:10px;text-transform:uppercase;letter-spacing:.04em;color:#536473;font-weight:700}.form-field input,.form-field select,.form-field textarea,.cell-input{border:1px solid #AEB8C1;background:#fff;border-radius:2px;padding:6px 7px;color:#203342}.form-field input,.form-field select{height:30px}.form-field textarea{min-height:64px;resize:vertical}.form-field input:focus,.form-field select:focus,.form-field textarea:focus,.cell-input:focus{outline:1px solid var(--teal);border-color:var(--teal)}
.group-box{border:1px solid #BEC7CF;background:#FAFBFC;margin:10px 0;padding:12px;position:relative}.group-box-title{position:absolute;top:-8px;left:10px;background:#FAFBFC;padding:0 5px;font-size:10px;font-weight:700;color:#405463;text-transform:uppercase}.control-totals{display:flex;justify-content:flex-end;gap:24px;background:#F4F6F7;border:1px solid #CAD2D8;padding:8px 10px;margin-top:8px}.control-totals div{text-align:right}.control-totals span{display:block;color:#657583;font-size:10px}.control-totals strong{display:block;font-size:13px;color:var(--navy);font-variant-numeric:tabular-nums}.control-totals .out strong{color:var(--danger)}
.empty-state{padding:50px 20px;text-align:center;color:#6C7B88}.empty-state strong{display:block;font-family:var(--heading);font-size:17px;color:#33495A;margin-bottom:6px}.info-banner,.warning-banner,.success-banner{border:1px solid;padding:9px 11px;margin-bottom:10px;font-size:11px}.info-banner{background:#EDF6F7;border-color:#B6D8DA;color:#285B61}.warning-banner{background:#FFF7E4;border-color:#E5C978;color:#6C5215}.success-banner{background:#EAF7F2;border-color:#B7DDCF;color:#1E6554}
.summary-strip{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:10px}.summary-cell{border:1px solid #CBD3D9;background:#F9FAFB;padding:8px}.summary-cell span{display:block;font-size:9px;text-transform:uppercase;color:#71808C;letter-spacing:.04em}.summary-cell strong{display:block;font-size:14px;color:var(--navy);margin-top:3px}.summary-cell.gold{border-top:3px solid var(--gold)}.summary-cell.teal{border-top:3px solid var(--teal)}.summary-cell.emerald{border-top:3px solid var(--emerald)}

/* HOME */
.home-grid{display:grid;grid-template-columns:1.25fr .75fr;gap:12px}.home-panel{border:1px solid #BEC7CF;background:#fff}.home-panel h3{font-family:var(--heading);font-size:13px;margin:0;padding:8px 10px;background:#EEF1F3;border-bottom:1px solid #BEC7CF;color:var(--navy)}.home-panel-body{padding:10px}.module-launch-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.module-launch{border:1px solid #C5CDD4;background:#FAFBFC;padding:12px;text-align:left;cursor:pointer}.module-launch:hover{border-color:var(--teal);background:#EEF7F6}.module-launch strong{display:block;color:var(--navy);font-size:12px}.module-launch small{display:block;color:var(--muted);margin-top:4px;line-height:1.35}.home-logo-mark{display:flex;align-items:center;gap:10px}.home-logo-mark img{width:54px;height:54px}.home-logo-mark h2{font-family:var(--heading);margin:0;color:var(--navy)}.home-logo-mark p{margin:4px 0 0;color:var(--teal);font-size:11px;font-weight:700}

/* MODAL */
.modal-layer{position:fixed;inset:0;background:rgba(9,22,33,.42);display:flex;align-items:center;justify-content:center;z-index:1000;padding:20px}.modal{width:min(920px,96vw);max-height:90vh;overflow:auto;background:#fff;border:1px solid #7F8B95;box-shadow:0 20px 70px rgba(0,0,0,.25)}.modal-head{display:flex;align-items:center;justify-content:space-between;background:var(--navy);color:#fff;padding:8px 10px}.modal-head h3{margin:0;font-family:var(--heading);font-size:14px}.modal-head button{border:0;background:transparent;color:#fff;font-size:18px;cursor:pointer}.modal-body{padding:14px}.modal-foot{display:flex;justify-content:flex-end;gap:7px;padding:9px 12px;background:#EEF1F3;border-top:1px solid #C4CDD4}.toast{position:fixed;right:18px;bottom:38px;z-index:1200;max-width:420px;background:#172C3A;color:#fff;padding:10px 13px;border-left:4px solid var(--teal);box-shadow:0 5px 18px rgba(0,0,0,.2)}.toast.error{border-left-color:#C65D55}.toast.success{border-left-color:var(--emerald)}

/* JOURNAL ENTRY */
.journal-lines .cell-input{height:27px;width:100%;min-width:80px;padding:3px 5px}.journal-lines .account-input{min-width:150px}.journal-lines .desc-input{min-width:240px}.journal-lines .money-input{text-align:right;min-width:100px}.line-delete{border:0;background:none;color:#A0413A;cursor:pointer;font-size:15px}

/* EXCEL */
.import-drop{border:2px dashed #AFC0C8;background:#F9FBFC;padding:30px;text-align:center;color:#60717E}.import-drop strong{display:block;color:var(--navy);font-size:14px;margin-bottom:6px}.template-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.template-card{border:1px solid #C7D0D6;background:#fff;padding:11px}.template-card strong{display:block;color:var(--navy)}.template-card p{font-size:10px;color:var(--muted);min-height:32px}

@media(max-width:1100px){.app-header{grid-template-columns:1fr 1fr}.company-context{grid-column:1/-1;order:3;background:#F5F7F8;margin:0 -14px -8px;padding:5px 14px;border-top:1px solid #D3DAE0}.ledger-app{grid-template-rows:100px 28px 38px 1fr 26px}.work-area{grid-template-columns:245px minmax(0,1fr)}.form-grid{grid-template-columns:repeat(2,1fr)}.form-field.span4{grid-column:1/-1}.summary-strip{grid-template-columns:repeat(2,1fr)}}
@media(max-width:760px){body{overflow:auto}.auth-gate{grid-template-columns:1fr}.auth-brand-panel{display:none}.auth-card-wrap{min-height:100vh;padding:20px}.ledger-app{height:auto;min-height:100vh;grid-template-rows:auto auto auto 1fr auto}.app-header{grid-template-columns:1fr}.user-area{justify-content:flex-start;text-align:left}.company-context{display:grid;grid-template-columns:1fr 1fr;margin:0;padding:8px}.company-context label:first-child{grid-column:1/-1}.company-context label:first-child select{min-width:0}.work-area{grid-template-columns:1fr}.navigation-pane{max-height:260px}.desktop-pane{min-height:700px}.home-grid{grid-template-columns:1fr}.module-launch-grid,.template-grid{grid-template-columns:1fr}.form-grid,.form-grid.two{grid-template-columns:1fr}.form-field.span2,.form-field.span4{grid-column:auto}.status-bar{flex-wrap:wrap;height:auto;padding:5px}.quick-toolbar{overflow:auto}.user-area small{max-width:none}}
