@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;700&family=IBM+Plex+Mono:wght@400;500&display=swap');

:root {
  --bg-1: #f4efe6;
  --bg-2: #f8f5ec;
  --ink-1: #18201f;
  --ink-2: #3e4a48;
  --muted: #6a7775;
  --panel: rgba(255, 253, 246, 0.85);
  --line: #bfd0cc;
  --accent: #138a74;
  --accent-soft: #dcf7ef;
  --warn: #c96a1a;
  --entity-head: linear-gradient(115deg, #e6faf2 0%, #f7fffb 72%);
  --shadow: 0 14px 30px rgba(23, 48, 43, 0.14);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  color: var(--ink-1);
  background:
    radial-gradient(72rem 26rem at -8% -14%, #d3efe4 0%, transparent 58%),
    radial-gradient(60rem 24rem at 114% 6%, #ffe5ca 0%, transparent 56%),
    linear-gradient(180deg, var(--bg-2) 0%, var(--bg-1) 100%);
}

.login-shell {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-shell[hidden] {
  display: none !important;
}

.login-card {
  width: min(420px, 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 1px solid rgba(35, 54, 51, 0.2);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 22px;
}

.login-card h1 {
  margin: 0;
  font-size: 1.28rem;
}

.login-card label {
  font-size: 0.84rem;
  color: var(--ink-2);
}

.login-username-input {
  width: 100%;
  min-height: 2.4rem;
  padding: 0.62rem 0.72rem;
  border: 1px solid rgba(28, 56, 51, 0.26);
  border-radius: 10px;
  font: inherit;
  background: #fffef9;
  line-height: 1.35;
  outline: none;
}

.login-username-input:focus {
  border-color: #0d745f;
  box-shadow: 0 0 0 3px rgba(13, 116, 95, 0.15);
}

.login-username-input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.login-password-input {
  width: 100%;
  min-height: 2.4rem;
  padding: 0.62rem 0.72rem;
  border: 1px solid rgba(28, 56, 51, 0.26);
  border-radius: 10px;
  font: inherit;
  background: #fffef9;
  outline: none;
}

.login-password-input:focus {
  border-color: #0d745f;
  box-shadow: 0 0 0 3px rgba(13, 116, 95, 0.15);
}

.login-password-input:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

.login-card button {
  margin-top: 4px;
}

.login-error {
  margin: 0;
  color: #8b2b1d;
  font-size: 0.84rem;
  min-height: 1.2em;
}

.login-debug {
  margin-top: 8px;
  border: 1px solid rgba(28, 56, 51, 0.2);
  border-radius: 10px;
  background: #f8fbfa;
  padding: 8px;
}

.login-debug summary {
  cursor: pointer;
  font-size: 0.82rem;
  color: var(--ink-2);
}

.login-debug-output {
  margin: 8px 0 0;
  max-height: 170px;
  overflow: auto;
  border: 1px solid rgba(28, 56, 51, 0.16);
  border-radius: 8px;
  background: #ffffff;
  padding: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  line-height: 1.35;
  color: #213533;
  white-space: pre-wrap;
  word-break: break-word;
}

.app-shell {
  height: 100%;
  display: grid;
  grid-template-rows: 72px 1fr;
}

.app-shell[hidden] {
  display: none !important;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid rgba(35, 54, 51, 0.15);
  background: rgba(255, 251, 240, 0.82);
  backdrop-filter: blur(8px);
}

.app-main {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 200px 1fr;
}

.app-content {
  height: 100%;
  min-height: 0;
  overflow: hidden;
  display: grid;
}

.app-sidebar {
  border-right: 1px solid rgba(35, 54, 51, 0.15);
  background: rgba(255, 251, 240, 0.82);
  backdrop-filter: blur(8px);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-btn {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: flex-start;
}

.sidebar-admin-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sidebar-submenu {
  display: grid;
  gap: 6px;
  padding-left: 14px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-4px);
  pointer-events: none;
  transition: max-height 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.sidebar-admin-group:hover .sidebar-submenu,
.sidebar-admin-group:focus-within .sidebar-submenu,
.sidebar-admin-group.is-open .sidebar-submenu {
  max-height: 140px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.sidebar-submenu-btn {
  display: flex;
  align-items: center;
  width: 100%;
  justify-content: flex-start;
  font-size: 0.8rem;
  padding: 0.48rem 0.7rem;
  border-radius: 10px;
  background: rgba(255, 253, 246, 0.78);
}

.sidebar-submenu-btn.active {
  border-color: #0d745f;
  background: #e8f8f3;
  color: #0f5f4f;
}

.sidebar-btn.active {
  border-color: #0d745f;
  background: #e8f8f3;
  color: #0f5f4f;
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-brand h1 {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.brand-pill {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.78rem;
  font-weight: 500;
  color: #ffffff;
  background: linear-gradient(125deg, #0e6f5d 0%, #1d9f86 100%);
  border-radius: 999px;
  padding: 0.26rem 0.56rem;
}

.topbar-actions,
.panel button {
  display: flex;
  gap: 10px;
}

.topbar-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-user-menu {
  position: relative;
}

.topbar-user-menu > button {
  min-width: 136px;
  justify-content: center;
}

.topbar-user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  display: grid;
  gap: 4px;
  padding: 8px;
  border: 1px solid rgba(35, 54, 51, 0.16);
  border-radius: 14px;
  background: rgba(255, 253, 246, 0.96);
  box-shadow: 0 16px 28px rgba(23, 48, 43, 0.14);
  z-index: 30;
}

.topbar-user-menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  background: #fffef9;
}

button {
  font-family: inherit;
  border-radius: 11px;
  border: 1px solid rgba(28, 56, 51, 0.2);
  padding: 0.58rem 0.82rem;
  font-size: 0.88rem;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 120ms ease;
  color: var(--ink-1);
  background: #fffdf8;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(28, 56, 51, 0.12);
}

button.primary {
  color: #ffffff;
  border-color: #0d745f;
  background: linear-gradient(140deg, #0f7d66, #22a588);
}

button.ghost {
  background: #f8f8f2;
}

button.active-toggle {
  border-color: #bf5d1f;
  background: #ffe8d6;
  color: #6c2f0a;
}

.workspace {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: 260px minmax(640px, 1fr);
  gap: 14px;
  padding: 14px;
}

.workspace[hidden] {
  display: none !important;
}

.home-shell {
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  padding: 14px;
}

.home-shell[hidden] {
  display: none !important;
}

.home-shell-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

.home-diagram-tiles {
  min-height: 0;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  grid-auto-rows: max-content;
  align-content: start;
  align-items: start;
  gap: 12px;
}

.home-diagram-tile {
  border: 1px solid rgba(35, 54, 51, 0.2);
  border-radius: 14px;
  background: #fffef9;
  box-shadow: 0 10px 18px rgba(23, 48, 43, 0.1);
  padding: 12px;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 0;
  align-self: start;
  gap: 8px;
}

.home-diagram-tile h3 {
  margin: 0;
  font-size: 0.9rem;
}

.home-tile-meta {
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.4;
}

.home-tile-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(30, 52, 48, 0.28);
  background: #eef8f5;
  color: #1b5f52;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  padding: 0.14rem 0.44rem;
}

.admin-shell {
  height: 100%;
  min-height: 0;
  padding: 14px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 14px;
}

.admin-shell[hidden] {
  display: none !important;
}

.admin-card {
  border-radius: var(--radius);
  border: 1px solid rgba(35, 54, 51, 0.16);
  background: var(--panel);
  box-shadow: var(--shadow);
  padding: 14px;
}

.admin-card h2 {
  margin: 0;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.admin-panel-actions {
  margin-top: 6px;
  margin-bottom: 6px;
}

.admin-import-status {
  margin-top: 4px;
  margin-bottom: 8px;
  min-height: 1.2em;
}

.admin-import-status.is-success {
  color: #0d745f;
}

.admin-import-status.is-error {
  color: #8b2b1d;
}

.admin-diagrams-table-wrap {
  margin-top: 8px;
}

.admin-diagrams-table .actions-col,
.admin-diagrams-table .admin-diagrams-actions-cell {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.admin-users-shell {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.admin-users-create-card,
.admin-users-list-card {
  border: 1px solid rgba(35, 54, 51, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
  padding: 12px;
}

.admin-users-create-card h3,
.admin-users-list-card h3 {
  margin: 0 0 10px;
  font-size: 0.88rem;
}

.admin-users-form-grid {
  display: grid;
  gap: 8px;
}

.admin-users-form-grid label {
  font-size: 0.78rem;
  color: var(--ink-2);
}

.admin-users-form-grid input,
.admin-role-assign select {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.58rem 0.68rem;
  border: 1px solid rgba(28, 56, 51, 0.22);
  border-radius: 10px;
  font: inherit;
  background: #fffef9;
  outline: none;
}

.admin-users-form-grid input:focus,
.admin-role-assign select:focus {
  border-color: #0d745f;
  box-shadow: 0 0 0 3px rgba(13, 116, 95, 0.12);
}

.admin-users-table-wrap {
  overflow: auto;
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 700px;
}

.admin-users-table th,
.admin-users-table td {
  padding: 0.7rem 0.55rem;
  border-bottom: 1px solid rgba(35, 54, 51, 0.1);
  text-align: left;
  vertical-align: top;
}

.admin-users-table th {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.admin-role-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.admin-role-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  border: 1px solid rgba(13, 116, 95, 0.2);
  background: #eef8f5;
  color: #0f5f4f;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.68rem;
  padding: 0.18rem 0.55rem;
}

button.admin-role-chip {
  cursor: pointer;
}

button.admin-role-chip:hover {
  transform: translateY(-1px);
}

.admin-role-chip-remove {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.8rem;
  line-height: 1;
}

.admin-role-assign {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.admin-role-assign select {
  min-width: 170px;
}

.admin-role-assign button {
  white-space: nowrap;
}

.admin-column-types-toolbar {
  display: grid;
  gap: 6px;
  max-width: 420px;
}

.admin-column-types-toolbar label,
.admin-column-types-add label {
  font-size: 0.78rem;
  color: var(--ink-2);
}

.admin-column-types-toolbar select,
.admin-column-types-add input {
  width: 100%;
  min-height: 2.35rem;
  padding: 0.58rem 0.68rem;
  border: 1px solid rgba(28, 56, 51, 0.22);
  border-radius: 10px;
  font: inherit;
  background: #fffef9;
  outline: none;
}

.admin-column-types-toolbar select:focus,
.admin-column-types-add input:focus {
  border-color: #0d745f;
  box-shadow: 0 0 0 3px rgba(13, 116, 95, 0.12);
}

.admin-column-types-add {
  margin-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.admin-column-types-add label {
  grid-column: 1 / -1;
}

.admin-column-types-list-wrap {
  margin-top: 10px;
  overflow: auto;
  border: 1px solid rgba(35, 54, 51, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
}

.admin-column-types-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 320px;
}

.admin-column-types-table th,
.admin-column-types-table td {
  padding: 0.64rem 0.56rem;
  border-bottom: 1px solid rgba(35, 54, 51, 0.1);
  text-align: left;
}

.admin-column-types-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: #eef7f3;
}

.admin-column-types-table tbody tr:last-child td {
  border-bottom: none;
}

.user-settings-form {
  display: grid;
  gap: 8px;
}

.user-settings-form label {
  font-size: 0.82rem;
  color: var(--ink-2);
}

.user-settings-form input {
  width: 100%;
  min-height: 2.4rem;
  padding: 0.62rem 0.72rem;
  border: 1px solid rgba(28, 56, 51, 0.24);
  border-radius: 10px;
  font: inherit;
  background: #fffef9;
  outline: none;
}

.user-settings-form input:focus {
  border-color: #0d745f;
  box-shadow: 0 0 0 3px rgba(13, 116, 95, 0.12);
}

.user-settings-form input:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.panel {
  min-height: 0;
  overflow: auto;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(35, 54, 51, 0.16);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.muted {
  color: var(--muted);
  margin-top: 8px;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.panel-left {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.workspace-version-block {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workspace-viewer-tools {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workspace-work-package-tools {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workspace-table-tools {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.workspace-version-block h3 {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.workspace-viewer-tools h3 {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.workspace-work-package-tools h3 {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.workspace-table-tools h3 {
  margin: 0;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.workspace-version-block button {
  width: 100%;
  justify-content: flex-start;
}

.workspace-viewer-tools button {
  width: 100%;
  justify-content: flex-start;
}

.workspace-work-package-tools button {
  width: 100%;
  justify-content: flex-start;
}

.workspace-table-tools button {
  width: 100%;
  justify-content: flex-start;
}

.workspace-table-actions-label {
  margin: 0;
  font-size: 0.76rem;
  color: var(--muted);
  line-height: 1.4;
}

.versions-table-wrap {
  margin-top: 8px;
  border: 1px solid rgba(30, 52, 48, 0.25);
  border-radius: 12px;
  background: #fffef9;
  overflow-x: auto;
  overflow-y: visible;
}

.versions-detail-heading {
  margin: 10px 0 0;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.versions-detail-top-actions {
  margin-top: 8px;
  margin-bottom: 4px;
}

.versions-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.versions-table th,
.versions-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(30, 52, 48, 0.16);
  font-size: 0.8rem;
  text-align: left;
  vertical-align: middle;
}

.versions-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5fbf8;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.versions-table tbody tr:hover {
  background: #f8fdfb;
}

.versions-table tbody tr.versions-version-row {
  cursor: pointer;
}

.versions-table tbody tr.versions-version-row.is-selected td {
  background: #e3f4ee;
}

.versions-table tbody tr.is-selected td {
  background: #e3f4ee;
}

.versions-table tbody tr:last-child td {
  border-bottom: none;
}

.versions-work-packages-row td {
  background: #f8fdfb;
}

.versions-work-packages-cell {
  padding: 10px 12px;
}

.versions-work-packages-block h4 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}

.versions-work-packages-table-wrap {
  border: 1px solid rgba(30, 52, 48, 0.2);
  border-radius: 10px;
  overflow-x: auto;
  background: #fffef9;
}

.versions-work-packages-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.versions-work-packages-table th,
.versions-work-packages-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(30, 52, 48, 0.14);
  text-align: left;
  font-size: 0.76rem;
}

.versions-work-packages-table th {
  background: #eef7f3;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}

.versions-work-packages-table tbody tr:last-child td {
  border-bottom: none;
}

.versions-work-packages-table th.actions-col,
.versions-work-packages-table td.versions-row-actions-cell {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.versions-section-heading {
  margin: 12px 0 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}

.versions-work-packages-selector-table tbody tr {
  cursor: pointer;
}

.versions-work-packages-selector-table tbody tr:hover td {
  background: #f3fbf8;
}

.versions-work-packages-selector-table tbody tr.is-selected td {
  background: #e3f4ee;
}

.versions-work-package-selection-summary {
  margin: 8px 0 10px;
}

.versions-work-package-diagram-wrap {
  border: 1px solid rgba(30, 52, 48, 0.2);
  border-radius: 12px;
  background:
    linear-gradient(to right, rgba(20, 52, 47, 0.06) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(to bottom, rgba(20, 52, 47, 0.06) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(180deg, #fcfffe 0%, #f2f6f4 100%);
  overflow: auto;
  max-height: 480px;
}

.versions-work-package-diagram-canvas {
  position: relative;
  min-width: 100%;
  min-height: 360px;
}

.versions-work-package-diagram-links {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.versions-work-package-diagram-link {
  stroke: rgba(42, 95, 84, 0.56);
  stroke-width: 2;
}

.versions-work-package-diagram-link.is-highlighted {
  stroke: #118a74;
  stroke-width: 2.4;
}

.versions-work-package-diagram-link.is-dimmed {
  opacity: 0.2;
}

.versions-work-package-diagram-nodes {
  position: absolute;
  inset: 0;
}

.versions-work-package-diagram-node {
  position: absolute;
  width: 182px;
  min-height: 82px;
  border: 1px solid rgba(30, 52, 48, 0.28);
  border-radius: 11px;
  background: #fffef9;
  box-shadow: 0 8px 18px rgba(24, 50, 45, 0.12);
  padding: 10px;
}

.versions-work-package-diagram-node h5 {
  margin: 0;
  font-size: 0.84rem;
}

.versions-work-package-diagram-node p {
  margin: 4px 0 0;
  font-size: 0.73rem;
  color: var(--muted);
}

.versions-work-package-diagram-node.is-highlighted {
  border-color: #118a74;
  box-shadow: 0 0 0 2px rgba(17, 138, 116, 0.22), 0 10px 20px rgba(17, 138, 116, 0.18);
  background: #effaf6;
}

.versions-work-package-diagram-node.is-dimmed {
  opacity: 0.46;
}

.versions-thumbnail-section {
  margin-top: 10px;
  margin-bottom: 10px;
}

.versions-thumbnail-section h4 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}

.versions-thumbnail-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
}

.versions-thumbnail-card {
  flex: 0 0 auto;
  min-width: 165px;
  max-width: 220px;
  border: 1px solid rgba(30, 52, 48, 0.25);
  border-radius: 10px;
  background: #fffef9;
  padding: 8px 10px;
}

.versions-thumbnail-card h5 {
  margin: 0 0 4px;
  font-size: 0.8rem;
}

.versions-thumbnail-card p {
  margin: 2px 0;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.3;
}

.versions-table th.actions-col,
.versions-table td.versions-row-actions-cell {
  width: 1%;
  white-space: nowrap;
  text-align: right;
}

.versions-row-actions {
  position: relative;
  display: inline-flex;
  justify-content: flex-end;
}

.versions-row-menu-btn {
  min-width: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1;
  color: #314845;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(26, 54, 49, 0.2);
}

.versions-row-menu-btn:hover {
  transform: none;
  border-color: rgba(19, 138, 116, 0.35);
  background: #f0fbf8;
}

.versions-row-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 190px;
  max-width: 190px;
  min-width: 150px;
  border-radius: 10px;
  border: 1px solid rgba(26, 54, 49, 0.26);
  background: #fffef9;
  box-shadow: 0 14px 24px rgba(14, 29, 26, 0.18);
  padding: 4px;
  z-index: 1200;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.versions-row-menu button {
  width: 100%;
  display: flex;
  justify-content: flex-start;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-1);
}

.versions-row-menu button:hover {
  border-color: rgba(19, 138, 116, 0.24);
  background: #eefaf6;
}

.version-diagram-item {
  border: 1px solid rgba(30, 52, 48, 0.25);
  border-radius: 12px;
  background: #fffef9;
  padding: 10px;
}

.version-diagram-item h4 {
  margin: 0;
  font-size: 0.86rem;
}

.diagrams-panel {
  margin-top: 4px;
  border-top: 1px dashed rgba(30, 52, 48, 0.25);
  padding-top: 10px;
}

.diagrams-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diagram-item {
  border: 1px solid rgba(30, 52, 48, 0.25);
  border-radius: 10px;
  background: #fffef9;
  padding: 8px;
}

.diagram-item h4 {
  margin: 0;
  font-size: 0.82rem;
}

.diagram-meta {
  margin-top: 4px;
  font-size: 0.72rem;
  color: var(--muted);
  line-height: 1.35;
}

.legend {
  margin-top: 8px;
  border-top: 1px dashed rgba(30, 52, 48, 0.25);
  padding-top: 12px;
  color: var(--ink-2);
  font-size: 0.86rem;
}

.legend h3 {
  margin: 0 0 8px;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.legend p {
  margin: 0 0 8px;
  line-height: 1.35;
}

.canvas-wrap {
  position: relative;
  height: 100%;
  min-height: 0;
  border-radius: 20px;
  border: 1px solid rgba(35, 54, 51, 0.22);
  box-shadow: var(--shadow);
  background:
    linear-gradient(to right, rgba(20, 52, 47, 0.06) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(to bottom, rgba(20, 52, 47, 0.06) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(180deg, #fcfffe 0%, #f2f6f4 100%);
  overflow: hidden;
}

.workspace-context-banner {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(35, 54, 51, 0.12);
  background: rgba(255, 252, 244, 0.94);
  backdrop-filter: blur(6px);
}

.workspace-context-banner-title {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--ink-1);
}

.workspace-context-banner-meta {
  margin: 2px 0 0;
  font-size: 0.76rem;
  color: var(--muted);
}

#entity-layer,
#relationship-layer {
  position: absolute;
  inset: 0;
}

.canvas-wrap.has-context-banner #entity-layer,
.canvas-wrap.has-context-banner #relationship-layer {
  top: 68px;
  right: 0;
  bottom: 0;
  left: 0;
}

#relationship-layer {
  pointer-events: auto;
}

#entity-layer {
  pointer-events: none;
}

.relationship-line {
  fill: none;
  stroke: #6e8f88;
  stroke-width: 2;
  stroke-linecap: round;
}

.relationship-line.selected {
  stroke: var(--warn);
  stroke-width: 2.7;
}

.relationship-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  fill: #435553;
}

.entity-card {
  position: absolute;
  pointer-events: auto;
  width: 260px;
  border-radius: 14px;
  border: 1px solid rgba(27, 60, 54, 0.28);
  background: #fffefa;
  overflow: visible;
  box-shadow: 0 12px 18px rgba(26, 46, 42, 0.13);
}

.entity-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(16, 126, 102, 0.2), 0 12px 24px rgba(17, 74, 61, 0.18);
}

.entity-card.work-package-selected {
  border-color: #1a8d74;
  box-shadow: 0 0 0 2px rgba(26, 141, 116, 0.18), 0 12px 22px rgba(26, 92, 79, 0.16);
}

.entity-card.work-package-locked {
  opacity: 0.72;
}

.entity-header {
  position: relative;
  user-select: none;
  cursor: grab;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(26, 54, 49, 0.16);
  background: var(--entity-head);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.entity-header:active {
  cursor: grabbing;
}

.entity-title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 700;
}

.entity-subtitle {
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--muted);
  font-family: 'IBM Plex Mono', monospace;
}

.entity-header-content {
  min-width: 0;
}

.entity-menu-wrap {
  position: relative;
  z-index: 20;
}

.entity-menu-btn {
  min-width: 28px;
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1;
  color: #314845;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(26, 54, 49, 0.2);
}

.entity-menu-btn:hover {
  transform: none;
  box-shadow: 0 6px 12px rgba(28, 56, 51, 0.12);
}

.entity-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 110px;
  padding: 6px;
  border-radius: 10px;
  border: 1px solid rgba(28, 56, 51, 0.22);
  background: #fffef9;
  box-shadow: 0 12px 20px rgba(21, 41, 37, 0.18);
  z-index: 30;
}

.entity-menu button {
  width: 100%;
  justify-content: flex-start;
  font-size: 0.76rem;
  padding: 0.34rem 0.45rem;
}

.entity-columns {
  padding: 8px;
}

.column-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
  border-radius: 8px;
  border: 1px solid rgba(32, 62, 57, 0.15);
  padding: 6px 8px;
  background: #fdfdfa;
  cursor: pointer;
}

.column-row:last-child {
  margin-bottom: 0;
}

.column-row.selected {
  border-color: #d4883f;
  background: #fff2e5;
}

.column-row.readonly {
  cursor: default;
}

.column-left {
  min-width: 0;
}

.column-name {
  display: block;
  font-size: 0.82rem;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.column-type {
  display: block;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.66rem;
  color: var(--muted);
  margin-top: 2px;
}

.badges {
  display: flex;
  gap: 4px;
  font-family: 'IBM Plex Mono', monospace;
}

.badge {
  font-size: 0.62rem;
  border: 1px solid rgba(30, 54, 49, 0.22);
  border-radius: 999px;
  padding: 0.12rem 0.3rem;
  background: #fff;
}

.badge.pk {
  color: #0b7058;
  border-color: #52bfa4;
  background: #e7f9f3;
}

.badge.fk {
  color: #1f527a;
  border-color: #7db2df;
  background: #ecf5fc;
}

.badge.null {
  color: #8b5f2a;
  border-color: #e6b07f;
  background: #fff0df;
}

.empty-state {
  position: absolute;
  inset: auto 0 30px;
  margin: 0 auto;
  width: fit-content;
  font-size: 0.84rem;
  color: #556664;
  background: rgba(255, 255, 255, 0.8);
  border: 1px dashed rgba(28, 58, 53, 0.35);
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  pointer-events: none;
}

.inspector-empty {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 10px;
}

.field {
  margin-bottom: 12px;
}

.field label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #4f605d;
  margin-bottom: 6px;
}

input[type='text'],
input[type='number'],
select {
  width: 100%;
  border: 1px solid rgba(28, 56, 51, 0.28);
  border-radius: 8px;
  padding: 0.45rem 0.55rem;
  font-family: inherit;
  font-size: 0.88rem;
  background: #fff;
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.inspector-columns {
  margin-top: 10px;
  border-top: 1px solid rgba(26, 54, 49, 0.18);
  padding-top: 10px;
}

.inspector-column-card {
  border: 1px solid rgba(26, 54, 49, 0.2);
  border-radius: 10px;
  padding: 8px;
  background: #fbfdfc;
  margin-bottom: 8px;
}

.inline-actions {
  display: flex;
  gap: 8px;
}

.small {
  font-size: 0.78rem;
  padding: 0.36rem 0.5rem;
}

.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(12, 22, 20, 0.42);
  backdrop-filter: blur(4px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal-card {
  width: min(720px, 100%);
  max-height: min(80vh, 800px);
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid rgba(28, 56, 51, 0.22);
  background: #fffef9;
  box-shadow: 0 20px 44px rgba(13, 31, 27, 0.26);
  padding: 14px;
}

/* Tabbed modals keep a stable frame while users switch tabs. */
.modal-card.modal-card-tabbed {
  height: min(80vh, 800px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-card.modal-card-tabbed.modal-card-wide {
  height: min(88vh, 900px);
}

.modal-card.modal-card-tabbed > [id$='-content'] {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.modal-card.modal-card-narrow {
  width: min(560px, 100%);
}

.modal-card.modal-card-wide {
  width: min(1200px, 100%);
  max-height: min(88vh, 900px);
}

#table-edit-modal.view-mode .modal-card {
  width: min(860px, 100%);
  min-height: min(76vh, 760px);
}

#table-edit-modal.view-mode #table-edit-modal-content {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.modal-header h3 {
  margin: 0;
  font-size: 0.96rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.modal-muted {
  margin-bottom: 10px;
}

.version-create-message {
  margin: 0;
  color: var(--ink-2);
  line-height: 1.4;
}

.version-create-progress-block {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}

.version-create-progress-label {
  margin: 0;
  font-size: 0.82rem;
  color: var(--ink-2);
}

.version-create-progress-track {
  position: relative;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(28, 56, 51, 0.2);
  background: #edf4f2;
  overflow: hidden;
}

.version-create-progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(140deg, #0f7d66, #22a588);
  transition: width 180ms ease;
}

.version-create-step-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 0.8rem;
  color: var(--ink-2);
}

.version-create-step-list li.done {
  color: #1a6c5a;
}

.version-create-step-list li.active {
  color: #0f5f4f;
  font-weight: 600;
}

.work-package-form-grid {
  display: grid;
  gap: 10px;
}

.work-package-table-picker {
  border-top: 1px solid rgba(28, 56, 51, 0.16);
  padding-top: 10px;
}

.work-package-table-picker h4 {
  margin: 0 0 8px;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.work-package-table-list {
  display: grid;
  gap: 6px;
  max-height: min(40vh, 360px);
  overflow-y: auto;
  padding-right: 2px;
}

.work-package-table-item {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(28, 56, 51, 0.18);
  border-radius: 8px;
  padding: 6px 8px;
  background: #fcfefc;
  font-size: 0.84rem;
  color: var(--ink-1);
}

.work-package-table-item input[type='checkbox'] {
  margin: 0;
}

.work-package-selected-count {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-2);
}

.work-package-help {
  margin: 0;
  font-size: 0.78rem;
  color: var(--muted);
}

.work-package-dual-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.work-package-list-panel {
  display: grid;
  gap: 6px;
}

.work-package-list-title {
  margin: 0;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}

.work-package-transfer-select {
  min-height: 260px;
  max-height: min(42vh, 380px);
  width: 100%;
  border: 1px solid rgba(28, 56, 51, 0.22);
  border-radius: 10px;
  background: #fcfefc;
  padding: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  color: var(--ink-1);
}

.work-package-transfer-select option {
  padding: 4px 6px;
}

.work-package-transfer-select option[data-locked='1'] {
  color: #4f605d;
  background: #eef6f3;
}

.work-package-list-actions {
  display: grid;
  gap: 6px;
}

.work-package-list-actions button {
  min-width: 52px;
  justify-content: center;
}

.submit-work-package-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(28, 56, 51, 0.14);
  padding-bottom: 10px;
}

.submit-work-package-tab {
  border-radius: 999px;
  min-width: 110px;
  justify-content: center;
}

.submit-work-package-tab.active {
  border-color: #0d745f;
  background: #e8f8f3;
  color: #0f5f4f;
}

.submit-work-package-panel {
  display: grid;
  gap: 12px;
  min-height: min(44vh, 420px);
  align-content: start;
}

.submit-work-package-form {
  display: grid;
  gap: 10px;
}

.submit-work-package-textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
}

.approval-diff-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.approval-diff-metrics p {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-2);
}

.approval-diff-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.approval-diff-panel {
  border: 1px solid rgba(28, 56, 51, 0.22);
  border-radius: 12px;
  background: #fcfefc;
  padding: 10px;
}

.approval-diff-panel h4 {
  margin: 0 0 8px;
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}

.approval-diff-panel h5 {
  margin: 10px 0 8px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.approval-diff-fields {
  display: grid;
  gap: 6px;
}

.approval-diff-field {
  margin: 0;
  font-size: 0.78rem;
  color: var(--ink-1);
}

.approval-diff-field.is-changed {
  color: #875f1f;
  font-weight: 600;
}

.approval-diff-table-wrap {
  border: 1px solid rgba(28, 56, 51, 0.16);
  border-radius: 10px;
  overflow: auto;
  background: #fffef9;
}

.approval-diff-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 520px;
}

.approval-diff-table th,
.approval-diff-table td {
  padding: 7px 9px;
  border-bottom: 1px solid rgba(30, 52, 48, 0.12);
  text-align: left;
  font-size: 0.74rem;
}

.approval-diff-table th {
  background: #eef7f3;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-2);
}

.approval-diff-table tbody tr:last-child td {
  border-bottom: none;
}

.approval-diff-table tbody tr.is-added td {
  background: #eaf8f1;
}

.approval-diff-table tbody tr.is-removed td {
  background: #fff0ef;
}

.approval-diff-table tbody tr.is-changed td {
  background: #fff7e8;
}

.approval-diff-status {
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.work-package-open-selector {
  border: 1px solid rgba(28, 56, 51, 0.2);
  border-radius: 10px;
  overflow-x: auto;
  max-height: min(44vh, 420px);
  background: #fcfefc;
}

.work-package-open-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

.work-package-open-table th,
.work-package-open-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(30, 52, 48, 0.14);
  text-align: left;
  font-size: 0.76rem;
}

.work-package-open-table th {
  background: #eef7f3;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-2);
}

.work-package-open-table tbody tr {
  cursor: pointer;
}

.work-package-open-table tbody tr:hover td {
  background: #f3fbf8;
}

.work-package-open-table tbody tr.is-selected td {
  background: #e3f4ee;
}

.work-package-open-table tbody tr:last-child td {
  border-bottom: none;
}

.table-edit-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.table-columns-block {
  border-top: 1px solid rgba(28, 56, 51, 0.16);
  padding-top: 10px;
}

.table-view-tabs {
  margin-top: 12px;
  border-top: 1px solid rgba(28, 56, 51, 0.16);
  padding-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.table-view-tab-content {
  margin-top: 10px;
  min-height: min(44vh, 420px);
}

#table-edit-modal.view-mode .table-view-tab-content {
  height: min(44vh, 420px);
}

#table-edit-modal.view-mode .table-view-tab-content .table-columns-list,
#table-edit-modal.view-mode .table-view-tab-content .table-relationships-list,
#table-edit-modal.view-mode .table-view-tab-content .table-options-list {
  height: 100%;
  max-height: none;
}

.table-columns-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.table-columns-header h4 {
  margin: 0;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.table-columns-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(44vh, 420px);
  overflow-y: auto;
  padding-right: 2px;
}

.table-column-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(160px, 1fr) minmax(130px, auto);
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(28, 56, 51, 0.22);
  border-radius: 10px;
  background: #fcfdfb;
  padding: 8px;
}

.table-column-row.editable {
  background: #f8fcfa;
}

.table-col-name {
  font-size: 0.82rem;
  color: var(--ink-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.table-col-type {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  color: var(--muted);
}

.table-col-meta {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-content: flex-end;
}

.table-col-meta-edit {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.table-col-input {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(28, 56, 51, 0.22);
  border-radius: 8px;
  background: #ffffff;
  padding: 0.38rem 0.5rem;
  font-size: 0.8rem;
  color: var(--ink-1);
}

.table-col-type-input {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  color: var(--ink-2);
}

.table-col-flag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid rgba(30, 54, 49, 0.22);
  border-radius: 999px;
  background: #f2faf7;
  padding: 0.12rem 0.38rem;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.62rem;
  color: var(--ink-2);
}

.table-col-flag input {
  margin: 0;
}

.table-col-delete-btn {
  padding: 0.2rem 0.44rem;
}

.table-relationships-list,
.table-options-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: min(44vh, 420px);
  overflow-y: auto;
  padding-right: 2px;
}

.table-relationships-edit-list {
  display: grid;
  gap: 8px;
}

.table-relationship-edit-row,
.table-relationship-create-block {
  border: 1px solid rgba(28, 56, 51, 0.22);
  border-radius: 10px;
  background: #fcfdfb;
  padding: 8px;
}

.table-relationship-create-block h4 {
  margin: 0 0 8px;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.table-relationship-edit-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.field.compact {
  margin-bottom: 0;
}

.field.compact label {
  margin-bottom: 4px;
  font-size: 0.64rem;
}

.table-relationship-row,
.table-option-row {
  border: 1px solid rgba(28, 56, 51, 0.22);
  border-radius: 10px;
  background: #fcfdfb;
  padding: 8px;
}

.table-relationship-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
}

.table-relationship-path {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  color: var(--ink-2);
  line-height: 1.35;
}

.table-option-row {
  display: grid;
  gap: 4px;
}

.table-option-name {
  font-size: 0.8rem;
  color: var(--ink-1);
  font-weight: 600;
}

.table-option-value {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.74rem;
  color: var(--ink-2);
}

.table-readonly {
  border: 1px solid rgba(28, 56, 51, 0.2);
  border-radius: 8px;
  background: #fbfdfc;
  min-height: 36px;
  padding: 0.48rem 0.56rem;
  font-size: 0.86rem;
  display: flex;
  align-items: center;
  color: var(--ink-1);
}

.badge.not-null {
  color: #2e5a52;
  border-color: #9ac6bc;
  background: #ecf8f5;
}

.table-edit-actions {
  justify-content: flex-end;
  margin-top: 12px;
}

.table-edit-actions-left {
  justify-content: flex-start;
}

.danger {
  border-color: rgba(154, 54, 38, 0.3);
  color: #8b2b1d;
  background: #fff1ef;
}

.relationship-prompt {
  margin-top: 8px;
  font-size: 0.78rem;
  color: #7d491d;
  background: #fff0df;
  border: 1px solid #f2c598;
  border-radius: 8px;
  padding: 0.45rem 0.5rem;
}

@media (max-width: 1200px) {
  .workspace {
    grid-template-columns: 220px 1fr;
  }
}

@media (max-width: 980px) {
  .app-main {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .app-sidebar {
    border-right: none;
    border-bottom: 1px solid rgba(35, 54, 51, 0.15);
    flex-direction: row;
    flex-wrap: wrap;
  }

  .sidebar-btn {
    width: auto;
  }

  .sidebar-admin-group {
    flex-basis: 100%;
  }

  .sidebar-submenu {
    padding-left: 0;
  }

  .sidebar-submenu-btn {
    width: auto;
  }

  .home-shell-actions {
    justify-content: flex-start;
  }

  .admin-users-shell {
    grid-template-columns: 1fr;
  }

  .admin-column-types-add {
    grid-template-columns: 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(460px, 1fr);
  }

  .panel {
    max-height: 260px;
  }

  .table-edit-grid {
    grid-template-columns: 1fr;
  }

  .table-column-row {
    grid-template-columns: 1fr;
  }

  .table-relationship-edit-grid {
    grid-template-columns: 1fr;
  }

  .table-edit-actions {
    justify-content: flex-start;
  }

  .work-package-dual-list {
    grid-template-columns: 1fr;
  }

  .work-package-list-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .approval-diff-grid {
    grid-template-columns: 1fr;
  }
}
