:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-2: #f8fafb;
  --ink: #17212b;
  --muted: #65717d;
  --line: #dce4e8;
  --line-strong: #c8d3d9;
  --nav: #092331;
  --nav-2: #0f3141;
  --nav-active: #134b52;
  --teal: #0f9f8f;
  --teal-dark: #087b70;
  --amber: #e18a00;
  --red: #d93838;
  --green: #198f5a;
  --blue: #245e9f;
  --shadow: 0 16px 40px rgba(30, 45, 60, 0.08);
  --radius: 8px;
  --sidebar: 236px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
}

html,
body,
#app {
  height: 100%;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.boot {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  background: var(--bg);
}

.auth-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(9, 35, 49, 0.96), rgba(9, 35, 49, 0.82)),
    var(--bg);
}

.auth-card {
  width: min(440px, 100%);
  padding: 26px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.auth-brand {
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
}

.auth-card h1 {
  margin: 28px 0 8px;
  font-size: 28px;
  line-height: 1.15;
}

.auth-card p,
.auth-note {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 14px;
  margin: 24px 0 16px;
}

.auth-form label,
.form-grid label {
  display: grid;
  gap: 6px;
}

.auth-form label span,
.form-grid label span {
  color: #465661;
  font-size: 12px;
  font-weight: 750;
}

.auth-form input,
.form-grid input,
.form-grid select,
.form-grid textarea {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 10px;
  outline: 0;
}

.form-grid textarea {
  min-height: 120px;
  padding: 10px;
  resize: vertical;
}

.subsystem-import-card {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfc;
}

.subsystem-import-card legend {
  padding: 0 6px;
  color: #24333d;
  font-size: 13px;
  font-weight: 800;
}

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

.subsystem-import-actions {
  margin: 0;
}

.subsystem-import-list {
  max-height: 270px;
  display: grid;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.subsystem-import-option {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.subsystem-import-option input {
  width: auto;
  min-height: auto;
  margin-top: 3px;
  flex: 0 0 auto;
}

.subsystem-import-option strong,
.subsystem-import-option small {
  display: block;
}

.subsystem-import-option strong {
  font-size: 13px;
}

.subsystem-import-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dropzone input[type="file"] {
  min-height: 58px;
  padding: 14px 10px;
  border-style: dashed;
  background: #f8fbfc;
}

.auth-form input:focus,
.form-grid input:focus,
.form-grid select:focus,
.form-grid textarea:focus {
  border-color: var(--teal-dark);
  box-shadow: 0 0 0 3px rgba(15, 159, 143, 0.12);
}

.smart-picker-wrap {
  position: relative;
  width: 100%;
}

.smart-picker-wrap input {
  padding-right: 36px;
}

.smart-picker-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
}

.smart-picker-clear:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.smart-picker-menu {
  position: absolute;
  z-index: 60;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 280px;
  overflow: auto;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.smart-picker-option,
.smart-picker-empty {
  width: 100%;
  display: grid;
  gap: 3px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #fff;
  padding: 9px 10px;
  color: var(--ink);
  text-align: left;
}

.smart-picker-option:hover,
.smart-picker-option.active {
  background: #eef8f6;
}

.smart-picker-option strong {
  font-size: 13px;
}

.smart-picker-option span,
.smart-picker-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.smart-picker-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.smart-picker-pill {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  padding: 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.smart-picker-wrap.invalid input {
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(217, 56, 56, 0.12);
}

.auth-note {
  padding: 12px;
  border: 1px solid #f2d39a;
  border-radius: 6px;
  background: #fff7e6;
}

.auth-note.danger {
  border-color: #f0b8b8;
  background: #fff0f0;
  color: #9d2f2f;
}

.sso-button {
  width: 100%;
  margin: 0 0 14px;
}

.boot-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.boot-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

.shell {
  height: 100dvh;
  max-height: 100dvh;
  display: grid;
  grid-template-columns: clamp(204px, 16vw, var(--sidebar)) minmax(0, 1fr);
  overflow: hidden;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--nav) 0%, #071c28 100%);
  color: #d9e8ec;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 74px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  display: block;
  border: 1px solid rgba(80, 225, 208, 0.32);
  border-radius: 8px;
  background: #071c28;
  object-fit: cover;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.brand-mark::after {
  content: none;
}

.nav {
  padding: 12px 8px;
  overflow: auto;
}

.nav-button,
.side-action {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: #d5e4e9;
  padding: 0 12px;
  text-align: left;
  font-size: 14px;
  line-height: 1;
}

.nav-button:hover,
.side-action:hover {
  background: rgba(255, 255, 255, 0.07);
}

.nav-button.active {
  background: var(--nav-active);
  border-color: rgba(77, 207, 191, 0.25);
  color: #ffffff;
}

.nav-button svg,
.side-action svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  stroke-width: 1.9;
}

.nav-badge {
  margin-left: auto;
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #f26b2f;
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.sidebar-footer {
  margin-top: auto;
  padding: 10px 8px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.side-action {
  justify-content: flex-start;
}

.design-credit {
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0;
}

.auth-credit {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.sidebar-credit {
  margin-top: 12px;
  padding: 10px 10px 0;
  color: rgba(217, 232, 236, 0.64);
}

.workspace {
  min-width: 0;
  min-height: 0;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  min-height: 74px;
  display: grid;
  grid-template-columns: minmax(170px, 0.85fr) minmax(170px, 0.85fr) minmax(220px, 1.2fr) minmax(132px, 0.55fr) minmax(124px, 0.45fr) minmax(190px, 0.75fr);
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.top-cell {
  min-width: 0;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  border-right: 1px solid var(--line);
}

.field-stack {
  min-width: 0;
  width: 100%;
}

.field-stack label {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
}

.field-stack strong,
.field-stack select {
  color: var(--ink);
  font-size: 15px;
  font-weight: 750;
}

.field-stack select {
  width: 100%;
  border: 0;
  background: transparent;
  outline: 0;
  appearance: auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search {
  height: 42px;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
}

.search svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
}

.search input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--ink);
  font-size: 14px;
}

.module-search-results {
  margin-top: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  max-height: 260px;
  overflow: auto;
}

.module-search-results.empty {
  padding: 12px 14px;
  color: var(--muted);
  font-size: 13px;
}

.search-result-row {
  display: grid;
  gap: 3px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.search-result-row:last-child {
  border-bottom: 0;
}

.search-result-row:hover,
.search-result-row:focus-visible {
  background: #eef7f6;
  outline: none;
}

.search-result-row span {
  color: var(--muted);
  font-size: 12px;
}

.search-highlight {
  animation: searchPulse 2.2s ease;
}

@keyframes searchPulse {
  0%, 100% {
    box-shadow: inset 0 0 0 0 rgba(13, 148, 136, 0);
  }
  20%, 70% {
    box-shadow: inset 0 0 0 9999px rgba(13, 148, 136, 0.12);
  }
}

.inline-hint {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.inline-hint.good {
  border-color: #a7d9ce;
  background: #effaf7;
  color: #126655;
}

.inline-hint.warn {
  border-color: #f2bc43;
  background: #fff8e8;
  color: #7a4d00;
}

.sync-pill {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sync-icon {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--teal);
  color: white;
}

.sync-pill strong {
  display: block;
  font-size: 14px;
}

.sync-pill span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.sync-pill .live-time {
  display: inline;
  margin-left: 4px;
}

.permission-summary,
.subsystem-workspace {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--muted);
}

.permission-summary {
  padding: 12px 14px;
  font-weight: 700;
}

.permission-dropdown {
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  padding: 8px;
}

.permission-dropdown summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.2;
  font-size: 12px;
  list-style-position: outside;
}

.permission-dropdown summary svg {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  stroke-width: 2;
}

.permission-tools {
  margin-top: 10px;
}

.permission-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0;
}

.permission-option,
.permission-tools .check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
}

.permission-option input,
.permission-tools input {
  width: auto;
}

.permission-option input[type="checkbox"],
.permission-tools input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  max-height: 16px;
  flex: 0 0 16px;
  padding: 0;
  accent-color: var(--teal);
}

.permission-option span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.permission-edit-form {
  display: grid;
  gap: 8px;
  min-width: 280px;
  margin-bottom: 8px;
}

.subsystem-workspace {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.subsystem-workspace p {
  margin: 0;
  color: var(--ink);
}

tr.selected-row {
  background: rgba(31, 111, 122, 0.08);
}

.user {
  justify-content: flex-end;
}

.avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #203b67;
  color: white;
  font-weight: 800;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: #455661;
}

.icon-button.danger {
  border-color: #f0b8b8;
  color: var(--red);
}

.icon-button.danger:hover {
  background: #fff0f0;
}

.table-action {
  width: 30px;
  height: 30px;
}

.icon-button svg {
  width: 16px;
  height: 16px;
}

.notification-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.notification-button {
  position: relative;
}

.notification-button.active,
.notification-button:hover {
  border-color: #8ac8c0;
  background: #eefaf8;
  color: #08766d;
}

.notification-badge {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #dc2626;
  color: white;
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.notification-panel {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  width: min(520px, calc(100vw - 28px));
  max-height: min(74vh, 640px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 22px 54px rgba(15, 35, 50, 0.22);
}

.notification-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.notification-panel-head strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
}

.notification-panel-head span {
  color: var(--muted);
  font-size: 12px;
}

.notification-head-actions,
.notification-actions,
.notification-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.notification-filters {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #f7fafb;
}

.notification-filter {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.notification-filter.active {
  border-color: #8ac8c0;
  background: #e6f7f4;
  color: #08766d;
}

.notification-filter span {
  color: inherit;
  font-size: 11px;
}

.notification-list {
  min-height: 0;
  overflow: auto;
  padding: 10px;
}

.notification-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.notification-item + .notification-item {
  margin-top: 8px;
}

.notification-item.unread {
  border-color: #9bd9d0;
  background: #f2fbf9;
}

.notification-item.critical {
  border-left: 4px solid #dc2626;
}

.notification-item.warn {
  border-left: 4px solid #d97706;
}

.notification-main {
  min-width: 0;
}

.notification-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.notification-title-row strong {
  min-width: 0;
  color: var(--ink);
  overflow-wrap: anywhere;
}

.unread-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #0d9488;
}

.notification-item p {
  margin: 6px 0 9px;
  color: #435461;
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.notification-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.notification-actions {
  align-content: flex-start;
  justify-content: flex-end;
  max-width: 152px;
}

.role {
  min-width: 0;
  text-align: right;
}

.role strong {
  display: block;
  font-size: 14px;
}

.role span {
  color: var(--muted);
  font-size: 12px;
}

.main-scroll {
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding: 22px 16px 18px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 18px;
}

.page-title h1 {
  margin: 0 0 6px;
  color: #101a23;
  font-size: clamp(22px, 2vw, 30px);
  line-height: 1.12;
  letter-spacing: 0;
}

.page-title p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.btn {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.btn:hover {
  border-color: #99b1b9;
  background: #f9fbfc;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn:disabled:hover {
  border-color: var(--line-strong);
  background: var(--surface);
}

.btn.primary {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
  color: white;
}

.btn.danger {
  border-color: #eeb5b5;
  background: #fff7f7;
  color: var(--red);
}

.btn.small {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.file-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cell-note .file-actions,
.chat-attachment .file-actions {
  margin-top: 6px;
}

.chat-attachment {
  display: inline-block;
  margin: 4px 10px 4px 0;
}

.file-action {
  position: relative;
  text-decoration: none;
}

.file-action.view-action {
  border-color: #0b766f;
  background: #ecfdf7;
  color: #075f59;
}

.file-action.download-action {
  border-color: #a8b8c3;
  background: #f8fafc;
  color: #243341;
}

.file-action[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  z-index: 40;
  width: max-content;
  max-width: 240px;
  padding: 7px 9px;
  border-radius: 6px;
  background: #132532;
  color: white;
  box-shadow: 0 8px 22px rgba(15, 29, 41, 0.18);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
  text-align: center;
  white-space: normal;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px);
  transition: opacity 0.14s ease, transform 0.14s ease;
}

.file-action[data-tooltip]:hover::after,
.file-action[data-tooltip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}

.btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2;
}

.btn[disabled],
.btn.disabled,
.denied-download {
  opacity: 0.68;
  cursor: not-allowed;
}

.denied-download svg {
  width: 14px;
  height: 14px;
}

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

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

.span-2 {
  grid-column: span 2;
}

.span-full {
  grid-column: 1 / -1;
}

.panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(10, 30, 40, 0.02);
}

.panel-head {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
}

.panel-head small {
  color: var(--muted);
  font-size: 12px;
}

.panel-body {
  padding: 14px;
}

.vault-method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.vault-method {
  min-height: 148px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.vault-method strong {
  font-size: 15px;
}

.vault-method p {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.vault-method span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.help-dot {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  margin-left: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #fff;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  vertical-align: text-bottom;
}

.help-dot:hover,
.help-dot:focus {
  border-color: var(--teal-dark);
  background: #edfafa;
}

.help-drawer {
  width: min(760px, 100%);
  max-height: min(88vh, 920px);
  overflow: auto;
  border-left: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.help-list {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.help-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.help-item strong {
  font-size: 14px;
}

.help-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.thread {
  padding: 22px 24px;
}

.thread-rail {
  display: grid;
  grid-template-columns: repeat(7, minmax(90px, 1fr));
  gap: 0;
  align-items: start;
}

.thread-node {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  padding: 0 4px;
}

.thread-node::before {
  content: "";
  position: absolute;
  top: 31px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: #97a9b1;
}

.thread-node:first-child::before {
  display: none;
}

.node-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border: 1.5px solid #83929d;
  border-radius: 50%;
  background: white;
  z-index: 1;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.thread-node:hover .node-icon,
.thread-node:focus-visible .node-icon {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(10, 154, 139, 0.14);
  transform: translateY(-2px);
}

.thread-node:focus-visible {
  outline: 0;
}

.node-icon svg {
  width: 30px;
  height: 30px;
  color: #243340;
}

.thread-node h3 {
  min-height: 35px;
  margin: 12px 0 14px;
  font-size: 13px;
  line-height: 1.25;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--teal);
}

.status-dot.warn {
  background: var(--amber);
}

.status-dot.critical {
  background: var(--red);
}

.thread-node strong {
  margin-top: 10px;
  font-size: 18px;
}

.thread-node span {
  color: var(--muted);
  font-size: 12px;
}

.thread-node span.good {
  color: var(--green);
}

.thread-node span.warn {
  color: var(--amber);
}

.thread-node span.critical {
  color: var(--red);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.metric {
  min-height: 96px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  padding: 10px;
  border-right: 1px solid var(--line);
  text-align: center;
}

.metric:last-child {
  border-right: 0;
}

.metric small {
  color: var(--muted);
  font-size: 11px;
}

.metric strong {
  font-size: 30px;
  line-height: 1;
}

.metric strong.good {
  color: var(--green);
}

.metric strong.warn {
  color: var(--amber);
}

.metric strong.critical {
  color: var(--red);
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.trend {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  align-items: end;
  gap: 16px;
  min-height: 142px;
  padding: 18px 20px 12px;
}

.bar-wrap {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.bar {
  width: 36px;
  height: 88px;
  display: flex;
  flex-direction: column-reverse;
  overflow: hidden;
  border-radius: 4px 4px 0 0;
  background: #edf2f4;
}

.bar span {
  display: block;
  width: 100%;
}

.bar .good {
  background: #63b58d;
}

.bar .warn {
  background: #f2bc43;
}

.bar .critical {
  background: #e35950;
}

.bar-wrap small {
  color: var(--muted);
  font-size: 11px;
}

.table-wrap {
  overflow: auto;
}

.table-wrap.scroll-table {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.inventory-scroll-table {
  max-height: min(62vh, 680px);
}

.inventory-movement-scroll-table {
  max-height: min(52vh, 560px);
}

.vehicle-register-scroll-table {
  max-height: min(62vh, 680px);
}

.table-wrap.scroll-table thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  box-shadow: inset 0 -1px 0 var(--line);
}

.sort-header {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  text-align: left;
}

.sort-header span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

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

th,
td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
  overflow-wrap: normal;
}

th {
  color: #50606a;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.dashboard-grid th,
.dashboard-grid td {
  padding: 10px 9px;
  font-size: 12px;
  overflow-wrap: anywhere;
  white-space: normal;
}

.dashboard-grid table {
  min-width: 100%;
}

.module-grid .span-2 table {
  min-width: 1080px;
}

tr:last-child td {
  border-bottom: 0;
}

a.link,
.text-link {
  color: #006b7a;
  font-weight: 750;
  text-decoration: none;
}

button.text-link {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  font-size: inherit;
}

.cell-note {
  display: block;
  max-width: 520px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  white-space: normal;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 5px;
  border: 1px solid var(--line-strong);
  background: #f8fafb;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.chip.good,
.chip.pass,
.chip.released {
  border-color: #b9e1cb;
  background: #eaf7ef;
  color: var(--green);
}

.chip.warn,
.chip.medium,
.chip.review,
.chip.open {
  border-color: #f2d39a;
  background: #fff7e6;
  color: var(--amber);
}

.chip.critical,
.chip.high,
.chip.blocked,
.chip.risk {
  border-color: #f2b6b6;
  background: #fff0f0;
  color: var(--red);
}

.chip.neutral {
  border-color: var(--line-strong);
  background: #f8fafb;
  color: #3f4f59;
}

.subsystem-status-chip {
  cursor: pointer;
}

.subsystem-status-chip:focus-visible {
  outline: 2px solid var(--teal-dark);
  outline-offset: 2px;
}

.inline-status-select {
  min-height: 30px;
  min-width: 132px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  padding: 0 8px;
  outline: 0;
}

.inline-status-select:focus {
  border-color: var(--teal-dark);
  box-shadow: 0 0 0 3px rgba(15, 159, 143, 0.12);
}

.commit-list {
  display: grid;
  gap: 8px;
}

.commit {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.hash {
  font-family: "SFMono-Regular", Consolas, monospace;
  color: #006b7a;
  font-size: 12px;
  font-weight: 800;
}

.commit strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.commit span,
.commit time {
  color: var(--muted);
  font-size: 12px;
}

.trace-chain {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) 28px minmax(0, 1fr);
  gap: 10px;
  align-items: stretch;
}

.trace-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.trace-card h3 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.trace-card dl {
  margin: 0;
  padding: 10px 12px 12px;
}

.trace-card dt {
  color: var(--muted);
  font-size: 11px;
}

.trace-card dd {
  margin: 2px 0 8px;
  font-size: 13px;
}

.arrow {
  display: grid;
  place-items: center;
  color: #6a7b84;
}

.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

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

.form-grid .wide {
  grid-column: 1 / -1;
}

.form-grid label.check {
  display: flex;
  align-items: center;
  gap: 10px;
}

.form-grid label.check input {
  width: auto;
  min-height: auto;
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-2);
}

.check-grid .check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.check-grid input {
  width: auto;
  min-height: auto;
  flex: 0 0 auto;
}

.form-section-label {
  display: block;
  margin: 0 0 6px;
  color: #465661;
  font-size: 12px;
  font-weight: 750;
}

.approver-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.approver-check-grid {
  max-height: 230px;
  overflow: auto;
}

.approver-check-grid .check span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.approver-check-grid .check small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.department-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.department-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.department-card label {
  display: grid;
  gap: 6px;
}

.department-card label span {
  color: #465661;
  font-size: 12px;
  font-weight: 750;
}

.department-card input,
.department-card select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 11px;
  outline: 0;
}

.department-card .wide {
  grid-column: 1 / -1;
}

.department-card .approver-check-grid {
  grid-template-columns: 1fr;
  max-height: 180px;
}

.department-card .approver-check-grid .check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
}

.department-card .approver-check-grid input[type="checkbox"],
.check-grid input[type="checkbox"],
.form-grid label.check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  min-width: 16px;
  min-height: 16px;
  max-width: 16px;
  max-height: 16px;
  flex: 0 0 16px;
  margin: 2px 0 0;
  padding: 0;
  accent-color: var(--teal);
}

.department-card .approver-check-grid .check span,
.department-card .approver-check-grid .check strong,
.department-card .approver-check-grid .check small {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.approval-gate,
.handler-line,
.department-handler-preview {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.approval-gate {
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.approval-owner-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.approver-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid #bdd7d4;
  border-radius: 999px;
  background: #ecfaf8;
  color: #0f4f49;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.approver-pill small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.mail-preview {
  display: grid;
  gap: 12px;
}

.mail-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.mail-title-row strong {
  display: block;
  font-size: 18px;
  line-height: 1.25;
}

.mail-title-row span,
.mail-reply-context span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.mail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mail-meta-grid div,
.mail-reply-context {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}

.mail-meta-grid small {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.mail-meta-grid span {
  display: block;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.mail-body {
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  padding: 14px;
  font: 14px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  overflow-wrap: anywhere;
}

.mail-compose {
  min-height: 220px;
  line-height: 1.5;
  resize: vertical;
}

.mail-reply-context strong {
  display: block;
  overflow-wrap: anywhere;
}

.suggestion-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin-top: 6px;
  padding: 4px 8px;
  border: 1px solid rgba(14, 116, 144, 0.25);
  border-radius: 999px;
  background: #ecfeff;
  color: #0f5968;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.suggestion-chip.success {
  border-color: rgba(5, 150, 105, 0.24);
  background: #ecfdf5;
  color: #047857;
}

.suggestion-chip.warning {
  border-color: rgba(217, 119, 6, 0.28);
  background: #fffbeb;
  color: #92400e;
}

.suggestion-chip.danger {
  border-color: rgba(220, 38, 38, 0.25);
  background: #fef2f2;
  color: #b91c1c;
}

.rule-list {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.rule-row-form {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  padding: 12px;
}

.security-note,
.json-format-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px;
}

.security-note {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.security-note p,
.json-format-card p {
  margin: 0;
  color: var(--muted);
}

.json-format-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.json-format-card {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.json-format-card pre {
  max-height: 360px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f6fafb;
  padding: 12px;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.guide-list,
.attachment-grid {
  display: grid;
  gap: 12px;
}

.guide-list > div,
.attachment-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 14px;
}

.guide-list strong,
.attachment-card strong {
  display: block;
}

.guide-list span,
.route-suggestion span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.attachment-card {
  display: grid;
  gap: 12px;
}

.attachment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.route-suggestion {
  border-left: 3px solid var(--teal-dark);
  padding-left: 10px;
}

.form-grid.compact {
  gap: 10px;
}

.job-card-table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.job-card-editor {
  min-width: 960px;
  border-collapse: collapse;
  empty-cells: show;
}

.job-card-editor th,
.job-card-editor td {
  border: 1px solid var(--line);
  padding: 6px;
  text-align: left;
  vertical-align: top;
}

.job-card-editor th {
  color: #465661;
  font-size: 11px;
  background: #f4f8f9;
}

.job-card-editor input,
.job-card-editor select {
  min-height: 34px;
  padding: 0 8px;
}

.job-card-checklist {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fbfc;
  padding: 12px;
}

.checklist-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 10px;
}

.checklist-head span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

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

.checklist-item {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 8px;
}

.checklist-item small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 2px;
}

.compact-drawer {
  max-width: 680px;
}

.job-card-popup-list {
  display: grid;
  gap: 10px;
  margin: 16px 0;
}

.job-card-popup-list .checklist-item {
  display: flex;
  gap: 10px;
  align-items: center;
}

.job-card-popup-list .checklist-item input {
  width: auto;
}

.job-card-popup-list .select-all-row {
  border-color: rgba(20, 184, 166, 0.45);
  background: rgba(20, 184, 166, 0.08);
  font-weight: 800;
}

.empty-state {
  border: 1px dashed var(--line-strong);
  border-radius: 6px;
  color: var(--muted);
  background: #f8fbfc;
  padding: 14px;
}

.empty-state.danger {
  border-color: rgba(220, 38, 38, 0.45);
  background: #fef2f2;
  color: #991b1b;
}

.inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 12px;
}

.stack {
  display: grid;
  gap: 14px;
}

.program-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.kpi {
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.kpi small {
  color: var(--muted);
  font-size: 12px;
}

.kpi strong {
  display: block;
  margin: 8px 0 4px;
  font-size: 28px;
}

.kpi span {
  color: var(--muted);
  font-size: 12px;
}

.context-bar {
  min-height: 72px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 10px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  background: #092331;
  color: #dbe9ed;
}

.context-left {
  display: grid;
  gap: 3px;
  min-width: 190px;
}

.context-left strong {
  font-size: 14px;
}

.context-left span {
  color: rgba(219, 233, 237, 0.72);
  font-size: 11px;
  line-height: 1.3;
}

.context-controls {
  display: flex;
  gap: 10px;
  min-width: 0;
  overflow: auto;
}

.context-select {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.08);
  color: #dce9ed;
  white-space: nowrap;
}

.context-select label {
  color: #a8bbc4;
  font-size: 12px;
}

.context-select strong {
  font-size: 13px;
}

.context-status {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 286px;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
}

.context-status strong {
  display: block;
  color: #3fd2bd;
  font-size: 14px;
}

.context-status span {
  display: block;
  color: #c5d7de;
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 10;
  max-width: 360px;
  padding: 13px 15px;
  border: 1px solid #b5ded8;
  border-radius: 7px;
  background: #e8faf7;
  color: #075e55;
  box-shadow: var(--shadow);
  font-size: 13px;
  font-weight: 750;
}

.linked-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  justify-content: flex-end;
  background: rgba(9, 35, 49, 0.42);
}

.linked-drawer {
  width: min(920px, 100%);
  height: 100vh;
  overflow: auto;
  padding: 18px;
  border-left: 1px solid var(--line-strong);
  background: var(--bg);
  box-shadow: -22px 0 44px rgba(9, 35, 49, 0.18);
}

.linked-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.drawer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-left: auto;
}

.context-transfer-form {
  margin-top: 14px;
}

.linked-head h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.linked-head p {
  margin: 5px 0 0;
  color: var(--muted);
}

.linked-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.linked-meta-grid > div,
.linked-version-note,
.linked-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.linked-meta-grid > div {
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px 12px;
}

.linked-meta-grid small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.linked-meta-grid strong {
  font-size: 15px;
  overflow-wrap: anywhere;
}

.linked-version-note {
  margin-bottom: 12px;
  padding: 12px;
  color: #40505a;
  font-size: 13px;
  line-height: 1.45;
}

.linked-section {
  margin-top: 12px;
  overflow: hidden;
}

.linked-section h3 {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.linked-section .table-wrap {
  max-height: 340px;
}

.error {
  margin: 28px;
  padding: 18px;
  border: 1px solid #efb2b2;
  border-radius: var(--radius);
  background: #fff1f1;
  color: #9a2020;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
}

.calendar-header strong {
  color: var(--ink);
  font-size: 16px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 14px;
}

.calendar-weekday {
  min-height: 32px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-weekday:nth-child(7) {
  border-right: 0;
}

.calendar-cell {
  min-height: 104px;
  padding: 7px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #fff;
  overflow: hidden;
}

.calendar-cell:nth-child(7n) {
  border-right: 0;
}

.calendar-cell.muted {
  background: #f4f7f8;
}

.calendar-cell.today {
  box-shadow: inset 0 0 0 2px rgba(15, 159, 143, 0.28);
}

.calendar-day {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.calendar-event {
  width: 100%;
  min-height: 24px;
  display: block;
  margin: 3px 0;
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: #eef7f6;
  color: #075e55;
  font-size: 11px;
  font-weight: 750;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event.critical {
  background: #fff0f0;
  border-color: #f0b8b8;
  color: #9d2f2f;
}

.calendar-event.warn {
  background: #fff7e6;
  border-color: #f2d39a;
  color: #8a5300;
}

.calendar-event.good {
  background: #edf9f2;
  border-color: #bce7ce;
  color: #166238;
}

.project-board {
  display: grid;
  grid-template-columns: repeat(7, minmax(180px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.project-column {
  min-width: 180px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fafc;
  display: flex;
  flex-direction: column;
  max-height: 520px;
}

.project-column header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}

.project-column header span {
  min-width: 26px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: #e8eef3;
  font-size: 12px;
  color: var(--muted);
}

.project-card-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  overflow: auto;
}

.project-card,
.empty-card {
  width: 100%;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  text-align: left;
  display: grid;
  gap: 6px;
  color: var(--text);
}

.project-card {
  cursor: pointer;
}

.project-card-main {
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  display: grid;
  gap: 6px;
  cursor: pointer;
}

.project-card-main strong,
.project-card-main span,
.project-card-main small {
  overflow-wrap: anywhere;
}

.project-card-main span,
.project-card-main small,
.empty-card {
  color: var(--muted);
  font-size: 12px;
}

.project-card-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.project-card-actions .btn.small {
  min-height: 30px;
  padding: 5px 8px;
}

.project-progress {
  width: 96px;
  height: 8px;
  background: #e8eef3;
  border-radius: 999px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
  margin-right: 6px;
}

.project-progress span {
  display: block;
  height: 100%;
  background: #0f9b8e;
}

.inline-select.project-status-control {
  min-width: 132px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  padding: 6px 30px 6px 10px;
  font: inherit;
}

.compact-project-form {
  align-items: end;
}

@media (max-width: 1400px) {
  .topbar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .user {
    justify-content: flex-start;
  }

  .top-cell {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 1180px) {
  .shell {
    grid-template-columns: 204px minmax(0, 1fr);
  }

  .topbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .top-cell {
    padding: 9px 14px;
  }

  .role {
    text-align: left;
  }

  .notification-panel {
    right: auto;
    left: 0;
  }

  .dashboard-grid,
  .module-grid {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .thread-rail {
    grid-template-columns: repeat(4, minmax(110px, 1fr));
    gap: 22px 8px;
  }

  .thread-node::before {
    display: none;
  }
}

@media (max-width: 820px) {
  .shell {
    height: 100dvh;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
  }

  .sidebar {
    position: relative;
    height: auto;
    max-height: 178px;
    overflow: hidden;
  }

  .workspace {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .brand {
    min-height: 62px;
  }

  .nav {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 8px;
  }

  .nav-button {
    width: auto;
    min-width: 150px;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    grid-template-columns: 1fr;
    max-height: 42vh;
    overflow: auto;
  }

  .top-cell {
    min-height: 62px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .notification-panel {
    position: fixed;
    top: 86px;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: 72vh;
  }

  .notification-item {
    grid-template-columns: 1fr;
  }

  .notification-actions {
    justify-content: flex-start;
    max-width: none;
  }

  .page-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .mail-title-row,
  .checklist-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .mail-meta-grid {
    grid-template-columns: 1fr;
  }

  .actions {
    width: 100%;
    justify-content: flex-start;
  }

  .thread-rail,
  .metrics,
  .kpi-row,
  .subsystem-import-grid,
  .department-card,
  .form-grid,
  .trace-chain {
    grid-template-columns: 1fr;
  }

  .project-board {
    grid-template-columns: repeat(7, minmax(168px, 220px));
  }

  .arrow {
    min-height: 18px;
    transform: rotate(90deg);
  }

  .context-bar {
    grid-template-columns: 1fr;
  }

  .context-status {
    min-width: 0;
  }

  .toast {
    left: 16px;
    right: 16px;
    bottom: 20px;
  }
}
