/* Admin frame v21.0. Hover menus and fully expanded navigation lists.
   Service CSS styles content only. Avoid nth-child placement and mode-specific
   frame dimensions: dynamically mounted services use this same container. */
:root { --admin-rail-width:256px; --admin-shell-line:#d6e0ed; --admin-navy:#102745; }
html { scrollbar-gutter:stable; }
body { margin:0; }
.aig-shell { width:100%; max-width:none; margin:0; padding:0; }
#dashboardView { position:relative; padding-top:var(--aig-header-offset,56px); }
/* A service's status text cannot wrap the header and move the whole frame. */
html body #dashboardView .aig-header {
  display:grid; grid-template-columns:minmax(0,1fr) auto !important;
  grid-template-rows:48px auto; align-items:center; gap:0 16px;
  min-height:64px !important; padding:8px 14px !important;
}
#dashboardView .aig-header .brand-row > div { min-width:0; }
#dashboardView .aig-header h1 { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
@media(max-width:980px) {
  html body #dashboardView .aig-header { grid-template-columns:minmax(0,1fr) !important; }
  html body #dashboardView .aig-header .brand-row { display:none !important; }
}
#adminTopControlBar {
  position:sticky; top:var(--aig-header-offset,56px); z-index:90;
  display:grid; grid-template-columns:var(--admin-rail-width) minmax(0,1fr);
  align-items:stretch; gap:0; height:64px; min-height:64px; width:100%;
  margin:0; padding:0; border:0; border-bottom:1px solid var(--admin-shell-line);
  border-radius:0; background:#f7f9fc; box-shadow:none;
}
#adminTopControlBar .sticky-bar-title {
  display:grid; align-content:center; gap:3px; min-width:0; padding:7px 14px;
  border-right:1px solid var(--admin-shell-line);
}
.sticky-bar-title .eyebrow { margin:0; font-size:9px; letter-spacing:.12em; color:#60799d; }
.sticky-bar-title strong { font-size:16px; line-height:1.2; color:#102745; }
.sticky-bar-title small { font-size:10px; color:#65758c; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#adminTopControlBar .sticky-control-group {
  grid-column:2; grid-row:1; display:flex; align-items:center; justify-content:space-between;
  gap:12px; min-width:0; min-height:0; height:63px; padding:8px 12px;
  overflow-x:auto; overflow-y:hidden; flex-wrap:nowrap; background:#fff; scrollbar-width:thin;
}
#adminTopControlBar .sticky-control-group.hidden { display:none !important; }
.sticky-actions,.sticky-window-bucket { display:flex; align-items:center; flex-wrap:nowrap; gap:8px; }
#adminTopControlBar :is(.window-filter,.asg-window-filter,.asg-directory-window-filter) {
  display:flex; flex-wrap:nowrap; gap:0; margin:0; padding:0; border:1px solid #cbd7e6;
  border-radius:8px; background:#fff; box-shadow:none; width:max-content;
}
#adminTopControlBar :is(.btn,.window-btn,.asg-window-btn,.asg-directory-window-btn) {
  min-height:36px; padding:7px 12px; font-size:11px; white-space:nowrap; box-shadow:none;
}
#adminTopControlBar :is(.window-btn,.asg-window-btn,.asg-directory-window-btn) {
  border:0; border-right:1px solid #dde5ef; border-radius:0; color:#52657d; background:#fff;
}
#adminTopControlBar :is(.window-btn,.asg-window-btn,.asg-directory-window-btn).active { background:#102745; color:#fff; }
#adminTopControlBar #asgDirectoryControlBar { min-height:0; padding:0; }
#adminTopControlBar #asgDirectoryControlBar .dir-v21-toolbar {
  min-height:63px !important; height:63px; width:max-content !important; min-width:100%;
  grid-template-columns:max-content max-content max-content; gap:12px !important;
}
#adminWorkGrid {
  display:grid; grid-template-columns:var(--admin-rail-width) minmax(0,1fr);
  align-items:stretch; gap:0; width:100%; margin:0; padding:0; border:0; background:#fff;
  min-height:calc(100dvh - var(--aig-header-offset,56px) - 64px);
}
#dashboardView .admin-left-rail {
  grid-column:1; grid-row:1; position:relative;
  top:auto; align-self:start;
  height:auto; max-height:none;
  width:100%; min-width:0; max-width:none; min-height:0; margin:0; padding:10px;
  overflow:visible;
  border:0; border-right:1px solid var(--admin-shell-line); border-radius:0;
  background:#f4f7fb; box-shadow:none;
}
#dashboardView .admin-stage-content {
  display:flow-root;
  grid-column:2; grid-row:1; align-self:start; width:100%; max-width:100%; min-width:0;
  margin:0; padding:0; border:0; border-radius:0; background:#fff; box-shadow:none;
  overflow:clip;
}
.admin-mode-panel { display:none !important; min-width:0; width:100%; margin:0; }
.admin-mode-panel.active-admin-mode { display:flow-root !important; }
#dashboardView .admin-stage-content > .admin-mode-panel { margin:0 !important; }
.admin-stage-content .internal-nav,.admin-stage-content .asg-workspace-tabs { display:none; }
.admin-left-rail .rail-group { margin:0; padding:8px 0; }
.admin-left-rail .rail-label { font-size:10px; font-weight:800; line-height:1.4; letter-spacing:.1em; text-transform:uppercase; color:#687c99; margin:0 0 7px; }
#modeTabRail { margin:0; padding:0; }
#modeTabRail .admin-mode-tabs { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:7px; width:100%; padding:0; margin:0; border:0; background:none; }
#adminSectionRails { margin-top:14px; }
#adminSectionRails:empty { display:none; }
#adminUtilityGroup { padding-top:14px; margin-top:14px; border-top:1px solid var(--admin-shell-line); }
#adminUtilityTabs { display:grid; grid-template-columns:minmax(0,1fr); gap:7px; margin:0; padding:0; }
.admin-left-rail .mode-tab {
  --tab-color:#334764; --tab-tint:#edf2f8;
  display:flex; align-items:center; gap:7px; min-width:0; width:100%; min-height:44px;
  padding:9px 8px; margin:0; text-align:left; white-space:normal; cursor:pointer;
  border:1px solid #cfdaea; border-left:3px solid var(--tab-color); border-radius:8px;
  color:var(--tab-color); background:var(--tab-tint); box-shadow:none; transform:none;
}
.admin-left-rail [data-admin-mode="rtdAdminWorkspace"] { --tab-color:#166079; --tab-tint:#eaf7fb; }
.admin-left-rail [data-admin-mode="asgClientsWorkspace"] { --tab-color:#2256ac; --tab-tint:#edf3ff; }
.admin-left-rail [data-admin-mode="asgDirectoryWorkspace"] { --tab-color:#147164; --tab-tint:#eaf8f3; }
.admin-left-rail [data-admin-mode="supportAdminWorkspace"] { --tab-color:#88501c; --tab-tint:#fff4e6; }
.admin-left-rail [data-admin-mode="aigInternalWorkspace"] { --tab-color:#334764; --tab-tint:#edf2f8; }
.admin-left-rail [data-admin-mode="dataAdminWorkspace"] { --tab-color:#6446a0; --tab-tint:#f2edfc; }
.admin-left-rail [data-admin-mode="mailAdminWorkspace"] { --tab-color:#a03464; --tab-tint:#fceef5; }
.admin-left-rail [data-admin-mode="adminDevicesWorkspace"] { --tab-color:#3f696b; --tab-tint:#edf6f5; }
.admin-left-rail .mode-tab:hover { border-color:var(--tab-color); filter:brightness(.98); }
.admin-left-rail .mode-tab.active { background:var(--tab-color); color:#fff; border-color:var(--tab-color); }
.admin-left-rail .mode-tab span { display:grid; place-items:center; flex:0 0 22px; height:22px; border-radius:6px; background:#ffffffaa; color:var(--tab-color); font-size:9px; font-weight:800; }
.admin-left-rail .mode-tab.active span { background:#ffffff24; color:#fff; }
.admin-left-rail .mode-tab strong { min-width:0; font-size:12px; line-height:1.3; font-weight:750; }
.admin-left-rail .mode-tab small,.admin-left-rail .mode-tab br { display:none; }
.admin-left-rail :is(.rail-stack,.rail-group).hidden { display:none !important; }
.admin-left-rail .rail-stack { display:grid; gap:0; margin:0; padding:0; }
.admin-left-rail :is(.rail-stack,.rail-group,#adminSectionRails,#rtdEmbeddedControls,#supportSectionRail,.internal-nav,.asg-workspace-tabs,.asg-directory-workspace-tabs,.wda-tabs,.sa-nav) {
  height:auto; max-height:none; overflow:visible;
}
.admin-left-rail :is(.internal-nav,.asg-workspace-tabs,.asg-directory-workspace-tabs,.wda-tabs,.sa-nav) {
  position:static; display:grid; grid-template-columns:1fr; gap:5px; min-width:0;
  width:100%; margin:0; padding:0; border:0; background:transparent; box-shadow:none;
}
.admin-left-rail :is(.nav-btn,.asg-tab-btn,.asg-directory-tab-btn,.wda-tab) {
  display:flex; align-items:center; gap:8px; width:100%; min-width:0; min-height:42px;
  margin:0; padding:9px 10px; border:1px solid #d9e2ee; border-radius:7px;
  text-align:left; font-family:inherit; font-size:12px; font-weight:600; line-height:1.35; white-space:normal; color:#334764;
  background:#fff; box-shadow:none; transform:none; cursor:pointer;
}
.admin-left-rail :is(.nav-btn,.asg-tab-btn,.asg-directory-tab-btn,.wda-tab) span { flex:0 0 auto; font-size:10px; color:#6c83a3; }
.admin-left-rail :is(.nav-btn.active,.asg-tab-btn.active,.asg-directory-tab-btn.active,.wda-tab.is-active) { color:#fff; background:#102745; border-color:#102745; }
.admin-left-rail :is(.nav-btn.active,.asg-tab-btn.active,.asg-directory-tab-btn.active,.wda-tab.is-active) span { color:#dce9ff; }
.admin-left-rail :is(button,a):focus-visible { outline:3px solid #2e76d9; outline-offset:2px; }
#rtdEmbeddedControls { max-height:none; }
/* Navigation remains in document flow on narrow screens as well. */
@media (max-width:760px) {
  html body #dashboardView .aig-header .apple-clock { display:none !important; }
  html body #dashboardView .aig-header .header-right { width:100%; gap:8px !important; overflow:visible; }
  #adminTopControlBar { grid-template-columns:minmax(0,1fr); height:108px; min-height:108px; }
  #adminTopControlBar .sticky-bar-title { grid-row:1; min-height:44px; height:44px; padding:5px 12px; grid-template-columns:auto minmax(0,1fr); align-items:center; border-right:0; }
  #adminTopControlBar .sticky-bar-title .eyebrow { display:none; }
  #adminTopControlBar .sticky-bar-title small { text-align:right; }
  #adminTopControlBar .sticky-control-group { grid-column:1; grid-row:2; height:63px; }
  #adminWorkGrid { grid-template-columns:minmax(0,1fr); min-height:0; }
  #dashboardView .admin-left-rail { grid-column:1; grid-row:1; position:relative; top:auto; height:auto; max-height:none; border-right:0; border-bottom:1px solid var(--admin-shell-line); }
  #dashboardView .admin-stage-content { grid-column:1; grid-row:2; }
  #adminSectionRails { margin-top:10px; }
}

/* Dual navigation: compact branding in both modes; one opt-in header row.
   Original service navigation stays mounted to preserve state and handlers. */
html body #dashboardView .aig-header {
  grid-template-columns:minmax(300px,1fr) auto !important;
  grid-template-rows:auto !important; gap:8px 16px;
  padding:8px 12px !important; min-height:60px !important;
}
.admin-header-brand { display:flex; align-items:center; gap:16px; min-width:0; }
html body #dashboardView .aig-header .brand-row { display:flex !important; align-items:center; flex:0 0 auto; }
html body #dashboardView .aig-header h1 { font-size:16px !important; line-height:1.2 !important; margin:0; }
html body #dashboardView .aig-header h1 span { display:block; font-size:10px; letter-spacing:.09em; text-transform:uppercase; color:#6a7a91; margin-top:2px; }
html body #dashboardView .aig-header .brand-mark { width:30px !important; height:30px !important; flex-basis:30px; background:transparent; box-shadow:none; }
.admin-navigation-layout { display:inline-flex; flex:0 0 auto; padding:3px; gap:2px; border:1px solid #d2ddec; border-radius:10px; background:#eaf0f8; }
.admin-navigation-layout[hidden], #adminHeaderNavigation[hidden], .admin-header-sections[hidden] { display:none !important; }
.admin-navigation-layout button { min-height:36px; padding:6px 11px; border:0; border-radius:7px; background:transparent; color:#526780; font-family:inherit; font-size:11px; line-height:1.2; font-weight:700; cursor:pointer; }
.admin-navigation-layout button[aria-pressed="true"] { color:#153450; background:#fff; box-shadow:0 1px 4px #15345018; }
html body #dashboardView .aig-header .header-right { min-width:0; max-width:100%; overflow:visible !important; }
html body #dashboardView .aig-header #topStatus { max-width:220px; overflow:hidden; text-overflow:ellipsis; }
html body #dashboardView .aig-header .asg-directory-header-status { max-width:205px; min-width:0; }
html body #dashboardView .session-expiry-warning { width:100%; margin:0; padding:8px; grid-column:1/-1; border-radius:6px; white-space:normal; flex-wrap:wrap; }
#adminHeaderNavigation { grid-column:1/-1; display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); gap:6px; min-width:0; padding:0; margin:0; }
.admin-header-tab { --tab-color:#334764; --tab-tint:#edf2f8; display:flex; align-items:center; justify-content:center; gap:8px; min-width:0; min-height:44px; padding:8px 10px; margin:0; border:1px solid #d2deec; border-top:3px solid var(--tab-color); border-radius:8px; background:var(--tab-tint); color:var(--tab-color); font-family:inherit; font-size:12px; font-weight:750; line-height:1.25; cursor:pointer; }
.admin-header-tab[data-header-mode="rtdAdminWorkspace"] { --tab-color:#166079; --tab-tint:#eaf7fb; }
.admin-header-tab[data-header-mode="asgClientsWorkspace"] { --tab-color:#2256ac; --tab-tint:#edf3ff; }
.admin-header-tab[data-header-mode="asgDirectoryWorkspace"] { --tab-color:#147164; --tab-tint:#eaf8f3; }
.admin-header-tab[data-header-mode="supportAdminWorkspace"] { --tab-color:#88501c; --tab-tint:#fff4e6; }
.admin-header-tab[data-header-mode="dataAdminWorkspace"] { --tab-color:#6446a0; --tab-tint:#f2edfc; }
.admin-header-tab[data-header-mode="mailAdminWorkspace"] { --tab-color:#a03464; --tab-tint:#fceef5; }
.admin-header-tab[data-header-mode="adminDevicesWorkspace"] { --tab-color:#3f696b; --tab-tint:#edf6f5; }
.admin-header-tab:hover { border-color:var(--tab-color); }
.admin-header-tab.is-active { background:var(--tab-color); color:#fff; border-color:var(--tab-color); }
.admin-header-tab:disabled { opacity:.5; cursor:wait; }
.admin-header-chevron { font-size:15px; line-height:1; }
.admin-header-tab[aria-expanded="true"] .admin-header-chevron { transform:rotate(180deg); }
.admin-header-sections { position:absolute; z-index:999999; box-sizing:border-box; height:auto; max-height:none; overflow:visible; padding:8px; border:1px solid #d1ddeb; border-radius:12px; background:#fff; color:#19334f; box-shadow:0 16px 40px #172f5329; }
.admin-header-section-items { display:grid; grid-auto-flow:column; grid-template-columns:repeat(var(--menu-columns,1),minmax(0,1fr)); grid-template-rows:repeat(var(--menu-rows,1),auto); gap:2px 8px; }
.admin-header-sections-title { margin:0; padding:8px 10px 10px; font-size:10px; font-weight:800; letter-spacing:.09em; text-transform:uppercase; color:#72839b; }
.admin-header-sections button { display:block; width:100%; min-width:0; min-height:42px; padding:10px 12px; border:0; border-radius:7px; text-align:left; white-space:normal; overflow-wrap:anywhere; color:#284361; background:transparent; font-family:inherit; font-size:12px; font-weight:600; line-height:1.35; cursor:pointer; }
.admin-header-sections button:hover, .admin-header-sections button:focus-visible { background:#edf4ff; color:#184c90; }
.admin-header-sections button[aria-current="page"] { background:#123452; color:#fff; }
.admin-header-sections button:disabled { opacity:.5; cursor:default; }
.admin-header-menu-notice { margin:0; padding:12px; font-size:12px; color:#6a7e96; }
:is(.admin-navigation-layout button,.admin-header-tab,.admin-header-sections button):focus-visible { outline:3px solid #5597f0; outline-offset:2px; }
#dashboardView[data-admin-navigation="header"] .admin-left-rail { display:none !important; }
#dashboardView[data-admin-navigation="header"] #adminWorkGrid { grid-template-columns:minmax(0,1fr); }
#dashboardView[data-admin-navigation="header"] .admin-stage-content { grid-column:1; grid-row:1; }
#dashboardView[data-admin-navigation="header"] #adminTopControlBar { grid-template-columns:200px minmax(0,1fr); }
@media(max-width:1240px) {
  html body #dashboardView .aig-header { grid-template-columns:minmax(0,1fr) !important; gap:6px; }
  .admin-header-brand { justify-content:space-between; }
  html body #dashboardView .aig-header .header-right { justify-content:flex-start !important; width:100%; min-height:44px; }
  html body #dashboardView .aig-header .session-header-actions { margin-left:auto !important; }
  html body #dashboardView .aig-header .apple-clock { display:none !important; }
}
@media(max-width:800px) {
  #adminHeaderNavigation { grid-template-columns:repeat(4,minmax(0,1fr)); gap:5px; }
  .admin-header-tab { padding:7px 5px; font-size:11px; gap:5px; }
}
@media(max-width:760px) {
  #dashboardView[data-admin-navigation="header"] #adminTopControlBar { grid-template-columns:minmax(0,1fr); }
}
@media(max-width:600px) {
  html body #dashboardView .aig-header { padding:6px 8px !important; }
  html body #dashboardView .aig-header .header-right { display:grid !important; grid-template-columns:minmax(0,1fr) auto; grid-template-rows:40px; align-items:center; gap:6px !important; }
  html body #dashboardView .aig-header .tools-menu { grid-column:1; grid-row:1; width:max-content; }
  html body #dashboardView .aig-header .session-header-actions { grid-column:2; grid-row:1; }
  html body #dashboardView .aig-header .asg-directory-header-status { grid-column:1/-1; grid-row:2; max-width:none; width:100%; }
  html body #dashboardView .aig-header .asg-directory-header-status strong { font-size:10px; }
  .admin-header-brand { gap:8px; }
  .admin-navigation-layout button { min-height:40px; padding:6px 10px; }
  html body #dashboardView .aig-header h1 { font-size:13px !important; }
}
@media(prefers-reduced-motion:no-preference) {
  .admin-header-sections:not([hidden]) { animation:admin-sections-in .14s ease-out; }
  @keyframes admin-sections-in { from { opacity:0; transform:translateY(-4px); } to { opacity:1; transform:translateY(0); } }
}
@media print {
  #adminHeaderNavigation, .admin-header-sections, .admin-navigation-layout { display:none !important; }
}
