/* 冠成科技账号管理中心 —— 管理界面样式 */
:root {
  /* 主题色取自冠成科技 logo 红 #C30E23 */
  --brand: #c30e23;
  --brand-dark: #9f0b1c;
  --brand-soft: #fdeff0;
  --brand-line: #f2c4c9;
  --blue: #2f5fb3;
  --bg: #ffffff;
  --card: #ffffff;
  --line: #e8e5e3;
  --text: #25211f;
  --muted: #7b7572;
  --red: #c0392b;
  --green: #168253;
  --orange: #b45309;
  --sidebar: #ffffff;
  --sidebar-w: 216px;
  /* 间距刻度：全站只用这几档 */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  /* 圆角刻度：控件 / 卡片 / 弹窗 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;
  --page-max: 1280px;
  /* 字号：只允许这三档 —— 标题 / 正文 / 副标题（辅助说明、表头、标签、时间等） */
  --fs-title: 18px;
  --fs-body: 14px;
  --fs-sub: 12px;
  /* 控件高度：按钮、输入框、下拉框全局同高 */
  --control-h: 34px;
  --control-h-sm: 28px;
  font-size: var(--fs-body);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: var(--fs-body)/1.6 -apple-system, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
}
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 600; }
[hidden] { display: none !important; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background:
    radial-gradient(900px 500px at 8% 0%, rgba(195, 14, 35, .10), transparent 60%),
    radial-gradient(800px 480px at 100% 100%, rgba(195, 14, 35, .08), transparent 60%),
    #f3f1ef;
}
.login-shell {
  width: 880px;
  max-width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(60, 20, 20, .16), 0 2px 6px rgba(60, 20, 20, .06);
}
.login-brand {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 18px 24px 42px;
  background: linear-gradient(160deg, #fff 0%, #fdf1f2 100%);
  overflow: hidden;
}
.login-brand img { width: 208px; max-width: 72%; height: auto; display: block; }
.login-brand .tagline { margin-top: 10px; color: var(--muted); font-size: var(--fs-sub); letter-spacing: 3px; }
/* 呼应 logo 的斜切造型 */
.login-brand::after {
  content: "";
  position: absolute; left: -10%; right: -10%; bottom: -34px; height: 92px;
  background: var(--brand);
  transform: skewY(-5deg);
}
.login-brand .brand-foot {
  position: absolute; left: 0; right: 0; bottom: 14px; z-index: 1;
  text-align: center; color: #fff; font-size: var(--fs-sub); letter-spacing: 2px;
}
.login-card { padding: 48px var(--space-6) var(--space-6); display: flex; flex-direction: column; justify-content: center; }
.login-logo-h { display: none; height: 34px; width: auto; margin-bottom: var(--space-5); }
.login-card h1 { font-size: var(--fs-title); margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: var(--space-5); }
.login-card .field { margin-bottom: var(--space-4); }

.login-card { --control-h: 40px; }
.login-card .btn { --btn-py: 8px; font-size: var(--fs-title); width: 100%; justify-content: center; }
.login-card form .btn { margin-top: var(--space-2); }
.login-card .btn + .login-divider { margin-top: 18px; }
/* 登录/扫码并排按钮行：字号缩小、高度收紧 */
.login-btn-row { display: flex; gap: 10px; margin-top: var(--space-2); }
.login-btn-row .btn { flex: 1; width: auto; --btn-py: 6px; font-size: 13px; min-height: 34px; }
@media (max-width: 760px) {
  .login-shell { grid-template-columns: 1fr; width: 420px; }
  .login-brand { display: none; }
  .login-logo-h { display: block; }
  .login-card { padding: var(--space-5); }
}
.login-qr-tip { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 8px; padding: 8px 12px; margin-bottom: 14px; font-size: var(--fs-body); }
.login-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: var(--fs-sub); margin: 16px 0; }
.login-divider::before, .login-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* ---------- 布局 ---------- */
.layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar);
  color: var(--text);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
}
.sidebar .brand {
  padding: var(--space-5) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--line);
}
.sidebar .brand img { display: block; width: 150px; height: auto; margin-bottom: 8px; }
.sidebar .brand span { font-size: var(--fs-sub); color: var(--muted); }
.nav { flex: 1; overflow-y: auto; padding: 10px 0; }
.nav button {
  display: flex; align-items: center; gap: var(--space-3);
  width: 100%;
  background: none;
  border: 0;
  color: #4a4441;
  padding: 10px var(--space-5);
  font: inherit;
  cursor: pointer;
  text-align: left;
  border-left: 3px solid transparent;
}
.nav button svg { width: 17px; height: 17px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .75; }
.nav button:hover { background: #f7f4f3; color: var(--text); }
.nav button.active {
  background: var(--brand-soft);
  border-left-color: var(--brand);
  color: var(--brand-dark);
  font-weight: 600;
}
.nav button.active svg { opacity: 1; }
.nav .group { font-size: var(--fs-sub); color: #a39d9a; padding: var(--space-4) var(--space-5) var(--space-1); letter-spacing: 1px; }
.sidebar .foot { padding: var(--space-4) var(--space-5); border-top: 1px solid var(--line); font-size: var(--fs-sub); color: var(--muted); display: flex; flex-direction: column; gap: var(--space-3); }
.sidebar .foot-actions { display: flex; gap: var(--space-2); }
.sidebar .foot-actions .btn { flex: 1; justify-content: center; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
/* 顶栏：半透明 + 高斯模糊，内容滚动到下方时若隐若现 */
.topbar {
  background: rgba(255, 255, 255, .72);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid rgba(232, 229, 227, .8);
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: 60px;
  min-height: 60px;
  max-height: 60px;
  flex-shrink: 0;
  position: sticky; top: 0; z-index: 20;
}
.topbar .crumb { font-size: var(--fs-title); font-weight: 600; white-space: nowrap; }
/* 页面级操作区：搜索框、主要按钮，统一在顶栏右侧 */
.topbar-actions { display: flex; align-items: center; gap: var(--space-2); min-width: 0; max-height: 100%; overflow-x: auto; flex-wrap: nowrap; }
.topbar-actions > * { flex-shrink: 0; }
.topbar-actions .tool-input { width: 300px; }
/* 内容区：统一水平内边距、居中限宽；子块之间统一垂直间距，卡片自身不再带外边距 */
.content { padding: var(--space-5) var(--space-6) var(--space-6); max-width: var(--page-max); width: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-5); }
.content > * { margin: 0; }

/* ---------- 通用组件 ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-5); }
/* 卡片头（全站唯一标题样式，由 JS 的 cardHead 生成）：
   第一行 标题 + 紧随的徽标，卡片自身的操作靠右；第二行 副标题 + 紧随的筛选器 */
.card-head { margin-bottom: var(--space-4); }
.card-head-row { display: flex; align-items: center; gap: var(--space-3); min-height: 28px; }
.card-head h2 { font-size: var(--fs-title); font-weight: 600; margin: 0; }
.card-head .head-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-2); }
.card-head .card-sub { display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-3); margin: var(--space-1) 0 0; color: var(--muted); font-size: var(--fs-sub); }
.card-head .card-filters { display: inline-flex; align-items: center; gap: var(--space-2); font-weight: 400; }
/* 标题行里的筛选器用小号高度，不撑高标题行 */
.card-head .card-filters :where(select, input) { height: var(--control-h-sm); font-size: var(--fs-sub); }
.btn.push { margin-left: auto; }
.bar-end { display: flex; justify-content: flex-end; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.bar-end .hint-left { margin-right: auto; }
.card > :last-child { margin-bottom: 0; }

.row { display: flex; gap: var(--space-3); flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: var(--space-4); }
.grid > .card, .grid > .stat { margin: 0; }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 1000px) { .grid.cols-4, .grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }

.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-md); padding: var(--space-4) var(--space-5); }
.stat .num { font-size: var(--fs-title); font-weight: 700; }
.stat .lbl { color: var(--muted); font-size: var(--fs-sub); }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--brand); color: #fff;
  border: 1px solid var(--brand);
  border-radius: var(--radius-sm);
  /* 按钮内边距：只改 --btn-py，左右恒为上下的 2 倍 */
  --btn-py: 5px;
  padding: 0 calc(var(--btn-py) * 2);
  height: var(--control-h);
  justify-content: center;
  font: inherit; font-size: var(--fs-body);
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--text); border-color: #d6d0cd; }
.btn.secondary:hover { background: #f4f1f0; }
.btn.danger { background: #fff; color: var(--red); border-color: #e6bcb7; }
.btn.danger:hover { background: #fdf1ef; }
.btn.small { --btn-py: 3px; height: var(--control-h-sm); font-size: var(--fs-sub); }
.btn.large { --btn-py: 8px; height: 40px; }
.btn.link { background: none; border: 0; color: var(--brand); --btn-py: 2px; height: auto; }
.btn.link:hover { text-decoration: underline; }

/* 注意：很多输入框没写 type 属性，必须用排除法而不是 [type=text]，否则会丢失样式 */
:where(input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]), select, textarea) {
  font: inherit;
  border: 1px solid #d6d0cd;
  border-radius: var(--radius-sm);
  padding: 0 11px;
  height: var(--control-h);
  background: #fff;
  color: var(--text);
  width: 100%;
}
textarea { height: auto; padding: 7px 11px; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(195, 14, 35, .18); border-color: var(--brand); }
input:disabled, select:disabled { background: #f3f1f0; color: var(--muted); }
.field { display: flex; flex-direction: column; gap: var(--space-1); margin-bottom: var(--space-4); }
.field label { font-size: var(--fs-sub); color: var(--muted); font-weight: 600; }
.field .hint { font-size: var(--fs-sub); color: var(--muted); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-4); }
.form-grid .full { grid-column: 1 / -1; }

table.data { width: 100%; border-collapse: collapse; }
table.data th {
  text-align: left;
  font-size: var(--fs-sub);
  color: var(--muted);
  font-weight: 600;
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td { padding: var(--space-3); border-bottom: 1px solid #efebe9; vertical-align: middle; }
table.data tr:hover td { background: #faf8f7; }
table.data .actions { display: flex; gap: var(--space-2); justify-content: flex-end; flex-wrap: wrap; }
.empty { color: var(--muted); text-align: center; padding: var(--space-6) 0; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sub);
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge.green { background: #e8f7ef; color: var(--green); border-color: #bce5cf; }
.badge.gray { background: #f0f2f6; color: var(--muted); border-color: #dfe3ea; }
.badge.red { background: #fdecea; color: var(--red); border-color: #f3c5c0; }
.badge.blue { background: #e9eef8; color: #274b8f; border-color: #c9d6ee; }
.badge.orange { background: #fef3e2; color: var(--orange); border-color: #f5d9ae; }

.pill-group { display: flex; gap: var(--space-1); flex-wrap: wrap; }

/* 弹窗 */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(15, 20, 34, .45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 60px var(--space-5) var(--space-6);
  z-index: 100;
  overflow-y: auto;
}
.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 560px;
  max-width: 100%;
  padding: var(--space-5);
  box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}
.modal.wide { width: 860px; }
.modal h3 { font-size: var(--fs-title); margin-bottom: var(--space-4); }
.modal .modal-foot { display: flex; justify-content: flex-end; gap: var(--space-3); margin-top: var(--space-5); }
.secret-box {
  background: #fdf5f5; border: 1px dashed #e4aab0; border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4); margin: var(--space-3) 0;
  font-family: ui-monospace, Consolas, monospace;
  word-break: break-all;
  font-size: var(--fs-body);
}
.callout { border-radius: var(--radius-sm); padding: var(--space-3) var(--space-4); margin: var(--space-3) 0; font-size: var(--fs-body); }
.callout:first-child { margin-top: 0; }
.callout:last-child { margin-bottom: 0; }
.callout.warn { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; }
.callout.info { background: #fff; border: 1px solid var(--line); color: var(--text); }
.callout.danger { background: #fdecea; border: 1px solid #f3c5c0; color: var(--red); }

/* toast */
#toast-wrap { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; }
.toast {
  background: #2b2523; color: #fff;
  border-radius: var(--radius-sm); padding: 10px var(--space-4);
  font-size: var(--fs-body);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
  animation: fadein .18s ease;
}
.toast.err { background: var(--red); }
.toast.ok { background: var(--green); }
@keyframes fadein { from { opacity: 0; transform: translateY(-6px); } }

.perm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2) var(--space-5); }
.perm-item { display: flex; gap: 7px; align-items: center; font-size: var(--fs-body); }
.perm-item input { width: auto; }
.perm-group { font-size: var(--fs-sub); color: var(--muted); font-weight: 600; margin: var(--space-3) 0 var(--space-1); }

.tree-indent { color: #c3bcb9; margin-right: 4px; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: var(--fs-sub); }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sub); }
.mt8 { margin-top: var(--space-2); }
.modal .modal-foot .push-left { margin-right: auto; }
/* 角色列表：每个角色单行，权限只显示前几项，其余以 +N 悬浮查看 */
.role-list { border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.role-row { display: flex; align-items: center; gap: var(--space-4); padding: var(--space-2) var(--space-4); min-height: 44px; border-bottom: 1px solid var(--line); }
.role-row:last-child { border-bottom: 0; }
.role-row:hover { background: #faf8f7; }
.role-name { flex: 0 0 240px; display: flex; align-items: center; gap: var(--space-2); white-space: nowrap; }
.role-count { flex: 0 0 64px; white-space: nowrap; }
.role-desc { flex: 1 1 180px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-perms { flex: 0 1 auto; min-width: 0; overflow: hidden; display: flex; gap: var(--space-1); white-space: nowrap; }
.role-perms .badge { flex-shrink: 0; }
@media (max-width: 1200px) { .role-desc { display: none; } .role-perms { flex: 1 1 auto; } .role-name { flex-basis: 220px; } }
.role-actions { flex: 0 0 auto; display: flex; gap: var(--space-2); margin-left: auto; }
/* 首页 */
.ico { width: 17px; height: 17px; flex-shrink: 0; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: var(--space-5); flex-wrap: wrap; border-left: 3px solid var(--brand); }
.hero-title { font-size: var(--fs-title); font-weight: 700; }
.hero-sub { color: var(--muted); font-size: var(--fs-sub); margin-top: var(--space-1); }
.hero-actions { display: flex; gap: var(--space-2); flex-wrap: wrap; }
.stat { display: flex; align-items: center; gap: var(--space-4); }
.stat-ico { width: 44px; height: 44px; border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.stat-ico .ico { width: 22px; height: 22px; }
.stat .num { line-height: 1.2; }
.stat .sub { color: var(--muted); font-size: var(--fs-sub); margin-top: 2px; }
.two-col { display: grid; grid-template-columns: 2fr 1fr; gap: var(--space-5); align-items: start; }
@media (max-width: 1000px) { .two-col { grid-template-columns: 1fr; } }
.feed-item { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--line); }
.feed-item:last-child { border-bottom: 0; padding-bottom: 0; }
.feed-item:first-child { padding-top: 0; }
.feed-main { flex: 1; min-width: 0; }
.feed-text { overflow-wrap: anywhere; }
.feed-meta { color: var(--muted); font-size: var(--fs-sub); margin-top: 2px; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-top: 8px; flex-shrink: 0; }
.dot.fail { background: var(--red); }
.dot.denied { background: var(--orange); }
.kv { display: flex; justify-content: space-between; align-items: center; padding: var(--space-2) 0; border-bottom: 1px solid var(--line); }
.steps { margin: var(--space-4) 0 var(--space-3); padding-left: var(--space-5); color: var(--text); line-height: 1.9; }
.steps li::marker { color: var(--brand); font-weight: 700; }
/* 员工详情：两列键值对，信息分组横向铺开 */
.dl-title { font-size: var(--fs-sub); color: var(--muted); font-weight: 600; margin: var(--space-4) 0 var(--space-1); }
.dl-title:first-of-type { margin-top: 0; }
.dl { display: grid; grid-template-columns: 1fr 1fr; gap: 0 var(--space-6); }
.dl .item { display: flex; align-items: center; gap: var(--space-3); min-height: 40px; padding: var(--space-1) 0; border-bottom: 1px solid var(--line); }
.dl .item.full { grid-column: 1 / -1; }
.dl .k { flex: 0 0 76px; color: var(--muted); font-size: var(--fs-sub); }
.dl .v { flex: 1; min-width: 0; overflow-wrap: anywhere; display: flex; align-items: center; gap: var(--space-2); }
.ghost { visibility: hidden; pointer-events: none; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chip { display: inline-flex; align-items: center; gap: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: var(--space-1) var(--space-2); }
.bind-row { display: flex; align-items: center; gap: var(--space-2); margin-top: var(--space-3); }
.bind-row .btn { margin-left: auto; }
@media (max-width: 760px) { .dl { grid-template-columns: 1fr; } .bind-row { flex-wrap: wrap; } }
/* 弹窗底部：左侧次要操作组，右侧主操作 */
.modal-foot .foot-left { display: flex; gap: var(--space-3); margin-right: auto; }
.dl .v > :where(input, select) { width: 100%; }
/* 编辑态的输入框：与查看态同一行高（控件 28px < 行高 40px），底色与边框很淡，不抢眼 */
.dl .v :where(input:not([type=radio]), select) { height: var(--control-h-sm); font-size: var(--fs-body); border-color: #ece9e7; background: #fbfaf9; }
.dl .v :where(input, select)::placeholder { color: #c4bebb; }
.dl .v :where(input:not([type=radio]), select):focus { background: #fff; border-color: var(--brand); }
.modal h3 { display: flex; align-items: center; gap: var(--space-2); min-height: 28px; }
.dept-editor { width: 100%; display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-3); }
.dept-editor #f-depts { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; min-height: 28px; }
.dept-editor [data-dept-row] { margin: 0; flex-wrap: nowrap; }
.dept-editor [data-dept-row] + [data-dept-row] { margin-top: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb0 { margin-bottom: 0; }
.ml8 { margin-left: var(--space-2); }
.list { margin: 0; padding-left: var(--space-5); }
.check { display: flex; gap: var(--space-1); align-items: center; }
/* 控件宽度档位 */
.w-sm { width: 130px; }
.w-md { width: 180px; }
.w-lg { width: 240px; }
.tool-input { width: 240px; }
.label-col { width: 110px; }
[data-dept-row] { margin-bottom: var(--space-2); }
.text-right { text-align: right; }

/* 员工管理 · 部门分组折叠 */
.dept-group { border: 1px solid var(--line); border-radius: 8px; margin-bottom: 12px; overflow: hidden; }
.dept-group summary {
  list-style: none; cursor: pointer;
  padding: 10px 14px;
  background: #f8fafc;
  display: flex; align-items: center; gap: 6px;
  font-size: 13.5px;
  user-select: none;
}
.dept-group summary::-webkit-details-marker { display: none; }
.dept-group summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.dept-group:not([open]) summary::after { transform: rotate(-90deg); }
.dept-group summary:hover { background: #f1f4f9; }
.dept-group > table.data { margin: 0; }
.dept-group > table.data thead th { background: #fbfcfe; }

/* 组织架构 · 部门行展开成员 */
.dept-toggle {
  display: inline-block; width: 16px; margin-right: 6px;
  color: var(--muted); cursor: pointer; text-align: center;
  font-size: 12px; user-select: none;
  transition: transform .15s;
}
.dept-toggle:hover { color: var(--brand, var(--blue)); }
.dept-toggle.open { transform: rotate(90deg); }
tr.member-row > td { border-top: none !important; }
tr.member-row table.data { background: #fff; border: 1px solid var(--line); border-radius: 8px; }
tr.member-row table.data th { padding: 7px 10px; }
tr.member-row table.data td { padding: 7px 10px; }

/* 组织与员工统一工作区 */
.organization-layout { display:grid; grid-template-columns:340px minmax(0,1fr); gap:24px; align-items:start; }
.organization-layout .card { margin:0; }
.organization-layout > * { min-width:0; }
#organization-left .card { padding:20px; }
#organization-left .card > .btn { margin-bottom:16px; }
#organization-left th:nth-child(3), #organization-left td:nth-child(3), #organization-left th:nth-child(4), #organization-left td:nth-child(4) { display:none; }
#organization-left .card-head p { display:none; }
#organization-right .card { overflow-x:auto; }
.organization-select { cursor:pointer; }
.organization-select:hover, .organization-select.selected { background:#fff0f2; }
.organization-select.selected b { color:#cf0025; }
@media(max-width:1100px) { .organization-layout { grid-template-columns:280px minmax(0,1fr); gap:16px; } }
@media(max-width:800px) { .organization-layout { grid-template-columns:1fr; } }

/* 紧凑的组织与员工列表 */
.organization-layout { grid-template-columns:260px minmax(0,1fr); gap:20px; }
#organization-left .card, #organization-right .card { padding:20px; }
#organization-left table.data th, #organization-left table.data td { padding:8px 6px; }
#organization-left table.data th:nth-child(2), #organization-left table.data td:nth-child(2) { width:48px; text-align:center; white-space:nowrap; }
#organization-left table.data th:last-child, #organization-left table.data td:last-child { width:46px; }
#organization-right table.data { table-layout:fixed; min-width:850px; }
#organization-right table.data th, #organization-right table.data td { padding:7px 8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1.35; }
#organization-right table.data th:nth-child(1) { width:72px; }
#organization-right table.data th:nth-child(2) { width:80px; }
#organization-right table.data th:nth-child(4) { width:168px; }
#organization-right table.data th:nth-child(5) { width:142px; }
#organization-right table.data th:nth-child(6) { width:90px; }
#organization-right table.data th:nth-child(7) { width:66px; }
#organization-right table.data th:nth-child(8) { width:62px; text-align:right; }
#organization-right table.data .actions { flex-wrap:nowrap; }
#organization-right table.data .btn { padding:3px 8px; min-height:26px; }
#organization-right .card-head { margin-bottom:12px; }
#organization-right table.data thead { background:#faf8f7; }
@media(max-width:1100px) { .organization-layout { grid-template-columns:230px minmax(0,1fr); gap:16px; } }
@media(max-width:800px) { .organization-layout { grid-template-columns:1fr; } }

/* 员工列表保留更舒展的展示高度 */
#organization-right > .card { min-height: 560px; }

/* Boxicons：统一图标尺寸和当前文字颜色 */
.nav button svg, .ico { fill:currentColor; stroke:none; width:19px; height:19px; opacity:.85; }
.nav button { gap:12px; }
.nav button.active svg, .nav button:hover svg { opacity:1; }
.btn .ico { width:17px; height:17px; }
.stat-ico .ico { width:24px; height:24px; }
#organization-right table.data th:last-child, #organization-right table.data td:last-child { text-align:center; }
#organization-right table.data td:last-child .actions { justify-content:center; }
/* 部门树：统一层级、图标与选中反馈 */
#organization-left table.data { border-collapse:separate; border-spacing:0 4px; }
#organization-left table.data th { border-bottom:1px solid var(--line); padding-bottom:10px; }
#organization-left .organization-select td { border-bottom:0; padding:8px 6px; transition:background .15s ease; }
#organization-left .organization-select td:first-child { border-radius:6px 0 0 6px; }
#organization-left .organization-select td:last-child { border-radius:0 6px 6px 0; }
#organization-left .organization-select:hover td { background:#faf4f4; }
#organization-left .organization-select.selected td { background:var(--brand-soft); color:var(--brand-dark); }
.org-tree-label { display:flex; align-items:center; gap:8px; min-height:28px; position:relative; }
.org-tree-label b { font-weight:500; white-space:nowrap; }
.org-tree-label.is-child::before { content:''; position:absolute; left:4px; top:4px; width:6px; height:13px; border-left:1px solid #d8ceca; border-bottom:1px solid #d8ceca; border-radius:0 0 0 3px; }
#organization-left .dept-toggle { display:inline-flex; align-items:center; justify-content:center; margin:0; width:18px; flex:0 0 18px; color:#9b8d88; }
#organization-left .dept-toggle .ico { width:17px; height:17px; }
#organization-left .selected .dept-toggle { color:var(--brand); }
#organization-left .organization-select .btn { background:#fff; border-color:#d6d0cd; color:var(--text); padding:3px 8px; min-height:26px; }
#organization-left .organization-select .btn:hover { background:#f4f1f0; border-color:#d6d0cd; color:var(--text); }

.org-add-department { margin-left:auto; flex-shrink:0; color:var(--brand); border-color:transparent; background:var(--brand-soft); }
.org-add-department:hover { border-color:var(--brand); }
.organization-employee-actions { margin-left:auto; display:flex; align-items:center; gap:8px; min-width:0; }
.organization-employee-actions .tool-input { width:260px; min-width:120px; }
.organization-employee-actions .btn { white-space:nowrap; flex-shrink:0; }
#organization-right .card-head-row { flex-wrap:wrap; }
@media(max-width:1100px) { .organization-employee-actions .tool-input { width:190px; } }
/* 全局标题操作行：统一控件高度、字号和垂直基线 */
.card-head-row { min-height:34px; align-items:center; }
.card-head-row h2 { margin:0; line-height:34px; }
.topbar-actions, .card-head .head-actions, .card-head .card-filters, .organization-employee-actions { align-items:center; }
.topbar-actions .btn, .card-head-row .btn,
.topbar-actions :where(input:not([type=checkbox]):not([type=radio]), select),
.card-head-row :where(input:not([type=checkbox]):not([type=radio]), select),
.card-head .card-filters :where(input:not([type=checkbox]):not([type=radio]), select) {
  height:34px; min-height:34px; max-height:34px; margin-top:0; margin-bottom:0;
  padding-top:0; padding-bottom:0; font-size:13px; line-height:normal; box-sizing:border-box;
}
.card-head-row .btn, .topbar-actions .btn { display:inline-flex; align-items:center; justify-content:center; padding-left:10px; padding-right:10px; }
.card-head-row input[type=radio], .card-head-row input[type=checkbox] { width:16px; height:16px; margin:0; vertical-align:middle; accent-color:var(--brand); }
/* 员工列表末四列统一居中 */
#organization-right table.data th:nth-child(n+5),
#organization-right table.data td:nth-child(n+5) { text-align:center; }
#organization-right table.data td:nth-child(n+5) .actions { justify-content:center; }
