:root{--navy:#111c2c;--ink:#172334;--muted:#718096;--line:#e6eaf0;--bg:#f5f7fa;--blue:#2859a8}*{box-sizing:border-box}body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,system-ui,-apple-system,"Segoe UI",Arial,sans-serif;font-size:14px}button,input,select,textarea{font:inherit}button{cursor:pointer}.app-shell{min-height:100vh;display:flex}.sidebar{width:248px;background:var(--navy);color:#d9e2ef;display:flex;flex-direction:column;flex-shrink:0;padding:22px 14px;min-height:100vh}.brand{display:flex;align-items:center;gap:11px;padding:0 10px 27px}.brand-mark{display:grid;place-items:center;width:39px;height:39px;border-radius:12px;background:#eaf1fb;color:#152641;font-weight:900;font-size:22px}.brand strong{display:block;color:#fff;font-size:16px}.brand small,.sidebar-bottom small{display:block;color:#9cacbf;font-size:11px;margin-top:3px}.workspace-label{padding:0 12px 10px;color:#8394aa;font-size:10px;font-weight:800;letter-spacing:1.5px}nav{display:grid;gap:4px}.nav-item{width:100%;border:0;background:transparent;color:#bac8d9;text-align:left;padding:11px 12px;border-radius:9px;display:flex;gap:12px;align-items:center;font-weight:550}.nav-item span{width:18px;text-align:center;font-size:16px;color:#a7bad0}.nav-item b{margin-left:auto;font-size:11px;background:#30445e;padding:3px 7px;border-radius:20px}.nav-item:hover,.nav-item.active{background:#253850;color:#fff}.nav-item.active{box-shadow:inset 3px 0 #9bbbe9}.nav-separator{height:1px;background:#2b3b50;margin:12px 9px}.sidebar-bottom{display:flex;gap:10px;align-items:center;margin-top:auto;padding:16px 10px 0;border-top:1px solid #2b3b50;font-size:11px}.sidebar-bottom strong{color:#e5edf7}.mode-dot{width:8px;height:8px;border-radius:50%;background:#e5ad4b;box-shadow:0 0 0 4px #594c31}.main{min-width:0;flex:1;display:flex;flex-direction:column}.topbar{height:72px;background:#fff;border-bottom:1px solid var(--line);display:flex;align-items:center;gap:18px;padding:0 30px;position:sticky;top:0;z-index:5}.breadcrumbs{color:#8a95a4;font-size:13px}.breadcrumbs span{margin:0 8px;color:#c4ccd6}.breadcrumbs strong{color:#27384d}.top-actions{display:flex;align-items:center;gap:10px;margin-left:auto}.status-pill{border:1px solid #f0dfb6;background:#fff9e8;color:#86621a;border-radius:20px;padding:7px 10px;font-size:11px;font-weight:700;white-space:nowrap}.status-pill i{display:inline-block;width:6px;height:6px;border-radius:50%;background:#d5a13c;margin-right:5px}.btn{border:1px solid transparent;border-radius:8px;padding:10px 14px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;gap:7px;white-space:nowrap}.btn-primary{background:#1b2a3d;color:#fff}.btn-primary:hover{background:#263e59}.btn-ghost{background:#fff;border-color:#dce3ec;color:#46566b}.btn-sm{padding:7px 10px;font-size:12px}.icon-btn{border:1px solid #e2e7ee;background:#fff;color:#516176;border-radius:8px;width:36px;height:36px;font-size:17px}.content{width:100%;max-width:1600px;padding:28px 30px 34px;margin:0 auto;flex:1}.page-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px;margin-bottom:22px}.page-head h1{font-size:26px;letter-spacing:-.7px;margin:0 0 7px;color:#18263a}.page-head p{margin:0;color:var(--muted);line-height:1.5}.eyebrow{font-size:10px;font-weight:800;letter-spacing:1.4px;color:#8390a2;margin-bottom:8px}.stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;margin-bottom:20px}.stat-card{background:#fff;border:1px solid var(--line);border-radius:12px;padding:18px;min-width:0}.stat-top{display:flex;align-items:center;justify-content:space-between;color:#68788d;font-size:12px;font-weight:650}.stat-icon{width:32px;height:32px;border-radius:9px;background:#f0f4f9;display:grid;place-items:center;color:#425d7e}.stat-value{font-size:27px;font-weight:800;letter-spacing:-.7px;margin:13px 0 5px}.stat-note{color:#8491a2;font-size:11px}.dashboard-grid{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(290px,1fr);gap:18px}.panel{background:#fff;border:1px solid var(--line);border-radius:12px;min-width:0;overflow:hidden}.panel-head{display:flex;align-items:center;justify-content:space-between;padding:17px 19px;border-bottom:1px solid #edf0f4;gap:12px}.panel-head h2{margin:0;font-size:14px}.panel-head p{margin:5px 0 0;color:var(--muted);font-size:11px}.panel-body{padding:16px 19px}.text-link{border:0;background:transparent;color:#315e9b;font-size:12px;font-weight:750}.table-wrap{overflow:auto;width:100%}table{width:100%;border-collapse:collapse;white-space:nowrap}th{text-align:left;background:#fafbfd;color:#8490a0;font-size:10px;text-transform:uppercase;letter-spacing:.7px;font-weight:800;padding:12px 15px;border-bottom:1px solid #edf0f4}td{padding:13px 15px;border-bottom:1px solid #f0f2f5;color:#3a485b;font-size:12px}tbody tr:last-child td{border-bottom:0}tbody tr:hover{background:#fafcff}.id-link{border:0;background:transparent;padding:0;color:#2e5b94;font-weight:800;font-size:12px}.subcell{display:block;color:#8a96a5;font-size:10px;margin-top:4px}.badge{display:inline-flex;align-items:center;border-radius:20px;padding:5px 8px;font-size:10px;font-weight:800;background:#eef2f6;color:#526276}.badge.green{background:#e8f5ee;color:#18794e}.badge.amber{background:#fff4d8;color:#956600}.badge.red{background:#ffebe9;color:#b42318}.badge.blue{background:#eaf1fc;color:#315e9b}.empty{padding:28px 18px;text-align:center;color:#7e8b9c}.empty strong{display:block;color:#34445a;margin-bottom:6px}.empty p{margin:0 0 13px;font-size:12px}.action-list{display:grid}.action-row{display:flex;align-items:flex-start;gap:12px;padding:13px 0;border-bottom:1px solid #f0f2f5}.action-row:last-child{border-bottom:0}.action-dot{width:8px;height:8px;border-radius:50%;background:#dba33c;margin-top:5px;flex-shrink:0}.action-row strong{display:block;font-size:12px;margin-bottom:4px}.action-row small{color:#8491a2;font-size:11px;line-height:1.5}.action-row .right{margin-left:auto;text-align:right;white-space:nowrap}.section-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.searchbar{display:flex;gap:8px;align-items:center;margin-bottom:15px}.searchbar input,.field input,.field select,.field textarea{width:100%;border:1px solid #dce3eb;border-radius:8px;padding:10px 11px;color:#26364b;background:#fff;outline:none;min-width:0}.searchbar input:focus,.field input:focus,.field select:focus,.field textarea:focus{border-color:#6e8db7;box-shadow:0 0 0 3px #eaf1fc}.searchbar input{max-width:380px}.field{display:flex;flex-direction:column;gap:6px;min-width:0}.field label{font-size:11px;color:#536277;font-weight:750}.field small{font-size:10px;color:#8793a3}.field textarea{min-height:78px;resize:vertical}.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:15px;padding:21px 24px}.field.full{grid-column:1/-1}.modal-backdrop{position:fixed;inset:0;background:#0c1727a6;z-index:20;display:grid;place-items:center;padding:20px}.modal-backdrop[hidden]{display:none}.modal{width:min(760px,100%);max-height:92vh;overflow:auto;background:#fff;border-radius:15px;box-shadow:0 22px 70px #07101e55}.modal-head{position:sticky;top:0;background:#fff;border-bottom:1px solid var(--line);padding:19px 24px;display:flex;align-items:center;justify-content:space-between}.modal-head small{font-size:10px;letter-spacing:1.4px;font-weight:800;color:#8290a3}.modal-head h2{font-size:20px;margin:5px 0 0}.modal-actions{position:sticky;bottom:0;background:#fbfcfe;border-top:1px solid var(--line);padding:15px 24px;display:flex;justify-content:flex-end;gap:9px}.detail-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:18px}.detail-box{border:1px solid var(--line);border-radius:9px;padding:13px}.detail-box small{display:block;color:#8290a3;font-size:10px;margin-bottom:7px}.detail-box strong{font-size:15px;overflow-wrap:anywhere}.project-toolbar{display:flex;flex-wrap:wrap;gap:8px}.alert-note{padding:13px 15px;border:1px solid #f0dfb6;background:#fff9e8;color:#775919;border-radius:9px;font-size:12px;line-height:1.5;margin-bottom:16px}.check-row{display:flex;align-items:center;gap:9px;font-size:12px;padding:10px 0;border-bottom:1px solid #f0f2f5}.check-row input{accent-color:#2859a8}.check-row:last-child{border-bottom:0}.toast{position:fixed;bottom:22px;right:22px;background:#15243a;color:#fff;padding:12px 16px;border-radius:9px;box-shadow:0 10px 30px #0d1b2e30;z-index:40;opacity:0;transform:translateY(8px);transition:.2s;pointer-events:none}.toast.show{opacity:1;transform:translateY(0)}footer{padding:16px 30px;border-top:1px solid var(--line);color:#8793a3;font-size:10px;display:flex;justify-content:space-between;gap:15px}#menuBtn{display:none}@media(max-width:1050px){.sidebar{width:220px}.content{padding:23px 20px}.topbar{padding:0 20px}.stat-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.dashboard-grid{grid-template-columns:1fr}}@media(max-width:720px){.sidebar{position:fixed;left:-260px;top:0;bottom:0;z-index:15;transition:left .2s;box-shadow:10px 0 30px #0d1b2e20}.sidebar.open{left:0}#menuBtn{display:block}.topbar{height:62px;padding:0 12px;gap:10px}.breadcrumbs{font-size:11px}.top-actions{gap:6px}.status-pill{display:none}.top-actions .btn{padding:9px 10px;font-size:11px}.content{padding:20px 12px}.page-head h1{font-size:23px}.stat-grid{gap:9px}.stat-card{padding:13px}.stat-value{font-size:23px}.stat-top{font-size:11px}.section-grid{grid-template-columns:1fr}.form-grid{grid-template-columns:1fr;padding:17px}.field.full{grid-column:auto}.modal-backdrop{padding:9px}.modal-head{padding:16px 17px}.modal-actions{padding:12px 17px}.detail-grid{grid-template-columns:1fr 1fr;padding:12px}.top-actions #exportBtn{display:none}footer{padding:13px;flex-direction:column}.page-head>.btn{font-size:11px;padding:9px}.panel-head{padding:14px}.panel-body{padding:13px}}

/* Modern Trident ERP authentication */
.auth-screen{--auth-ink:#17263a;--auth-muted:#78869a;position:relative;isolation:isolate;min-height:100vh;display:grid;place-items:center;overflow:hidden;padding:clamp(18px,4vw,56px);background:#f4f6f9;color:var(--auth-ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif}
.auth-screen:before{content:"";position:absolute;z-index:-2;inset:0 50% 0 0;background:radial-gradient(ellipse at 18% 10%,#304966 0,transparent 42%),linear-gradient(145deg,#111e30,#172b42 65%,#213d56)}
.auth-screen:after{content:"";position:absolute;z-index:-1;left:0;right:50%;bottom:0;height:34%;opacity:.19;background-image:linear-gradient(#9db4ce22 1px,transparent 1px),linear-gradient(90deg,#9db4ce22 1px,transparent 1px);background-size:34px 34px;mask-image:linear-gradient(transparent,#000)}
.auth-orbit{position:absolute;z-index:-1;border:1px solid #ffffff0d;border-radius:50%;pointer-events:none}.orbit-one{width:510px;height:510px;left:-240px;bottom:-245px}.orbit-two{width:340px;height:340px;left:-155px;bottom:-160px}
.auth-layout{width:min(1160px,100%);min-height:min(740px,calc(100vh - 60px));display:grid;grid-template-columns:1fr .88fr;overflow:hidden;border:1px solid #dce2e9;border-radius:25px;background:#fff;box-shadow:0 32px 100px #09172b36}
.auth-showcase{position:relative;display:flex;flex-direction:column;padding:clamp(28px,4vw,52px);color:#fff;background:linear-gradient(160deg,#15253a 0%,#1a3048 62%,#254660 100%);overflow:hidden}
.auth-showcase:after{content:"";position:absolute;right:-125px;top:22%;width:370px;height:370px;border:1px solid #ffffff12;border-radius:50%;box-shadow:0 0 0 42px #ffffff05,0 0 0 84px #ffffff03;pointer-events:none}
.auth-brand{display:flex;align-items:center;gap:12px;position:relative;z-index:1}.auth-brand-mark{width:43px;height:43px;display:grid;place-items:center;border:1px solid #ffffff3b;border-radius:13px;background:#ffffff12;font-size:24px;font-weight:850;letter-spacing:-2px;color:#fff}.auth-brand-mark span{color:#8cb8f3}.auth-brand strong{display:block;font-size:15px;letter-spacing:2.5px}.auth-brand small{display:block;margin-top:5px;color:#9eb0c5;font-size:8px;letter-spacing:1.35px}
.auth-showcase-copy{position:relative;z-index:1;margin:auto 0;padding:54px 0 38px;max-width:440px}.auth-kicker{display:inline-flex;align-items:center;gap:8px;color:#668ac0;font-size:10px;font-weight:800;letter-spacing:1.8px}.auth-showcase .auth-kicker{color:#a9c5e9}.auth-kicker i,.auth-utility span i{display:inline-block;width:7px;height:7px;border-radius:50%;background:#75c9a1;box-shadow:0 0 0 4px #75c9a11c}.auth-showcase-copy h2{font-size:clamp(36px,4.2vw,56px);line-height:1.08;letter-spacing:-2.2px;font-weight:650;margin:23px 0 17px}.auth-showcase-copy h2 em{font-style:normal;color:#a4c4f0}.auth-showcase-copy p{max-width:360px;font-size:14px;line-height:1.9;color:#b2c0d1;margin:0}
.auth-preview{position:relative;z-index:1;padding:19px 20px 16px;border:1px solid #ffffff1d;border-radius:15px;background:linear-gradient(120deg,#ffffff0e,#ffffff05);backdrop-filter:blur(8px);max-width:440px}.preview-top,.preview-metric,.preview-foot{display:flex;align-items:center;justify-content:space-between;gap:12px}.preview-top{font-size:9px;letter-spacing:1.2px;color:#aebed0;font-weight:800}.preview-live{display:flex;align-items:center;gap:6px;font-size:8px;color:#8ed3b2}.preview-live i{width:5px;height:5px;background:#6bc59b;border-radius:50%}.preview-metric{justify-content:flex-start;gap:44px;padding:24px 0 18px}.preview-metric small{display:block;font-size:8px;color:#91a4ba;letter-spacing:1px}.preview-metric strong{display:block;margin-top:8px;font-size:20px;letter-spacing:1px;color:#fff}.preview-metric .preview-status{font-size:13px;color:#9ccebb;letter-spacing:0}.preview-line{height:4px;border-radius:10px;background:#ffffff12;overflow:hidden}.preview-line span{display:block;height:100%;border-radius:10px;background:linear-gradient(90deg,#668fca,#9cc5f3)}.preview-foot{justify-content:flex-start;gap:22px;padding-top:15px;color:#9daec2;font-size:9px}.auth-legal{margin-top:28px;font-size:8px;letter-spacing:1.5px;color:#8196ae}.auth-legal span,.auth-copyright span{padding:0 7px;color:#a5b1c0}
.auth-panel-wrap{display:grid;place-items:center;padding:clamp(28px,4vw,58px);background:linear-gradient(145deg,#fff,#fbfcfe)}.auth-panel{width:100%;max-width:370px}.auth-mobile-brand{display:none}.auth-welcome{margin-bottom:29px}.auth-lock-icon{width:42px;height:42px;display:grid;place-items:center;border:1px solid #e4eaf2;border-radius:12px;color:#365b88;background:#f5f8fc;margin-bottom:24px}.auth-lock-icon svg{width:22px;height:22px}.auth-welcome h1{font-size:clamp(24px,2.5vw,30px);line-height:1.2;letter-spacing:-1px;margin:11px 0 9px;font-weight:760;color:#192a40}.auth-welcome p{font-size:13px;line-height:1.7;color:var(--auth-muted);margin:0}
.auth-form{display:flex;flex-direction:column;gap:10px}.auth-form label{font-size:11px;font-weight:750;color:#34465d;margin-top:7px}.auth-form input{width:100%;height:47px;padding:0 13px;border:1px solid #dbe2eb;border-radius:9px;outline:none;background:#fff;color:#17263a;font:inherit;font-size:13px;transition:border .18s,box-shadow .18s}.auth-form input::placeholder{color:#a5afbd}.auth-form input:focus{border-color:#7596c2;box-shadow:0 0 0 4px #dfeafb80}.password-field{position:relative}.password-field input{padding-right:62px}.password-toggle{position:absolute;right:10px;top:50%;transform:translateY(-50%);border:0;background:transparent;color:#52729c;font-size:11px;font-weight:750;padding:7px}.auth-submit{display:flex;align-items:center;justify-content:space-between;width:100%;margin-top:15px;padding:14px 16px;border:1px solid #1a2c43;border-radius:9px;background:linear-gradient(100deg,#1a2b41,#2a4766);color:#fff;font-size:12px;font-weight:750;box-shadow:0 7px 16px #1d33451c;transition:transform .18s,box-shadow .18s}.auth-submit span:last-child{font-size:17px;font-weight:400}.auth-submit:hover{transform:translateY(-1px);box-shadow:0 10px 22px #1d33452b}.auth-submit:disabled{opacity:.65;cursor:wait;transform:none}
.auth-utility{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:18px}.auth-utility span{display:flex;align-items:center;gap:8px;font-size:10px;color:#78869a}.auth-utility span i{width:6px;height:6px;box-shadow:none}.auth-utility button,.auth-back{border:0;background:transparent;color:#345d91;font-size:11px;font-weight:750;padding:5px 0}.auth-back{margin-top:12px}.auth-message{min-height:0;margin:13px 0 0;color:#b42318;font-size:12px;line-height:1.6;overflow-wrap:anywhere}.auth-message:empty{display:none}.auth-security{display:flex;gap:10px;align-items:flex-start;border-top:1px solid #e9edf2;margin-top:27px;padding-top:17px}.auth-security svg{width:18px;height:18px;flex-shrink:0;color:#7c91ab}.auth-security p{margin:0;color:#8793a3;font-size:10px;line-height:1.7}.auth-copyright{margin-top:28px;color:#a0aab7;font-size:9px;text-align:center}
@media(max-width:820px){.auth-screen{padding:0;background:#f6f8fb}.auth-screen:before{inset:0 0 65%}.auth-screen:after{right:0;bottom:65%}.auth-layout{min-height:100vh;width:100%;grid-template-columns:1fr;border:0;border-radius:0;box-shadow:none}.auth-showcase{display:none}.auth-panel-wrap{padding:32px 24px;min-height:100vh}.auth-panel{max-width:400px}.auth-mobile-brand{display:flex;align-items:center;gap:10px;margin-bottom:48px}.auth-mobile-brand .auth-brand-mark{background:#1a2c43;border-color:#1a2c43}.auth-mobile-brand strong{font-size:13px;letter-spacing:1.8px}.auth-welcome{margin-bottom:27px}.auth-lock-icon{margin-bottom:20px}.auth-copyright{margin-top:38px}}
@media(prefers-reduced-motion:reduce){.auth-submit,.auth-form input{transition:none}}


/* Security: the ERP application must remain hidden until Supabase verifies an active staff session. */
.app-shell[hidden]{display:none!important}
#authGate[hidden]{display:none!important}
#erpApp:not([hidden]){display:flex}
@media(min-width:821px){.auth-screen{padding:clamp(18px,3.5vh,38px) clamp(18px,4vw,56px)}.auth-layout{min-height:min(740px,calc(100dvh - 48px))}.auth-panel-wrap{padding:clamp(26px,3.4vw,52px)}}
@media(max-width:820px){.auth-screen{min-height:100dvh;min-height:100svh;padding:0}.auth-layout{min-height:100dvh;min-height:100svh}.auth-panel-wrap{min-height:100dvh;min-height:100svh;padding:clamp(24px,6vh,44px) clamp(20px,6vw,34px)}.auth-mobile-brand{margin-bottom:clamp(30px,7vh,52px)}}
@media(max-width:380px){.auth-panel-wrap{padding:24px 18px}.auth-mobile-brand{margin-bottom:30px}.auth-welcome h1{font-size:24px}.auth-utility{align-items:flex-start}.auth-utility span{font-size:9px}.auth-utility button{font-size:10px}.auth-security{margin-top:22px}}
@media(min-width:821px) and (max-height:700px){.auth-screen{padding:14px}.auth-layout{min-height:calc(100dvh - 28px)}.auth-showcase,.auth-panel-wrap{padding:24px 32px}.auth-showcase-copy{padding:24px 0}.auth-showcase-copy h2{font-size:38px;margin:14px 0}.auth-showcase-copy p{font-size:12px}.auth-preview{padding:13px 16px}.auth-security{margin-top:17px}.auth-copyright{margin-top:17px}.auth-welcome{margin-bottom:18px}.auth-lock-icon{margin-bottom:14px}}
