/* Shared desktop shell; existing editors and tables keep their Bootstrap contracts. */
:root {
  --workspace-accent: #315eaa;
  --workspace-muted: #647184;
  --workspace-panel: #f4f6f9;
  --workspace-line: #dfe4eb;
  --workspace-selected: #e7eef9;
  --workspace-sidebar-width: 248px;
}
:root[data-bs-theme="dark"] {
  --workspace-accent: #96b9f1;
  --workspace-muted: #a1aebf;
  --workspace-panel: #1c222d;
  --workspace-line: #333d4c;
  --workspace-selected: #293c57;
  --bs-body-bg: #202733;
  --bs-body-bg-rgb: 32, 39, 51;
  --bs-body-color: #e3e8f0;
  --bs-secondary-color: #a1aebf;
  --bs-tertiary-bg: #252e3b;
  --bs-border-color: #333d4c;
}
.management-app { height: 100dvh; min-height: 0; overflow: hidden; color: var(--bs-body-color); background: var(--bs-body-bg); }
.management-app .btn-primary { --bs-btn-bg: #315eaa; --bs-btn-border-color: #315eaa; --bs-btn-hover-bg: #284f91; --bs-btn-hover-border-color: #284f91; --bs-btn-active-bg: #244782; background-color: var(--bs-btn-bg); border-color: var(--bs-btn-border-color); }
.management-app .btn-outline-primary { --bs-btn-color: var(--workspace-accent); --bs-btn-border-color: var(--workspace-accent); --bs-btn-hover-bg: #315eaa; --bs-btn-hover-border-color: #315eaa; }
:root[data-bs-theme="dark"] .management-app .module-tabs a.active { color: var(--workspace-accent); }
.management-app a { text-underline-offset: 3px; }
.workspace-icon { width: 18px; height: 18px; flex: 0 0 auto; }
.workspace-titlebar { height: 61px; flex-shrink: 0; display: flex; align-items: center; gap: 24px; padding: 0 22px 0 14px; border-bottom: 1px solid var(--workspace-line); background: var(--bs-body-bg); z-index: 20; }
.workspace-brand-area { display: flex; align-items: center; gap: 12px; width: 220px; flex: 0 0 auto; }
.workspace-brand { display: flex; align-items: center; }
.workspace-brand img { width: 165px; height: 38px; object-fit: contain; object-position: left; }
.workspace-icon-button { display: grid; place-items: center; width: 30px; height: 30px; border: 0; border-radius: 4px; background: transparent; color: var(--workspace-muted); transition: background 140ms ease; }
.workspace-icon-button:hover { background: var(--workspace-selected); color: var(--workspace-accent); }
.workspace-window-title { font-size: 12px; color: var(--workspace-muted); border-left: 1px solid var(--workspace-line); padding-left: 22px; }
.workspace-user-nav { flex-direction: row; align-items: center; gap: 16px; margin-left: auto; }
.workspace-user-identity { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--workspace-muted); }
.workspace-user-identity > span:last-child { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-avatar { display: grid; place-items: center; border: 1px solid var(--workspace-line); background: var(--workspace-panel); width: 28px; height: 28px; border-radius: 50%; font-size: 11px; font-weight: 650; color: var(--workspace-accent); }
.workspace-frame { display: flex; flex: 1 1 auto; overflow: hidden; min-height: 0; }
.workspace-sidebar { width: var(--workspace-sidebar-width); flex: 0 0 var(--workspace-sidebar-width); display: flex; flex-direction: column; background: var(--workspace-panel); border-right: 1px solid var(--workspace-line); overflow: hidden; transition: margin-left 180ms ease; }
.workspace-nav-collapsed .workspace-sidebar { margin-left: calc(-1 * var(--workspace-sidebar-width)); }
.workspace-nav-search { display: flex; align-items: center; margin: 18px 14px 8px; padding: 7px 9px; border: 1px solid var(--workspace-line); background: var(--bs-body-bg); border-radius: 5px; color: var(--workspace-muted); }
.workspace-nav-search .workspace-icon { width: 15px; height: 15px; }
.workspace-nav-search input { width: 100%; min-width: 0; padding: 0 7px; font-size: 12px; outline: none; border: 0; background: transparent; color: var(--bs-body-color); }
.workspace-nav-search:focus-within { border-color: var(--workspace-accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--workspace-accent) 15%, transparent); }
.workspace-nav-search kbd { background: var(--workspace-panel); color: var(--workspace-muted); border: 1px solid var(--workspace-line); padding: 0 4px; font: 11px "Segoe UI", sans-serif; }
.workspace-navigation { overflow: auto; flex: 1; padding: 9px 10px 20px; scrollbar-width: thin; }
.workspace-nav-heading { margin: 4px 12px 8px; color: var(--workspace-muted); text-transform: uppercase; font-size: 10px; font-weight: 650; letter-spacing: .1em; }
.workspace-nav-link { display: flex; align-items: center; gap: 10px; min-height: 31px; padding: 6px 11px; border-radius: 4px; color: var(--bs-body-color); text-decoration: none; font-size: 12px; transition: background-color 120ms ease, color 120ms ease; }
.workspace-overview { margin-bottom: 18px; }
.workspace-nav-section { margin: 17px 0 0; }
.workspace-nav-section h2 { display: flex; align-items: center; gap: 9px; margin: 0 10px 7px; font-size: 11px; line-height: 1.4; font-weight: 650; color: var(--workspace-muted); }
.workspace-nav-section h2 .workspace-icon { width: 15px; height: 15px; }
.workspace-nav-section > .workspace-nav-link { padding-left: 34px; }
.workspace-nav-link:hover, .workspace-nav-module > summary:hover { background: color-mix(in srgb, var(--workspace-selected) 65%, transparent); color: var(--workspace-accent); }
.workspace-nav-link.is-current { background: var(--workspace-selected); color: var(--workspace-accent); font-weight: 650; box-shadow: inset 2px 0 var(--workspace-accent); }
.workspace-nav-module > summary { display: flex; align-items: center; justify-content: space-between; padding: 7px 12px 7px 34px; border-radius: 4px; list-style: none; font-size: 12px; cursor: pointer; transition: background-color 120ms ease; }
.workspace-nav-module > summary::-webkit-details-marker { display: none; }
.workspace-chevron { width: 5px; height: 5px; border-top: 1px solid currentColor; border-right: 1px solid currentColor; transform: rotate(45deg); transition: transform 150ms ease; color: var(--workspace-muted); }
.workspace-nav-module[open] > summary .workspace-chevron { transform: rotate(135deg); }
.workspace-module-links { margin: 2px 0 5px 40px; padding-left: 8px; border-left: 1px solid var(--workspace-line); animation: workspace-reveal 140ms ease; }
.workspace-nav-empty { padding: 16px 12px; font-size: 12px; color: var(--workspace-muted); }
.workspace-navigation [hidden] { display: none !important; }
.workspace-sidebar-footer { display: flex; align-items: center; gap: 7px; border-top: 1px solid var(--workspace-line); padding: 13px 20px; color: var(--workspace-muted); font-size: 10px; }
.workspace-environment-mark { width: 6px; height: 6px; background: var(--workspace-muted); border-radius: 50%; }
.workspace-stage { min-width: 0; display: flex; flex: 1; flex-direction: column; }
.workspace-contextbar { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; height: 41px; padding: 0 28px; border-bottom: 1px solid var(--workspace-line); }
.workspace-breadcrumb { display: flex; align-items: center; gap: 10px; min-width: 0; font-size: 11px; color: var(--workspace-muted); overflow: hidden; white-space: nowrap; }
.workspace-breadcrumb a { color: var(--workspace-muted); text-decoration: none; }
.workspace-breadcrumb strong { font-weight: 600; color: var(--bs-body-color); overflow: hidden; text-overflow: ellipsis; }
.workspace-context-label { color: var(--workspace-muted); font-size: 10px; letter-spacing: .13em; padding-left: 16px; }
.workspace-stage > .workspace-content { padding: 25px 28px 40px; flex: 1; min-height: 0; overflow: auto; scrollbar-gutter: stable; }
.workspace-statusbar { display: flex; align-items: center; justify-content: space-between; height: 27px; flex-shrink: 0; padding: 0 18px; border-top: 1px solid var(--workspace-line); background: var(--workspace-panel); color: var(--workspace-muted); font-size: 10px; }
.workspace-statusbar a { color: inherit; text-decoration: none; }
.workspace-status-divider { padding: 0 10px; }
.management-app .workspace-page-header { margin-bottom: 22px !important; padding: 0 0 19px !important; }
.management-app .workspace-page-header h1 { font-size: 25px; font-weight: 600 !important; letter-spacing: -.035em; margin-bottom: 6px !important; }
.workspace-eyebrow { color: var(--workspace-muted); text-transform: uppercase; font-size: 10px; letter-spacing: .12em; font-weight: 650; margin: 0 0 9px; }
.workspace-home-heading { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.workspace-home-heading .btn { white-space: nowrap; }
.workspace-directory-section { display: grid; grid-template-columns: minmax(190px, .8fr) minmax(0, 1.65fr); gap: 38px; padding: 22px 0; border-bottom: 1px solid var(--workspace-line); }
.workspace-directory-section:first-child { padding-top: 4px; }
.workspace-directory-heading { display: flex; gap: 13px; padding-top: 11px; }
.workspace-directory-heading > .workspace-icon { color: var(--workspace-accent); margin-top: 1px; }
.management-app .workspace-directory-heading h2 { font-size: 14px; font-weight: 600; margin: 0 0 7px; }
.workspace-directory-heading p { max-width: 260px; color: var(--workspace-muted); font-size: 12px; line-height: 1.65; margin: 0; }
.workspace-directory-link { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 11px 14px; color: var(--bs-body-color); text-decoration: none; border-radius: 4px; transition: background-color 140ms ease; }
.workspace-directory-link:hover { background: var(--workspace-panel); color: var(--workspace-accent); }
.workspace-directory-link strong { display: block; font-size: 13px; font-weight: 600; }
.workspace-directory-link div > span { display: block; color: var(--workspace-muted); font-size: 12px; margin-top: 4px; }
.workspace-directory-action { color: var(--workspace-muted); font-size: 11px; flex-shrink: 0; }
.workspace-directory-action > span { margin-left: 10px; }
.workspace-welcome { max-width: 850px; margin: 5vh auto; padding: 20px; }
.workspace-welcome h1 { font-size: clamp(25px, 3vw, 38px); letter-spacing: -.04em; margin: 16px 0; }
.workspace-welcome > p:not(.workspace-eyebrow) { max-width: 570px; color: var(--workspace-muted); line-height: 1.8; margin-bottom: 25px; }
.workspace-welcome-index { margin-top: 48px; border-top: 1px solid var(--workspace-line); }
.workspace-welcome-index > div { display: grid; grid-template-columns: 30px 1fr; gap: 5px 15px; padding: 20px 0; border-bottom: 1px solid var(--workspace-line); }
.workspace-welcome-index span { color: var(--workspace-muted); font-size: 11px; }
.workspace-welcome-index strong { font-weight: 600; font-size: 14px; }
.workspace-welcome-index p { grid-column: 2; margin: 0; font-size: 12px; color: var(--workspace-muted); }
.management-app .main-content .table thead th { color: var(--workspace-muted); font-size: 11px; padding-block: 10px !important; }
.management-app .main-content .table td { padding-block: 9px !important; }
.workspace-skip-link { position: absolute; top: -100px; left: 15px; background: var(--bs-body-bg); padding: 10px; z-index: 1100; }
.workspace-skip-link:focus { top: 8px; }
.workspace-navigation a:focus-visible, .workspace-navigation summary:focus-visible, .workspace-icon-button:focus-visible { outline: 2px solid var(--workspace-accent); outline-offset: -2px; }
@keyframes workspace-reveal { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 1100px) {
  .workspace-window-title { display: none; }
  .workspace-stage > .workspace-content { padding: 22px 20px 32px; }
  .workspace-contextbar { padding-inline: 20px; }
  .workspace-directory-section { grid-template-columns: 180px minmax(0, 1fr); gap: 20px; }
  .workspace-directory-action { font-size: 0; }
  .workspace-directory-action > span { font-size: 14px; }
}
@media (max-width: 900px) {
  .workspace-sidebar { position: fixed; top: 61px; bottom: 27px; z-index: 15; box-shadow: 12px 0 28px #00000014; }
  .workspace-nav-collapsed .workspace-sidebar { box-shadow: none; }
  .workspace-brand-area { width: auto; }
  .workspace-user-nav { gap: 8px; }
  .workspace-user-identity > span:last-child { display: none; }
}
@media (max-width: 600px) {
  .workspace-titlebar { padding: 0 10px; gap: 10px; }
  .workspace-brand-area { gap: 6px; }
  .workspace-brand img { width: 120px; }
  .workspace-user-identity { display: none; }
  .management-app .workspace-user-nav .btn { padding-inline: 7px; min-height: 32px; }
  .workspace-user-nav .theme-toggle { min-width: 48px; }
  .workspace-contextbar { padding: 0 14px; }
  .workspace-breadcrumb > span:not([aria-hidden]) { display: none; }
  .workspace-breadcrumb > span[aria-hidden] ~ span[aria-hidden] { display: none; }
  .workspace-stage > .workspace-content { padding: 20px 14px 30px; }
  .workspace-home-heading { align-items: flex-start; flex-direction: column; gap: 16px; }
  .workspace-directory-section { grid-template-columns: 1fr; gap: 14px; }
  .workspace-directory-link { padding-inline: 0; }
  .workspace-statusbar { font-size: 9px; padding-inline: 10px; }
  .workspace-status-divider { padding-inline: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .workspace-sidebar, .workspace-chevron, .workspace-nav-link, .workspace-directory-link, .workspace-icon-button { transition: none; }
  .workspace-module-links { animation: none; }
}
