:root {
  /* BPMN / bpmn.io — базовая палитра (затемнённая шкала серого) */
  --bpmn-grey-15: hsl(225, 10%, 15%);
  --bpmn-grey-35: hsl(225, 10%, 32%);
  --bpmn-grey-55: hsl(225, 10%, 49%);
  --bpmn-grey-75: hsl(225, 10%, 68%);
  --bpmn-grey-95: hsl(225, 10%, 88%);
  --bpmn-grey-97: hsl(225, 10%, 92%);
  --bpmn-blue: hsl(205, 100%, 50%);
  --bpmn-blue-hover: hsl(205, 100%, 45%);
  --bpmn-blue-soft: hsl(205, 100%, 93%);
  --bpmn-white: #ffffff;
  --bpmn-canvas: #ffffff;
  --bpmn-surface: hsl(225, 10%, 94%);
  --bpmn-border: var(--bpmn-grey-75);
  --bpmn-border-strong: var(--bpmn-grey-15);

  /* Бренд Dreamlab */
  --brand-navy: #1b355b;
  --brand-navy-hover: #152a4a;
  --brand-sky: #59c3ff;
  --brand-sky-soft: rgba(89, 195, 255, 0.12);
  --brand-sky-soft-strong: rgba(89, 195, 255, 0.2);

  /* Левое меню — белый фон */
  --sidebar-bg: #ffffff;
  --sidebar-border: var(--bpmn-border);
  --sidebar-text: var(--bpmn-grey-15);
  --sidebar-muted: var(--bpmn-grey-55);
  --sidebar-hover: hsl(225, 8%, 96%);
  --sidebar-active-bg: hsl(225, 10%, 94%);
  --sidebar-active-indicator: var(--highlight);
  --sidebar-brand-bg: #f0f1f4;

  /* Основная рабочая область — чистый белый */
  --content-bg: #ffffff;
  --bg: var(--content-bg);
  --panel: var(--content-bg);
  --panel-elevated: hsl(225, 8%, 96%);
  --border: var(--bpmn-border);
  --text: var(--bpmn-grey-15);
  --muted: var(--bpmn-grey-55);
  --accent: var(--brand-navy);
  --accent-hover: var(--brand-navy-hover);
  --accent-soft: var(--brand-sky-soft);
  --accent-soft-strong: var(--brand-sky-soft-strong);
  --accent-border-soft: rgba(27, 53, 91, 0.22);
  --highlight: var(--bpmn-blue);
  --highlight-hover: var(--bpmn-blue-hover);
  --highlight-soft: var(--bpmn-blue-soft);

  /* GitLab / Pajamas — кнопки и табы */
  --gl-radius: 4px;
  --gl-blue-500: #1f75cb;
  --gl-blue-600: #1068bf;
  --gl-blue-700: #0b5cad;
  --gl-border: #dcdcde;
  --gl-border-strong: #bfbfc3;
  --btn-primary-bg: var(--accent);
  --btn-primary-hover: var(--accent-hover);
  --btn-secondary-hover: #f0f0f0;
  --tab-active-border: var(--btn-primary-bg);

  --danger: hsl(360, 100%, 45%);
  --ok: hsl(150, 86%, 44%);
  --editor-rail-width: 240px;
  --app-font-family: "GitLab Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans", Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
  --app-font-size: 14px;
  --app-line-height: 1.45;
  --app-radius: var(--gl-radius);
  --app-radius-lg: 8px;
  font-family: var(--app-font-family);
  font-size: var(--app-font-size);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-family: var(--app-font-family);
  font-size: var(--app-font-size);
  line-height: var(--app-line-height);
  letter-spacing: normal;
}

.hidden { display: none !important; }

button, .btn {
  cursor: pointer;
  border: 1px solid transparent;
  border-radius: var(--gl-radius);
  padding: 7px 12px;
  min-height: 32px;
  font-family: inherit;
  font-size: var(--app-font-size);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: normal;
  background: var(--btn-primary-bg);
  color: #fff;
}

button:hover, .btn:hover {
  background: var(--btn-primary-hover);
}

button.secondary, .btn.secondary {
  background: var(--content-bg);
  border-color: var(--gl-border);
  color: var(--text);
  font-weight: 400;
}

button.secondary:hover, .btn.secondary:hover {
  background: var(--btn-secondary-hover);
  border-color: var(--gl-border-strong);
  color: var(--text);
}

button.btn-link, .btn.btn-link {
  background: transparent;
  border-color: transparent;
  color: var(--gl-blue-500);
  padding-left: 8px;
  padding-right: 8px;
  font-weight: 400;
}

button.btn-link:hover, .btn.btn-link:hover {
  background: transparent;
  color: var(--gl-blue-700);
  text-decoration: underline;
}

button.danger, .btn.danger {
  background: var(--danger);
  border-color: transparent;
}

button.danger:hover, .btn.danger:hover {
  background: hsl(360, 100%, 40%);
}

input:not(.bio-properties-panel-input),
textarea:not(.bio-properties-panel-input),
select:not(.bio-properties-panel-input) {
  font-family: inherit;
  letter-spacing: normal;
  background: var(--content-bg);
  border: 1px solid var(--gl-border);
  color: var(--bpmn-grey-15);
  border-radius: var(--gl-radius);
  padding: 7px 10px;
  min-height: 32px;
  font-size: var(--app-font-size);
  width: 100%;
}

input:not(.bio-properties-panel-input):focus,
textarea:not(.bio-properties-panel-input):focus,
select:not(.bio-properties-panel-input):focus {
  border-color: var(--gl-blue-500);
  background: var(--content-bg);
  outline: none;
  box-shadow: inset 0 0 0 1px var(--gl-blue-500);
}

/* Поля внутри BPMN-редактора — свои стили в bpmn-overrides.css */
.djs-popup input,
.djs-popup textarea,
.djs-container input,
.djs-container textarea,
.editor-workspace input:not([type="checkbox"]):not(.bio-properties-panel-input),
.editor-workspace textarea:not(.bio-properties-panel-input) {
  width: auto;
}

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }

.form-group { margin-bottom: 14px; }

.error {
  color: var(--danger);
  font-size: 13px;
  margin-top: 8px;
}

.boot-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bpmn-grey-55);
  font-size: 14px;
  background: var(--sidebar-brand-bg);
}

/* login */
body:has(#view-login:not(.hidden)) {
  background: var(--sidebar-brand-bg);
}

.login-shell {
  width: min(880px, calc(100vw - 40px));
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  background: var(--bpmn-white);
  border: 1px solid var(--bpmn-border);
  border-radius: var(--app-radius-lg);
  overflow: hidden;
}

.login-info-panel,
.login-auth-panel {
  padding: 32px;
}

.login-auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--bpmn-white);
  border-right: 1px solid var(--bpmn-border);
}

.login-auth-panel form {
  width: min(340px, 100%);
}

.login-info-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--sidebar-bg);
  color: var(--bpmn-grey-15);
}

.login-brand {
  text-align: center;
  margin-bottom: 24px;
}

.login-brand .brand-logo--full {
  margin: 0 auto 12px;
}

.login-auth-panel h2,
.login-info-panel h2 {
  margin: 0 0 16px;
  font-size: 18px;
  font-weight: 600;
  color: var(--brand-navy);
}

.login-auth-panel label {
  color: var(--bpmn-grey-35);
}

.login-auth-panel input {
  background: var(--bpmn-white);
  border: 1px solid var(--bpmn-border);
  color: var(--bpmn-grey-15);
}

.login-auth-panel input:focus {
  border-color: var(--highlight);
  background: var(--highlight-soft);
  outline: none;
}

.login-auth-panel .error {
  color: var(--danger);
}

.login-auth-panel textarea {
  background: var(--bpmn-white);
  border: 1px solid var(--bpmn-border);
  color: var(--bpmn-grey-15);
  width: 100%;
  min-height: 72px;
  resize: vertical;
}

.login-auth-panel textarea:focus {
  border-color: var(--highlight);
  background: var(--highlight-soft);
  outline: none;
}

.login-switch {
  margin: 16px 0 0;
  text-align: center;
}

.login-request-lead {
  margin: 0 0 16px;
  color: var(--bpmn-grey-35);
  font-size: 14px;
  line-height: 1.45;
}

.login-success {
  margin: 12px 0 0;
  color: var(--ok);
  font-size: 13px;
  line-height: 1.45;
}

.admin-section {
  margin-bottom: 28px;
}

.admin-section-title {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  color: var(--bpmn-grey-15);
}

.admin-section-hint {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

#access-requests-table {
  margin-top: 12px;
}

.brand-logo {
  display: block;
  max-width: 100%;
  height: auto;
}

.brand-logo--full {
  width: min(260px, 100%);
  margin: 0 auto;
}

.brand-logo--mark {
  flex-shrink: 0;
  width: 22px;
  height: auto;
}

.login-tagline {
  color: var(--bpmn-grey-55);
  margin: 0;
  font-size: 14px;
}

.login-info-list {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--bpmn-grey-15);
}

.login-info-list li {
  position: relative;
  margin: 0 0 12px;
  padding-left: 22px;
  color: var(--bpmn-grey-35);
  font-size: 14px;
  line-height: 1.45;
}

.login-info-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-sky);
  box-shadow: 0 0 0 3px rgba(89, 195, 255, 0.22);
}

@media (max-width: 760px) {
  .login-shell {
    position: static;
    transform: none;
    grid-template-columns: 1fr;
    margin: 24px auto;
  }

  .login-auth-panel {
    border-right: none;
    border-bottom: 1px solid var(--bpmn-border);
  }
}

/* layout */
.app-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100vh;
  overflow: hidden;
  background: var(--content-bg);
  --app-rail-header-h: 56px;
}

.app-rail-header {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  height: var(--app-rail-header-h);
  min-height: var(--app-rail-header-h);
  max-height: var(--app-rail-header-h);
  flex-shrink: 0;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--sidebar-border);
}

.app-sidebar {
  display: flex;
  flex-direction: column;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
  min-height: 0;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  box-sizing: border-box;
  height: var(--app-rail-header-h);
  min-height: var(--app-rail-header-h);
  max-height: var(--app-rail-header-h);
  flex-shrink: 0;
  flex-wrap: nowrap;
  border-bottom: 1px solid var(--sidebar-border);
  background: var(--sidebar-brand-bg);
}

.app-brand-text {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--sidebar-text);
}

.app-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  flex: 0 0 auto;
}

.app-nav .nav-item {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  color: var(--sidebar-muted);
  border: none;
  border-radius: 4px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  position: relative;
}

.nav-item-icon {
  flex-shrink: 0;
  opacity: 0.78;
}

.app-nav .nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
}

.app-nav .nav-item:hover .nav-item-icon {
  opacity: 1;
}

.app-nav .nav-item.active {
  background: var(--sidebar-active-bg);
  color: var(--sidebar-text);
  box-shadow: none;
  font-weight: 600;
}

.app-nav .nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 4px 0 0 4px;
  background: var(--sidebar-active-indicator);
}

.app-nav .nav-item.active .nav-item-icon {
  opacity: 1;
  color: var(--sidebar-text);
}

.app-sidebar-footer {
  position: relative;
  margin-top: auto;
  padding: 8px;
  flex-shrink: 0;
  border-top: 1px solid var(--sidebar-border);
  background: transparent;
}

.sidebar-platform-link {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 12px;
  border-radius: 4px;
  color: var(--sidebar-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  box-sizing: border-box;
}

.sidebar-platform-link:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text);
}

.sidebar-platform-link:hover .nav-item-icon {
  opacity: 1;
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-radius: 4px;
  text-align: left;
  color: var(--sidebar-text);
  font-weight: 500;
}

.user-menu-trigger:hover,
.user-menu-trigger[aria-expanded="true"] {
  background: var(--sidebar-hover);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand-navy);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.user-menu-label {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.user-menu-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--sidebar-text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-meta {
  font-size: 12px;
  color: var(--sidebar-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-chevron {
  flex-shrink: 0;
  color: var(--sidebar-muted);
  transition: transform 0.15s ease;
}

.user-menu-trigger[aria-expanded="true"] .user-menu-chevron {
  transform: rotate(180deg);
}

.user-menu-dropdown {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--content-bg);
  border: 1px solid var(--border);
  border-radius: var(--app-radius);
  box-shadow: 0 8px 24px rgba(27, 53, 91, 0.12);
  padding: 4px;
  z-index: 30;
}

.user-menu-dropdown button {
  width: 100%;
  text-align: left;
  background: transparent;
  color: var(--text);
  padding: 8px 10px;
  border-radius: 4px;
  font-weight: 400;
}

.user-menu-dropdown button:hover {
  background: var(--sidebar-hover);
}

.user-menu-dropdown button#btn-logout-menu {
  color: var(--danger);
}

.user-menu-dropdown button#btn-logout-menu:hover {
  background: hsla(360, 100%, 45%, 0.08);
}

.app-main {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--content-bg);
}

.panel-body {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--content-bg);
}

.diagrams-workspace {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--content-bg);
}

.folders-panel {
  flex: 0 0 auto;
  max-height: min(44vh, 380px);
  min-height: 160px;
  display: flex;
  flex-direction: column;
  background: var(--content-bg);
  border-bottom: 1px solid var(--border);
}

.folder-explorer-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 0 10px;
  flex-shrink: 0;
  box-sizing: border-box;
  height: var(--app-rail-header-h);
  min-height: var(--app-rail-header-h);
  max-height: var(--app-rail-header-h);
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  border-bottom: 1px solid var(--sidebar-border);
  background: var(--bpmn-surface);
  position: relative;
  z-index: 2;
}

.archive-tabs {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.archive-tabs--compact .archive-tab,
.archive-tabs--line .archive-tab {
  box-shadow: none;
}

.archive-tabs--compact .archive-tab:focus-visible,
.archive-tabs--line .archive-tab:focus-visible {
  outline: 2px solid var(--gl-blue-500);
  outline-offset: 1px;
}

button.folder-breadcrumb-link {
  min-height: auto;
  padding: 2px 6px;
  font-weight: 400;
  border: none;
  box-shadow: none;
}

.archive-tabs--compact {
  gap: 8px;
}

.archive-tabs--compact .archive-tab {
  min-height: 32px;
  padding: 7px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  background: var(--content-bg);
  border: 1px solid var(--gl-border);
  border-radius: var(--gl-radius);
  color: var(--text);
  font-weight: 400;
}

.archive-tabs--compact .archive-tab:hover {
  background: var(--btn-secondary-hover);
  border-color: var(--gl-border-strong);
  color: var(--text);
}

.archive-tabs--compact .archive-tab.active {
  background: var(--btn-primary-bg);
  border-color: var(--btn-primary-bg);
  color: #fff;
  box-shadow: none;
  font-weight: 600;
}

.archive-tabs--compact .archive-tab.active:hover {
  background: var(--btn-primary-hover);
  border-color: var(--btn-primary-hover);
  color: #fff;
}

.archive-tabs--line {
  gap: 0;
  align-self: flex-start;
  margin-bottom: 0;
  border-bottom: none;
}

.archive-tabs--line .archive-tab {
  min-height: 40px;
  padding: 10px 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  margin-bottom: -1px;
  color: var(--muted);
  font-weight: 400;
}

.archive-tabs--line .archive-tab:hover {
  color: var(--text);
  background: transparent;
  border-bottom-color: transparent;
}

.archive-tabs--line .archive-tab.active {
  color: var(--text);
  border-bottom-color: var(--tab-active-border);
  background: transparent;
  font-weight: 600;
}

.folder-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 2px 4px;
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 4px 8px;
  min-height: 32px;
  border-radius: var(--gl-radius);
  background: var(--content-bg);
  border: 1px solid var(--gl-border);
  font-size: 13px;
  line-height: 1.35;
}

.folder-breadcrumb-sep {
  color: var(--muted);
  margin: 0 2px;
  user-select: none;
}

.folder-breadcrumb-link {
  padding: 2px 6px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--gl-blue-500);
  font: inherit;
  cursor: pointer;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-breadcrumb-link:hover {
  background: transparent;
  color: var(--gl-blue-700);
  text-decoration: underline;
}

.folder-breadcrumb-current {
  padding: 2px 6px;
  color: var(--text);
  font-weight: 600;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.folder-explorer-new {
  flex-shrink: 0;
  white-space: nowrap;
  min-height: 32px;
}

.folder-explorer-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 12px 14px 14px;
  background: var(--content-bg);
}

.folder-explorer-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 100px;
  padding: 20px 16px;
  color: var(--muted);
}

.folder-explorer-empty-icon {
  font-size: 36px;
  line-height: 1;
  margin-bottom: 10px;
  opacity: 0.7;
}

.folder-explorer-empty p {
  margin: 0;
  font-size: 14px;
}

.folder-explorer-empty-hint {
  margin-top: 6px !important;
  font-size: 12px;
  opacity: 0.85;
}

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}

.folder-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 12px 12px;
  min-height: 104px;
  border-radius: var(--app-radius);
  border: 1px solid var(--border);
  background: var(--content-bg);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.12s ease, background 0.12s ease, box-shadow 0.12s ease;
}

.folder-tile:hover,
.folder-tile:focus-visible {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 2px 10px rgba(27, 53, 91, 0.08);
  outline: none;
}

.folder-tile--selected {
  border-color: var(--accent);
  background: var(--accent-soft-strong);
  box-shadow: inset 0 0 0 1px var(--accent-border-soft);
}

.folder-tile-icon {
  font-size: 32px;
  line-height: 1;
}

.folder-tile-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  word-break: break-word;
}

.folder-tile-meta {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}

.folder-tile-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: flex;
  gap: 2px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease;
}

.folder-tile:hover .folder-tile-actions,
.folder-tile:focus-within .folder-tile-actions {
  opacity: 1;
  pointer-events: auto;
}

.folder-tile-act {
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bpmn-white);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted);
  cursor: pointer;
}

.folder-tile-act:hover {
  color: var(--text);
  border-color: var(--bpmn-grey-75);
  background: var(--bpmn-grey-95);
}
.diagrams-panel {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 20px 20px;
  background: var(--content-bg);
}

.diagrams-panel-header {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  margin-bottom: 12px;
  flex-shrink: 0;
  border-bottom: none;
  padding-bottom: 0;
}

.diagrams-panel-header .list-toolbar {
  width: 100%;
  padding-bottom: 0;
  align-items: flex-end;
}

.diagrams-panel-hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}

.diagram-list-wrap {
  flex: 1;
  min-height: 0;
  overflow: auto;
  background: var(--content-bg);
}

.toolbar-checkbox {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  white-space: nowrap;
}

.admin-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  background: var(--bpmn-surface);
}

.app-main-header {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  height: var(--app-rail-header-h);
  min-height: var(--app-rail-header-h);
  max-height: var(--app-rail-header-h);
  flex-shrink: 0;
  padding: 0 24px;
  border-bottom: 1px solid var(--sidebar-border);
  background: var(--bpmn-surface);
  color: var(--bpmn-grey-15);
}

.app-main-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 600;
  color: var(--bpmn-grey-15);
}

.admin-panel-body {
  flex: 1;
  min-height: 0;
  width: 100%;
  overflow: auto;
  padding: 20px 24px;
  background: var(--bpmn-canvas);
}

.profile-card {
  max-width: 520px;
  background: var(--content-bg);
  border: 1px solid var(--border);
  border-radius: var(--app-radius-lg);
  padding: 16px;
  box-shadow: 0 2px 12px rgba(27, 53, 91, 0.06);
}

.profile-card p {
  margin: 0 0 10px;
}
.list-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.list-toolbar input[type="search"] {
  width: 260px;
  min-height: 32px;
}

.diagram-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--content-bg);
  border: 1px solid var(--border);
  border-radius: var(--app-radius-lg);
  overflow: visible;
}
.diagram-table th,
.diagram-table td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.diagram-table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  background: var(--panel-elevated);
}
.diagram-table thead tr:first-child th:first-child {
  border-top-left-radius: var(--app-radius-lg);
}
.diagram-table thead tr:first-child th:last-child {
  border-top-right-radius: var(--app-radius-lg);
}
.diagram-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: var(--app-radius-lg);
}
.diagram-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: var(--app-radius-lg);
}
.diagram-table tbody tr:last-child td {
  border-bottom: none;
}
.diagram-table tbody tr:hover {
  background: var(--accent-soft);
}
.diagram-table tbody tr:focus-within {
  background: var(--accent-soft);
}
.diagram-table .row-actions {
  width: 1%;
  white-space: nowrap;
  padding-left: 12px;
  padding-right: 8px;
}

.diagram-table .row-actions-head {
  width: 1%;
  padding-left: 12px;
}
.diagram-table .title-cell {
  font-weight: 600;
}
.diagram-table .muted {
  color: var(--muted);
  font-size: 13px;
}

.icon-act {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  min-height: 28px;
  padding: 0;
  font-size: 12px;
  font-weight: 400;
  line-height: 1;
  border-radius: 4px;
  background: var(--bpmn-white);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  overflow: visible;
  transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

.icon-act-svg {
  flex: 0 0 16px;
}

.icon-act::after {
  content: attr(data-tooltip);
  position: absolute;
  top: 50%;
  right: calc(100% + 6px);
  bottom: auto;
  left: auto;
  transform: translateY(-50%);
  padding: 4px 8px;
  background: var(--bpmn-grey-15);
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.3;
  white-space: nowrap;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(27, 53, 91, 0.18);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  z-index: 20;
}

.icon-act::before {
  content: '';
  position: absolute;
  top: 50%;
  right: calc(100% + 2px);
  bottom: auto;
  left: auto;
  transform: translateY(-50%);
  border: 4px solid transparent;
  border-left-color: var(--bpmn-grey-15);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.12s ease, visibility 0.12s ease;
  z-index: 20;
}

.icon-act:hover::after,
.icon-act:hover::before,
.icon-act:focus-visible::after,
.icon-act:focus-visible::before {
  opacity: 1;
  visibility: visible;
}

.icon-act:focus-visible {
  outline: none;
}

.icon-act-open:hover,
.icon-act-open:focus-visible {
  border-color: var(--btn-primary-bg);
  color: var(--btn-primary-bg);
  background: var(--bpmn-grey-95);
}

.icon-act-edit:hover,
.icon-act-edit:focus-visible,
.icon-act-restore:hover,
.icon-act-restore:focus-visible {
  color: var(--text);
  border-color: var(--bpmn-grey-75);
  background: var(--bpmn-grey-95);
}

.icon-act-archive:hover,
.icon-act-archive:focus-visible,
.icon-act-delete:hover,
.icon-act-delete:focus-visible {
  color: var(--danger);
  border-color: var(--danger);
  background: #fff5f5;
}
.list-empty {
  text-align: center;
  padding: 48px 20px;
  font-size: 14px;
  line-height: 1.45;
  color: var(--muted);
  background: var(--content-bg);
  border: 1px dashed var(--border);
  border-radius: var(--app-radius-lg);
}

.editor-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.editor-workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  background: var(--bpmn-canvas);
}

.editor-workspace #canvas,
#canvas {
  flex: 1;
  min-width: 0;
  min-height: 0;
  background: var(--bpmn-canvas);
}

.editor-rail {
  position: relative;
  width: var(--editor-rail-width);
  max-width: var(--editor-rail-width);
  flex: 0 0 var(--editor-rail-width);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 100%;
  align-self: stretch;
  border-left: 1px solid var(--bpmn-border-strong);
  background: var(--bpmn-surface);
  color: var(--bpmn-grey-15);
  overflow: hidden;
}

#properties-panel.properties-panel-host {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
  max-width: var(--editor-rail-width);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--bpmn-surface);
}

.properties-panel-host .bio-properties-panel {
  flex: 1 1 auto;
  min-height: 0;
  height: 100%;
  width: 100%;
  max-width: var(--editor-rail-width);
  overflow: hidden;
}

.properties-panel-host .bio-properties-panel-scroll-container {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

#versions-group.is-open {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#versions-group.is-open .bio-properties-panel-group-entries {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

#versions-group .version-list {
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
}

#versions-group .version-list-empty {
  padding: 8px 12px;
  color: var(--bpmn-grey-35);
  font-size: 13px;
  line-height: 1.4;
}

#versions-group .version-list-item {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--bpmn-border);
  line-height: 1.4;
  font-size: 13px;
  color: var(--bpmn-grey-15);
}

#versions-group .version-list-body {
  flex: 1 1 auto;
  min-width: 0;
}

#versions-group .version-list-actions {
  display: flex;
  flex: 0 0 auto;
  align-self: center;
  gap: 4px;
  overflow: visible;
}

#versions-group .version-list-item:last-child {
  border-bottom: none;
}

#versions-group .version-no {
  display: block;
  font-weight: 500;
}

#versions-group .version-meta {
  display: block;
  margin-top: 2px;
  color: var(--bpmn-grey-35);
}

#versions-group .version-date {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--bpmn-grey-55);
}

.toolbar {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  padding: 0 12px;
  box-sizing: border-box;
  height: var(--app-rail-header-h);
  min-height: var(--app-rail-header-h);
  max-height: var(--app-rail-header-h);
  border-bottom: 1px solid var(--sidebar-border);
  background: var(--content-bg);
  align-items: center;
  flex-shrink: 0;
  overflow-x: auto;
  overflow-y: hidden;
}
.toolbar .spacer { flex: 1; }
.toolbar input[type="text"] { width: 220px; }

.editor-page .toolbar #diagram-title {
  width: min(420px, 36vw);
  min-width: 280px;
}

.editor-page .toolbar {
  background: var(--bpmn-surface);
  border-bottom-color: var(--sidebar-border);
  color: var(--bpmn-grey-15);
}

.editor-page .toolbar input[type="text"] {
  background: var(--bpmn-white);
  border: 1px solid var(--bpmn-border);
  color: var(--bpmn-grey-15);
}

.editor-page .toolbar input[type="text"]:focus {
  border-color: var(--highlight);
  background: var(--highlight-soft);
}

.editor-page .toolbar button.secondary {
  background: var(--bpmn-white);
  border: 1px solid var(--bpmn-border);
  color: var(--bpmn-grey-15);
}

.editor-page .toolbar button.secondary:hover {
  background: var(--bpmn-grey-95);
}

.editor-page .toolbar #save-status {
  color: var(--bpmn-grey-55);
  font-size: 13px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(27, 53, 91, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--app-radius-lg);
  padding: 24px;
  width: min(420px, 92vw);
  box-shadow: 0 16px 48px rgba(27, 53, 91, 0.16);
}
.modal h2 {
  margin: 0 0 16px;
  font-size: 18px;
  color: var(--brand-navy);
  font-weight: 600;
}
.modal-message {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 16px;
  line-height: 1.45;
}
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; }
