/* Production dashboard shell. Every rule is scoped so /app-legacy keeps the prior presentation. */
body.dashboard-v2{
  --v2-rail:#0b1d3a;
  --v2-rail-deep:#07162c;
  --v2-blue:#2563eb;
  --v2-ink:#0f172a;
  --v2-copy:#475569;
  --v2-muted:#8490a4;
  --v2-line:#e4e9f1;
  --v2-soft:#f6f8fb;
  --v2-green:#11875d;
  margin:0;
  background:#f8fafc;
  color:var(--v2-ink);
  font-family:Inter,"IBM Plex Sans",system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

body.dashboard-v2.v2-modal-open{overflow:hidden}

.dashboard-v2.v2-ready .appshell{
  display:grid;
  grid-template-columns:82px 230px minmax(0,1fr);
  min-height:100vh;
  max-width:none;
  background:#f8fafc!important;
}

.dashboard-v2 .v2-global-rail{
  position:sticky;
  top:0;
  z-index:18;
  box-sizing:border-box;
  height:100vh;
  padding:14px 10px 12px;
  display:flex;
  flex-direction:column;
  align-items:stretch;
  background:linear-gradient(180deg,var(--v2-rail),var(--v2-rail-deep));
  border-right:1px solid rgba(255,255,255,.08);
  color:#c8d6ea;
}

.dashboard-v2 .v2-brand{
  width:52px;
  height:52px;
  margin:0 auto 14px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:13px;
}

.dashboard-v2 .v2-brand:focus-visible,
.dashboard-v2 .v2-global-rail button:focus-visible,
.dashboard-v2 .v2-mode-button:focus-visible,
.dashboard-v2 .v2-context-nav button:focus-visible,
.dashboard-v2 .v2-door-shortcut:focus-visible,
.dashboard-v2 .v2-all-workflows:focus-visible,
.dashboard-v2 .v2-launcher button:focus-visible,
.dashboard-v2 .v2-launcher input:focus-visible{
  outline:2px solid #60a5fa;
  outline-offset:2px;
}

.dashboard-v2 .v2-brand img{display:block;width:44px;height:44px;object-fit:contain}
.dashboard-v2 .v2-global-rail nav{display:flex;flex-direction:column;gap:5px}
.dashboard-v2 .v2-global-rail button{
  width:100%;
  min-height:64px;
  padding:7px 2px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:5px;
  border:1px solid transparent;
  border-radius:11px;
  background:transparent;
  color:#aebed5;
  font:inherit;
  font-size:10.5px;
  font-weight:600;
  cursor:pointer;
  transition:background .15s,color .15s,border-color .15s;
}
.dashboard-v2 .v2-global-rail button svg{width:22px;height:22px}
.dashboard-v2 .v2-global-rail button:hover{background:rgba(255,255,255,.07);color:#fff}
.dashboard-v2 .v2-global-rail button.active{
  background:linear-gradient(150deg,#2f6cf0,#2559dc);
  border-color:rgba(255,255,255,.18);
  color:#fff;
  box-shadow:0 9px 22px -13px rgba(37,99,235,.95);
}
.dashboard-v2 .v2-rail-bottom{margin-top:auto;display:flex;flex-direction:column;gap:5px}
.dashboard-v2 .v2-rail-bottom:before{content:"";height:1px;margin:3px 6px 5px;background:rgba(255,255,255,.1)}
.dashboard-v2 .v2-avatar{
  display:flex;
  align-items:center;
  justify-content:center;
  width:31px;
  height:31px;
  border-radius:50%;
  background:linear-gradient(145deg,#3f7cf4,#2260dc);
  color:#fff;
  font-size:12px;
  font-weight:700;
}

/* The existing sidebar becomes the contextual rail. Original links stay in the DOM for the
   existing router, gates, tests, and instant rollback, while the focused shell renders above them. */
.dashboard-v2.v2-ready .aside{
  position:sticky;
  top:0;
  z-index:16;
  box-sizing:border-box;
  width:auto;
  height:100vh;
  min-width:0;
  padding:15px 12px 13px!important;
  overflow-y:auto;
  background:#fff!important;
  color:var(--v2-copy)!important;
  border-right:1px solid var(--v2-line)!important;
  box-shadow:none!important;
}
.dashboard-v2.v2-ready .aside > .navlabel,
.dashboard-v2.v2-ready .aside > a[data-view],
.dashboard-v2.v2-ready .aside > .navsub,
.dashboard-v2.v2-ready .aside > .navmore{display:none!important}
.dashboard-v2.v2-ready .aside > .asidestat,
.dashboard-v2.v2-ready .aside > .acctrow{display:none!important}
.dashboard-v2.v2-ready .aside .wsswitch{
  min-height:54px;
  margin:0 0 9px;
  padding:7px 8px!important;
  background:transparent!important;
  border:0!important;
  border-radius:10px;
  box-shadow:none!important;
}
.dashboard-v2.v2-ready .aside .wsswitch:hover{background:var(--v2-soft)!important}
.dashboard-v2.v2-ready .aside .wsmark{display:none!important}
.dashboard-v2.v2-ready .aside .wsmeta{min-width:0}
.dashboard-v2.v2-ready .aside .wsmeta b{
  color:var(--v2-ink)!important;
  font-size:14px;
  font-weight:730;
  letter-spacing:-.015em;
  line-height:1.18;
  white-space:normal;
}
.dashboard-v2.v2-ready .aside .wsmeta i{color:var(--v2-muted)!important;font-size:10.5px;margin-top:3px}
.dashboard-v2.v2-ready .aside .wschev{color:#a8b2c3!important}
.dashboard-v2.v2-ready .aside .wspanel{
  left:10px;
  right:10px;
  top:72px;
  width:auto;
  border-color:var(--v2-line);
  border-radius:13px;
  box-shadow:0 18px 45px -20px rgba(15,23,42,.35);
}

.dashboard-v2 .v2-mode-card{position:relative;padding:7px 0 10px;border-top:1px solid var(--v2-line);border-bottom:1px solid var(--v2-line)}
.dashboard-v2 .v2-mode-button{
  width:100%;
  min-height:44px;
  display:grid;
  grid-template-columns:31px minmax(0,1fr) 14px;
  gap:8px;
  align-items:center;
  padding:6px 7px;
  border:0;
  border-radius:9px;
  background:transparent;
  color:var(--v2-ink);
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.dashboard-v2 .v2-mode-button:hover{background:var(--v2-soft)}
.dashboard-v2 .v2-mode-shield{width:31px;height:31px;display:flex;align-items:center;justify-content:center;border-radius:9px;background:#eaf1ff;color:var(--v2-blue)}
.dashboard-v2 .v2-mode-shield svg{width:17px;height:17px}
.dashboard-v2 .v2-mode-button strong{display:block;font-size:12.5px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dashboard-v2 .v2-mode-button small{display:block;margin-top:2px;color:var(--v2-muted);font-size:9.8px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dashboard-v2 .v2-mode-caret{color:#9aa5b7;text-align:center}
.dashboard-v2 .v2-authority{display:inline-flex;align-items:center;gap:6px;margin:5px 7px 0;padding:4px 8px;border-radius:999px;background:#edf8f2;color:#227351;font-size:9.8px;font-weight:650}
.dashboard-v2 .v2-authority i{width:6px;height:6px;border-radius:50%;background:#22a06b}
.dashboard-v2 .v2-access-card{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:7px;
  margin:7px 0 4px;
  padding:11px 8px 10px;
  border-top:1px solid var(--v2-line);
  border-bottom:1px solid var(--v2-line);
}
.dashboard-v2 .v2-access-card>span:first-child{min-width:0}
.dashboard-v2 .v2-access-card>span:first-child strong{display:block;color:var(--v2-ink);font-size:12px;line-height:1.25}
.dashboard-v2 .v2-access-card>span:first-child small{display:block;margin-top:3px;color:var(--v2-muted);font-size:9.5px;line-height:1.35}
.dashboard-v2 .v2-access-card .v2-authority{margin:0;padding:4px 7px}
.dashboard-v2 .v2-mode-menu{
  position:absolute;
  z-index:80;
  top:57px;
  left:0;
  width:290px;
  padding:8px;
  border:1px solid var(--v2-line);
  border-radius:13px;
  background:#fff;
  box-shadow:0 22px 55px -22px rgba(15,23,42,.36);
}
.dashboard-v2 .v2-mode-menu[hidden]{display:none}
.dashboard-v2 .v2-menu-heading{padding:7px 8px 9px;border-bottom:1px solid var(--v2-line);margin-bottom:4px}
.dashboard-v2 .v2-menu-heading strong{display:block;font-size:12px;color:var(--v2-ink)}
.dashboard-v2 .v2-menu-heading small{display:block;margin-top:3px;color:var(--v2-muted);font-size:10.5px}
.dashboard-v2 .v2-mode-menu button{
  width:100%;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  padding:8px 9px;
  border:0;
  border-radius:8px;
  background:#fff;
  color:var(--v2-copy);
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.dashboard-v2 .v2-mode-menu button:hover,.dashboard-v2 .v2-mode-menu button.active{background:#f2f6ff;color:var(--v2-ink)}
.dashboard-v2 .v2-mode-menu button strong{display:block;font-size:11.5px}
.dashboard-v2 .v2-mode-menu button small{display:block;margin-top:2px;color:var(--v2-muted);font-size:9.8px}
.dashboard-v2 .v2-mode-menu button b{visibility:hidden;color:var(--v2-blue)}
.dashboard-v2 .v2-mode-menu button.active b{visibility:visible}

.dashboard-v2 .v2-context-block{padding:14px 0 8px}
.dashboard-v2 .v2-context-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 8px 7px}
.dashboard-v2 .v2-context-heading span{font-size:10px;font-weight:750;letter-spacing:.08em;text-transform:uppercase;color:#667085}
.dashboard-v2 .v2-context-heading small{max-width:112px;color:#98a2b3;font-size:9.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dashboard-v2 .v2-context-nav{display:flex;flex-direction:column;gap:3px}
.dashboard-v2 .v2-context-nav button{
  width:100%;
  min-width:0;
  display:grid;
  grid-template-columns:28px minmax(0,1fr) 12px;
  align-items:center;
  gap:8px;
  padding:9px 8px;
  border:1px solid transparent;
  border-radius:9px;
  background:transparent;
  color:var(--v2-copy);
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.dashboard-v2 .v2-context-nav button:hover{background:var(--v2-soft);color:var(--v2-ink)}
.dashboard-v2 .v2-context-nav button.active{background:#edf3ff;border-color:#e1eaff;color:#174fcb}
.dashboard-v2 .v2-context-icon{width:28px;height:28px;display:flex;align-items:center;justify-content:center;border-radius:8px;color:#6b7890}
.dashboard-v2 .v2-context-nav button.active .v2-context-icon{background:#fff;color:var(--v2-blue);box-shadow:0 1px 3px rgba(15,23,42,.08)}
.dashboard-v2 .v2-context-nav svg{width:15px;height:15px}
.dashboard-v2 .v2-context-nav button>svg{width:12px;height:12px;color:#a8b2c2}
.dashboard-v2 .v2-context-nav strong{display:block;font-size:11.8px;font-weight:650;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dashboard-v2 .v2-context-nav small{display:block;margin-top:2px;color:#8a95a7;font-size:9.3px;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.dashboard-v2 .v2-context-nav em{display:block;margin-top:4px;color:#66758b;font-size:8.8px;font-style:normal;line-height:1.3}
.dashboard-v2 .v2-door-shortcut{
  width:100%;
  min-width:0;
  display:grid;
  grid-template-columns:28px minmax(0,1fr) 12px;
  align-items:center;
  gap:8px;
  padding:9px 8px;
  border:1px solid #d8e5f7;
  border-radius:10px;
  background:#f7faff;
  color:var(--v2-copy);
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.dashboard-v2 .v2-door-shortcut:hover{border-color:#bfd2f0;background:#f0f6ff;color:var(--v2-ink)}
.dashboard-v2 .v2-door-shortcut .v2-context-icon svg{width:15px;height:15px}
.dashboard-v2 .v2-door-shortcut>span:nth-child(2){min-width:0}
.dashboard-v2 .v2-door-shortcut strong{display:block;color:var(--v2-ink);font-size:11.8px}
.dashboard-v2 .v2-door-shortcut small{display:block;margin-top:2px;overflow:hidden;color:var(--v2-muted);font-size:9.3px;text-overflow:ellipsis;white-space:nowrap}
.dashboard-v2 .v2-door-shortcut>svg{width:12px;height:12px;color:#8ea1bc}
.dashboard-v2 .v2-all-workflows{
  width:100%;
  min-width:0;
  display:grid;
  grid-template-columns:27px minmax(0,1fr) 12px;
  align-items:center;
  gap:8px;
  padding:10px 9px;
  border:1px solid var(--v2-line);
  border-radius:10px;
  background:#fff;
  color:var(--v2-copy);
  font:inherit;
  text-align:left;
  cursor:pointer;
}
.dashboard-v2 .v2-all-workflows:hover{border-color:#cbd7ea;background:#fbfcfe}
.dashboard-v2 .v2-all-workflows>svg{width:18px;height:18px;color:#60708a}
.dashboard-v2 .v2-all-workflows strong{display:block;font-size:11.8px;color:var(--v2-ink)}
.dashboard-v2 .v2-all-workflows small{display:block;margin-top:2px;font-size:9.5px;color:var(--v2-muted)}
.dashboard-v2 .v2-all-workflows>svg:last-child{width:12px;height:12px;color:#9aa6b8}
.dashboard-v2.v2-ready .aside>.upcard{margin-top:9px!important;border-radius:10px!important;background:var(--v2-soft)!important;border-color:var(--v2-line)!important}
.dashboard-v2.v2-ready .aside>.upcard b{color:var(--v2-ink)!important}
.dashboard-v2.v2-ready .aside>.upcard p{color:var(--v2-copy)!important}

/* Existing live content and controls keep their behavior; the shell removes visual weight. */
.dashboard-v2.v2-ready .amain{min-width:0;zoom:1;background:#f8fafc!important}
.dashboard-v2.v2-ready .atop{
  min-height:64px;
  box-sizing:border-box;
  padding:10px 18px!important;
  gap:12px!important;
  background:rgba(255,255,255,.94)!important;
  border-bottom:1px solid var(--v2-line)!important;
  box-shadow:none!important;
  backdrop-filter:saturate(1.2) blur(12px)!important;
}
.dashboard-v2.v2-ready .atop .ttl{font-size:12.5px!important;font-weight:700!important;color:var(--v2-ink)!important}
.dashboard-v2.v2-ready .atop .topsearch{flex:0 1 510px;min-width:190px;max-width:510px;height:40px;border-color:var(--v2-line);border-radius:9px;background:#fff;box-shadow:0 1px 2px rgba(15,23,42,.03)}
.dashboard-v2.v2-ready .atop .right{gap:8px}
.dashboard-v2.v2-ready .atop .btn.topnew{min-height:40px;border-radius:8px;background:var(--v2-blue);box-shadow:0 6px 14px -9px rgba(37,99,235,.8)}
.dashboard-v2.v2-ready .atop .periodctl{height:38px;border-color:var(--v2-line);border-radius:8px;background:#fff}
.dashboard-v2.v2-ready .atop .planpill{border-radius:999px;padding:5px 9px}
.dashboard-v2.v2-ready .acontent{max-width:none;margin:0;padding:25px 26px 48px}
.dashboard-v2.v2-ready .pagehead{margin-bottom:17px}
.dashboard-v2.v2-ready .pagehead h1,.dashboard-v2.v2-ready .pagehead h2{font-size:24px;letter-spacing:-.025em}
.dashboard-v2.v2-ready .ph-sub{max-width:760px;color:#667085;line-height:1.5}
.dashboard-v2.v2-ready :is(.panel-card,.ckcard,.recscard,.dashcard,.rg-panel,.settings-card){border-color:var(--v2-line);box-shadow:0 1px 2px rgba(15,23,42,.025)}
.dashboard-v2.v2-ready .btn.btn-primary{background:var(--v2-blue)}

/* Complete launcher: all live feature destinations stay one action away even though the rail is focused. */
.v2-launcher{
  position:fixed;
  inset:0;
  z-index:500;
  display:flex;
  align-items:flex-start;
  justify-content:center;
  padding:7vh 20px 30px;
  background:rgba(8,18,35,.42);
  backdrop-filter:blur(8px);
}
.v2-launcher[hidden]{display:none}
.v2-launcher-card{
  width:min(850px,100%);
  max-height:86vh;
  display:flex;
  flex-direction:column;
  overflow:hidden;
  border:1px solid rgba(255,255,255,.75);
  border-radius:17px;
  background:#fff;
  color:#0f172a;
  box-shadow:0 35px 100px -35px rgba(5,15,32,.55);
}
.v2-launcher-head{display:flex;align-items:flex-start;justify-content:space-between;gap:18px;padding:17px 19px 14px;border-bottom:1px solid #e7ebf2}
.v2-launcher-head strong{display:block;font-size:16px;letter-spacing:-.015em}
.v2-launcher-head small{display:block;margin-top:4px;color:#7a8598;font-size:11.5px;line-height:1.4}
.v2-launcher-head>button{width:31px;height:31px;border:0;border-radius:8px;background:#f5f7fa;color:#667085;font-size:20px;cursor:pointer}
.v2-launcher-search{height:43px;margin:14px 18px 8px;display:flex;align-items:center;gap:9px;padding:0 12px;border:1px solid #dfe5ee;border-radius:10px;background:#fff}
.v2-launcher-search:focus-within{border-color:#8eb1fa;box-shadow:0 0 0 3px rgba(37,99,235,.1)}
.v2-launcher-search svg{width:18px;height:18px;color:#7b879a;flex:none}
.v2-launcher-search input{min-width:0;flex:1;border:0;outline:0;background:transparent;color:#0f172a;font:inherit;font-size:13px}
.v2-launcher-body{padding:8px 18px 20px;overflow-y:auto}
.v2-launcher-body section{padding-top:11px}
.v2-launcher-body h3{margin:0 0 6px;font-size:9.5px;letter-spacing:.1em;text-transform:uppercase;color:#8792a5}
.v2-launcher-body section>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px}
.v2-launcher-body button{min-width:0;display:grid;grid-template-columns:minmax(0,1fr) 14px;align-items:center;gap:8px;padding:10px 11px;border:1px solid transparent;border-radius:9px;background:#fff;color:#475569;font:inherit;text-align:left;cursor:pointer}
.v2-launcher-body button:hover{background:#f5f8fd;border-color:#e5eaf2}
.v2-launcher-body button strong{display:block;font-size:12.5px;color:#172033}
.v2-launcher-body button small{display:block;margin-top:2px;color:#7d889a;font-size:10.5px;line-height:1.35;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.v2-launcher-body button svg{width:13px;height:13px;color:#a5afbe}
.v2-launcher-empty{padding:38px 10px;text-align:center;color:#7d889a;font-size:13px}

@media(max-width:1180px) and (min-width:881px){
  .dashboard-v2.v2-ready .appshell{grid-template-columns:72px 214px minmax(0,1fr)}
  .dashboard-v2 .v2-global-rail{padding-left:7px;padding-right:7px}
  .dashboard-v2.v2-ready .acontent{padding-left:20px;padding-right:20px}
  .dashboard-v2.v2-ready .atop .periodctl{display:none}
}

@media(max-width:880px){
  .dashboard-v2.v2-ready .appshell{display:block}
  .dashboard-v2 .v2-global-rail{display:none}
  .dashboard-v2.v2-ready .aside{display:none!important}
  .dashboard-v2.v2-ready .amain{width:100%;zoom:1}
  .dashboard-v2.v2-ready .atop{padding:10px 14px!important}
  .dashboard-v2.v2-ready .acontent{padding:18px 14px 42px}
  .dashboard-v2.v2-ready .mnavbar{display:flex}
}

@media(max-width:620px){
  .v2-launcher{padding:0;align-items:stretch}
  .v2-launcher-card{max-height:none;height:100%;border:0;border-radius:0}
  .v2-launcher-body section>div{grid-template-columns:1fr}
}

@media(prefers-reduced-motion:reduce){
  .dashboard-v2 .v2-global-rail button,.dashboard-v2 .v2-context-nav button{transition:none}
  .v2-launcher{backdrop-filter:none}
}
