/* StarSpa v6 prelaunch headquarters and role portal */
:root{
 --e-navy:#173c3a;
 --e-teal:#1f6c67;
 --e-teal-2:#3f8f87;
 --e-coral:#ca7357;
 --e-gold:#ad7d25;
 --e-bg:#f2f4f1;
 --e-card:#fffdf8;
 --e-line:#dce3df;
 --e-text:#1d3433;
 --e-muted:#6b7b78;
 --e-danger:#a63f4c;
 --e-success:#237a55;
 --e-shadow:0 12px 34px rgba(24,61,58,.08);
}
body.enterprise-active{background:var(--e-bg);overflow:hidden}
body.enterprise-active #app{max-width:none;width:100%;height:100dvh;background:var(--e-bg);box-shadow:none}
.e-loading,.e-login{min-height:100dvh;display:grid;place-items:center;padding:24px;background:
 radial-gradient(circle at 15% 15%,rgba(202,115,87,.13),transparent 32%),
 radial-gradient(circle at 85% 10%,rgba(31,108,103,.15),transparent 35%),var(--e-bg)}
.e-loading-card{display:flex;align-items:center;gap:12px;padding:18px 22px;border:1px solid var(--e-line);border-radius:18px;background:var(--e-card);box-shadow:var(--e-shadow)}
.e-spinner{width:22px;height:22px;border:3px solid #dbe7e3;border-top-color:var(--e-teal);border-radius:50%;animation:e-spin .8s linear infinite}
@keyframes e-spin{to{transform:rotate(360deg)}}

.e-login-panel{width:min(100%,980px);display:grid;grid-template-columns:1.05fr .95fr;overflow:hidden;border:1px solid rgba(31,108,103,.15);border-radius:28px;background:var(--e-card);box-shadow:0 24px 70px rgba(23,60,58,.15)}
.e-login-brand{display:flex;flex-direction:column;justify-content:flex-end;min-height:570px;padding:48px;background:linear-gradient(145deg,#123c39,#276f69);color:#fff;position:relative;overflow:hidden}
.e-login-brand:before,.e-login-brand:after{content:"";position:absolute;border:1px solid rgba(255,255,255,.15);border-radius:50%}
.e-login-brand:before{width:340px;height:340px;right:-120px;top:-100px}.e-login-brand:after{width:220px;height:220px;left:-100px;bottom:80px}
.e-brand-mark{position:relative;z-index:1;display:inline-flex;align-items:center;gap:12px;font-size:14px;letter-spacing:.14em;text-transform:uppercase}
.e-brand-star{display:grid;place-items:center;width:42px;height:42px;border:1px solid rgba(255,255,255,.4);border-radius:50%;font-size:20px}
.e-login-brand h1{position:relative;z-index:1;margin:26px 0 14px;font-size:clamp(34px,5vw,58px);line-height:1.05;letter-spacing:-.03em}
.e-login-brand p{position:relative;z-index:1;max-width:450px;margin:0;color:rgba(255,255,255,.78);font-size:15px;line-height:1.8}
.e-login-form{display:flex;flex-direction:column;justify-content:center;padding:48px}
.e-login-form h2{margin:0 0 8px;color:var(--e-text);font-size:28px}.e-login-form>p{margin:0 0 28px;color:var(--e-muted);line-height:1.65}
.e-form-stack{display:flex;flex-direction:column;gap:15px}.e-field{display:flex;flex-direction:column;gap:7px;color:var(--e-text);font-size:12px;font-weight:700}
.e-field input,.e-field select,.e-field textarea{width:100%;min-height:46px;padding:11px 13px;border:1px solid #ccd8d4;border-radius:12px;background:#fff;color:var(--e-text);font:inherit;font-weight:500;outline:none}
.e-field input:focus,.e-field select:focus,.e-field textarea:focus{border-color:var(--e-teal);box-shadow:0 0 0 3px rgba(31,108,103,.12)}
.e-login-note{margin-top:18px;padding:12px 14px;border-radius:12px;background:#edf3f0;color:var(--e-muted);font-size:11px;line-height:1.6}

.e-shell{height:100dvh;display:grid;grid-template-columns:252px minmax(0,1fr);background:var(--e-bg);color:var(--e-text)}
.e-sidebar{display:flex;flex-direction:column;padding:22px 16px;background:var(--e-navy);color:#fff;overflow:auto}
.e-sidebar-brand{display:flex;align-items:center;gap:11px;padding:4px 8px 22px;border-bottom:1px solid rgba(255,255,255,.11)}
.e-sidebar-brand b{font-size:18px}.e-sidebar-brand small{display:block;margin-top:2px;color:rgba(255,255,255,.56);font-size:9px;letter-spacing:.08em}.e-sidebar-close{display:none;margin-left:auto;width:34px;height:34px;border:1px solid rgba(255,255,255,.18);border-radius:10px;background:rgba(255,255,255,.08);color:#fff;font-size:20px;cursor:pointer}
.e-role-card{margin:18px 4px 12px;padding:14px;border-radius:15px;background:rgba(255,255,255,.08)}
.e-role-card strong{display:block;font-size:14px}.e-role-card span{display:inline-flex;margin-top:7px;padding:4px 8px;border-radius:999px;background:rgba(255,255,255,.12);font-size:9px;font-weight:800}
.e-nav{display:flex;flex-direction:column;gap:5px;margin-top:8px}.e-nav button{display:flex;align-items:center;gap:10px;min-height:42px;padding:10px 12px;border:0;border-radius:11px;background:transparent;color:rgba(255,255,255,.72);text-align:left;font-size:12px;font-weight:700;cursor:pointer}
.e-nav button:hover,.e-nav button.active{background:rgba(255,255,255,.12);color:#fff}.e-nav-icon{width:22px;text-align:center;font-size:15px}
.e-sidebar-foot{margin-top:auto;padding:16px 6px 4px}.e-sidebar-foot button{width:100%;min-height:40px;border:1px solid rgba(255,255,255,.18);border-radius:11px;background:transparent;color:#fff;cursor:pointer}
.e-main{min-width:0;display:grid;grid-template-rows:auto minmax(0,1fr)}
.e-topbar{display:flex;align-items:center;justify-content:space-between;gap:16px;min-height:72px;padding:14px 24px;border-bottom:1px solid var(--e-line);background:var(--e-card);backdrop-filter:none;-webkit-backdrop-filter:none}
.e-topbar-title h1{margin:0;font-size:20px;line-height:1.2}.e-topbar-title p{margin:4px 0 0;color:var(--e-muted);font-size:10px}
.e-topbar-actions{display:flex;align-items:center;gap:9px}.e-status{display:inline-flex;align-items:center;gap:6px;padding:7px 10px;border-radius:999px;background:#e6f1ed;color:var(--e-success);font-size:9px;font-weight:850}.e-status:before{content:"";width:7px;height:7px;border-radius:50%;background:currentColor}
.e-content{overflow:auto;padding:22px 24px calc(28px + env(safe-area-inset-bottom))}

.e-grid{display:grid;gap:16px}.e-grid.stats{grid-template-columns:repeat(4,minmax(0,1fr))}.e-grid.two{grid-template-columns:repeat(2,minmax(0,1fr))}.e-grid.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.e-card{border:1px solid var(--e-line);border-radius:18px;background:var(--e-card);box-shadow:0 5px 20px rgba(29,52,51,.04);overflow:hidden}
.e-card-head{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;padding:17px 18px;border-bottom:1px solid #e8ece9}.e-card-head h2,.e-card-head h3{margin:0;font-size:15px}.e-card-head p{margin:5px 0 0;color:var(--e-muted);font-size:10px;line-height:1.45}
.e-card-body{padding:18px}.e-stat{padding:18px}.e-stat small{display:block;color:var(--e-muted);font-size:10px;font-weight:700}.e-stat strong{display:block;margin-top:10px;font-size:27px;line-height:1;font-variant-numeric:tabular-nums}.e-stat em{display:block;margin-top:10px;color:var(--e-success);font-size:10px;font-style:normal}.e-stat.warn em{color:var(--e-coral)}
.e-section-title{display:flex;align-items:end;justify-content:space-between;gap:15px;margin:24px 0 12px}.e-section-title h2{margin:0;font-size:18px}.e-section-title p{margin:4px 0 0;color:var(--e-muted);font-size:10px}
.e-table-wrap{overflow:auto}.e-table{width:100%;border-collapse:collapse;font-size:11px}.e-table th{padding:11px 12px;border-bottom:1px solid var(--e-line);background:#f4f7f5;color:var(--e-muted);text-align:left;font-size:9px;letter-spacing:.03em;white-space:nowrap}.e-table td{padding:12px;border-bottom:1px solid #edf0ee;vertical-align:middle}.e-table tr:last-child td{border-bottom:0}.e-table tbody tr:hover{background:#fbfcfa}
.e-money{font-variant-numeric:tabular-nums;font-weight:800;color:var(--e-teal)}.e-muted{color:var(--e-muted)}.e-positive{color:var(--e-success);font-weight:800}.e-negative{color:var(--e-danger);font-weight:800}
.e-chip{display:inline-flex;align-items:center;padding:4px 8px;border-radius:999px;background:#e8f0ed;color:var(--e-teal);font-size:9px;font-weight:800}.e-chip.hq{background:#f1e8d5;color:#865e17}.e-chip.manager{background:#dfeeea;color:#1d665f}.e-chip.staff{background:#eceeed;color:#52615f}.e-chip.inactive{background:#f2e4e5;color:var(--e-danger)}

.e-button{display:inline-flex;align-items:center;justify-content:center;gap:7px;min-height:38px;padding:9px 13px;border:1px solid transparent;border-radius:11px;background:var(--e-teal);color:#fff;font-size:10px;font-weight:800;cursor:pointer;white-space:nowrap}.e-button:hover{background:#195b57}.e-button.secondary{border-color:#bfd0cb;background:#fff;color:var(--e-teal)}.e-button.ghost{border-color:var(--e-line);background:transparent;color:var(--e-text)}.e-button.warm{background:var(--e-coral)}.e-button.danger{background:var(--e-danger)}.e-button.full{width:100%}.e-button:disabled{opacity:.45;cursor:not-allowed}
.e-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap}.e-toolbar select,.e-toolbar input{min-height:38px;padding:8px 11px;border:1px solid var(--e-line);border-radius:10px;background:#fff;color:var(--e-text);font-size:10px}
.e-empty{display:grid;place-items:center;min-height:180px;padding:30px;color:var(--e-muted);text-align:center}.e-empty b{display:block;margin-bottom:7px;color:var(--e-text);font-size:14px}
.e-alert{margin-bottom:15px;padding:12px 14px;border:1px solid #cfe0db;border-radius:12px;background:#edf5f2;color:#32635f;font-size:10px;line-height:1.6}.e-alert.warn{border-color:#ecd4c9;background:#fbefea;color:#8b503c}.e-alert.error{border-color:#ebc8cc;background:#fbecef;color:#8d3542}
.e-modal{position:fixed;inset:0;z-index:2000;display:grid;place-items:center;padding:20px;background:rgba(14,34,33,.48);backdrop-filter:blur(4px)}.e-modal-card{width:min(100%,720px);max-height:min(90dvh,820px);overflow:auto;border-radius:22px;background:var(--e-card);box-shadow:0 28px 80px rgba(0,0,0,.25)}
.e-modal-head{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;padding:17px 20px;border-bottom:1px solid var(--e-line);background:rgba(255,253,248,.96)}.e-modal-head h2{margin:0;font-size:17px}.e-modal-close{width:34px;height:34px;border:0;border-radius:50%;background:#edf1ef;color:var(--e-text);font-size:20px;cursor:pointer}.e-modal-body{padding:20px}.e-form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.e-form-grid .span-2{grid-column:1/-1}.e-form-actions{display:flex;justify-content:flex-end;gap:9px;margin-top:20px;padding-top:16px;border-top:1px solid var(--e-line)}
.e-toast{position:fixed;right:20px;bottom:20px;z-index:3000;max-width:min(420px,calc(100vw - 40px));padding:13px 16px;border-radius:12px;background:#153d3a;color:#fff;box-shadow:var(--e-shadow);font-size:11px;line-height:1.5}.e-toast.error{background:#8d3542}

.e-payroll-hero{display:grid;grid-template-columns:1.25fr repeat(3,minmax(0,.75fr));gap:1px;border-radius:18px;overflow:hidden;background:var(--e-line)}.e-payroll-hero>div{padding:18px;background:var(--e-card)}.e-payroll-hero small{display:block;color:var(--e-muted);font-size:9px}.e-payroll-hero strong{display:block;margin-top:8px;font-size:24px;font-variant-numeric:tabular-nums}.e-payroll-hero .final{background:var(--e-navy);color:#fff}.e-payroll-hero .final small{color:rgba(255,255,255,.65)}
.e-payroll-breakdown{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.e-payroll-line{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 12px;border:1px solid var(--e-line);border-radius:11px;background:#fff}.e-payroll-line span{color:var(--e-muted);font-size:10px}.e-payroll-line b{font-size:11px;font-variant-numeric:tabular-nums}.e-payroll-line.deduction b{color:var(--e-danger)}.e-payroll-line.income b{color:var(--e-success)}
.e-chart{display:flex;align-items:end;gap:9px;height:210px;padding:18px 12px 8px;border-bottom:1px solid var(--e-line)}.e-chart-month{flex:1;min-width:22px;display:flex;flex-direction:column;align-items:center;justify-content:end;gap:5px;height:100%}.e-chart-bars{display:flex;align-items:end;justify-content:center;gap:3px;width:100%;height:170px}.e-chart-bar{width:min(12px,42%);min-height:2px;border-radius:5px 5px 2px 2px;background:#b8c7c3}.e-chart-bar.current{background:var(--e-teal)}.e-chart-month small{color:var(--e-muted);font-size:8px}.e-chart-legend{display:flex;justify-content:center;gap:16px;padding:12px;font-size:9px;color:var(--e-muted)}.e-chart-legend i{display:inline-block;width:9px;height:9px;margin-right:5px;border-radius:3px;background:#b8c7c3}.e-chart-legend i.current{background:var(--e-teal)}
.e-inventory-low{background:#fff1ee!important}.e-inventory-low td:first-child:before{content:"低庫存";display:inline-flex;margin-right:7px;padding:3px 6px;border-radius:999px;background:#f5d6cf;color:#954a35;font-size:8px;font-weight:900}
.e-return{position:fixed;z-index:1500;top:max(12px,env(safe-area-inset-top));left:12px;display:none;align-items:center;gap:7px;min-height:38px;padding:8px 12px;border:1px solid rgba(255,255,255,.24);border-radius:12px;background:rgba(23,60,58,.94);color:#fff;box-shadow:0 8px 24px rgba(0,0,0,.2);font-size:10px;font-weight:800;cursor:pointer}.e-return.visible{display:inline-flex}

.e-mobile-menu{display:none;width:38px;height:38px;border:1px solid var(--e-line);border-radius:10px;background:#fff;color:var(--e-text)}
@media(max-width:1100px){.e-grid.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.e-grid.three{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){
 body.enterprise-active{overflow:auto}.e-login{padding:0}.e-login-panel{min-height:100dvh;grid-template-columns:1fr;border:0;border-radius:0}.e-login-brand{min-height:230px;padding:30px}.e-login-brand h1{font-size:36px}.e-login-form{padding:30px 22px}
 .e-shell{height:auto;min-height:100dvh;grid-template-columns:1fr}.e-sidebar{position:fixed;inset:0 auto 0 0;z-index:1800;width:270px;transform:translateX(-105%);transition:transform .2s ease;box-shadow:18px 0 50px rgba(0,0,0,.25)}.e-sidebar.open{transform:translateX(0)}.e-sidebar-close{display:grid;place-items:center}
 .e-mobile-menu{display:inline-grid;place-items:center}.e-main{min-height:100dvh}.e-topbar{position:sticky;top:0;z-index:1000;min-height:64px;padding:11px 14px}.e-topbar-title h1{font-size:17px}.e-topbar-actions .e-status{display:none}.e-content{padding:15px 12px calc(24px + env(safe-area-inset-bottom))}
 .e-grid.stats,.e-grid.two,.e-grid.three{grid-template-columns:1fr}.e-section-title{align-items:flex-start;flex-direction:column}.e-section-title>.e-toolbar{width:100%}.e-section-title>.e-toolbar .e-button{flex:1}
 .e-form-grid{grid-template-columns:1fr}.e-form-grid .span-2{grid-column:auto}.e-modal{padding:0}.e-modal-card{width:100%;max-height:100dvh;min-height:100dvh;border-radius:0}.e-modal-body{padding:16px}
 .e-payroll-hero{grid-template-columns:1fr 1fr}.e-payroll-hero .final{grid-column:1/-1}.e-payroll-breakdown{grid-template-columns:1fr}.e-chart{gap:4px;padding-inline:5px}.e-chart-month small{font-size:7px}
 .e-table{min-width:720px}.e-return{top:auto;bottom:calc(82px + env(safe-area-inset-bottom));left:12px}
}
@media(prefers-reduced-motion:reduce){.e-spinner,.e-sidebar{animation:none;transition:none}}
