.island-shell{--island-width:240px;--island-bg:#e7efeb;--island-text:#294c42;--island-active:#246b5c;display:grid;grid-template-columns:var(--island-width) minmax(0,1fr);gap:22px;padding:20px;align-items:start;transition:grid-template-columns .2s ease}
.island-shell.island-collapsed{--island-width:72px}
.island-shell>.island-sidebar{position:sticky;top:20px;left:auto;width:100%;height:calc(100dvh - 40px);max-height:none;display:flex;flex-direction:column;align-items:stretch;gap:14px;padding:18px 12px 12px;background:linear-gradient(165deg,#eff5f1,#e5eeea);color:var(--island-text);border:1px solid #fff;border-radius:23px;box-shadow:0 12px 30px #294c4219,0 3px 7px #294c4210;overflow:hidden;transform:none}
.island-sidebar>.brand{display:flex;align-items:center;gap:9px;padding:0 3px 14px;margin:0;border-bottom:1px solid #294c4214;min-height:50px;flex-shrink:0}
.island-sidebar .brand-mark{width:38px;height:38px;min-width:38px;border-radius:11px;background:#d6e4de;box-shadow:none}
.island-sidebar .brand-mark img{width:30px;height:30px}
.island-sidebar .brand>div{min-width:0;flex:1}.island-sidebar .brand strong{color:var(--island-text);font-size:13px;white-space:nowrap}.island-sidebar .brand small{color:#647b71;font-size:11px}
.island-toggle{width:26px;height:30px;min-width:26px;padding:0;background:transparent;color:var(--island-text);border:0;border-radius:7px;box-shadow:none;display:grid;place-items:center;flex-shrink:0}.island-toggle svg{width:16px;height:16px}.island-toggle:hover{background:#d8e7df}
.island-sidebar>nav{display:flex;flex-direction:column;gap:3px;min-height:0;flex:1;overflow-y:auto;overflow-x:hidden;margin:0;padding:0 2px;scrollbar-width:thin;scrollbar-color:#bdcec5 transparent}
.island-sidebar .nav-group{display:flex;flex-direction:column;gap:3px}.island-sidebar .nav-group+.nav-group{margin-top:8px;padding-top:9px;border-top:1px solid #294c4214}.island-sidebar .nav-group-label{font-size:11px;color:#6a8176;padding:0 9px 4px}
.island-shell .island-sidebar .nav-button{position:relative;width:100%;min-height:38px;display:flex;align-items:center;gap:11px;padding:8px 11px;border:0;border-radius:10px;color:var(--island-text);background:transparent;font-size:12px;font-weight:500;box-shadow:none;flex-shrink:0;text-align:left}
.island-shell .island-sidebar .nav-button:hover{background:#d7e6df}
.island-shell .island-sidebar .nav-button.active{background:var(--island-active);color:#fff;box-shadow:0 3px 7px #246b5c22;font-weight:650}
.island-shell .island-sidebar .nav-button.active::before{display:none}.island-shell .island-sidebar .nav-icon{width:18px;height:18px;min-width:18px;color:inherit;opacity:1}
.island-sidebar>.ghost-button{display:flex;align-items:center;gap:11px;min-height:38px;margin:0;padding:8px 11px;border:0;border-top:1px solid #294c4214;border-radius:0;color:var(--island-text);background:transparent;box-shadow:none;flex-shrink:0}.island-sidebar>.ghost-button svg{width:18px;height:18px;min-width:18px}
.island-sidebar .nav-count{margin-left:auto}.island-sidebar button:focus-visible{outline:2px solid var(--primary);outline-offset:2px}
.island-collapsed .island-sidebar{padding:14px 9px 10px}.island-collapsed .island-sidebar>.brand{flex-direction:column;gap:5px;padding:0 0 8px}.island-collapsed .brand>div,.island-collapsed .nav-label,.island-collapsed .nav-group-label{display:none!important}
.island-collapsed .island-sidebar .nav-button,.island-collapsed .island-sidebar>.ghost-button{justify-content:center;padding:10px 0;min-height:42px}.island-collapsed .island-sidebar .nav-count{position:absolute;top:2px;right:0;margin:0;min-width:17px;height:17px;font-size:10px;padding:0 3px}.island-collapsed .nav-group+.nav-group{margin-top:6px;padding-top:6px}
.island-shell>.content,.island-shell>.user-content{min-width:0;width:100%;max-width:none;padding:0 0 30px;background:var(--bg)}
.island-shell .agent-topbar,.island-shell .client-topbar{position:relative;top:auto;margin:0 0 20px;padding:13px 4px 16px;min-height:76px;border:0;background:transparent;box-shadow:none;display:flex;align-items:center;justify-content:space-between;gap:16px}
.island-shell .agent-topbar h2,.island-shell .client-topbar h2{font-size:25px;line-height:1.3;font-weight:750;letter-spacing:-.03em}.island-shell .client-topbar .eyebrow{display:none}
.island-subtitle{margin:7px 0 0;color:var(--muted);font-size:12px;line-height:1.5}
.island-shell .client-own-balance{display:grid;grid-template-columns:28px auto;column-gap:10px;align-items:center;padding:10px 18px;background:var(--primary-soft);border:1px solid var(--line-faint);border-radius:14px;min-width:155px;line-height:1.35}.island-wallet{grid-row:1/3;width:25px;height:25px;color:var(--primary)}.island-balance-label{font-size:11px;font-weight:500;color:var(--muted)}.client-own-balance strong{font-size:18px;color:var(--text)}
.island-shell #dashboard .stat-section{grid-template-columns:repeat(5,minmax(0,1fr));gap:14px;margin:20px 0}
.island-shell #dashboard .stat-item{border:1px solid var(--line-faint);border-radius:15px;padding:19px 18px;min-height:112px;gap:10px;background:var(--surface);box-shadow:0 5px 18px #294c4206}
.island-shell #dashboard .stat-item>span{display:flex;align-items:center;gap:9px;font-size:12px}.island-stat-icon{width:21px;height:21px;color:var(--primary)}.island-shell #dashboard .stat-item strong{font-size:26px;letter-spacing:-.03em}.island-shell #dashboard #agentProfitEntry{border-top:1px solid var(--line-faint)}
.island-shell .quick-entry{padding:22px;border:1px solid var(--line-faint);border-radius:17px;box-shadow:0 6px 20px #294c4206}.island-shell .quick-entry>h3{text-align:left;font-size:17px;margin:0 0 18px}.island-shell .quick-buttons{grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}
.island-shell .quick-btn{display:flex;align-items:flex-start;text-align:left;flex-direction:column;justify-content:flex-start;gap:10px;padding:18px;border:1px solid var(--line-faint);border-radius:13px;background:var(--surface);color:var(--text);box-shadow:none;min-height:130px;position:relative}.island-shell .quick-btn:hover{background:var(--surface-hover);border-color:var(--brand-200);transform:translateY(-2px)}
.island-entry-icon{width:40px;height:40px;padding:9px;box-sizing:border-box;border-radius:11px;background:var(--primary-soft);color:var(--primary)}.island-entry-label{font-size:14px;font-weight:650}.island-entry-description{font-size:12px;font-weight:400;color:var(--muted);line-height:1.5}.island-entry-arrow{position:absolute;right:16px;top:24px;color:var(--muted)}
[data-theme=dark] .island-shell{--island-bg:#25352d;--island-text:#dce8e1;--island-active:#385e4d}[data-theme=dark] .island-shell>.island-sidebar{background:linear-gradient(160deg,#2b3b32,#24342c);border-color:#415348;box-shadow:0 12px 30px #0004}[data-theme=dark] .island-sidebar .brand-mark{background:#354b3f}[data-theme=dark] .island-sidebar .brand small,[data-theme=dark] .island-sidebar .nav-group-label{color:#a2b7aa}[data-theme=dark] .island-shell .island-sidebar .nav-button:hover,[data-theme=dark] .island-toggle:hover{background:#354d3f}
@media(max-width:1100px){.island-shell{--island-width:220px;padding:16px;gap:18px}.island-shell>.island-sidebar{top:16px;height:calc(100dvh - 32px)}.island-shell #dashboard .stat-section{grid-template-columns:repeat(3,minmax(0,1fr))}.island-shell .quick-buttons{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.island-shell{--island-width:64px;padding:10px;gap:12px;grid-template-columns:var(--island-width) minmax(0,1fr)}.island-shell>.island-sidebar{top:10px;height:calc(100dvh - 20px);padding:12px 7px;border-radius:18px}.island-shell .island-sidebar>.brand{flex-direction:column;padding:0 0 8px;gap:4px;order:0;flex:0 0 auto}.island-shell .brand>div,.island-shell .nav-label,.island-shell .nav-group-label{display:none!important}.island-shell .island-sidebar>nav{order:0;flex-direction:column;flex:1;overflow-x:hidden;overflow-y:auto;width:100%}.island-shell .island-sidebar .nav-group{flex-direction:column}.island-shell .island-sidebar .nav-button,.island-shell .island-sidebar>.ghost-button{justify-content:center;width:100%;padding:10px 0;min-height:42px;order:0}.island-shell .island-sidebar .nav-count{position:absolute;right:0;top:1px;margin:0}.island-shell .agent-topbar,.island-shell .client-topbar{align-items:flex-start;flex-direction:column;gap:10px;margin-bottom:14px;padding:4px 0 12px}.island-shell .topbar-actions,.island-shell .client-actions{flex-wrap:wrap;gap:8px}.island-shell .agent-topbar h2,.island-shell .client-topbar h2{font-size:21px}.island-shell #dashboard .stat-section,.island-shell .quick-buttons{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}.island-shell #dashboard .stat-item{padding:14px 11px;min-height:100px}.island-shell #dashboard .stat-item strong{font-size:22px}.island-shell .quick-entry{padding:12px}.island-shell .quick-btn{padding:12px}.island-shell .island-toggle{display:none}.island-shell .client-own-balance{padding:8px 12px;min-width:145px}.island-shell .user-workbench{grid-template-columns:minmax(0,1fr)}}
@media(prefers-reduced-motion:reduce){.island-shell,.island-shell .quick-btn{transition:none!important;transform:none!important}}

/* Super-admin registration drawer; other accounts keep their existing layout. */
.registration-drawer-launch{display:inline-flex;align-items:center;gap:8px}.registration-status-badge{font-size:11px;line-height:1.5;padding:2px 8px;border-radius:20px;background:#e3f8eb;color:#166b52}.registration-status-badge.is-closed{background:var(--surface-hover);color:var(--muted)}
dialog.registration-drawer{position:fixed;inset:18px 18px 18px auto;margin:0;width:420px;max-width:calc(100vw - 36px);height:calc(100dvh - 36px);max-height:calc(100dvh - 36px);padding:0;border:1px solid var(--line);border-radius:18px;background:var(--surface);color:var(--text);box-shadow:0 18px 50px #294c4226;overflow:hidden}dialog.registration-drawer[open]{display:flex;flex-direction:column}.registration-drawer::backdrop{background:#192c2529}.registration-drawer-head{display:flex;justify-content:space-between;align-items:center;padding:24px;border-bottom:1px solid var(--line);gap:15px}.registration-drawer-head h3{margin:0;font-size:20px}.registration-drawer-head p{font-size:12px;color:var(--muted);margin:7px 0 0}.registration-drawer-head button{padding:4px 10px;border:0;background:transparent;color:var(--muted);font-size:24px}.registration-drawer-form{display:flex;flex-direction:column;flex:1;min-height:0}.registration-drawer-fields{padding:24px;display:grid;gap:28px;overflow:auto}.registration-switch-row{display:flex;justify-content:space-between;align-items:center;gap:18px}.registration-switch-row label{font-weight:600}.registration-switch-row small{display:block;margin-top:6px;color:var(--muted);font-size:12px}.registration-switch{position:relative;width:42px;min-width:42px;height:24px;display:block}.registration-switch input{position:absolute;inset:0;opacity:0;width:42px;height:24px;cursor:pointer;margin:0;z-index:1}.registration-switch span{position:absolute;inset:0;background:var(--line);border-radius:99px;pointer-events:none}.registration-switch span:after{content:'';position:absolute;width:18px;height:18px;top:3px;left:3px;background:white;border-radius:50%;box-shadow:0 1px 4px #0002}.registration-switch input:checked+span{background:var(--primary)}.registration-switch input:checked+span:after{transform:translateX(18px)}.registration-switch input:focus-visible+span{outline:2px solid var(--primary);outline-offset:3px}.registration-template-field{display:flex;flex-direction:column;gap:8px}.registration-template-field>span{font-size:12px;color:var(--muted)}.registration-drawer-note{margin:0;padding:14px 16px;background:var(--primary-soft);border-radius:10px;color:var(--muted);font-size:13px;line-height:1.85}.registration-drawer-fields>p[role=status]{margin:0;font-size:12px}.registration-drawer-foot{margin-top:auto;padding:22px 24px;border-top:1px solid var(--line);display:flex;justify-content:flex-end;gap:10px}.registration-drawer-foot button[type=submit]{min-width:115px}
@media(max-width:760px){dialog.registration-drawer{inset:10px 10px 10px auto;width:calc(100vw - 20px);max-width:calc(100vw - 20px);height:calc(100dvh - 20px);max-height:calc(100dvh - 20px)}.registration-drawer-head,.registration-drawer-fields{padding:20px}.registration-drawer-foot{padding:18px 20px}}

/* Mobile expansion overlays content, keeping the workbench width unchanged. */
.island-backdrop{display:none}
@media(max-width:760px){
 .island-shell .island-toggle{display:grid;width:44px;height:44px;min-width:44px}
 .island-shell.island-mobile-open>.island-sidebar{position:fixed;inset:10px auto 10px 10px;z-index:81;width:min(260px,calc(100vw - 30px));padding:18px 12px 12px;box-shadow:0 12px 35px #0003}
 .island-shell.island-mobile-open .island-sidebar>.brand{flex-direction:row;gap:9px;padding:0 3px 14px}
 .island-shell.island-mobile-open .brand>div,.island-shell.island-mobile-open .nav-label,.island-shell.island-mobile-open .nav-group-label{display:block!important}
 .island-shell.island-mobile-open .island-sidebar .nav-button,.island-shell.island-mobile-open .island-sidebar>.ghost-button{justify-content:flex-start;padding:10px 11px}
 .island-shell.island-mobile-open .nav-group+.nav-group{margin-top:8px;padding-top:9px}
 .island-shell.island-mobile-open .island-sidebar .nav-count{position:static;margin-left:auto}
 .island-shell.island-mobile-open>.island-backdrop{display:block;position:fixed;inset:0;z-index:80;border:0;border-radius:0;margin:0;padding:0;background:#192c2559;box-shadow:none}
}
@media(max-width:760px){.island-shell .island-sidebar .island-toggle{background:transparent!important;color:var(--island-text)}.island-shell .island-toggle svg{width:22px;height:22px}}

/* Keep mobile content in place when the sidebar opens; wrap long labels. */
@media(max-width:760px){
 .island-shell>.content,.island-shell>.user-content{grid-column:2;grid-row:1}
 .island-shell .quick-btn{min-width:0;white-space:normal}
 .island-entry-label,.island-entry-description{max-width:100%;overflow-wrap:anywhere}
 #projectSelectText{min-width:0;white-space:normal;overflow-wrap:anywhere}
 #projectSelectBtn>span:last-child{flex-shrink:0}
}
