/* 翡翠版角色端统一外壳：业务页面只通过 role-* 变量区分身份。 */
:root {
  /* ── 页面与表面 ── */
  --emerald-deep: #043d3b;          /* 深翡翠外壳（侧栏/页头底色） */
  --emerald-deep-2: #062e2d;        /* 深翡翠外壳渐变次色 */
  --emerald-paper: #f5faf8;         /* 浅翡翠画布（内容区底色） */
  --emerald-surface: #ffffff;       /* 白色卡片表面 */
  --emerald-surface-soft: #eef7f3;  /* 柔和底面（次级分组/内衬） */

  /* ── 文字与边界 ── */
  --emerald-text: #173f3c;          /* 正文主色 */
  --emerald-muted: #65847e;         /* 弱文本/辅助说明 */
  --emerald-line: #d8ebe5;          /* 常规边界 */
  --emerald-line-strong: #bcd9d1;   /* 强调边界（表头分隔/突出描边） */

  /* ── 品牌与交互 ── */
  --emerald-gold: #f5d68a;          /* 金色强调（徽章/点缀），不作焦点态 */
  --emerald-focus: #159b79;         /* 键盘焦点主色（与金色分离） */
  --emerald-focus-ring: rgba(21, 155, 121, 0.32); /* 焦点外圈 */

  /* ── 语义状态（仅定义；U3 再逐页接入） ── */
  --status-success: #16a34a; --status-success-soft: #dcfce7;
  --status-warning: #d97706; --status-warning-soft: #fef3c7;
  --status-danger: #dc2626; --status-danger-soft: #fef2f2;
  --status-info: #2563eb; --status-info-soft: #eff6ff;

  /* ── 字体标度（从辅助文字到页面标题，固定层级；本卡不替换页面字号） ── */
  --font-xs: 11px;      /* 辅助标签/注释 */
  --font-sm: 12px;      /* 表格单元格/小注释 */
  --font-base: 13px;    /* 正文/默认 */
  --font-md: 14px;      /* 区块标题 */
  --font-lg: 16px;      /* 卡片标题 */
  --font-xl: 18px;      /* 页面标题 */

  /* ── 间距标度（4px 基准递进） ── */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* ── 圆角与阴影 ── */
  /* 圆角沿用 U1 已核验标度：输入框/按钮 8px · 卡片/模态框 16px · 胶囊 999px */
  --radius-sm: 8px;
  --radius: 8px;
  --radius-md: 16px;
  --radius-lg: 16px;
  --radius-full: 999px;
  --shadow-sm: 0 1px 2px rgba(12, 79, 67, 0.05);
  --shadow-card: 0 10px 24px rgba(12, 79, 67, 0.055);
  --shadow-modal: 0 25px 60px rgba(0, 0, 0, 0.2);
}

body.emerald-role-shell {
  --role: #159b79;
  --role-soft: #e9f8f2;
  --role-strong: #08795d;
  background: var(--emerald-paper) !important;
  color: var(--emerald-text);
}
/* All six role workbenches follow the approved emerald home-page palette. */
body.role-eval,
body.role-enterprise,
body.role-auditor,
body.role-signer,
body.role-admin {
  --role: #159b79;
  --role-soft: #e9f8f2;
  --role-strong: #08795d;
}

.emerald-role-shell .sidebar {
  width: 252px !important;
  background: linear-gradient(180deg, var(--emerald-deep) 0%, var(--emerald-deep-2) 100%) !important;
  border-right: 1px solid rgba(177, 232, 215, 0.15);
  box-shadow: 12px 0 34px rgba(4, 61, 59, 0.08);
}
.emerald-role-shell .nav-section-label {
  color: #edfff8 !important;
  background: rgba(255,255,255,.075) !important;
  border: 1px solid rgba(190, 236, 220, .14) !important;
  box-shadow: none !important;
}
.emerald-role-shell .nav-item { color: #b9d8ce !important; border-left-color: transparent !important; }
.emerald-role-shell .nav-item:hover { color: #fff !important; background: rgba(255,255,255,.08) !important; }
.emerald-role-shell .nav-item.active {
  color: #fff !important;
  background: color-mix(in srgb, var(--role) 30%, transparent) !important;
  border-left: 3px solid var(--role) !important;
}

.emerald-role-shell main,
.emerald-role-shell .main-content {
  background: var(--emerald-paper) !important;
}
.emerald-role-shell .stat-card,
.emerald-role-shell .record-panel,
.emerald-role-shell .modal-box,
.emerald-role-shell .sheet,
.emerald-role-shell .card {
  border-color: var(--emerald-line) !important;
  border-radius: 16px !important;
  box-shadow: 0 10px 24px rgba(12, 79, 67, .055);
}
.emerald-role-shell .stat-card { border-top: 3px solid var(--role) !important; }
.emerald-role-shell .data-table th { background: var(--role-soft) !important; color: var(--role-strong) !important; }
.emerald-role-shell .data-table tr:hover td { background: #fbfefd !important; }
.emerald-role-shell .badge,
.emerald-role-shell .grade-chip {
  border-color: color-mix(in srgb, var(--role) 22%, transparent) !important;
  white-space: nowrap !important;
}
.emerald-role-shell .short-label { white-space: nowrap !important; }
/* U1-B：表格名称/姓名列统一省略号+悬停（三件套；列宽约束由各表 th 显式宽度提供） */
.emerald-role-shell .cell-ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.emerald-role-shell .role-session {
  display: flex;
  min-width: 0;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  color: #64748b;
  font-size: 12px;
}
.emerald-role-shell .role-session-chip {
  display: inline-flex;
  max-width: 230px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  padding: 4px 10px;
  border-radius: 999px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.emerald-role-shell .role-session-user,
.emerald-role-shell .role-session-context {
  overflow: hidden;
  max-width: 190px;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #475569;
  font-weight: 600;
}
.emerald-role-shell .role-session-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: #64748b;
}
.emerald-role-shell .role-session-status i {
  display: block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #16a34a;
}
@media (max-width: 1100px) {
  .emerald-role-shell .role-session { gap: 7px; }
  .emerald-role-shell .role-session-context { display: none; }
  .emerald-role-shell .role-session-chip { max-width: 110px; padding-inline: 8px; }
  .emerald-role-shell .role-session-user { max-width: 110px; }
}
.emerald-role-shell .data-table td[style*="monospace"],
.emerald-role-shell span[style*="monospace"] { white-space: nowrap; }
.emerald-role-shell .progress-fill { background: var(--role) !important; }
.emerald-role-shell button[class*="primary"],
.emerald-role-shell .btn-primary,
.emerald-role-shell .button-primary {
  background: var(--role) !important;
  border-color: var(--role) !important;
}
.emerald-role-shell a:focus-visible,
.emerald-role-shell button:focus-visible,
.emerald-role-shell input:focus-visible,
.emerald-role-shell select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--role) 32%, transparent);
  outline-offset: 2px;
}

body.emerald-login {
  background: #043d3b url("/政策工具_翡翠版_独立版/assets/visuals/homepage-option4/hero-emerald-orbit.png") center/cover fixed !important;
}
.emerald-login .login-wrap {
  border: 1px solid rgba(194, 239, 222, .42);
  border-radius: 20px;
  box-shadow: 0 28px 70px rgba(0, 31, 29, .42);
}
.emerald-login .btn-login { background: #079b79 !important; }
.emerald-login .role-btn.selected { border-color: #079b79 !important; background: #e9f8f2 !important; color: #08795d !important; }
.emerald-login .back-link { color: #d7f5e9; }
@media (max-width: 760px) {
  .emerald-role-shell .sidebar { width: 232px !important; }
  .emerald-role-shell .role-session { gap: 7px; }
  .emerald-role-shell .role-session-user,
  .emerald-role-shell .role-session-context { display: none; }
  .emerald-role-shell .role-session-chip { max-width: 160px; padding-inline: 8px; }
}
