/* ==========================================================================
   企业智能中枢系统 · v5.1
   企业内部工作台。暖纸底色、发丝分隔、单一主色，只在风险处用赭色。
   ========================================================================== */

:root {
  --shell: #14312c;
  --shell-2: #1d443d;
  --shell-text: #b6c9c3;

  --bg: #ecebe2;
  --surface: #fffdfa;
  --surface-2: #f8f8f5;
  --surface-3: #eceee8;

  --ink: #181d1b;
  --ink-2: #3a423e;
  --muted: #616b66;
  --faint: #6f7a75;

  --line: #e0dfd3;
  --line-strong: #d2d3c6;

  --brand: #1d6f5b;
  --brand-dark: #145544;
  --brand-2: #2f8a72;
  --brand-soft: #e5efe9;

  --orange: #a85c25;
  --orange-soft: #faf1e7;
  --red: #a9413a;
  --red-soft: #fbeceb;
  --green: #226b52;
  --green-soft: #e8f1ec;
  --blue: #35657a;
  --blue-soft: #eaf1f4;

  --rail: 64px;
  --context: 220px;
  --topbar: 56px;

  --r-lg: 22px;
  --r-md: 18px;
  --r-sm: 10px;
  --sand: #f5eddd;
  --sand-ink: #8a6122;
  --sky: #e9eff3;
  --sky-ink: #3e6379;
  --rose: #f8e9e5;
  --rose-ink: #a05243;
  --mint: #e5efe9;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Menlo, monospace;

  font-family:
    'PingFang SC',
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    'Noto Sans SC',
    'Microsoft YaHei',
    sans-serif;
  font-size: 14px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
}

body {
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: #cfe4dc;
  color: #0d2a24;
}

* {
  scrollbar-width: thin;
  scrollbar-color: #c3cbc5 transparent;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  background: #c3cbc5;
  border-radius: 8px;
  border: 3px solid transparent;
  background-clip: padding-box;
}

::-webkit-scrollbar-thumb:hover {
  background: #aab4ad;
  border: 2px solid transparent;
  background-clip: padding-box;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  color: inherit;
}

button:not(:disabled) {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

h1,
h2,
h3,
h4,
p,
figure {
  margin: 0;
}

svg {
  display: block;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

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

/* --------------------------------------------------------------------------
   Login · 居中登录卡片
   主流软件登录页的结构：品牌 → 白色登录卡 → 演示身份 → 页脚链接。
   只保留一处品牌色、一处朱砂提示，不使用渐变堆叠、毛玻璃或发光。
   -------------------------------------------------------------------------- */

.login {
  --brand-ink: #145544;
  --brand-ink-2: #0f4436;
  --login-bg: #edf0ec;
  --login-card: #ffffff;
  --login-line: #e4e7e1;
  --login-field: #dfe3dc;

  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  color: var(--ink);
  background-color: var(--login-bg);
  /* 四角低饱和度色块围出一口「光井」，卡片落在中间最亮的位置 */
  background-image:
    radial-gradient(120% 72% at 50% -16%, rgba(255, 255, 255, 0.92) 0%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(54% 46% at 10% 4%, rgba(37, 92, 76, 0.34) 0%, rgba(37, 92, 76, 0) 64%),
    radial-gradient(50% 44% at 94% 10%, rgba(96, 122, 138, 0.26) 0%, rgba(96, 122, 138, 0) 62%),
    radial-gradient(58% 48% at 8% 98%, rgba(186, 158, 118, 0.26) 0%, rgba(186, 158, 118, 0) 64%),
    radial-gradient(56% 48% at 92% 92%, rgba(24, 62, 52, 0.3) 0%, rgba(24, 62, 52, 0) 64%),
    /* 底部投影 + 四周轻压暗，把平面「压低」成有纵深的台面 */
    radial-gradient(64% 30% at 50% 104%, rgba(20, 50, 40, 0.09) 0%, rgba(20, 50, 40, 0) 70%),
    radial-gradient(116% 96% at 50% 46%, rgba(20, 50, 40, 0) 54%, rgba(20, 50, 40, 0.05) 100%);
}

/* 中间再压一层极淡的提亮，避免四角色块透到卡片上 */
.login::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(
    58% 52% at 50% 44%,
    rgba(243, 246, 241, 0.86) 0%,
    rgba(243, 246, 241, 0.5) 42%,
    rgba(243, 246, 241, 0) 76%
  );
  pointer-events: none;
}

/* 纸张颗粒：只给底色加一点手感，不参与任何交互 */
.login::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  opacity: 0.3;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
  pointer-events: none;
}

.login-main {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 412px;
}

/* 品牌 */

.login-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 22px;
}

.login-brand .mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--brand-ink);
  color: #f3f7f4;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0;
}

.login-brand div strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.2;
}

.login-brand div span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

/* 登录卡 */

.login-card {
  padding: 28px 28px 24px;
  border: 1px solid var(--login-line);
  border-radius: 10px;
  background: var(--login-card);
  box-shadow:
    0 1px 2px rgba(20, 40, 34, 0.05),
    0 18px 36px -20px rgba(20, 40, 34, 0.26);
}

.login-card h2 {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.login-hint {
  margin-top: 6px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--muted);
}

/* 字段 */

.lf {
  display: block;
  margin-top: 17px;
}

.lf > span {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink-2);
}

.lf input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--login-field);
  border-radius: 8px;
  background: #fff;
  font-size: 14px;
  color: var(--ink);
  transition:
    border-color 0.15s var(--ease),
    box-shadow 0.15s var(--ease);
}

.lf input::placeholder {
  color: #a6afa8;
}

.lf input:hover {
  border-color: #c7cfc8;
}

.lf input:focus {
  outline: none;
  border-color: var(--brand-ink);
  box-shadow: 0 0 0 3px rgba(20, 85, 68, 0.12);
}

.lf .password {
  position: relative;
  display: block;
}

.lf .password input {
  padding-right: 52px;
}

.lf .password button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  height: 30px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  font-size: 12px;
  color: var(--muted);
}

.lf .password button:hover {
  background: #f3f6f3;
  color: var(--ink);
}

.login-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0 18px;
}

.login-row .check {
  font-size: 12px;
  color: var(--muted);
}

.login-row .link-btn {
  font-size: 12px;
  color: var(--brand-ink);
}

.login-error {
  font-size: 12px;
  line-height: 1.6;
  color: var(--red);
}

.login-error:empty {
  display: none;
}

.login-error:not(:empty) {
  margin-bottom: 12px;
  padding: 8px 10px;
  border: 1px solid #f0d7d4;
  border-radius: 7px;
  background: #fdf4f3;
}

.login-submit {
  width: 100%;
  height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--brand-ink);
  color: #f4f8f5;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.08em;
  transition: background 0.15s var(--ease);
}

.login-submit:hover:not(:disabled) {
  background: var(--brand-ink-2);
}

.login-submit:active:not(:disabled) {
  background: #0b392d;
}

.login-submit:focus-visible {
  outline: 2px solid var(--brand-ink);
  outline-offset: 3px;
}

.login-submit:disabled {
  opacity: 0.7;
  cursor: progress;
}

/* 其他方式 */

.login-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0 13px;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: #98a29b;
}

.login-or::before,
.login-or::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--login-line);
}

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

.login-sso button {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 6px;
  border: 1px solid var(--login-line);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  color: var(--ink-2);
  transition:
    border-color 0.15s var(--ease),
    background 0.15s var(--ease);
}

.login-sso button:hover {
  border-color: #c9d2cc;
  background: #f9fbf9;
}

.login-sso .icon {
  width: 15px;
  height: 15px;
  color: var(--muted);
}

/* 演示身份 */

.login-demo {
  margin-top: 14px;
  padding: 14px 14px 13px;
  border: 1px solid var(--login-line);
  border-radius: 10px;
  background: var(--login-card);
  box-shadow: 0 1px 2px rgba(20, 40, 34, 0.04);
}

.demo-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--muted);
}

.demo-head span:last-child {
  font-size: 10.5px;
  color: #9aa39d;
}

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

.demo-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 11px 6px 9px;
  border: 1px solid #eaede7;
  border-radius: 8px;
  background: #fff;
  transition:
    border-color 0.15s var(--ease),
    background 0.15s var(--ease);
}

.demo-item:hover {
  border-color: #cfd8d2;
  background: #fafbf9;
}

.demo-item:focus-visible {
  outline: 2px solid var(--brand-ink);
  outline-offset: 1px;
}

.demo-item.on {
  border-color: var(--brand-ink);
  background: #f2f7f4;
}

.demo-av {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-soft);
  color: #145544;
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
}

.demo-av img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 50%;
  filter: saturate(0.92) contrast(1.02);
}

.demo-item.on .demo-av {
  background: var(--brand-soft);
  color: #f3f7f4;
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 3.5px var(--brand-ink);
}

.demo-name {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

.demo-title {
  max-width: 100%;
  font-size: 9.5px;
  color: var(--faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 页脚 */

.login-foot {
  margin-top: 18px;
  text-align: center;
}

.login-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}

.login-links button {
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 11.5px;
  color: var(--muted);
}

.login-links button:hover {
  color: var(--brand-ink);
}

.login-links i {
  font-style: normal;
  color: #c3cbc5;
}

.login-meta {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  color: #9aa39d;
}

.login-meta span {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.login-offline {
  margin-top: 14px;
  padding: 11px 12px;
  border: 1px solid var(--login-line);
  border-radius: 8px;
  background: #f8faf8;
}

.login-offline p {
  margin: 0 0 8px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
}

@media (max-width: 480px) {
  .login {
    padding: 26px 14px 22px;
    align-items: flex-start;
  }

  .login-card {
    padding: 22px 18px 20px;
  }

  .login-card h2 {
    font-size: 18px;
  }

  .login-sso button {
    height: 40px;
    gap: 5px;
    padding: 0 2px;
    font-size: 11.5px;
  }

  .login-sso .icon {
    width: 14px;
    height: 14px;
  }

  .login-demo {
    padding: 12px 12px 11px;
  }

  .demo-grid {
    gap: 5px;
  }

  .demo-title {
    display: none;
  }

  .demo-item {
    padding: 8px 2px 7px;
  }

  .demo-av {
    width: 30px;
    height: 30px;
  }
}

/* 通用表单原件（弹窗与抽屉复用） */

.field {
  display: block;
  margin-bottom: 14px;
}

.field > span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink-2);
}

.input,
.field input,
.field select,
.field textarea {
  width: 100%;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  padding: 0 11px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.field input:hover,
.field select:hover {
  border-color: #b6c0b8;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(25, 107, 91, 0.12);
}

.password {
  position: relative;
  display: flex;
}

.password input {
  padding-right: 56px;
}

.password button {
  position: absolute;
  right: 3px;
  top: 3px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  padding: 0 9px;
  border-radius: 5px;
}

.password button:hover {
  color: var(--ink);
  background: var(--surface-2);
}

.form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 15px 0 18px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
}

.check input {
  width: 14px;
  height: 14px;
  accent-color: var(--brand);
}

.link-btn {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  padding: 2px;
}

.link-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */

.app-shell {
  height: 100svh;
  overflow: hidden;
  display: grid;
  grid-template-columns: var(--rail) var(--context) minmax(0, 1fr);
  grid-template-rows: var(--topbar) minmax(0, 1fr);
}

.global-rail {
  grid-row: 1 / -1;
  background: var(--shell);
  color: var(--shell-text);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  z-index: 40;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--shell);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 16px;
  font-weight: 600;
}

.global-rail .brand-mark {
  margin-bottom: 20px;
  background: #f4f6f1;
  color: var(--shell);
}

.rail-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.rail-btn {
  width: 100%;
  min-height: 54px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #9db2ab;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  letter-spacing: 0.01em;
  transition:
    background 0.15s,
    color 0.15s;
}

.rail-btn .icon {
  width: 19px;
  height: 19px;
}

.rail-btn:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #fff;
}

.rail-btn.active {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.rail-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.rail-env {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-align: center;
  color: #7d968e;
  padding: 10px 0 2px;
}

.context-nav {
  grid-row: 1 / -1;
  grid-column: 2;
  background: var(--surface);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  min-width: 0;
  z-index: 35;
}

.context-head {
  height: var(--topbar);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--line);
}

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

.context-head span {
  display: block;
  font-size: 11px;
  color: var(--faint);
  margin-top: 1px;
}

.context-scroll {
  padding: 14px 10px;
  overflow: auto;
  flex: 1;
}

.nav-group {
  margin-bottom: 18px;
}

.nav-label {
  color: var(--faint);
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 0 9px 6px;
}

.nav-item {
  width: 100%;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #4d5752;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 9px;
  text-align: left;
  font-size: 13px;
  transition:
    background 0.12s,
    color 0.12s;
}

.nav-item:hover {
  background: #f2f4ef;
  color: var(--ink);
}

.nav-item.active {
  background: var(--brand-soft);
  color: #145043;
  font-weight: 600;
}

.nav-item .icon {
  width: 17px;
  height: 17px;
  color: #6f7a74;
}

.nav-item.active .icon {
  color: var(--brand);
}

.nav-count {
  margin-left: auto;
  min-width: 18px;
  padding: 0 5px;
  line-height: 17px;
  border-radius: 5px;
  background: #eceee9;
  color: #626c66;
  text-align: center;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.nav-item.active .nav-count {
  background: #cfe3db;
  color: #145043;
}

.context-foot {
  border-top: 1px solid var(--line);
  padding: 11px 13px;
}

.permission-note {
  display: flex;
  gap: 8px;
  color: #6b766f;
  font-size: 11px;
  line-height: 1.5;
}

.permission-note .icon {
  width: 14px;
  height: 14px;
  margin-top: 1px;
  flex: 0 0 14px;
}

.topbar {
  grid-column: 3;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--topbar);
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  z-index: 30;
}

.top-title {
  min-width: 0;
  margin-right: auto;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.top-title strong {
  font-size: 13px;
  font-weight: 600;
}

.top-title span {
  font-size: 12px;
  color: var(--faint);
}

.search-btn {
  width: min(30vw, 360px);
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-2);
  color: #77827c;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  text-align: left;
  font-size: 12px;
  transition:
    border-color 0.15s,
    background 0.15s;
}

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

.search-btn span:nth-child(2) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.search-btn .icon {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
}

.kbd {
  margin-left: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  font-size: 10px;
  color: var(--faint);
}

.icon-btn {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  display: grid;
  place-items: center;
  color: #5f6a64;
  padding: 7px;
  transition:
    background 0.12s,
    color 0.12s;
}

.icon-btn:hover {
  background: #f0f2ed;
  color: var(--ink);
}

.env-tag {
  font-size: 11px;
  color: var(--faint);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 6px;
  background: transparent;
}

.user-wrap {
  position: relative;
}

.user-btn {
  border: 0;
  background: transparent;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 4px;
}

.user-btn:hover {
  background: #f0f2ed;
}

.avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #dfe9e4;
  color: #235649;
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 600;
}

.user-copy {
  text-align: left;
}

.user-copy strong,
.user-copy span {
  display: block;
}

.user-copy strong {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.user-copy span {
  font-size: 11px;
  color: var(--faint);
  line-height: 1.3;
}

.popover {
  position: fixed;
  right: 14px;
  top: 50px;
  width: 240px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  box-shadow: 0 16px 40px -16px rgba(20, 36, 30, 0.3);
  padding: 6px;
  z-index: 120;
}

.popover-profile {
  padding: 9px 9px 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 5px;
}

.popover-profile strong,
.popover-profile span {
  display: block;
}

.popover-profile strong {
  font-size: 13px;
}

.popover-profile span {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.popover button {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 5px;
  padding: 7px 9px;
  text-align: left;
  font-size: 12px;
}

.popover button:hover {
  background: #f2f4ef;
}

.popover button.danger {
  color: var(--red);
}

.workspace {
  grid-column: 3;
  overflow: auto;
  padding: 24px 28px 48px;
}

.page {
  max-width: 1360px;
  margin: 0 auto;
  animation: page-in 0.22s var(--ease);
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
}

/* --------------------------------------------------------------------------
   Page head / figures
   -------------------------------------------------------------------------- */

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

.page-head h1 {
  font-size: 26px;
  line-height: 1.35;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.page-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  max-width: 62ch;
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 2px;
}

.scope {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--faint);
  font-size: 12px;
  white-space: nowrap;
  margin-right: 4px;
}

.scope .icon {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
}

.mobile-menu {
  display: none;
}

.summary-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  border: 0;
  margin-bottom: 18px;
}
.summary {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 15px 18px 16px;
  min-width: 0;
}
.summary + .summary {
  padding-left: 18px;
}
.summary:first-child {
  background: linear-gradient(160deg, #17483d 0%, #123a31 100%);
  border-color: transparent;
  color: #eef5f0;
  box-shadow: 0 10px 24px -18px rgba(18, 58, 49, 0.8);
}
.summary:first-child label {
  color: rgba(238, 245, 240, 0.68);
}
.summary:first-child strong {
  color: #fff;
}
.summary:first-child small {
  color: rgba(238, 245, 240, 0.66);
}
.summary:first-child small.good {
  color: #9fe3c7;
}
.summary:first-child small.warn {
  color: #f0c794;
}
.summary:first-child small.bad {
  color: #f2a79e;
}
.summary label {
  display: block;
  color: var(--muted);
  font-size: 12px;
}
.summary strong {
  display: block;
  font-size: 27px;
  font-weight: 660;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin: 5px 0 2px;
  font-variant-numeric: tabular-nums;
}
.summary small {
  font-size: 12px;
  color: var(--muted);
}
.summary small.good {
  color: var(--green);
}

.summary small.warn {
  color: var(--orange);
}

.summary small.bad {
  color: var(--red);
}

/* --------------------------------------------------------------------------
   Surfaces
   -------------------------------------------------------------------------- */

.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  min-width: 0;
  box-shadow: 0 4px 16px -10px rgba(24, 36, 30, 0.32);
}

.surface-header {
  min-height: 54px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.surface-header h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.005em;
}

.surface-header p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.surface-body {
  padding: 16px;
}

.surface-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.plain-btn {
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  padding: 3px 2px;
  white-space: nowrap;
}

.plain-btn:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.alert-strip {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 50px;
  padding: 10px 14px;
  margin-bottom: 16px;
  background: var(--orange-soft);
  border: 1px solid #eedcc9;
  border-radius: var(--r-md);
  color: #6d431b;
}

.alert-strip .icon {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  color: var(--orange);
}

.alert-strip div {
  min-width: 0;
}

.alert-strip strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.alert-strip span {
  display: block;
  color: #7d572f;
  font-size: 12px;
  margin-top: 1px;
}

.alert-strip button {
  margin-left: auto;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, 0.75fr);
  gap: 16px;
  align-items: start;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.triple {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  align-items: start;
}

/* --------------------------------------------------------------------------
   Charts / data visuals
   -------------------------------------------------------------------------- */

.chart-shell {
  height: 248px;
  padding: 16px 16px 10px;
  position: relative;
}

.chart-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-svg .grid {
  stroke: #e9ebe6;
  stroke-width: 1;
}

.chart-svg .axis {
  fill: #7b8680;
  stroke: none;
  font-size: 11px;
}

.chart-svg .line-main {
  stroke: #1f6b5b;
  stroke-width: 2.5;
  fill: none;
}

.chart-svg .line-muted {
  stroke: #aab9b2;
  stroke-width: 1.5;
  fill: none;
  stroke-dasharray: 4 4;
}

.chart-svg .area {
  fill: #e6f0eb;
  stroke: none;
}

.chart-svg .point {
  fill: #fff;
  stroke: #1f6b5b;
  stroke-width: 2;
}

.chart-legend {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 11px;
  color: var(--muted);
}

.chart-legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: #1f6b5b;
  margin-right: 5px;
}

.chart-legend i.muted {
  background: transparent;
  border: 1px dashed #aab9b2;
}

.bar-list {
  padding: 4px 16px 6px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) 64px;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid #eef0eb;
}

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

.bar-row header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 6px;
}

.bar-row header strong {
  font-size: 12.5px;
  font-weight: 600;
}

.bar-row header span {
  font-size: 11px;
  color: var(--muted);
}

.bar-track {
  height: 5px;
  background: #eef0eb;
  border-radius: 3px;
  overflow: hidden;
}

.bar-track i {
  display: block;
  height: 100%;
  background: #3f8272;
  border-radius: 3px;
  transition: width 0.4s var(--ease);
}

.bar-track i.warn {
  background: #c08a4e;
}

.bar-track i.bad {
  background: #b9635b;
}

.bar-value {
  text-align: right;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  align-self: center;
}

.funnel {
  padding: 18px 16px;
}

.funnel-row {
  display: grid;
  grid-template-columns: 88px 1fr 64px;
  align-items: center;
  gap: 10px;
  margin: 9px 0;
}

.funnel-row label {
  font-size: 12px;
  color: var(--muted);
}

.funnel-shape {
  height: 26px;
  display: flex;
  justify-content: center;
}

.funnel-shape i {
  display: block;
  height: 100%;
  background: #6c9d91;
  border-radius: 3px;
}

.funnel-row:nth-child(2) i {
  background: #5d8f84;
}

.funnel-row:nth-child(3) i {
  background: #4b8276;
}

.funnel-row:nth-child(4) i {
  background: #357267;
}

.funnel-row:nth-child(5) i {
  background: #1e6157;
}

.funnel-row strong {
  text-align: right;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.heatmap {
  display: grid;
  grid-template-columns: 84px repeat(7, minmax(0, 1fr));
  gap: 4px;
  padding: 16px;
}

.heatmap span {
  height: 26px;
  border-radius: 3px;
  background: #f0f2ed;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #6b766f;
}

.heatmap .name {
  background: transparent;
  justify-content: start;
  color: var(--ink-2);
}

.heatmap .l1 {
  background: #dcebe4;
}

.heatmap .l2 {
  background: #b7d4c9;
}

.heatmap .l3 {
  background: #6fa392;
  color: #fff;
}

.heatmap .l4 {
  background: #2f7465;
  color: #fff;
}

.timeline {
  padding: 4px 16px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 74px 16px 1fr;
  gap: 10px;
  min-height: 58px;
}

.timeline-row time {
  font-size: 11px;
  color: var(--faint);
  padding-top: 10px;
  font-variant-numeric: tabular-nums;
}

.timeline-line {
  position: relative;
}

.timeline-line:before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 7px;
  width: 1px;
  background: #e3e6e0;
}

.timeline-line i {
  position: absolute;
  top: 13px;
  left: 3px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--brand);
}

.timeline-row:last-child .timeline-line:before {
  display: none;
}

.timeline-content {
  padding: 9px 0;
  border-bottom: 1px solid #f0f2ed;
}

.timeline-row:last-child .timeline-content {
  border-bottom: 0;
}

.timeline-content strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}

.timeline-content span {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
  display: block;
}

.price-grid {
  padding: 8px 16px;
}

.price-line {
  display: grid;
  grid-template-columns: 118px 1fr 64px;
  gap: 12px;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid #eef0eb;
}

.price-line:last-child {
  border-bottom: 0;
}

.price-line strong {
  font-size: 12.5px;
  font-weight: 600;
}

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

.price-line b {
  text-align: right;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.spark {
  height: 24px;
}

.spark polyline {
  fill: none;
  stroke: #4c8577;
  stroke-width: 1.6;
}

.spark polyline.bad {
  stroke: #b9635b;
}

.delta-up {
  color: var(--green);
}

.delta-down {
  color: var(--red);
}

.waterfall {
  height: 238px;
  padding: 22px 16px 34px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.waterfall-item {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  position: relative;
}

.waterfall-item i {
  display: block;
  width: 70%;
  background: #5f9488;
  border-radius: 2px 2px 0 0;
  min-height: 6px;
}

.waterfall-item.negative i {
  background: #c88379;
}

.waterfall-item.total i {
  background: #24604f;
}

.waterfall-item label {
  position: absolute;
  bottom: -22px;
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.waterfall-item b {
  position: absolute;
  font-size: 10.5px;
  font-weight: 600;
  transform: translateY(-5px);
  font-variant-numeric: tabular-nums;
}

.topology {
  position: relative;
  height: 290px;
  margin: 6px 16px 10px;
}

.topology svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.topology line {
  stroke: #d5dad4;
  stroke-width: 1.4;
}

.node {
  position: absolute;
  width: 128px;
  padding: 9px 11px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  font-size: 12px;
  text-align: center;
  box-shadow: 0 2px 6px -4px rgba(20, 36, 30, 0.25);
}

.node strong {
  display: block;
  font-size: 12px;
  font-weight: 600;
}

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

.node:after {
  content: '';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

.node.warn:after {
  background: var(--orange);
}

.node.gateway {
  left: 50%;
  top: 16px;
  transform: translateX(-50%);
}

.node.agent {
  left: 18%;
  top: 112px;
  transform: translateX(-50%);
}

.node.permission {
  left: 50%;
  top: 112px;
  transform: translateX(-50%);
}

.node.knowledge {
  left: 82%;
  top: 112px;
  transform: translateX(-50%);
}

.node.model {
  left: 18%;
  top: 210px;
  transform: translateX(-50%);
}

.node.vector {
  left: 50%;
  top: 210px;
  transform: translateX(-50%);
}

.node.storage {
  left: 82%;
  top: 210px;
  transform: translateX(-50%);
}

.log-view {
  padding: 6px 0;
  font-family: var(--mono);
  font-size: 12px;
}

.log-row {
  display: grid;
  grid-template-columns: 132px 58px 120px minmax(0, 1fr);
  gap: 12px;
  padding: 7px 16px;
  border-bottom: 1px solid #f0f2ed;
  color: #47524c;
}

.log-row:hover {
  background: var(--surface-2);
}

.log-row span:first-child {
  color: var(--faint);
}

.log-row .warn {
  color: var(--orange);
}

.log-row .error {
  color: var(--red);
}

.log-row .info {
  color: var(--faint);
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.data-table-wrap {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

.data-table th {
  height: 38px;
  padding: 0 14px;
  text-align: left;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  color: #5e6963;
  font-weight: 600;
}

.data-table th.sortable:after {
  content: '↕';
  margin-left: 5px;
  color: #a4aea8;
}

.sort-btn {
  width: 100%;
  height: 38px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: inherit;
  font-size: 12px;
  font-weight: 600;
}

.sort-btn span {
  margin-left: 5px;
  color: #a4aea8;
}

.sort-btn[data-dir='asc'] span,
.sort-btn[data-dir='desc'] span {
  color: var(--brand);
}

.data-table td {
  height: 46px;
  padding: 8px 14px;
  border-bottom: 1px solid #eef0eb;
  color: #414b45;
  font-size: 13px;
}

.data-table tbody tr {
  transition: background 0.1s;
  cursor: pointer;
}

.data-table tbody tr:hover {
  background: #f7f8f4;
}

.data-table tbody tr:last-child td {
  border-bottom: 0;
}

.data-table .primary {
  font-weight: 600;
  color: var(--ink);
}

.data-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}

.search-input {
  width: 240px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 0 10px;
  background: var(--surface);
  font-size: 13px;
  transition:
    border-color 0.15s,
    box-shadow 0.15s;
}

.search-input::placeholder {
  color: #8d9791;
}

.search-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(25, 107, 91, 0.1);
}

.toolbar-spacer {
  margin-left: auto;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
}

.pagination div {
  display: flex;
  gap: 4px;
}

.pagination button {
  width: 28px;
  height: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 5px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--line-strong);
  background: var(--surface-2);
}

.pagination button.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* --------------------------------------------------------------------------
   Status / tags
   -------------------------------------------------------------------------- */

.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1.4;
  color: #4e5852;
  background: none;
  padding: 0;
}

.status:before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: 0 0 6px;
}

.status.ok {
  color: var(--green);
}

.status.warn {
  color: var(--orange);
}

.status.bad {
  color: var(--red);
}

.status.info {
  color: var(--blue);
}

.tag {
  display: inline-flex;
  align-items: center;
  height: 20px;
  border-radius: 4px;
  padding: 0 6px;
  background: #f0f2ed;
  color: #5c6660;
  font-size: 11px;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.btn {
  height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 12px;
  font-size: 13px;
  white-space: nowrap;
  transition:
    background 0.14s,
    border-color 0.14s,
    color 0.14s,
    transform 0.08s;
}

.btn:hover:not(:disabled) {
  background: var(--surface-2);
  border-color: #b9c2bb;
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.btn.primary:hover:not(:disabled) {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

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

.btn.danger:hover:not(:disabled) {
  background: var(--red-soft);
}

.btn.block {
  width: 100%;
  height: 38px;
}

.btn .icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
}

.btn:focus-visible,
.icon-btn:focus-visible,
.nav-item:focus-visible,
.rail-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Decision list / service tiles
   -------------------------------------------------------------------------- */

.decision-list {
  display: flex;
  flex-direction: column;
}

.decision {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 84px;
  gap: 16px;
  padding: 13px 14px;
  margin: 6px 10px;
  border-radius: 12px;
  background: #f6f5ec;
  align-items: center;
  cursor: pointer;
  transition:
    background 0.12s,
    box-shadow 0.12s,
    transform 0.12s;
}

.decision:hover {
  background: #fffdfa;
  box-shadow: 0 8px 20px -14px rgba(24, 36, 30, 0.45);
  transform: translateY(-1px);
}

.decision h3 {
  font-size: 13px;
  font-weight: 600;
}

.decision p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.decision-meta {
  text-align: right;
}

.decision-meta strong,
.decision-meta span {
  display: block;
}

.decision-meta strong {
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.decision-meta span {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
}

.service-tile {
  border: 0;
  border-bottom: 1px solid #eef0eb;
  border-right: 1px solid #eef0eb;
  border-radius: 0;
  background: transparent;
  padding: 14px 16px;
  text-align: left;
  min-height: 84px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-content: center;
}

.service-tile:nth-child(2n) {
  border-right: 0;
}

.service-tile:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.service-tile:hover {
  background: var(--surface-2);
}

.service-tile .icon {
  color: var(--brand);
  grid-row: 1 / 3;
  width: 19px;
  height: 19px;
  margin: 0;
  align-self: center;
}

.service-tile strong {
  font-size: 13px;
  font-weight: 600;
}

.service-tile span {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 1px;
}

.mini-people {
  display: flex;
}

.mini-people span {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #dfe9e4;
  border: 2px solid var(--surface);
  margin-left: -6px;
  display: grid;
  place-items: center;
  font-size: 10px;
}

.mini-people span:first-child {
  margin-left: 0;
}

/* --------------------------------------------------------------------------
   Drawer
   -------------------------------------------------------------------------- */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(16, 30, 25, 0.28);
  z-index: 60;
  animation: fade-in 0.18s var(--ease);
}

@keyframes fade-in {
  from {
    opacity: 0;
  }
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 520px;
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px -30px rgba(20, 36, 30, 0.4);
  z-index: 70;
  display: flex;
  flex-direction: column;
  animation: drawer-in 0.24s var(--ease);
}

@keyframes drawer-in {
  from {
    transform: translateX(24px);
    opacity: 0.4;
  }
}

.drawer-head {
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px 0 22px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}

.drawer-head strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.drawer-body {
  flex: 1;
  overflow: auto;
  padding: 22px;
}

.drawer-title {
  font-size: 20px;
  font-weight: 650;
  line-height: 1.4;
  letter-spacing: -0.01em;
}

.drawer-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 22px;
}

.drawer-section {
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.drawer-section h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 8px;
}

.drawer-section p {
  font-size: 13px;
  line-height: 1.75;
  color: var(--ink-2);
}

.drawer-section .plain-btn {
  margin-top: 10px;
}

.kv {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 9px 14px;
  font-size: 12.5px;
}

.kv span:nth-child(odd) {
  color: var(--muted);
}

.kv span:nth-child(even),
.kv strong {
  color: var(--ink-2);
}

.drawer-foot {
  border-top: 1px solid var(--line);
  padding: 12px 16px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  background: var(--surface);
}

.drawer-open .workspace {
  padding-right: 0;
}

/* --------------------------------------------------------------------------
   Command palette
   -------------------------------------------------------------------------- */

.command {
  position: fixed;
  inset: 0;
  background: rgba(16, 30, 25, 0.32);
  z-index: 100;
  padding: 12vh 16px 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  animation: fade-in 0.16s var(--ease);
}

.command-box {
  width: min(620px, 100%);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 30px 70px -24px rgba(16, 30, 25, 0.45);
  overflow: hidden;
}

.command-input {
  width: 100%;
  height: 54px;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 0 18px;
  font-size: 14px;
  background: transparent;
}

.command-input:focus {
  outline: none;
}

.command-input::placeholder {
  color: #8d9791;
}

.command-results {
  max-height: 380px;
  overflow: auto;
  padding: 6px;
}

.command-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  text-align: left;
}

.command-item:hover {
  background: var(--surface-2);
}

.command-item .icon {
  color: var(--muted);
  width: 17px;
  height: 17px;
}

.command-item strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.command-item span span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

/* --------------------------------------------------------------------------
   Analysis panel
   -------------------------------------------------------------------------- */

.analysis-panel {
  position: fixed;
  top: var(--topbar);
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 100vw;
  background: var(--surface);
  border-left: 1px solid var(--line);
  box-shadow: -24px 0 60px -30px rgba(20, 36, 30, 0.35);
  z-index: 50;
  display: flex;
  flex-direction: column;
  animation: drawer-in 0.24s var(--ease);
}

.analysis-head {
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px 0 18px;
  border-bottom: 1px solid var(--line);
}

.analysis-head strong {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.analysis-body {
  padding: 20px;
  overflow: auto;
}

.analysis-body > p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--ink-2);
}

.analysis-steps {
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.analysis-steps div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #eef0eb;
  font-size: 12px;
}

.analysis-steps span {
  color: var(--muted);
}

.analysis-steps strong {
  font-weight: 600;
  text-align: right;
}

/* --------------------------------------------------------------------------
   Feedback states
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  background: #1c2622;
  color: #f4f6f1;
  padding: 9px 15px;
  border-radius: 7px;
  font-size: 12.5px;
  box-shadow: 0 16px 40px -16px rgba(10, 20, 16, 0.55);
  z-index: 200;
  animation: toast-in 0.22s var(--ease);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(-50%, 6px);
  }
}

.skeleton {
  display: inline-block;
  background: #e8ebe5;
  border-radius: 3px;
  color: transparent;
  overflow: hidden;
  position: relative;
}

.skeleton:after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.5);
  animation: skeleton-pulse 1.4s ease-in-out infinite alternate;
}

@keyframes skeleton-pulse {
  from {
    opacity: 0.25;
  }
  to {
    opacity: 0.7;
  }
}

.empty-state {
  padding: 44px 24px;
  text-align: center;
}

.empty-visual {
  width: 44px;
  height: 44px;
  margin: 0 auto 14px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  position: relative;
}

.empty-visual:after {
  content: '';
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  border: 1px dashed #a9b3ac;
}

.empty-state h3 {
  font-size: 14px;
  font-weight: 600;
}

.empty-state p {
  font-size: 12px;
  color: var(--muted);
  margin: 6px 0 14px;
}

.error-state {
  padding: 10px 12px;
  border: 1px solid #e7c9c5;
  border-radius: var(--r-sm);
  background: var(--red-soft);
  margin-bottom: 8px;
}

.error-state strong {
  display: block;
  font-size: 12px;
  color: var(--red);
}

.error-state span {
  display: block;
  font-size: 11.5px;
  color: #7c4a45;
  margin-top: 2px;
}

.mobile-backdrop {
  display: none;
}

[data-detail] {
  transition: background 0.1s;
}

[data-detail]:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: -2px;
  background: var(--brand-soft);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1180px) {
  :root {
    --context: 208px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .summary-band {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .summary:nth-child(3) {
    padding-left: 18px;
  }
  .split {
    grid-template-columns: 1fr;
  }
  .triple {
    grid-template-columns: 1fr 1fr;
  }
  .search-btn {
    width: 240px;
  }
}

@media (max-width: 900px) {
  .page-actions .scope {
    display: none;
  }
}

@media (max-width: 900px) {
  :root {
    --topbar: 54px;
  }
  .app-shell {
    display: block;
    height: 100svh;
  }
  .global-rail,
  .context-nav {
    position: fixed;
    top: 0;
    bottom: 0;
    transform: translateX(-100%);
    transition: transform 0.22s var(--ease);
  }
  .global-rail {
    left: 0;
    width: 64px;
  }
  .context-nav {
    left: 64px;
    width: 210px;
    transform: translateX(calc(-100% - 64px));
  }
  .mobile-nav-open .global-rail,
  .mobile-nav-open .context-nav {
    transform: none;
  }
  .mobile-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 29, 25, 0.46);
    z-index: 32;
  }
  .mobile-nav-open .mobile-backdrop {
    display: block;
  }
  .topbar {
    height: var(--topbar);
    padding: 0 10px;
    position: relative;
    gap: 4px;
  }
  .mobile-menu {
    display: grid;
  }
  .top-title span,
  .search-btn,
  .user-copy,
  .env-tag {
    display: none;
  }
  .top-title strong {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 42vw;
  }
  .workspace {
    height: calc(100svh - var(--topbar));
    padding: 18px 14px 40px;
  }
  .page-head {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 16px;
  }
  .page-head h1 {
    font-size: 20px;
  }
  .page-head p {
    font-size: 12.5px;
  }
  .page-actions {
    width: 100%;
    padding-top: 0;
    flex-wrap: wrap;
  }
  .page-actions .btn {
    flex: 1;
    min-height: 36px;
  }
  .summary {
    padding: 12px 14px;
  }
  .summary + .summary {
    padding-left: 14px;
  }
  .summary strong {
    font-size: 20px;
  }
  .summary label,
  .summary small {
    font-size: 11.5px;
  }
  .dashboard-grid,
  .triple {
    grid-template-columns: 1fr;
  }
  .chart-shell {
    height: 210px;
    padding: 10px 8px 4px;
  }
  .heatmap {
    grid-template-columns: 64px repeat(7, minmax(0, 1fr));
    gap: 3px;
    padding: 12px;
  }
  .heatmap span {
    height: 24px;
    font-size: 10px;
  }
  .service-grid {
    grid-template-columns: 1fr;
  }
  .service-tile {
    border-right: 0;
    min-height: 66px;
    padding: 12px 14px;
  }
  .service-tile:nth-last-child(2) {
    border-bottom: 1px solid #eef0eb;
  }
  .decision {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding: 12px 14px;
  }
  .decision > div:nth-child(3) {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
  }
  .decision-meta {
    text-align: left;
  }
  .drawer {
    width: 100vw;
  }
  .analysis-panel {
    width: 100vw;
    top: var(--topbar);
  }
  .command {
    padding-top: 8vh;
  }
  .log-row {
    grid-template-columns: 96px 52px minmax(0, 1fr);
    font-size: 11px;
  }
  .log-row span:nth-child(3) {
    display: none;
  }
  .topology {
    height: 330px;
    margin: 0 8px;
  }
  .node {
    width: 96px;
    padding: 7px 6px;
    font-size: 11px;
  }
  .node strong {
    font-size: 11px;
  }
  .node span {
    font-size: 10px;
  }
  .waterfall {
    height: 210px;
    padding-left: 6px;
    padding-right: 6px;
  }
  .waterfall-item label {
    font-size: 10px;
  }
  .field input,
  .field select,
  .input {
    height: 42px;
  }
  .btn {
    min-height: 36px;
  }
  .account-menu {
    max-height: 240px;
  }
  .table-toolbar {
    gap: 6px;
  }
  .search-input {
    width: 100%;
    order: -1;
    height: 36px;
  }

  /* Tables become stacked records on phones */
  .data-table-wrap {
    overflow: visible;
  }
  .data-table,
  .data-table tbody,
  .data-table tr,
  .data-table td {
    display: block;
    width: 100%;
  }
  .data-table thead {
    display: none;
  }
  .data-table {
    min-width: 0;
  }
  .data-table tr {
    padding: 11px 14px;
    border-bottom: 1px solid var(--line);
  }
  .data-table tr:last-child {
    border-bottom: 0;
  }
  .data-table td {
    height: auto;
    padding: 2px 0;
    border: 0;
    font-size: 12.5px;
    display: flex;
    justify-content: space-between;
    gap: 14px;
  }
  .data-table td:before {
    content: attr(data-label);
    color: var(--faint);
    font-size: 11.5px;
    flex: 0 0 88px;
  }
  .data-table td.primary {
    font-size: 13.5px;
    padding-bottom: 4px;
  }
  .data-table td.primary:before {
    display: none;
  }
  .data-table td.num {
    text-align: left;
  }
  .pagination {
    flex-wrap: wrap;
    gap: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .page {
    animation: none;
  }
}

/* --------------------------------------------------------------------------
   v5.1 page archetypes
   -------------------------------------------------------------------------- */

.tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.tab {
  height: 34px;
  border: 0;
  background: none;
  padding: 0 12px;
  font-size: 13px;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition:
    color 0.12s,
    border-color 0.12s;
}

.tab:hover {
  color: var(--ink);
}

.tab.active {
  color: var(--ink);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.policy-group + .policy-group {
  margin-top: 16px;
}

.policy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef0eb;
  align-items: center;
}

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

.policy-row strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

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

.switch {
  width: 36px;
  height: 21px;
  border-radius: 11px;
  background: #d7dbd4;
  border: 0;
  position: relative;
  padding: 0;
  transition: background 0.16s;
}

.switch i {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(20, 30, 26, 0.2);
  transition: transform 0.16s var(--ease);
}

.switch.on {
  background: var(--brand);
}

.switch.on i {
  transform: translateX(15px);
}

.progress-list {
  display: flex;
  flex-direction: column;
}

.progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(120px, 1fr) 62px auto;
  gap: 18px;
  align-items: center;
  padding: 13px 16px;
  border-bottom: 1px solid #eef0eb;
}

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

.progress-row strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.progress-row small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.progress-row b {
  text-align: right;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}

.ask-row {
  display: flex;
  gap: 8px;
}

.ask-row .input {
  flex: 1;
}

.ask-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.chip {
  height: 28px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 14px;
  padding: 0 11px;
  font-size: 12px;
  color: var(--ink-2);
  transition:
    border-color 0.14s,
    background 0.14s;
}

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

.ask-note {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--faint);
}

.answer {
  padding: 16px;
}

.answer-lead {
  font-size: 14px;
  line-height: 1.8;
  color: var(--ink);
}

.answer-points {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.answer-points div {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f0f2ed;
  font-size: 12.5px;
  line-height: 1.7;
}

.answer-points div:last-child {
  border-bottom: 0;
}

.answer-points em {
  font-style: normal;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.evidence {
  list-style: none;
  padding: 0;
  margin: 0;
}

.evidence li {
  padding: 12px 16px;
  border-bottom: 1px solid #eef0eb;
}

.evidence li:last-child {
  border-bottom: 0;
}

.evidence strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}

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

.feed-row {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #eef0eb;
  cursor: pointer;
}

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

.feed-row:hover {
  background: #f7f8f4;
}

.feed-row.unread {
  background: #fbfcfa;
}

.feed-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: transparent;
  flex: 0 0 7px;
  margin-top: 7px;
}

.feed-row.unread .feed-dot {
  background: var(--brand);
}

.feed-row > div {
  min-width: 0;
  flex: 1;
}

.feed-row strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.feed-row p {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.6;
}

.feed-time {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: var(--faint);
  font-variant-numeric: tabular-nums;
}

.cal {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding: 16px;
}

.cal-head {
  font-size: 11px;
  color: var(--faint);
  text-align: center;
  padding-bottom: 2px;
}

.cal-day {
  min-height: 56px;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 6px 7px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--surface);
}

.cal-day b {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.cal-day.ok {
  background: var(--green-soft);
  border-color: #d5e5db;
}

.cal-day.warn {
  background: var(--orange-soft);
  border-color: #eedcc9;
}

.cal-day.bad {
  background: var(--red-soft);
  border-color: #eccfcc;
}

.cal-day.blank {
  border: 0;
  background: transparent;
}

.cal-legend {
  display: flex;
  gap: 14px;
  padding: 0 16px 14px;
  font-size: 11px;
  color: var(--muted);
}

.cal-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.cal-legend i {
  width: 9px;
  height: 9px;
  border-radius: 2px;
  background: var(--green-soft);
  border: 1px solid #d5e5db;
}

.svc-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 108px auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #eef0eb;
}

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

.svc-row:hover {
  background: #f7f8f4;
}

.svc-row .icon {
  color: var(--brand);
}

.svc-row strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.svc-row span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.svc-sla {
  font-size: 12px;
  color: var(--ink-2);
  text-align: right;
}

.split-side {
  grid-template-columns: 250px minmax(0, 1fr);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.kv-block {
  padding: 4px 16px 12px;
}

.kv-block div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid #f0f2ed;
  font-size: 12.5px;
}

.kv-block div:last-child {
  border-bottom: 0;
}

.kv-block span:first-child {
  color: var(--muted);
}

.files-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 76px 96px;
  gap: 12px;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid #eef0eb;
  font-size: 12.5px;
}

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

.files-row .icon {
  color: var(--muted);
}

.files-row strong {
  font-weight: 600;
}

.files-row span {
  color: var(--muted);
  font-size: 11.5px;
}

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

@media (max-width: 900px) {
  .policy-row,
  .progress-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px 14px;
  }
  .progress-row .bar-track {
    grid-column: 1 / -1;
  }
  .progress-row b {
    text-align: right;
  }
  .profile-grid,
  .license-grid {
    grid-template-columns: 1fr;
  }
  .cal {
    gap: 3px;
    padding: 10px;
  }
  .cal-day {
    min-height: 44px;
    padding: 4px;
    font-size: 10.5px;
  }
  .svc-row {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    padding: 12px 14px;
  }
  .svc-sla {
    display: none;
  }
  .files-row {
    grid-template-columns: 20px minmax(0, 1fr) auto;
    padding: 10px 14px;
  }
  .files-row span:nth-child(3) {
    display: none;
  }
  .ask-row {
    flex-direction: column;
  }
}

.person-list {
  display: flex;
  flex-direction: column;
}

.person-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 11px 16px;
  border-bottom: 1px solid #eef0eb;
}

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

.person-row strong {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
}

.person-row span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.person-row b {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.answer-points div {
  grid-template-columns: 10px minmax(0, 1fr);
  gap: 8px;
}

.answer-points em {
  color: var(--brand);
  line-height: 1.7;
}

.progress-row {
  grid-template-columns: minmax(0, 1.3fr) 240px 56px 64px;
}

.alert-strip.ok {
  background: var(--brand-soft);
  border-color: #cfe3db;
  color: #174f44;
}

.alert-strip.ok .icon {
  color: var(--brand);
}

.alert-strip.ok span {
  color: #2c5f52;
}

.alert-strip.flush {
  margin: 0;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}

.report-headline {
  display: block;
  font-size: 19px;
  font-weight: 650;
  letter-spacing: -0.01em;
  margin: 2px 0 4px;
}

.report-body p {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}

.chart-shell.sm {
  height: 150px;
  padding: 0;
}

.search-input.wide {
  width: 320px;
}

.app-badge {
  width: 34px;
  height: 34px;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 650;
  flex: 0 0 34px;
}

.connector-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connector-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
}

.connector-desc {
  min-height: 34px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}

.mt-10 {
  margin-top: 10px;
}

.swatch-warn {
  background: var(--orange-soft);
  border-color: #eedcc9;
}

.swatch-bad {
  background: var(--red-soft);
  border-color: #eccfcc;
}

.figures-inline {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.meta-xs {
  font-size: 11px;
  color: var(--faint);
}

/* Mobile corrections: keep last so they win the cascade */
@media (max-width: 900px) {
  .data-table,
  .data-table td {
    white-space: normal;
  }
  .data-table td:before {
    flex: 0 0 76px;
  }
  .split-side {
    grid-template-columns: 1fr;
  }
  .search-input.wide {
    width: 100%;
  }
  .progress-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 6px 12px;
  }
  .progress-row > div:first-child {
    grid-column: 1;
    grid-row: 1;
  }
  .progress-row b {
    grid-column: 2;
    grid-row: 1;
  }
  .progress-row .bar-track {
    grid-column: 1 / -1;
    grid-row: 2;
    margin-top: 2px;
  }
  .progress-row .status {
    grid-column: 1 / -1;
    grid-row: 3;
    justify-self: start;
  }
  .analysis-panel .analysis-body {
    padding: 16px;
  }
  .page-actions .btn {
    min-height: 38px;
  }
  .tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }
  .tab {
    flex: 0 0 auto;
  }
}

@media (max-width: 420px) {
  .log-row {
    grid-template-columns: 78px 44px minmax(0, 1fr);
    gap: 8px;
    padding: 7px 12px;
  }
  .workspace {
    padding-left: 12px;
    padding-right: 12px;
  }
}

.cal-day span {
  display: block;
  font-size: 10px;
  line-height: 1.3;
  margin-top: 2px;
}

.login-mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
}

.login-mobile-brand .mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--shell);
  color: #f6f8f4;
  display: grid;
  place-items: center;
  font-size: 15px;
}

.login-mobile-brand strong {
  display: block;
  font-size: 14px;
}

.login-mobile-brand span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

@media (max-width: 900px) {
  .login-mobile-brand {
    display: flex;
  }
  .cal-day span {
    display: none;
  }
  .cal-day {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
  }
}

.mt-10 {
  margin-top: 10px;
}

.conn-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 96px auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #eef0eb;
}

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

.conn-row:hover {
  background: #f8f9f5;
}

.conn-row strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
}

.conn-row div > span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.conn-state {
  justify-self: start;
}

.row-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

@media (max-width: 900px) {
  .conn-row {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px 14px;
  }
  .conn-state {
    display: none;
  }
  .row-actions {
    grid-column: 2 / -1;
    justify-content: flex-start;
    margin-top: 6px;
  }
}

/* --------------------------------------------------------------------------
   团队工位（融合版）
   -------------------------------------------------------------------------- */

.floor-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.floor-stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 16px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.floor-stat b {
  font-size: 21px;
  font-weight: 660;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

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

.floor-stat em {
  margin-left: auto;
  font-style: normal;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--mint);
  color: var(--brand);
}

.floor-stat em.warn {
  background: var(--sand);
  color: var(--sand-ink);
}

.floor-stat em.off {
  background: #eff1eb;
  color: #7b857e;
}

.floor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 356px;
  gap: 16px;
  align-items: start;
}

.floor-card {
  overflow: hidden;
}

.floor-canvas {
  position: relative;
  margin: 0 16px;
  border: 1px solid #dcdcd0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.42);
  overflow: hidden;
}

.floor-canvas:before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(to right, rgba(30, 45, 38, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(30, 45, 38, 0.045) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.seat-bench {
  position: absolute;
  left: 6%;
  right: 6%;
  height: 140px;
}

.seat-bench .desk-bar {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 26px;
  margin-top: -13px;
  border-radius: 7px;
  background: #f2f0e3;
  border: 1px solid #dedccb;
  box-shadow: 0 2px 5px -4px rgba(30, 45, 38, 0.35);
}

.seat-bench .desk-bar:before,
.seat-bench .desk-bar:after {
  content: '';
  position: absolute;
  top: -1px;
  bottom: -1px;
  width: 1px;
  background: #dddcd0;
}

.seat-bench .desk-bar:before {
  left: 10px;
}
.seat-bench .desk-bar:after {
  right: 10px;
}

.seat {
  position: absolute;
  top: 50%;
  width: 176px;
  height: 58px;
  margin-left: -88px;
  margin-top: -29px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 0 2px;
  border-radius: 29px;
  cursor: pointer;
  z-index: 2;
  border: 0;
  background: transparent;
  text-align: left;
  transition:
    background 0.14s,
    box-shadow 0.14s;
}

.seat.up {
  margin-top: -87px;
}
.seat.down {
  margin-top: 33px;
}

.seat:hover {
  background: rgba(255, 253, 249, 0.92);
  box-shadow: 0 6px 16px -12px rgba(30, 45, 38, 0.6);
}

.seat.sel {
  background: #f2f8f4;
  box-shadow: 0 0 0 1px rgba(29, 111, 91, 0.18);
}

.seat .av {
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border-radius: 50%;
  background: #e7efe9;
  border: 1px solid #d7e4dc;
  display: grid;
  place-items: center;
  color: #3f7a66;
  position: relative;
}

.seat .av svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
  opacity: 0.9;
}

.seat.sel .av {
  background: #dceee5;
  border: 2px solid var(--brand);
  color: var(--brand);
}

.seat .txt {
  min-width: 0;
}

.seat b {
  display: block;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.25;
  color: var(--ink);
  white-space: nowrap;
}

.seat em {
  display: block;
  font-style: normal;
  font-size: 9px;
  color: var(--muted);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seat .st {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #2f8a72;
  box-shadow: 0 0 0 2px var(--surface);
}

.seat.busy .av {
  background: var(--sand);
  border-color: #ecd7b8;
  color: var(--sand-ink);
}

.seat.busy .st {
  background: #d09a54;
}

.seat.away .av {
  background: #eef0ea;
  border-color: #dde1d8;
  color: #9aa29b;
}

.seat.away .st {
  background: #b8beb6;
}
.seat.away b {
  color: #6e7770;
}

.floor-legend {
  display: flex;
  gap: 16px;
  padding: 12px 18px 14px;
  font-size: 11.5px;
  color: var(--muted);
}

.floor-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.floor-legend i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2f8a72;
}

.floor-legend i.busy {
  background: #d09a54;
}
.floor-legend i.away {
  background: #b8beb6;
}

.person-card {
  position: sticky;
  top: 0;
}

.person-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 16px 18px 0;
}

.person-head .av {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: var(--mint);
  color: var(--brand);
  display: grid;
  place-items: center;
  border: 1px solid #d7e4dc;
}

.person-head svg {
  width: 30px;
  height: 30px;
  fill: currentColor;
}

.person-head h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.01em;
}

.person-head .role {
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.person-state {
  margin: 12px 18px 0;
  display: flex;
  align-items: center;
  gap: 7px;
  background: var(--mint);
  color: var(--brand);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12px;
}

.person-state i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.person-state.busy {
  background: var(--sand);
  color: var(--sand-ink);
}

.person-state.away {
  background: #eff1eb;
  color: #75806f;
}

.p-block {
  padding: 13px 18px 10px;
  border-top: 1px solid #eff0e9;
  margin-top: 14px;
}

.p-block h4 {
  margin: 0 0 9px;
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 600;
  display: flex;
  justify-content: space-between;
}

.p-block h4 span {
  font-weight: 400;
}

.p-work {
  display: grid;
  gap: 8px;
}

.p-work > div {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 9px;
  font-size: 12px;
}

.p-work time {
  color: var(--faint);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  padding-top: 1px;
}

.p-work b {
  display: block;
  font-weight: 600;
}

.p-work span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
}

.p-deals {
  display: grid;
  gap: 9px;
}

.p-deal-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.p-deal-row b {
  font-weight: 650;
}

.p-deal-row small {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 1px;
}

.p-deal-row .amt {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.p-deal-track {
  height: 5px;
  background: #edefe6;
  border-radius: 3px;
  overflow: hidden;
  margin-top: 5px;
}

.p-deal-track i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: #2f8a72;
}

.p-deal-track i.warn {
  background: #c08a4e;
}

.p-out {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.p-out div {
  background: #f8f8f1;
  border-radius: 8px;
  padding: 9px 10px;
}

.p-out b {
  display: block;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  font-weight: 660;
}

.p-out span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}

.p-load {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
}

.p-load .ring {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
}

.p-load .ring circle {
  fill: none;
  stroke-width: 6;
}

.p-load .ring .track {
  stroke: #edefe6;
}
.p-load .ring .val {
  stroke: #c08a4e;
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.p-load p {
  margin: 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

.p-load p b {
  color: var(--ink);
  font-weight: 650;
}

.person-actions {
  display: flex;
  gap: 8px;
  padding: 12px 18px 16px;
}

.person-actions .btn {
  flex: 1;
  height: 36px;
}

@media (max-width: 1180px) {
  .floor-layout {
    grid-template-columns: 1fr;
  }
  .person-card {
    position: static;
  }
}

@media (max-width: 900px) {
  .floor-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .floor-canvas {
    margin: 0 10px;
    overflow-x: auto;
  }
  .seat {
    width: 150px;
    margin-left: -75px;
  }
  .seat .av {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
  }
  .seat .av svg {
    width: 24px;
    height: 24px;
  }
}

.chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.chip.on {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.seat.c1 {
  left: 14%;
}
.seat.c2 {
  left: 50%;
}
.seat.c3 {
  left: 86%;
}

@media (max-width: 900px) {
  .seat.c1 {
    left: 18%;
  }
  .seat.c3 {
    left: 82%;
  }
  .seat {
    width: 124px;
    margin-left: -62px;
  }
  .seat .av {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }
  .seat .av svg {
    width: 23px;
    height: 23px;
  }
  .seat b {
    font-size: 11px;
  }
  .seat em {
    font-size: 8.5px;
  }
}

.seat .txt {
  min-width: 0;
  flex: 1;
}

.seat em {
  max-width: 100%;
}

@media (max-width: 900px) {
  .seat {
    width: 96px;
    height: 54px;
    margin-left: -48px;
  }
  .seat em {
    display: none;
  }
  .seat b {
    font-size: 11px;
  }
}

/* --------------------------------------------------------------------------
   Dashboard modules
   -------------------------------------------------------------------------- */

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

.c2 {
  grid-column: span 2;
}
.c3 {
  grid-column: span 3;
}
.c4 {
  grid-column: span 4;
}
.c5 {
  grid-column: span 5;
}
.c6 {
  grid-column: span 6;
}
.c7 {
  grid-column: span 7;
}
.c8 {
  grid-column: span 8;
}
.c9 {
  grid-column: span 9;
}
.c12 {
  grid-column: span 12;
}

.dash-main,
.dash-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
  min-width: 0;
  box-shadow: 0 4px 18px -10px rgba(24, 36, 30, 0.32);
}

.tile h3 {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.01em;
}

.tile .big {
  font-size: 32px;
  font-weight: 660;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 8px 0 2px;
  font-variant-numeric: tabular-nums;
}

.tile .sub {
  font-size: 12px;
  color: var(--muted);
}

.tile.dark {
  background: linear-gradient(160deg, #17483d 0%, #123a31 62%, #0f332b 100%);
  border-color: transparent;
  color: #eef5f0;
  box-shadow: 0 14px 30px -24px rgba(16, 44, 36, 0.9);
}

.tile.dark h3,
.tile.dark .sub {
  color: rgba(238, 245, 240, 0.66);
}

.tile.dark .big {
  color: #fff;
}

.tile.sand {
  background: var(--sand);
  border-color: #ecdfc9;
}

.tile.sand h3,
.tile.sand .sub {
  color: var(--sand-ink);
}

.tile.sky {
  background: var(--sky);
  border-color: #dbe6ec;
}

.tile.sky h3,
.tile.sky .sub {
  color: var(--sky-ink);
}

.tile.rose {
  background: var(--rose);
  border-color: #eedcd6;
}

.tile.rose h3,
.tile.rose .sub {
  color: var(--rose-ink);
}

.tile .mini {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 58%;
  height: 66%;
  opacity: 0.9;
  pointer-events: none;
}

.tile .mini svg {
  width: 100%;
  height: 100%;
}

.tile .mini .area {
  fill: rgba(126, 200, 176, 0.18);
}

.tile .mini .line {
  fill: none;
  stroke: #7fd6b8;
  stroke-width: 2;
}

.tile .ring {
  position: absolute;
  right: 16px;
  bottom: 14px;
  width: 62px;
  height: 62px;
}

.tile .ring circle {
  fill: none;
  stroke-width: 7;
}

.tile .ring .track {
  stroke: #eceee6;
}

.tile .ring .val {
  stroke: var(--brand-2);
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
}

.tile.sky .ring .track {
  stroke: rgba(62, 99, 121, 0.14);
}

.tile.sky .ring .val {
  stroke: #4f7389;
}

.tile .tile-link {
  position: absolute;
  right: 14px;
  top: 12px;
  font-size: 12px;
  color: var(--brand);
  border: 0;
  background: transparent;
  padding: 2px;
}

.tile.dark .tile-link {
  color: #9fe3c7;
}

.dash-list {
  display: flex;
  flex-direction: column;
}

.dash-row {
  display: grid;
  grid-template-columns: 3px minmax(0, 1fr) 96px 84px;
  gap: 12px;
  align-items: center;
  padding: 11px 12px;
  margin-bottom: 6px;
  border-radius: 12px;
  background: #f6f5ec;
  cursor: pointer;
  transition:
    background 0.14s,
    box-shadow 0.14s,
    transform 0.14s;
}

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

.dash-row:hover {
  background: #fffdfa;
  box-shadow: 0 8px 20px -14px rgba(24, 36, 30, 0.5);
  transform: translateY(-1px);
}

.dash-row .bar {
  height: 30px;
  border-radius: 2px;
  background: var(--brand-2);
}

.dash-row .bar.sand {
  background: #c08a4e;
}
.dash-row .bar.sky {
  background: #5d8298;
}
.dash-row .bar.rose {
  background: #b06a5c;
}

.dash-row b {
  display: block;
  font-size: 13px;
  font-weight: 650;
}

.dash-row span {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  margin-top: 2px;
}

.dash-row .amt {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  font-size: 13px;
}

.dash-row .amt small {
  display: block;
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
}

.dash-row .pill {
  justify-self: end;
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 11px;
  background: var(--mint);
  color: var(--brand);
  white-space: nowrap;
}

.dash-row .pill.warn {
  background: var(--sand);
  color: var(--sand-ink);
}

.dash-row .pill.bad {
  background: var(--rose);
  color: var(--rose-ink);
}

.avatar-stack {
  display: flex;
  align-items: center;
}

.avatar-stack .avatar {
  margin-left: -7px;
  border: 2px solid var(--surface);
  width: 30px;
  height: 30px;
  font-size: 10px;
}

.avatar-stack .avatar:first-child {
  margin-left: 0;
}

.avatar-stack .more {
  margin-left: 8px;
  font-size: 11px;
  color: var(--muted);
}

.people-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  margin: 4px 0;
  border-radius: 12px;
  background: #f6f5ec;
}

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

.people-row .who {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.people-row b {
  display: block;
  font-size: 12.5px;
  font-weight: 650;
}

.people-row span {
  display: block;
  font-size: 11px;
  color: var(--muted);
}

.people-row em {
  font-style: normal;
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 1180px) {
  .dash > * {
    grid-column: span 12 !important;
  }
}

@media (max-width: 900px) {
  .dash {
    gap: 10px;
  }
  .tile {
    padding: 14px 16px;
  }
  .tile .big {
    font-size: 27px;
  }
  .tile .mini,
  .tile .ring {
    display: none;
  }
}

@media (max-width: 900px) {
  .dash-row {
    grid-template-columns: 3px minmax(0, 1fr) auto;
    gap: 6px 10px;
    align-items: start;
  }
  .dash-row .amt {
    grid-column: 2 / -1;
    text-align: left;
    font-size: 12px;
  }
  .dash-row .pill {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
  }
  .alert-strip {
    flex-wrap: wrap;
  }
  .alert-strip button {
    margin-left: 0;
  }
}
