:root{
  --shell-sidebar:#102a34;
  --shell-sidebar-text:#c9d7dc;
  --shell-sidebar-muted:#8fa4ac;
  --shell-page:#f5f7f8;
  --shell-purple:#5b45a8;
  --shell-purple-soft:#eeeaff;
  --shell-purple-line:#d9d0ff;
  --shell-green:#287a54;
  --shell-green-soft:#e8f5ee;
}

body{background:var(--shell-page)}

.management-shell a:focus-visible,.management-shell summary:focus-visible,.auth-shell a:focus-visible,.auth-shell button:focus-visible{outline:3px solid #6ab5cf;outline-offset:2px}

.management-shell{display:grid;grid-template-columns:232px minmax(0,1fr);min-height:100vh}
.shell-sidebar{position:sticky;top:0;display:flex;flex-direction:column;gap:20px;height:100vh;overflow-y:auto;padding:22px 15px 17px;background:var(--shell-sidebar);color:#fff;z-index:30}
.shell-brand{display:grid;gap:3px;padding:0 9px;color:#fff;text-decoration:none}
.shell-brand:hover{color:#fff;text-decoration:none}
.shell-brand strong{letter-spacing:.15em;font-size:.96rem}
.shell-brand span{color:#b7c7cd;font-size:.76rem}

.shell-environment{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:10px 11px;border-radius:10px}
.shell-environment strong{font-size:.78rem;letter-spacing:.07em}
.shell-environment span{font-size:.68rem;opacity:.82}
.environment-surface-staging{background:var(--shell-purple)!important;color:#fff!important}
.environment-surface-production{background:#9d2c2c!important;color:#fff!important}
.environment-surface-development{background:#245d7a!important;color:#fff!important}
.environment-surface-unknown{background:#7f1d1d!important;color:#fff!important}

.shell-sidebar-nav.nav{position:static;display:grid;align-content:start;gap:4px;overflow:visible;padding:0;background:transparent;border:0;z-index:auto}
.shell-nav-heading{padding:1px 10px 6px;color:var(--shell-sidebar-muted);font-size:.67rem;font-weight:700;letter-spacing:.09em;text-transform:uppercase}
.shell-sidebar-nav.nav>a,.shell-sidebar-nav .nav-group>summary{display:flex;align-items:center;min-height:40px;width:100%;padding:9px 10px;color:var(--shell-sidebar-text);border-radius:8px;font-size:.82rem}
.shell-sidebar-nav.nav>a:hover,.shell-sidebar-nav .nav-group>summary:hover{background:#ffffff12;color:#fff;text-decoration:none}
.shell-sidebar-nav.desktop-nav>a.active,.shell-sidebar-nav.desktop-nav>.nav-group.active>summary,.shell-sidebar-nav.desktop-nav a[aria-current="page"]{background:#ffffff1f;color:#fff;border-radius:8px}
.shell-sidebar-nav .nav-group{position:static;margin:0;width:100%}
.shell-sidebar-nav .nav-group>summary{justify-content:space-between}
.shell-sidebar-nav .nav-group>summary::after{content:"+";font-size:.92rem;color:var(--shell-sidebar-muted)}
.shell-sidebar-nav .nav-group[open]>summary::after{content:"–"}
.shell-sidebar-nav .nav-group[open]>summary{background:#ffffff0d;color:#fff}
.shell-sidebar-nav .nav-menu{position:static;display:grid;min-width:0;margin:2px 0 6px 12px;padding:3px 0 3px 10px;background:transparent;border:0;border-left:1px solid #ffffff1c;border-radius:0;box-shadow:none}
.shell-sidebar-nav .nav-menu a{padding:7px 9px;color:#aebfc5;border-radius:7px;font-size:.75rem}
.shell-sidebar-nav .nav-menu a:hover{background:#ffffff0d;color:#fff;text-decoration:none}
.shell-sidebar-nav .nav-menu a.active,.shell-sidebar-nav .nav-menu a[aria-current="page"]{background:#ffffff17;color:#fff;font-weight:700}

.shell-user{display:grid;grid-template-columns:34px minmax(0,1fr);align-items:center;gap:9px;margin-top:auto;padding:12px 7px 0;border-top:1px solid #ffffff1c}
.shell-avatar{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;background:#c8e7df;color:#173640;font-size:.72rem;font-weight:800}
.shell-user-copy{display:grid;min-width:0}
.shell-user-copy strong{overflow:hidden;color:#f4fafb;font-size:.76rem;text-overflow:ellipsis;white-space:nowrap}
.shell-user-copy small{color:var(--shell-sidebar-muted);font-size:.65rem}

.shell-body{display:flex;min-width:0;min-height:100vh;flex-direction:column}
.shell-topbar.topbar{position:sticky;top:0;min-height:62px;padding:11px 26px;background:#fff;color:var(--ink);border-bottom:1px solid var(--line);z-index:22}
.shell-context{display:grid;gap:2px}
.shell-context>span{font-size:.83rem;font-weight:700}
.shell-context small{color:var(--muted);font-size:.7rem}
.shell-mobile-brand{display:none}
.shell-topbar .userline{color:#30414a}
.shell-topbar .role-chip{background:#e8eef1;color:#42535c}
.shell-topbar .linkbtn{color:#2d596a!important}

.environment-banner{display:flex;align-items:center;justify-content:space-between;gap:18px;min-height:38px;padding:8px 26px;font-size:.74rem;z-index:20}
.environment-banner.environment-surface-staging{background:var(--shell-purple-soft)!important;color:#453578!important;border-bottom:1px solid var(--shell-purple-line)}
.environment-banner.environment-surface-production{background:#fde7e7!important;color:#7f1d1d!important;border-bottom:1px solid #f3bcbc}
.environment-banner.environment-surface-development{background:#e4f2f8!important;color:#174e69!important;border-bottom:1px solid #badbe9}
.environment-banner.environment-surface-unknown{background:#7f1d1d!important;color:#fff!important;border-bottom:1px solid #5d1212}
.environment-domain{overflow:hidden;opacity:.78;text-overflow:ellipsis;white-space:nowrap}

.shell-content.container{width:100%;max-width:1500px;flex:1;padding:28px}
.shell-body>footer{margin-top:auto}
.shell-mobile-nav{display:none}

.dashboard-head{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;margin-bottom:20px}
.dashboard-kicker{margin:0 0 5px;color:#67578e;font-size:.72rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase}
.dashboard-head h1{margin:0 0 5px;font-size:1.85rem}
.dashboard-head .lead{max-width:none}
.dashboard-live{display:flex;align-items:center;gap:8px;color:#2b704e;font-size:.76rem;white-space:nowrap}
.dashboard-live::before{content:"";width:8px;height:8px;border-radius:50%;background:#3a9669;box-shadow:0 0 0 4px #3a96691f}

.dashboard-status-grid{display:grid;grid-template-columns:minmax(210px,1.2fr) repeat(4,minmax(110px,.7fr));gap:1px;overflow:hidden;margin-bottom:22px;background:#dde5e8;border:1px solid #dde5e8;border-radius:13px}
.dashboard-status{display:grid;align-content:center;min-height:86px;padding:14px 16px;background:#fff}
.dashboard-status span{color:#718087;font-size:.7rem}
.dashboard-status strong{margin-top:5px;font-size:1.06rem}
.dashboard-status-primary{grid-template-columns:40px minmax(0,1fr);align-items:center;gap:12px}
.dashboard-status-icon{display:grid;place-items:center;width:40px;height:40px;border-radius:11px;background:var(--shell-green-soft);color:var(--shell-green);font-size:1.05rem;font-weight:900}
.dashboard-status-primary>div{display:grid;gap:3px}
.dashboard-status-primary strong{margin:0;font-size:.94rem}
.dashboard-status-primary span{font-size:.72rem}
.dashboard-status-primary.warning .dashboard-status-icon{background:#fff2d6;color:#986712}
.dashboard-status-primary.critical .dashboard-status-icon{background:#fde5e5;color:#a72f2f}

.dashboard-workspace{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(250px,.72fr);gap:20px;align-items:start}
.dashboard-panel{overflow:hidden;background:#fff;border:1px solid var(--line);border-radius:13px}
.dashboard-panel-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:16px 18px 13px;border-bottom:1px solid #edf0f2}
.dashboard-panel-head h2{margin:0;font-size:1rem}
.dashboard-panel-head a,.dashboard-panel-head span{color:var(--muted);font-size:.72rem}
.dashboard-panel-head a{text-decoration:none}
.dashboard-panel-head a:hover{text-decoration:underline}
.dashboard-attention-list{display:grid}
.dashboard-attention-item{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:12px;min-height:66px;padding:12px 18px;border-bottom:1px solid #edf0f2;color:inherit;text-decoration:none}
.dashboard-attention-item:last-child{border-bottom:0}
.dashboard-attention-item:hover{background:#f9fbfb;text-decoration:none}
.dashboard-attention-mark{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:#edf3f6;color:#285f75;font-weight:800}
.dashboard-attention-mark.reply{background:#e8f5ee;color:#287a54}
.dashboard-attention-mark.warning{background:#fff2d6;color:#986712}
.dashboard-attention-mark.critical{background:#fde5e5;color:#a72f2f}
.dashboard-attention-copy{display:grid;gap:3px;min-width:0}
.dashboard-attention-copy strong{font-size:.82rem}
.dashboard-attention-copy span{overflow:hidden;color:var(--muted);font-size:.7rem;text-overflow:ellipsis;white-space:nowrap}
.dashboard-attention-count{min-width:28px;text-align:right;font-size:.9rem;font-weight:800}
.dashboard-empty{display:flex;align-items:center;gap:11px;padding:22px 18px;color:#2b704e;font-size:.8rem}
.dashboard-empty-mark{display:grid;place-items:center;width:32px;height:32px;border-radius:9px;background:var(--shell-green-soft);font-weight:900}

.dashboard-summary-list{display:grid;padding:4px 18px 9px}
.dashboard-summary-row{display:flex;align-items:center;justify-content:space-between;gap:14px;min-height:49px;border-bottom:1px solid #edf0f2}
.dashboard-summary-row:last-child{border-bottom:0}
.dashboard-summary-row span{color:#5f6d74;font-size:.75rem}
.dashboard-summary-row strong{font-size:.8rem;text-align:right}
.dashboard-quiet{display:flex;align-items:center;gap:8px;padding:12px 18px;background:#f2faf5;color:#2b704e;border-top:1px solid #d8eee1;font-size:.73rem}
.dashboard-quiet.warning{background:#fff8e8;color:#7a5715;border-top-color:#f2dfb2}

.dashboard-activity{margin-top:20px}
.dashboard-activity-list{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;background:#edf0f2}
.dashboard-activity-item{display:grid;gap:4px;min-height:86px;padding:15px 18px;background:#fff;color:inherit;text-decoration:none}
.dashboard-activity-item:hover{background:#f9fbfb;text-decoration:none}
.dashboard-activity-item span{color:var(--muted);font-size:.7rem}
.dashboard-activity-item strong{font-size:.82rem}
.dashboard-activity-item small{color:var(--muted);font-size:.68rem}

.auth-shell{display:flex;min-height:100vh;flex-direction:column;background:linear-gradient(145deg,#edf3f5 0%,#f7f8f9 55%,#f0eef9 100%)}
.auth-topbar.topbar{padding:15px 28px}
.auth-environment{display:flex;align-items:center;gap:9px;padding:7px 10px;border-radius:9px;font-size:.72rem}
.auth-environment span{opacity:.82}
.auth-container{width:100%;flex:1}
.auth-container .login-card{margin:8vh auto 5vh;padding:26px;border:0;box-shadow:0 18px 55px #10212b1c}
.auth-container .login-card h1{margin:0 0 4px}
.auth-container .login-card>p{margin-top:0;color:var(--muted)}
.auth-shell>footer{margin-top:auto}

@media(max-width:1180px){
  .management-shell{grid-template-columns:218px minmax(0,1fr)}
  .dashboard-status-grid{grid-template-columns:minmax(210px,1.2fr) repeat(2,minmax(110px,.7fr))}
  .dashboard-status-primary{grid-row:span 2}
}

@media(max-width:1100px){
  .management-shell{display:block}
  .shell-sidebar{display:none}
  .shell-mobile-brand{display:grid;gap:0}
  .shell-mobile-brand strong{letter-spacing:.12em;font-size:.82rem}
  .shell-mobile-brand span{color:var(--muted);font-size:.68rem}
  .shell-context{display:none}
  .shell-mobile-nav{display:block;position:sticky;top:62px;padding:7px 15px;background:#fff;border-bottom:1px solid var(--line);z-index:21}
  .shell-mobile-nav>summary{padding:7px 2px}
  .shell-mobile-nav .mobile-nav-grid{position:absolute;left:12px;right:12px;top:calc(100% + 6px);max-height:calc(100vh - 130px);overflow-y:auto;padding:12px;background:#fff;border:1px solid var(--line);border-radius:12px;box-shadow:0 18px 45px #10212b2b}
  .shell-mobile-nav .mobile-nav-grid a.active{background:#e8f3f4;color:#174f5b;font-weight:800}
  .shell-content.container{padding:23px 18px}
}

@media(max-width:760px){
  .shell-topbar.topbar{padding:11px 15px}
  .environment-banner{padding:8px 15px}
  .environment-domain{display:none}
  .dashboard-head{display:grid;align-items:start}
  .dashboard-status-grid{grid-template-columns:1fr 1fr}
  .dashboard-status-primary{grid-column:1/-1;grid-row:auto}
  .dashboard-workspace{grid-template-columns:1fr}
  .dashboard-activity-list{grid-template-columns:1fr}
  .dashboard-attention-copy span{white-space:normal}
}

@media(max-width:480px){
  .shell-topbar .userline>span:first-child{display:none}
  .shell-topbar .role-chip{display:inline-block;font-size:.62rem}
  .environment-banner{font-size:.68rem}
  .shell-content.container{padding:19px 13px}
  .dashboard-head h1{font-size:1.5rem}
  .dashboard-status{min-height:76px;padding:12px}
  .dashboard-status-primary{grid-template-columns:36px minmax(0,1fr)}
  .dashboard-status-icon{width:36px;height:36px}
  .dashboard-attention-item{grid-template-columns:32px minmax(0,1fr);padding:12px 14px}
  .dashboard-attention-count{grid-column:2;text-align:left}
  .auth-topbar.topbar{padding:13px 16px}
  .auth-environment{font-size:.64rem}
  .auth-container .login-card{margin:5vh auto;padding:20px}
}
