/* ===========================================================
   智造云 · 制造企业数字化管理平台
   =========================================================== */
:root {
  --brand: #1668dc;
  --brand-dark: #0d4ba8;
  --brand-light: #e8f1ff;
  --brand-50: #f2f7ff;

  --ink: #1c2536;
  --ink-2: #48566a;
  --ink-3: #7a879b;
  --ink-4: #a5b0c0;

  --line: #e5e9f0;
  --line-2: #eef1f6;
  --bg: #f5f7fa;
  --card: #ffffff;

  --ok: #16a34a;
  --ok-bg: #ecfdf3;
  --warn: #d97706;
  --warn-bg: #fffbeb;
  --danger: #dc2626;
  --danger-bg: #fef2f2;
  --info: #0891b2;
  --info-bg: #ecfeff;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .05);
  --shadow: 0 4px 16px rgba(16, 24, 40, .08);
  --shadow-lg: 0 12px 40px rgba(16, 24, 40, .14);
  --sidebar-w: 232px;
  --sidebar-w-collapsed: 60px;
  --topbar-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: var(--font);
  font-size: 14px;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; border: none; background: none; }
a { color: var(--brand); text-decoration: none; }
.hidden { display: none !important; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ============ 登录页 ============ */
.login-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a1a35 0%, #10294f 45%, #123a6b 100%);
  overflow: hidden;
  padding: 24px;
}
.login-bg { position: absolute; inset: 0; }
.login-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 40%, #000 30%, transparent 78%);
}
.login-glow { position: absolute; border-radius: 50%; filter: blur(90px); }
.login-glow-1 { width: 520px; height: 520px; background: rgba(41, 121, 255, .34); top: -140px; right: -80px; }
.login-glow-2 { width: 420px; height: 420px; background: rgba(0, 190, 160, .2); bottom: -120px; left: 8%; }

.login-wrap {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1080px;
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 64px;
  align-items: center;
}
.login-left { color: #fff; }
.brand-mark { display: flex; align-items: center; gap: 13px; margin-bottom: 44px; }
.brand-logo {
  width: 44px; height: 44px; border-radius: 11px;
  background: linear-gradient(135deg, #3b8bff, #1668dc);
  display: grid; place-items: center;
  font-size: 22px; font-weight: 700; color: #fff;
  box-shadow: 0 6px 18px rgba(22, 104, 220, .45);
}
.brand-logo.sm { width: 28px; height: 28px; border-radius: 7px; font-size: 15px; box-shadow: none; }
.brand-name { font-size: 19px; font-weight: 650; letter-spacing: .5px; }
.brand-sub { font-size: 12px; color: rgba(255,255,255,.6); margin-top: 1px; }

.login-headline { font-size: 40px; line-height: 1.28; font-weight: 680; letter-spacing: -1px; margin-bottom: 16px; }
.login-desc { font-size: 15px; color: rgba(255,255,255,.68); line-height: 1.7; max-width: 460px; }
.login-feats { list-style: none; margin: 30px 0 34px; display: grid; gap: 13px; }
.login-feats li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: rgba(255,255,255,.85); }
.feat-ico {
  width: 20px; height: 20px; border-radius: 50%;
  background: rgba(45, 190, 140, .2); color: #4ade80;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.login-industries { padding-top: 22px; border-top: 1px solid rgba(255,255,255,.12); }
.ind-title { font-size: 12px; color: rgba(255,255,255,.45); margin-bottom: 11px; letter-spacing: .5px; }
.ind-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.ind-tags span {
  font-size: 12.5px; padding: 5px 13px; border-radius: 20px;
  background: rgba(255,255,255,.09); border: 1px solid rgba(255,255,255,.12);
  color: rgba(255,255,255,.8);
}

.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 34px 32px 28px;
  box-shadow: 0 24px 70px rgba(0,0,0,.3);
}
.lc-head { margin-bottom: 24px; }
.lc-head h2 { font-size: 21px; font-weight: 650; margin-bottom: 6px; }
.lc-head p { font-size: 13px; color: var(--ink-3); }
.lc-field { margin-bottom: 16px; }
.lc-field > label { display: block; font-size: 12.5px; font-weight: 550; color: var(--ink-2); margin-bottom: 7px; }
.ind-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ind-item {
  border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 11px 6px; text-align: center; cursor: pointer;
  transition: all .16s; background: #fff;
}
.ind-item:hover { border-color: var(--brand); background: var(--brand-50); }
.ind-item.active { border-color: var(--brand); background: var(--brand-light); }
.ind-item .ii-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.ind-item .ii-desc { font-size: 10.5px; color: var(--ink-4); margin-top: 3px; line-height: 1.35; }
.ind-item.active .ii-name { color: var(--brand-dark); }

.input-wrap { position: relative; }
.input-wrap input {
  width: 100%; height: 40px; padding: 0 38px 0 13px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  outline: none; transition: border-color .15s, box-shadow .15s;
  background: #fff;
}
.input-wrap input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22,104,220,.1); }
.pwd-toggle { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 14px; opacity: .5; }
.pwd-toggle:hover { opacity: .9; }

.lc-row { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 20px; }
.chk { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.chk input { width: 14px; height: 14px; accent-color: var(--brand); cursor: pointer; }
.link { font-size: 12.5px; color: var(--ink-3); }
.link:hover { color: var(--brand); }

.btn-login {
  width: 100%; height: 42px; border-radius: var(--radius);
  background: var(--brand); color: #fff; font-size: 15px; font-weight: 600;
  transition: background .15s, transform .08s; box-shadow: 0 4px 14px rgba(22,104,220,.3);
}
.btn-login:hover { background: var(--brand-dark); }
.btn-login:active { transform: translateY(1px); }
.btn-login:disabled { background: var(--ink-4); cursor: not-allowed; box-shadow: none; }
.lc-hint { text-align: center; font-size: 11.5px; color: var(--ink-4); margin-top: 16px; }

/* ============ 顶栏 ============ */
.app { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
.topbar {
  height: var(--topbar-h); flex-shrink: 0;
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px 0 12px; z-index: 30;
}
.tb-left, .tb-right { display: flex; align-items: center; gap: 8px; }
.tb-brand { display: flex; align-items: center; gap: 9px; padding-left: 4px; }
.tb-brand-name { font-size: 15px; font-weight: 650; letter-spacing: .3px; }
.tb-env {
  font-size: 10.5px; padding: 2px 7px; border-radius: 4px;
  background: var(--warn-bg); color: var(--warn); font-weight: 600;
  border: 1px solid #fde68a;
}
.tb-industry {
  display: flex; align-items: center; gap: 7px; margin-left: 14px;
  padding: 5px 11px; border-radius: 16px;
  background: var(--brand-50); border: 1px solid #d6e6ff;
  font-size: 12.5px; color: var(--brand-dark); font-weight: 550;
  cursor: pointer; transition: background .15s;
}
.tb-industry:hover { background: var(--brand-light); }
.tb-industry .ti-arrow { font-size: 9px; opacity: .6; }

.icon-btn {
  width: 32px; height: 32px; border-radius: 7px;
  display: grid; place-items: center; color: var(--ink-2);
  transition: background .14s, color .14s; position: relative;
}
.icon-btn:hover { background: var(--line-2); color: var(--ink); }
.badge-btn .badge {
  position: absolute; top: 3px; right: 2px;
  min-width: 15px; height: 15px; padding: 0 4px;
  background: var(--danger); color: #fff;
  font-size: 10px; font-weight: 600; border-radius: 8px;
  display: grid; place-items: center; border: 1.5px solid #fff;
}
.tb-divider { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.tb-user { display: flex; align-items: center; gap: 9px; padding: 4px 8px 4px 4px; border-radius: 8px; cursor: pointer; transition: background .14s; }
.tb-user:hover { background: var(--line-2); }
.avatar {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, #3b8bff, #1668dc);
  color: #fff; display: grid; place-items: center;
  font-size: 13px; font-weight: 600;
}
.u-info .u-name { font-size: 13px; font-weight: 600; line-height: 1.25; }
.u-info .u-role { font-size: 11px; color: var(--ink-3); }
.chev { width: 14px; height: 14px; color: var(--ink-4); }

/* ============ 主体 ============ */
.body { flex: 1; display: flex; overflow: hidden; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: #fff; border-right: 1px solid var(--line);
  display: flex; flex-direction: column; overflow: hidden;
  transition: width .2s ease;
}
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.menu { flex: 1; overflow-y: auto; padding: 10px 8px 16px; }
.menu::-webkit-scrollbar { width: 5px; }
.menu::-webkit-scrollbar-thumb { background: #d4dae4; border-radius: 3px; }

.mgroup { margin-bottom: 3px; }
.mgroup-head {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 9px; border-radius: 7px; cursor: pointer;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  transition: background .14s; user-select: none;
}
.mgroup-head:hover { background: var(--line-2); }
.mgroup-head .mg-ico { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.mgroup-head .mg-name { flex: 1; white-space: nowrap; overflow: hidden; }
.mgroup-head .mg-arrow { font-size: 9px; color: var(--ink-4); transition: transform .18s; }
.mgroup.open .mgroup-head .mg-arrow { transform: rotate(90deg); }
.mgroup-items { display: none; padding: 2px 0 5px 8px; margin-left: 12px; border-left: 1.5px solid var(--line-2); }
.mgroup.open .mgroup-items { display: block; }

.mitem {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 6px;
  font-size: 13px; color: var(--ink-2); cursor: pointer;
  transition: all .14s; white-space: nowrap;
  margin-bottom: 1px;
}
.mitem:hover { background: var(--line-2); color: var(--ink); }
.mitem.active { background: var(--brand-light); color: var(--brand-dark); font-weight: 600; }
.mitem .mi-ico { font-size: 14px; width: 17px; text-align: center; flex-shrink: 0; }
.mitem .mi-name { flex: 1; overflow: hidden; text-overflow: ellipsis; }
.mitem .mi-badge {
  font-size: 10px; padding: 1px 6px; border-radius: 9px;
  background: var(--danger); color: #fff; font-weight: 600;
}
.sidebar.collapsed .mgroup-head .mg-name,
.sidebar.collapsed .mgroup-head .mg-arrow,
.sidebar.collapsed .mitem .mi-name,
.sidebar.collapsed .mitem .mi-badge { display: none; }
.sidebar.collapsed .mgroup-items { margin-left: 0; border-left: none; padding-left: 0; }
.sidebar.collapsed .mitem { justify-content: center; padding: 9px 0; }
.sidebar.collapsed .mgroup-head { justify-content: center; }

.side-foot { border-top: 1px solid var(--line); padding: 11px 14px; }
.sf-row { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; color: var(--ink-3); margin-bottom: 6px; }
.dot-ok { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); display: inline-block; box-shadow: 0 0 0 2px var(--ok-bg); }
.sf-ver { font-size: 10.5px; color: var(--ink-4); margin-top: 9px; padding-top: 9px; border-top: 1px dashed var(--line); }
.sidebar.collapsed .side-foot { display: none; }

.content { flex: 1; overflow-y: auto; overflow-x: hidden; }
.crumbs {
  height: 42px; display: flex; align-items: center; gap: 6px;
  padding: 0 22px; font-size: 12.5px; color: var(--ink-3);
  background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 20;
}
.crumbs .cb-sep { color: var(--ink-4); }
.crumbs .cb-cur { color: var(--ink); font-weight: 550; }
.view { padding: 20px 22px 40px; }

/* ============ 页面头 ============ */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.page-title { font-size: 20px; font-weight: 650; letter-spacing: -.3px; }
.page-desc { font-size: 13px; color: var(--ink-3); margin-top: 5px; }
.page-actions { display: flex; gap: 8px; flex-shrink: 0; }

.btn {
  height: 34px; padding: 0 14px; border-radius: 7px;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 550; white-space: nowrap;
  border: 1px solid var(--line); background: #fff; color: var(--ink-2);
  transition: all .14s;
}
.btn:hover { border-color: #cbd3df; background: #fafbfc; color: var(--ink); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.ok:hover { filter: brightness(.94); }
.btn.warn { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn.warn:hover { filter: brightness(.94); }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: #fecaca; }
.btn.danger:hover { background: var(--danger-bg); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn svg { width: 15px; height: 15px; }

/* ============ 卡片 ============ */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.card-head {
  padding: 14px 18px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title { font-size: 14.5px; font-weight: 620; }
.card-sub { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.card-body { padding: 16px 18px; }

/* ============ KPI ============ */
.kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 18px; }
.kpi {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 16px 17px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden;
  transition: box-shadow .18s, transform .18s;
}
.kpi:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.kpi-label { font-size: 12.5px; color: var(--ink-3); margin-bottom: 9px; }
.kpi-value { font-size: 25px; font-weight: 680; letter-spacing: -.6px; line-height: 1.1; }
.kpi-unit { font-size: 12.5px; font-weight: 500; color: var(--ink-3); margin-left: 3px; }
.kpi-trend { font-size: 11.5px; margin-top: 8px; display: flex; align-items: center; gap: 4px; }
.kpi-trend.up { color: var(--ok); }
.kpi-trend.down { color: var(--danger); }
.kpi-trend.flat { color: var(--ink-3); }

/* ============ 图表 ============ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 14px; }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 14px; }

.bar-chart { display: flex; flex-direction: column; gap: 11px; }
.bar-row { display: grid; grid-template-columns: 110px 1fr 92px; align-items: center; gap: 12px; }
.bar-label { font-size: 12.5px; color: var(--ink-2); text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-track { height: 20px; background: var(--line-2); border-radius: 5px; overflow: hidden; position: relative; }
.bar-fill { height: 100%; background: linear-gradient(90deg, #4a90ff, #1668dc); border-radius: 5px; transition: width .5s cubic-bezier(.4,0,.2,1); }
.bar-fill.warn { background: linear-gradient(90deg, #fbbf24, #d97706); }
.bar-fill.danger { background: linear-gradient(90deg, #f87171, #dc2626); }
.bar-fill.ok { background: linear-gradient(90deg, #4ade80, #16a34a); }
.bar-val { font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; text-align: right; }

.line-chart { position: relative; height: 220px; }
.line-chart svg { width: 100%; height: 100%; overflow: visible; }
.chart-legend { display: flex; gap: 18px; font-size: 12px; color: var(--ink-3); margin-top: 10px; justify-content: center; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }

.donut-wrap { display: flex; align-items: center; gap: 24px; }
.donut { position: relative; width: 148px; height: 148px; flex-shrink: 0; }
.donut-center { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.donut-center .dc-v { font-size: 24px; font-weight: 680; }
.donut-center .dc-l { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.donut-legend { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.dl-item { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.dl-dot { width: 9px; height: 9px; border-radius: 2px; flex-shrink: 0; }
.dl-name { flex: 1; color: var(--ink-2); }
.dl-val { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============ 待办 / 预警 ============ */
.todo-list { display: flex; flex-direction: column; }
.todo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line-2); cursor: pointer;
  transition: background .14s;
}
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { background: var(--brand-50); margin: 0 -8px; padding-left: 8px; padding-right: 8px; border-radius: 6px; }
.ti-type { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--brand-light); color: var(--brand-dark); font-weight: 600; flex-shrink: 0; }
.ti-body { flex: 1; min-width: 0; }
.ti-title { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ti-meta { font-size: 11.5px; color: var(--ink-4); margin-top: 2px; display: flex; gap: 10px; }
.ti-amt { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.ti-urgent { width: 6px; height: 6px; border-radius: 50%; background: var(--danger); flex-shrink: 0; }

.alert-item { display: flex; gap: 11px; padding: 11px 0; border-bottom: 1px solid var(--line-2); }
.alert-item:last-child { border-bottom: none; }
.al-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 5px; flex-shrink: 0; }
.al-body { flex: 1; }
.al-title { font-size: 13px; font-weight: 550; }
.al-desc { font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.al-action { font-size: 12px; color: var(--brand); margin-top: 5px; display: inline-block; }

/* ============ 工具栏 ============ */
.toolbar {
  display: flex; align-items: center; gap: 9px;
  padding: 12px 16px; border-bottom: 1px solid var(--line-2);
  flex-wrap: wrap;
}
.tb-search { position: relative; flex-shrink: 0; }
.tb-search input {
  width: 220px; height: 32px; padding: 0 12px 0 32px;
  border: 1.5px solid var(--line); border-radius: 7px; outline: none;
  transition: border-color .15s, box-shadow .15s; font-size: 13px;
}
.tb-search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22,104,220,.08); }
.tb-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; color: var(--ink-4); }
.filter-select {
  height: 32px; padding: 0 26px 0 10px; border: 1.5px solid var(--line);
  border-radius: 7px; outline: none; font-size: 12.5px; color: var(--ink-2);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a879b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 7px center / 13px;
  appearance: none; cursor: pointer;
}
.filter-select:focus { border-color: var(--brand); }
.toolbar-spacer { flex: 1; }
.tb-count { font-size: 12.5px; color: var(--ink-3); }
.tb-count b { color: var(--ink); font-weight: 600; }

/* ============ 表格 ============ */
.table-wrap { overflow-x: auto; }
table.dt { width: 100%; border-collapse: collapse; font-size: 13px; }
table.dt th {
  text-align: left; padding: 10px 14px; font-weight: 600; font-size: 12.5px;
  color: var(--ink-2); background: #fafbfc; border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; z-index: 5;
}
table.dt th.sortable { cursor: pointer; user-select: none; }
table.dt th.sortable:hover { color: var(--brand); }
table.dt th .sort-ico { margin-left: 4px; opacity: .35; font-size: 9px; }
table.dt th.sorted .sort-ico { opacity: 1; color: var(--brand); }
table.dt td {
  padding: 10px 14px; border-bottom: 1px solid var(--line-2);
  color: var(--ink); vertical-align: middle; white-space: nowrap;
}
table.dt tbody tr { transition: background .12s; cursor: pointer; }
table.dt tbody tr:hover { background: var(--brand-50); }
table.dt tbody tr.selected { background: var(--brand-light); }
table.dt .col-idx { width: 42px; text-align: center; color: var(--ink-4); font-size: 12px; }
table.dt .col-fix { position: sticky; left: 0; background: #fff; z-index: 4; }
table.dt th.col-fix { background: #fafbfc; z-index: 6; }
table.dt tbody tr:hover .col-fix { background: var(--brand-50); }
.cell-mono { font-variant-numeric: tabular-nums; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; }
.cell-money { text-align: right; font-variant-numeric: tabular-nums; font-weight: 550; }
.cell-muted { color: var(--ink-3); }
.cell-strong { font-weight: 600; }
.cell-link { color: var(--brand); }
.cell-wrap { white-space: normal; max-width: 260px; }

.tag {
  display: inline-block; padding: 2px 9px; border-radius: 11px;
  font-size: 11.5px; font-weight: 550; line-height: 18px; white-space: nowrap;
}
.tag-gray { background: #f1f3f7; color: var(--ink-2); }
.tag-blue { background: var(--brand-light); color: var(--brand-dark); }
.tag-green { background: var(--ok-bg); color: var(--ok); }
.tag-orange { background: var(--warn-bg); color: var(--warn); }
.tag-red { background: var(--danger-bg); color: var(--danger); }
.tag-cyan { background: var(--info-bg); color: var(--info); }
.tag-purple { background: #f5f0ff; color: #7c3aed; }
.tag-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

.pager {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-3);
}
.pg-btns { display: flex; gap: 5px; }
.pg-btn {
  min-width: 28px; height: 28px; padding: 0 7px; border-radius: 6px;
  border: 1px solid var(--line); background: #fff; font-size: 12.5px; color: var(--ink-2);
  display: grid; place-items: center;
}
.pg-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.pg-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.pg-btn:disabled { opacity: .4; cursor: not-allowed; }

.empty { padding: 56px 20px; text-align: center; color: var(--ink-4); }
.empty-ico { font-size: 40px; opacity: .35; margin-bottom: 12px; }
.empty-txt { font-size: 13.5px; }

/* ============ 抽屉 ============ */
.drawer-mask {
  position: fixed; inset: 0; background: rgba(16,24,40,.4);
  z-index: 100; display: flex; justify-content: flex-end;
  animation: fadeIn .18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }
.drawer {
  width: 460px; max-width: 96vw; height: 100%;
  background: #fff; display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg); animation: slideIn .22s cubic-bezier(.32,.72,0,1);
}
.drawer.wide { width: 860px; max-width: 96vw; }
.dw-head {
  padding: 16px 20px; border-bottom: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-shrink: 0;
}
.dw-head h3 { font-size: 16px; font-weight: 650; }
.dw-sub { font-size: 12.5px; color: var(--ink-3); margin-top: 4px; }
.dw-body { flex: 1; overflow-y: auto; padding: 18px 20px; }
.dw-foot {
  padding: 13px 20px; border-top: 1px solid var(--line);
  display: flex; gap: 9px; justify-content: flex-end; flex-shrink: 0; background: #fafbfc;
}
.dw-head-actions { display: flex; gap: 6px; }

/* ============ 表单 ============ */
.form-group { margin-bottom: 22px; }
.fg-title {
  font-size: 13px; font-weight: 620; color: var(--ink);
  padding-bottom: 9px; margin-bottom: 14px; border-bottom: 1px solid var(--line-2);
  display: flex; align-items: center; gap: 8px;
}
.fg-title::before { content: ''; width: 3px; height: 13px; background: var(--brand); border-radius: 2px; }
.fg-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.fg-rows .full { grid-column: 1 / -1; }
.fg-rows .half { grid-column: span 1; }
.fg-rows .narrow { grid-column: span 1; }

.fi { display: flex; flex-direction: column; gap: 5px; }
.fi-label { font-size: 12.5px; color: var(--ink-2); font-weight: 500; display: flex; align-items: center; gap: 3px; }
.fi-req { color: var(--danger); font-weight: 700; }
.fi-ctrl input, .fi-ctrl select, .fi-ctrl textarea {
  width: 100%; height: 34px; padding: 0 11px;
  border: 1.5px solid var(--line); border-radius: 7px; outline: none;
  transition: border-color .15s, box-shadow .15s; background: #fff; font-size: 13px;
}
.fi-ctrl textarea { height: auto; min-height: 62px; padding: 9px 11px; resize: vertical; line-height: 1.6; }
.fi-ctrl input:focus, .fi-ctrl select:focus, .fi-ctrl textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(22,104,220,.09); }
.fi-ctrl input[readonly], .fi-ctrl input:disabled, .fi-ctrl textarea[readonly] { background: #f7f8fa; color: var(--ink-3); cursor: default; }
.fi-ctrl select { cursor: pointer; appearance: none; padding-right: 28px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a879b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 9px center / 13px; }
.fi-ctrl .suffix { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--ink-4); }
.fi-ctrl.has-suffix input { padding-right: 30px; }
.fi-hint { font-size: 11px; color: var(--ink-4); }
.fi-err { font-size: 11.5px; color: var(--danger); display: none; }
.fi.invalid .fi-ctrl input, .fi.invalid .fi-ctrl select, .fi.invalid .fi-ctrl textarea { border-color: var(--danger); }
.fi.invalid .fi-err { display: block; }
.fi.invalid .fi-ctrl input:focus, .fi.invalid .fi-ctrl select:focus { box-shadow: 0 0 0 3px rgba(220,38,38,.1); }

.ref-input { position: relative; display: flex; }
.ref-input input { padding-right: 30px; }
.ref-btn {
  position: absolute; right: 1px; top: 1px; width: 28px; height: 32px;
  display: grid; place-items: center; color: var(--ink-4); border-radius: 0 6px 6px 0;
}
.ref-btn:hover { background: var(--line-2); color: var(--brand); }
.ref-pop {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow-lg); max-height: 260px; overflow-y: auto; display: none;
}
.ref-pop.open { display: block; }
.ref-item { padding: 8px 12px; cursor: pointer; font-size: 13px; border-bottom: 1px solid var(--line-2); }
.ref-item:hover { background: var(--brand-50); }
.ref-item:last-child { border-bottom: none; }
.ref-item .ri-sub { font-size: 11.5px; color: var(--ink-4); margin-top: 2px; }
.ref-empty { padding: 16px; text-align: center; color: var(--ink-4); font-size: 12.5px; }

/* 明细子表 */
.sub-table { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.sub-table table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.sub-table th {
  background: #fafbfc; padding: 8px 10px; text-align: left;
  font-weight: 600; font-size: 12px; color: var(--ink-2); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.sub-table td { padding: 5px 6px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.sub-table tr:last-child td { border-bottom: none; }
.sub-table input, .sub-table select {
  width: 100%; height: 28px; padding: 0 8px; font-size: 12.5px;
  border: 1px solid transparent; border-radius: 5px; outline: none; background: transparent;
}
.sub-table input:hover, .sub-table select:hover { border-color: var(--line); }
.sub-table input:focus, .sub-table select:focus { border-color: var(--brand); background: #fff; box-shadow: 0 0 0 2px rgba(22,104,220,.08); }
.sub-table input[readonly] { color: var(--ink-3); }
.sub-table .col-idx { width: 34px; text-align: center; color: var(--ink-4); }
.sub-table .col-act { width: 32px; text-align: center; }
.sub-act {
  width: 22px; height: 22px; border-radius: 4px; display: inline-grid; place-items: center;
  color: var(--ink-4); font-size: 13px;
}
.sub-act:hover { background: var(--danger-bg); color: var(--danger); }
.sub-foot {
  padding: 8px 10px; background: #fafbfc; border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.sub-total { font-size: 12.5px; color: var(--ink-2); }
.sub-total b { font-size: 14px; font-weight: 650; color: var(--ink); font-variant-numeric: tabular-nums; margin-left: 5px; }

/* 审计轨迹 */
.audit-trail { display: flex; gap: 0; flex-wrap: wrap; }
.at-item { flex: 1; min-width: 118px; padding: 9px 12px; background: #fafbfc; border-radius: 7px; margin-right: 8px; }
.at-label { font-size: 11.5px; color: var(--ink-4); }
.at-value { font-size: 12.5px; font-weight: 550; margin-top: 3px; }

/* 状态条 */
.status-flow { display: flex; align-items: center; gap: 0; margin-bottom: 18px; flex-wrap: wrap; }
.sf-node {
  display: flex; align-items: center; gap: 6px; padding: 5px 12px;
  border-radius: 16px; font-size: 12px; background: #f1f3f7; color: var(--ink-3);
}
.sf-node.done { background: var(--ok-bg); color: var(--ok); }
.sf-node.current { background: var(--brand); color: #fff; font-weight: 600; }
.sf-sep { width: 18px; height: 1px; background: var(--line); margin: 0 3px; }

/* ============ 组织架构 ============ */
.org-tree { font-size: 13px; }
.org-node { padding: 7px 0; }
.org-row { display: flex; align-items: center; gap: 9px; padding: 7px 10px; border-radius: 7px; cursor: pointer; }
.org-row:hover { background: var(--brand-50); }
.org-ico { width: 26px; height: 26px; border-radius: 7px; background: var(--brand-light); color: var(--brand-dark); display: grid; place-items: center; font-size: 13px; }
.org-name { font-weight: 550; }
.org-meta { font-size: 12px; color: var(--ink-3); margin-left: auto; }
.org-children { margin-left: 20px; border-left: 1.5px solid var(--line-2); padding-left: 14px; }

/* ============ 权限矩阵 ============ */
.perm-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.perm-table th, .perm-table td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); text-align: center; }
.perm-table th { background: #fafbfc; font-weight: 600; color: var(--ink-2); }
.perm-table td:first-child, .perm-table th:first-child { text-align: left; }
.perm-yes { color: var(--ok); font-weight: 700; }
.perm-no { color: var(--ink-4); }
.perm-partial { color: var(--warn); font-weight: 600; }

/* ============ 审核流配置 ============ */
.flow-card { border: 1px solid var(--line); border-radius: 9px; padding: 13px 15px; margin-bottom: 10px; }
.flow-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 11px; }
.flow-steps { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.flow-step {
  padding: 6px 13px; border-radius: 7px; font-size: 12.5px;
  background: var(--brand-light); color: var(--brand-dark); font-weight: 550;
  border: 1px solid #d6e6ff;
}
.flow-arrow { color: var(--ink-4); font-size: 12px; }

/* ============ 日志 ============ */
.log-item { display: flex; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.log-time { font-size: 12px; color: var(--ink-4); width: 128px; flex-shrink: 0; font-variant-numeric: tabular-nums; }
.log-who { font-size: 12.5px; font-weight: 550; width: 78px; flex-shrink: 0; }
.log-act { font-size: 12.5px; color: var(--ink-2); flex: 1; }
.log-tag { font-size: 11px; padding: 1px 7px; border-radius: 4px; background: var(--line-2); color: var(--ink-2); flex-shrink: 0; }

/* ============ 搜索面板 ============ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16,24,40,.45);
  z-index: 200; display: flex; align-items: flex-start; justify-content: center;
  padding-top: 12vh; animation: fadeIn .15s;
}
.search-panel {
  width: 620px; max-width: 92vw; background: #fff; border-radius: 12px;
  box-shadow: var(--shadow-lg); overflow: hidden; animation: slideUp .2s cubic-bezier(.32,.72,0,1);
}
@keyframes slideUp { from { transform: translateY(-14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sp-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sp-input svg { color: var(--ink-4); }
.sp-input input { flex: 1; border: none; outline: none; font-size: 15px; }
.sp-input kbd {
  font-size: 11px; padding: 2px 6px; border-radius: 4px;
  background: var(--line-2); color: var(--ink-3); font-family: inherit;
}
.sp-results { max-height: 420px; overflow-y: auto; padding: 6px; }
.sp-group-title { font-size: 11.5px; color: var(--ink-4); padding: 9px 12px 5px; font-weight: 600; }
.sp-item { padding: 9px 12px; border-radius: 7px; cursor: pointer; display: flex; align-items: center; gap: 10px; }
.sp-item:hover, .sp-item.hl { background: var(--brand-50); }
.sp-item .si-ico { font-size: 15px; }
.sp-item .si-name { flex: 1; font-size: 13.5px; }
.sp-item .si-meta { font-size: 11.5px; color: var(--ink-4); }
.sp-empty { padding: 36px; text-align: center; color: var(--ink-4); font-size: 13px; }

/* ============ 错误弹层 ============ */
.err-modal {
  width: 520px; max-width: 92vw; background: #fff; border-radius: 13px;
  box-shadow: var(--shadow-lg); overflow: hidden; margin: auto;
  animation: slideUp .2s cubic-bezier(.32,.72,0,1);
}
.em-head { padding: 18px 20px; display: flex; gap: 13px; align-items: flex-start; border-bottom: 1px solid var(--line-2); }
.em-icon {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  background: var(--danger-bg); color: var(--danger);
  display: grid; place-items: center; font-size: 19px; font-weight: 700;
}
.em-head h3 { font-size: 16px; font-weight: 650; }
.em-code { font-size: 11.5px; color: var(--ink-4); margin-top: 3px; font-family: ui-monospace, monospace; }
.em-body { padding: 18px 20px; font-size: 13.5px; line-height: 1.75; color: var(--ink-2); max-height: 400px; overflow-y: auto; }
.em-body h4 { font-size: 12.5px; color: var(--ink-3); font-weight: 600; margin: 14px 0 6px; }
.em-body h4:first-child { margin-top: 0; }
.em-body ul { margin: 0 0 0 18px; }
.em-body li { margin-bottom: 4px; }
.em-body .em-loc {
  margin-top: 14px; padding: 10px 12px; background: #f7f8fa; border-radius: 7px;
  font-size: 12.5px; color: var(--ink-2); border-left: 3px solid var(--brand);
}
.em-body .em-safe { color: var(--ok); font-weight: 550; }
.em-foot { padding: 13px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 9px; background: #fafbfc; }

/* ============ Toast ============ */
.toast-wrap { position: fixed; top: 16px; left: 50%; transform: translateX(-50%); z-index: 300; display: flex; flex-direction: column; gap: 9px; align-items: center; }
.toast {
  padding: 10px 18px; border-radius: 9px; background: #1c2536; color: #fff;
  font-size: 13px; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 8px;
  animation: toastIn .22s cubic-bezier(.32,.72,0,1); max-width: 520px;
}
.toast.ok { background: #15803d; }
.toast.err { background: #b91c1c; }
.toast.warn { background: #b45309; }
@keyframes toastIn { from { transform: translateY(-14px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ============ 响应式 ============ */
@media (max-width: 1400px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1100px) {
  .login-wrap { grid-template-columns: 1fr; max-width: 460px; }
  .login-left { display: none; }
  .grid-2, .grid-3, .grid-2-1 { grid-template-columns: 1fr; }
  .drawer.wide { width: 100%; }
}
@media (max-width: 760px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .sidebar { position: fixed; z-index: 90; height: calc(100vh - var(--topbar-h)); }
  .fg-rows { grid-template-columns: 1fr; }
}
