:root {
  --bg: #e8efec;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: #ffffff;
  --surface-soft: rgba(248, 251, 249, 0.82);
  --ink: #14231e;
  --muted: #61736b;
  --muted-strong: #3d5149;
  --line: rgba(92, 116, 106, 0.19);
  --primary: #166247;
  --primary-dark: #0d3d2d;
  --accent: #238d78;
  --accent-soft: rgba(35, 141, 120, 0.11);
  --blue: #315f9f;
  --warn: #b45309;
  --danger: #b42318;
  --soft: rgba(224, 241, 231, 0.72);
  --glass: rgba(255, 255, 255, 0.68);
  --glass-strong: rgba(255, 255, 255, 0.84);
  --shadow: 0 16px 34px rgba(23, 44, 35, 0.08);
  --shadow-soft: 0 7px 18px rgba(23, 44, 35, 0.06);
  --sidebar: #081f1b;
  --sidebar-2: #0d2b2d;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(135deg, rgba(22, 98, 71, 0.16), transparent 30%),
    linear-gradient(225deg, rgba(49, 95, 159, 0.14), transparent 35%),
    linear-gradient(180deg, #f2f7f2 0%, #e9f1ee 52%, #f8faf7 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
  font-size: 13px;
}

.hidden {
  display: none !important;
}

.login-mode {
  min-height: 100vh;
  background:
    linear-gradient(90deg, rgba(35, 106, 75, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(35, 106, 75, 0.08) 1px, transparent 1px),
    #f3f6f1;
  background-size: 44px 44px;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 460px);
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
  padding: clamp(28px, 6vw, 76px);
}

.login-hero {
  max-width: 720px;
  display: grid;
  gap: 34px;
}

.login-brand {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 800;
}

.login-mark {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(35, 106, 75, 0.22);
  border-radius: 8px;
  color: white;
  background: var(--primary);
  font-size: 14px;
  letter-spacing: 0;
}

.login-copy {
  display: grid;
  gap: 14px;
}

.login-kicker {
  margin: 0;
  color: var(--primary);
  font-size: 14px;
  font-weight: 800;
}

.login-copy h1 {
  max-width: 680px;
  margin: 0;
  color: #18251e;
  font-size: clamp(34px, 4.8vw, 58px);
  line-height: 1.08;
}

.login-copy p {
  max-width: 560px;
  margin: 0;
  color: #526158;
  font-size: 17px;
}

.login-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 150px));
  gap: 12px;
}

.login-stats span {
  display: grid;
  gap: 4px;
  min-height: 76px;
  padding: 13px 14px;
  border: 1px solid rgba(35, 106, 75, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  box-shadow: 0 12px 32px rgba(24, 41, 31, 0.06);
}

.login-stats b {
  color: var(--ink);
  font-size: 24px;
}

.login-panel {
  width: 100%;
  display: grid;
  gap: 16px;
  padding: 30px;
  border: 1px solid rgba(23, 63, 46, 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 24px 70px rgba(24, 41, 31, 0.14);
}

.login-panel-head {
  display: grid;
  gap: 6px;
}

.login-panel-head span {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
}

.login-panel h2 {
  margin: 0;
  color: #18251e;
  font-size: 26px;
}

.login-panel label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.login-panel input {
  width: 100%;
  min-height: 44px;
  border: 1px solid #d6dfd7;
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fbfcfa;
  font: inherit;
}

.login-panel input:focus {
  outline: 3px solid rgba(35, 106, 75, 0.14);
  border-color: var(--primary);
}

.login-submit {
  min-height: 46px;
  font-weight: 800;
}

.login-hints {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.login-hints span {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 8px;
  background: #f8faf7;
  overflow-wrap: anywhere;
}

.login-result {
  min-height: 44px;
  padding: 10px 12px;
  font-size: 13px;
}

body.locale-ug {
  direction: rtl;
  font-family: "UKIJ Ekran", "UKIJ Tuz", "Noto Sans Arabic", "Segoe UI", Arial, sans-serif;
}

body.locale-ug #archive,
body.locale-ug #archivePreview,
body.locale-ug .archive-preview {
  direction: ltr;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans SC", "Microsoft YaHei", Arial, sans-serif;
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background:
    linear-gradient(180deg, rgba(8, 31, 27, 0.98), rgba(13, 43, 45, 0.98)),
    linear-gradient(135deg, rgba(35, 141, 120, 0.36), transparent 45%);
  color: #eef7f3;
  padding: 16px 12px;
  border-right: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 18px 0 42px rgba(15, 42, 35, 0.12);
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 8px 16px;
  font-size: 15px;
  font-weight: 800;
}

.brand::after {
  content: "2026";
  margin-left: auto;
  border: 1px solid rgba(158, 229, 202, 0.28);
  border-radius: 999px;
  padding: 2px 7px;
  color: #bff2dd;
  background: rgba(158, 229, 202, 0.10);
  font-size: 10px;
  font-weight: 800;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #0f3128;
  background: linear-gradient(135deg, #f7fff9, #a9e6d0);
  font-size: 11px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 10px 22px rgba(0, 0, 0, 0.18);
}

.tenant-card {
  min-width: 168px;
  background: linear-gradient(180deg, var(--glass-strong), rgba(255, 255, 255, 0.66));
  border: 1px solid rgba(255, 255, 255, 0.74);
  border-radius: var(--radius);
  padding: 7px 10px;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.tenant-card strong,
.tenant-switcher {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
}

.tenant-switcher span {
  color: var(--muted-strong);
  font-weight: 700;
}

.tenant-switcher select {
  width: 100%;
  min-height: 29px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 3px 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  font: inherit;
}

.compact-switcher {
  min-width: 108px;
}

.locale-switcher {
  min-width: 86px;
}

nav {
  display: grid;
  gap: 8px;
}

.nav-section {
  display: grid;
  gap: 2px;
}

.nav-section-toggle {
  position: relative;
  min-height: 24px;
  padding: 2px 24px 2px 9px;
  color: rgba(238, 247, 243, 0.54);
  background: transparent;
  border: 0;
  text-align: left;
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
  box-shadow: none;
}

.nav-section-toggle::after {
  content: "⌄";
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-52%);
  color: rgba(238, 247, 243, 0.52);
  font-size: 13px;
}

.nav-section.collapsed .nav-section-toggle::after {
  content: "›";
}

.nav-section.collapsed button[data-view] {
  display: none;
}

body.locale-ug .nav-section-toggle {
  padding-left: 24px;
  padding-right: 9px;
  text-align: right;
}

body.locale-ug .nav-section-toggle::after {
  left: 9px;
  right: auto;
}

button {
  border: 1px solid var(--line);
  border-radius: 7px;
  min-height: 28px;
  padding: 4px 9px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 650;
}

nav button[data-view] {
  border: 0;
  min-height: 30px;
  padding: 5px 10px;
  color: rgba(238, 247, 243, 0.78);
  background: transparent;
  text-align: left;
  font-weight: 650;
}

body.locale-ug nav button,
body.locale-ug .tenant-switcher,
body.locale-ug .tenant-card,
body.locale-ug .topbar,
body.locale-ug .module-kicker,
body.locale-ug .panel,
body.locale-ug .metrics article {
  text-align: right;
}

nav button[data-view].active,
nav button[data-view]:hover {
  color: #ffffff;
  background:
    linear-gradient(90deg, rgba(158, 229, 202, 0.22), rgba(255, 255, 255, 0.10));
  border-radius: 8px;
  box-shadow: inset 3px 0 0 #9ee5ca;
}

body.locale-ug nav button[data-view].active,
body.locale-ug nav button[data-view]:hover {
  box-shadow: inset -3px 0 0 #9ee5ca;
}

.primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-color: var(--primary);
  color: white;
  box-shadow: 0 10px 22px rgba(22, 98, 71, 0.18);
}

.ghost-action {
  background: rgba(255, 255, 255, 0.58);
}

main {
  min-width: 0;
  padding: 14px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(210px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin: -14px -14px 12px;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.84);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.95), rgba(232, 248, 241, 0.78) 48%, rgba(237, 243, 252, 0.82)),
    linear-gradient(180deg, rgba(250, 253, 251, 0.90), rgba(241, 247, 244, 0.78)),
    rgba(247, 250, 248, 0.78);
  backdrop-filter: blur(22px);
  box-shadow: 0 10px 26px rgba(30, 57, 47, 0.07);
}

.page-title {
  position: relative;
  min-width: 220px;
  display: grid;
  gap: 2px;
}

.page-title h1 {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.page-title h1 small {
  display: inline-flex;
  align-items: center;
  max-width: 108px;
  min-height: 18px;
  border: 1px solid rgba(35, 141, 120, 0.16);
  border-radius: 999px;
  padding: 1px 7px;
  color: var(--primary-dark);
  background: var(--accent-soft);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.locale-ug .page-title h1 {
  justify-content: flex-end;
}

body.locale-ug .page-title h1 small {
  max-width: 104px;
}

.module-kicker {
  width: max-content;
  max-width: 100%;
  border: 1px solid rgba(35, 141, 120, 0.18);
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--primary-dark);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}

.page-title p {
  display: block;
  max-width: 720px;
  font-size: 11px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ui-version {
  position: absolute;
  top: 0;
  right: 0;
  display: none;
  align-items: center;
  min-height: 20px;
  border: 1px solid rgba(49, 95, 159, 0.20);
  border-radius: 999px;
  padding: 2px 8px;
  color: #244f8e;
  background: rgba(49, 95, 159, 0.08);
  font-size: 11px;
  font-weight: 800;
}

body.locale-ug .ui-version {
  left: 0;
  right: auto;
}

.topbar-tools {
  display: grid;
  grid-template-columns: 1px minmax(170px, 240px) auto auto auto;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
}

.topbar-tools::before {
  content: "";
  align-self: stretch;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(92, 116, 106, 0.24), transparent);
}

.workspace-switcher,
.account-cluster,
.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.workspace-switcher,
.identity-switcher,
.toolbar-actions,
.account-cluster {
  min-height: 34px;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.46);
  padding: 3px;
  box-shadow: 0 6px 16px rgba(24, 50, 40, 0.045);
  backdrop-filter: blur(16px);
}

.workspace-switcher {
  min-width: 0;
}

.enterprise-switcher,
.enterprise-switcher select {
  width: 100%;
}

.identity-switcher {
  min-width: 118px;
}

.toolbar-actions button {
  white-space: nowrap;
}

.user-chip {
  display: flex;
  align-items: center;
  min-width: 74px;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: var(--radius);
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.64);
  backdrop-filter: blur(16px);
}

.user-chip span {
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-backdrop {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: rgba(15, 31, 26, 0.18);
  backdrop-filter: blur(3px);
}

.profile-panel {
  position: fixed;
  top: 56px;
  right: 16px;
  z-index: 80;
  width: min(480px, calc(100vw - 32px));
  max-height: calc(100vh - 72px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.76);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(235, 247, 241, 0.86)),
    var(--surface);
  box-shadow: 0 22px 56px rgba(21, 43, 35, 0.18);
  padding: 12px;
  backdrop-filter: blur(20px);
}

body.locale-ug .profile-panel {
  left: 16px;
  right: auto;
}

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

.profile-panel-head span {
  display: block;
  color: var(--primary);
  font-size: 10px;
  font-weight: 850;
  text-transform: uppercase;
}

.compact-result {
  min-height: 38px;
  margin-top: 8px;
  padding: 7px 9px;
  font-size: 12px;
}

h1 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

h2 {
  margin: 0 0 9px;
  font-size: 14px;
  line-height: 1.25;
}

p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
}

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

.view {
  display: none;
}

.view.active {
  display: block;
}

.command-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 12px;
  margin-bottom: 12px;
}

.command-hero,
.focus-panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.command-hero {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-end;
  min-height: 138px;
  padding: 18px;
  color: #f8fffb;
  background:
    linear-gradient(135deg, rgba(10, 44, 37, 0.96), rgba(18, 89, 73, 0.88) 52%, rgba(32, 82, 134, 0.84)),
    #0d2b2d;
}

.command-hero::after {
  content: "";
  position: absolute;
  inset: auto 20px 0 auto;
  width: 220px;
  height: 68px;
  border-radius: 8px 8px 0 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.03)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.22) 0 1px, transparent 1px 22px);
  opacity: 0.58;
}

.command-hero > * {
  position: relative;
  z-index: 1;
}

.command-hero .module-kicker {
  color: #d9fff0;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.18);
}

.command-hero h2 {
  margin: 10px 0 7px;
  color: #ffffff;
  font-size: 26px;
  line-height: 1.18;
}

.command-hero p {
  max-width: 620px;
  color: rgba(248, 255, 251, 0.78);
  font-size: 13px;
}

.hero-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.hero-actions button {
  border-color: rgba(255, 255, 255, 0.24);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.hero-actions .primary {
  color: #0d2b2d;
  background: #ffffff;
  border-color: #ffffff;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.16);
}

.focus-panel {
  display: grid;
  align-content: center;
  gap: 8px;
  min-height: 138px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(239, 248, 244, 0.76));
}

.focus-panel span,
.panel-head span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
}

.focus-panel strong {
  color: var(--ink);
  font-size: 17px;
}

.focus-panel p {
  max-height: 72px;
  overflow: hidden;
  font-size: 12px;
}

.role-console {
  display: grid;
  grid-template-columns: 1.15fr 0.9fr 1.2fr;
  gap: 12px;
  margin-bottom: 12px;
}

.role-console > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 251, 249, 0.76));
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(16px);
}

.role-brief {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(231, 246, 240, 0.82)) !important;
}

.role-brief > span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 850;
}

.role-brief h2 {
  margin: 5px 0 6px;
  font-size: 17px;
}

.scope-list,
.quick-action-grid,
.solution-map {
  display: grid;
  gap: 7px;
}

.scope-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.scope-list span {
  border: 1px solid rgba(35, 141, 120, 0.16);
  border-radius: 7px;
  padding: 7px 8px;
  color: var(--primary-dark);
  background: rgba(35, 141, 120, 0.08);
  font-size: 12px;
  font-weight: 750;
}

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

.quick-action {
  justify-content: center;
  min-height: 36px;
  background: rgba(255, 255, 255, 0.82);
}

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

.solution-card {
  display: grid;
  gap: 6px;
  min-height: 76px;
  padding: 9px;
  white-space: pre-line;
  text-align: left;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 250, 247, 0.72));
}

.solution-card .status {
  width: max-content;
}

.solution-card.disabled {
  opacity: 0.56;
  cursor: default;
}

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

.integration-card {
  min-height: 118px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(244, 250, 247, 0.72));
  box-shadow: var(--shadow-soft);
}

.integration-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
}

.integration-card p {
  font-size: 12px;
}

.metrics,
.grid {
  display: grid;
  gap: 12px;
}

.metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
}

.compact-metrics {
  gap: 8px;
  margin-bottom: 0;
}

.metrics article,
.panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(250, 253, 251, 0.78));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  backdrop-filter: blur(16px);
}

.metrics article {
  min-height: 96px;
  position: relative;
  overflow: hidden;
}

.compact-metrics article {
  min-height: 74px;
  padding: 10px 12px;
}

.executive-metrics article {
  display: grid;
  align-content: end;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(237, 248, 244, 0.78)),
    var(--surface);
}

.metrics article::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, var(--accent), rgba(49, 95, 159, 0.44));
}

body.locale-ug .metrics article::before {
  inset: 0 0 0 auto;
}

.metrics b {
  display: block;
  font-size: 28px;
  margin-bottom: 2px;
}

.compact-metrics b {
  font-size: 20px;
}

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

.grid {
  grid-template-columns: repeat(12, 1fr);
}

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

.panel-head h2 {
  margin: 2px 0 0;
}

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

.workstream-panel,
.batch-command-panel {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 249, 0.84));
}

.alert-panel {
  background:
    linear-gradient(180deg, rgba(255, 251, 241, 0.96), rgba(255, 255, 255, 0.82));
  border-color: rgba(180, 83, 9, 0.18);
}

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

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

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

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

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

.panel-gap {
  margin-top: 10px;
}

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

.module-grid,
.module-section,
.module-cards {
  display: grid;
  gap: 9px;
}

.module-section h3 {
  margin: 4px 0 0;
  font-size: 15px;
}

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

.module-card {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface-soft);
}

.module-card.enabled {
  background: #f1f7f2;
  border-color: #bdd8c4;
}

.module-card-head,
.module-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.module-card strong,
.module-card small {
  display: block;
}

.module-card p {
  margin: 0;
}

.module-card small,
.module-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

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

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

.setup-summary article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background: var(--surface-soft);
}

.setup-summary b,
.setup-summary span {
  display: block;
}

.setup-summary b {
  color: var(--primary-dark);
  font-size: 20px;
  line-height: 1.15;
}

.setup-summary span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.org-card {
  display: grid;
  gap: 7px;
  min-height: 148px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(247, 251, 249, 0.70));
  box-shadow: 0 7px 16px rgba(23, 44, 35, 0.04);
}

.org-card.active {
  border-color: rgba(35, 141, 120, 0.24);
  background:
    linear-gradient(180deg, rgba(241, 249, 245, 0.96), rgba(255, 255, 255, 0.78));
}

.org-card.setup-check {
  min-height: 132px;
  border-left: 3px solid rgba(194, 144, 51, 0.55);
}

.org-card.setup-check.active {
  border-left-color: rgba(35, 141, 120, 0.72);
}

.org-card-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
}

.org-card strong,
.org-card small {
  display: block;
}

.org-card p {
  margin: 0;
  color: var(--ink);
  font-weight: 750;
}

.org-card small {
  color: var(--muted);
  line-height: 1.45;
}

.warn-text {
  color: var(--warn);
}

.compact-list {
  margin-top: 10px;
}

.item {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.86), rgba(249, 252, 250, 0.66));
  box-shadow: 0 7px 16px rgba(23, 44, 35, 0.04);
}

.item-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 120px;
}

.item strong {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.item small {
  color: var(--muted);
}

.trace-item {
  align-items: flex-start;
}

.readiness-summary {
  color: var(--muted);
  line-height: 1.7;
}

.readiness-item {
  align-items: flex-start;
}

.batch-board {
  display: grid;
  gap: 9px;
}

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

.batch-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.90), rgba(244, 250, 247, 0.72));
  box-shadow: 0 9px 20px rgba(23, 44, 35, 0.05);
}

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

.batch-head strong,
.batch-head small {
  display: block;
}

.batch-head small {
  color: var(--muted);
  margin-top: 4px;
}

.progress-track {
  height: 7px;
  border-radius: 999px;
  background: #edf1ec;
  margin: 8px 0;
  overflow: hidden;
}

.progress-track span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent), var(--blue));
}

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

.step-pill {
  min-height: 26px;
  padding: 5px 6px;
  font-size: 11px;
  white-space: nowrap;
  text-align: center;
}

.step-pill.completed {
  border-color: #c6ddce;
  background: #e7f3ec;
  color: var(--primary-dark);
}

.step-pill.pending {
  border-color: #f1d59d;
  background: #fff4df;
  color: var(--warn);
}

.step-pill.blocked {
  border-color: #f0c5c0;
  background: #fff0ee;
  color: var(--danger);
}

.link-button {
  border: 0;
  min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
}

.link-button:hover {
  color: var(--primary);
}

.batch-detail {
  display: grid;
  gap: 12px;
}

.detail-cover {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.detail-cover h3,
.detail-section h3 {
  margin: 0 0 8px;
  font-size: 15px;
}

.detail-cover p {
  margin: 0;
}

.detail-section {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: var(--surface-soft);
}

.detail-rows {
  display: grid;
  gap: 7px;
}

.detail-line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 8px;
  font-size: 13px;
}

.detail-line span {
  color: var(--muted);
}

.detail-line strong {
  font-weight: 600;
  overflow-wrap: anywhere;
}

.detail-actions {
  display: flex;
  justify-content: flex-end;
}

.trace-chain {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: rgba(255, 255, 255, 0.7);
  display: grid;
  gap: 8px;
}

.trace-chain h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.trace-node {
  position: relative;
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  border-left: 3px solid #c6ddce;
  padding: 7px 8px 7px 10px;
  background: #f6faf6;
  border-radius: 6px;
}

.trace-node.pending {
  border-left-color: #f1d59d;
  background: #fffaf0;
}

.trace-node.blocked {
  border-left-color: #f0c5c0;
  background: #fff7f6;
}

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

.trace-node strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.trace-search {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.trace-search input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  font: inherit;
  background: rgba(255, 255, 255, 0.78);
}

.trace-search-result {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}

.search-hit {
  min-height: 30px;
  padding: 5px 9px;
  font-size: 12px;
}

.amount-input,
.settlement-select {
  width: 96px;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 5px 7px;
  font: inherit;
  font-size: 12px;
}

.settlement-select {
  width: 88px;
}

.status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 3px 8px;
  min-height: 22px;
  font-size: 11px;
  color: var(--primary-dark);
  background: var(--soft);
}

.status.warn {
  color: var(--warn);
  background: #fff4df;
}

.status.danger {
  color: var(--danger);
  background: #fff0ee;
}

.small-action {
  min-height: 26px;
  padding: 4px 7px;
  font-size: 11px;
  white-space: nowrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 7px 8px;
  vertical-align: top;
}

th {
  color: var(--muted);
  background: #fafbf9;
}

.messages {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.message {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px 9px;
  background: rgba(255, 255, 255, 0.7);
}

.message.tenant {
  background: #e7f3ec;
  border-color: #c6ddce;
}

.message.support {
  background: #eef3fb;
  border-color: #c9d8ee;
}

.message.system {
  background: #fff8e8;
  border-color: #ead9aa;
}

.message strong {
  display: block;
  margin-bottom: 4px;
}

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

.record-form.single-column {
  grid-template-columns: 1fr;
}

.record-form label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}

.record-form input,
.record-form select,
.record-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.8);
  font: inherit;
}

.record-form textarea {
  min-height: 74px;
  resize: vertical;
}

.record-form .checkline {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  grid-column: 1 / -1;
  min-height: 30px;
  padding: 5px 0;
}

.record-form .full-row {
  grid-column: 1 / -1;
}

.record-form .checkline input {
  width: auto;
}

.record-form .hidden-field {
  display: none;
}

.record-form [data-record-types].hidden-field {
  display: none !important;
}

.record-form button {
  grid-column: 1 / -1;
}

.button-row {
  display: flex;
  gap: 6px;
  grid-column: 1 / -1;
}

.button-row button {
  flex: 1;
}

.assist-status {
  margin-bottom: 12px;
}

.assist-banner {
  display: grid;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: var(--surface-soft);
}

.assist-banner.active {
  background: #e7f3ec;
  border-color: #b9d9c5;
}

.assist-banner span,
.audit-item small {
  color: var(--muted);
}

.section-subtitle {
  margin-top: 18px;
}

.result-box {
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  padding: 9px;
  color: var(--muted);
  line-height: 1.55;
  white-space: pre-wrap;
}

.hint-box {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6faf6;
  padding: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.subheading {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
}

.dynamic-editor {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 9px;
  background: rgba(255, 255, 255, 0.56);
}

.dynamic-editor-head,
.dynamic-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.dynamic-editor-head strong,
.dynamic-row-head strong {
  display: block;
  color: var(--ink);
  font-size: 13px;
}

.dynamic-editor-head small,
.dynamic-row-head small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

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

.dynamic-row {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 8px;
  background: var(--surface);
}

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

.dynamic-fields label {
  grid-column: span 2;
}

.dynamic-fields label.narrow {
  grid-column: span 1;
}

.dynamic-fields label.wide,
.ccp-panel {
  grid-column: 1 / -1;
}

.ccp-panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.ccp-panel.hidden {
  display: none;
}

.archive-preview {
  display: grid;
  gap: 14px;
}

.archive-cover {
  border: 1px solid #1f2a24;
  padding: 18px;
  background: #fff;
  page-break-after: always;
  break-after: page;
}

.archive-cover p {
  margin: 3px 0;
}

.archive-table {
  background: #fff;
  border: 1px solid #1f2a24;
  padding: 14px;
  overflow-x: auto;
  page-break-after: always;
  break-after: page;
}

.archive-table h3 {
  margin: 0 0 10px;
  font-size: 18px;
  text-align: center;
}

.archive-form-head,
.archive-form-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
  margin-bottom: 8px;
  font-size: 12px;
  color: #1f2a24;
}

.archive-form-head span:last-child {
  text-align: right;
}

.archive-table table {
  table-layout: fixed;
  border: 1px solid #5b665f;
}

.archive-table th,
.archive-table td {
  border: 1px solid #5b665f;
  padding: 6px 5px;
  text-align: center;
  vertical-align: middle;
  line-height: 1.32;
  overflow-wrap: anywhere;
  word-break: normal;
}

.archive-table td {
  min-height: 34px;
}

.archive-table tr.empty-row td {
  border-color: transparent;
  background: #fff;
  color: transparent;
}

.archive-form-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.archive-signature-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
  font-size: 12px;
  align-items: end;
}

.archive-signature-slot {
  display: flex;
  align-items: end;
  gap: 6px;
  min-height: 34px;
}

.archive-signature-label {
  white-space: nowrap;
}

.archive-signature-stamp {
  flex: 1;
  min-width: 56px;
  min-height: 28px;
  display: inline-grid;
  place-items: center;
  border: 1px solid #b3261e;
  color: #b3261e;
  font-family: "STXingkai", "KaiTi", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  transform: rotate(-4deg);
}

.archive-signature-blank {
  flex: 1;
  min-width: 64px;
  border-bottom: 1px solid #1f2a24;
}

.public-trace-page {
  background: #f5f7f3;
}

.public-trace {
  max-width: 860px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  gap: 12px;
}

.public-trace-hero {
  padding: 22px 0 8px;
  border-bottom: 1px solid var(--line);
}

.public-trace-hero p {
  margin: 0 0 6px;
  color: var(--muted);
}

.public-trace-hero h1 {
  margin: 0 0 12px;
  font-size: 30px;
}

.chat-form {
  display: flex;
  gap: 6px;
}

.chat-form input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 7px 9px;
  font: inherit;
  background: rgba(255, 255, 255, 0.78);
}

@media (max-width: 900px) {
  .login-screen {
    grid-template-columns: 1fr;
    gap: 26px;
    align-items: start;
    padding: 24px;
  }

  .login-hero {
    gap: 22px;
  }

  .login-copy h1 {
    font-size: 32px;
  }

  .login-copy p {
    font-size: 15px;
  }

  .login-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .login-panel {
    padding: 22px;
  }

  .shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

  .topbar {
    display: grid;
    grid-template-columns: 1fr;
    position: static;
    margin: 0 0 10px;
    padding: 10px;
  }

  .topbar-tools {
    grid-template-columns: 1fr 1fr;
    justify-content: stretch;
  }

  .topbar-tools::before {
    display: none;
  }

  .workspace-switcher,
  .account-cluster {
    align-items: stretch;
  }

  .workspace-switcher {
    grid-column: 1 / -1;
  }

  .identity-switcher,
  .toolbar-actions {
    min-width: 0;
  }

  .account-cluster {
    grid-column: 1 / -1;
    justify-content: space-between;
  }

  .compact-switcher,
  .identity-switcher,
  .locale-switcher,
  .user-chip {
    min-width: 0;
  }

  .item,
  .chat-form {
    display: grid;
  }

  .metrics,
  .grid,
  .command-dashboard,
  .role-console,
  .record-form,
  .module-cards,
  .org-grid,
  .setup-summary,
  .compact-board {
    grid-template-columns: 1fr;
  }

  .command-hero {
    display: grid;
    min-height: 0;
  }

  .step-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .span-8,
  .span-7,
  .span-4,
  .span-5,
  .span-6 {
    grid-column: auto;
  }
}

@media (max-width: 560px) {
  .login-screen {
    padding: 18px;
  }

  .login-copy h1 {
    font-size: 28px;
  }

  .login-stats,
  .login-hints {
    grid-template-columns: 1fr;
  }

  .topbar-tools,
  .workspace-switcher,
  .account-cluster,
  .toolbar-actions,
  .scope-list,
  .quick-action-grid,
  .solution-map,
  .integration-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar-actions button,
  .account-cluster button {
    width: 100%;
  }

  nav {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    display: grid;
  }

  .profile-panel {
    top: 10px;
    left: 10px;
    right: 10px;
    width: auto;
    max-height: calc(100vh - 20px);
  }
}

@media print {
  @page {
    size: A4 landscape;
    margin: 0;
  }

  html,
  body {
    background: white;
    width: 297mm;
    margin: 0;
  }

  .sidebar,
  .topbar,
  .profile-panel,
  .view:not(#archive),
  #archive > .grid,
  #archive > .panel:not(.print-area) {
    display: none !important;
  }

  .shell,
  main {
    display: block;
    padding: 0;
  }

  .print-area {
    border: 0;
    box-shadow: none;
    padding: 0;
  }

  table {
    page-break-inside: auto;
  }

  tr {
    page-break-inside: avoid;
  }

  .archive-preview {
    display: block;
  }

  .archive-cover,
  .archive-page {
    min-height: 210mm;
    box-sizing: border-box;
    padding: 10mm 8mm;
    page-break-after: always;
    break-after: page;
  }

  .archive-table {
    border: 0;
    overflow: visible;
  }

  .archive-table table {
    width: 100%;
    font-size: 11px;
  }

  .archive-table th,
  .archive-table td {
    border-color: #5b665f;
  }

  .archive-table tr.empty-row td {
    border-color: transparent;
  }
}
