/* ============ 破产案件管理驾驶舱 · 深蓝金 律所风 ============ */
:root {
  /* 品牌色系 */
  --navy-900: #0a1a2f;   /* 最深背景 */
  --navy-800: #0f2540;
  --navy-700: #16335a;   /* 侧边栏 */
  --navy-600: #1d426e;
  --navy-500: #24508a;
  --navy-400: #3a6ba5;
  --navy-100: #e8eef6;   /* 浅蓝底 */

  --gold-500: #b8860b;   /* 主金 */
  --gold-400: #d4a017;
  --gold-300: #e6c15c;
  --gold-100: #f7ecd1;   /* 浅金底 */

  --ink-900: #1a2333;    /* 正文 */
  --ink-600: #4a5568;
  --ink-400: #8892a6;

  --line: #e2e8f0;
  --bg: #f4f6f9;         /* 页面浅底 */
  --card: #ffffff;

  --red: #c0392b;
  --red-soft: #d4736a;     /* 柔化红 */
  --red-bg: #fdf2f0;       /* 淡红底 */
  --amber: #d9822b;
  --green: #2e7d52;

  --radius: 10px;
  --shadow-sm: 0 1px 3px rgba(10,26,47,.06), 0 1px 2px rgba(10,26,47,.04);
  --shadow-md: 0 4px 16px rgba(10,26,47,.10);
  --font-title: "Songti SC", "SimSun", "Noto Serif SC", "STSong", serif;
  --font-body: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  --font-num: "DIN Alternate", "SFMono-Regular", "SF Mono", "Consolas", monospace;
}

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

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink-900);
  -webkit-font-smoothing: antialiased;
  font-size: 13px;
  line-height: 1.5;
}

/* ============ 登录页 ============ */
.login-screen {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  background: radial-gradient(1200px 600px at 80% -10%, #1d426e 0%, transparent 60%),
              radial-gradient(900px 500px at -10% 110%, #0f2540 0%, transparent 55%),
              linear-gradient(160deg, #0a1a2f 0%, #12304f 100%);
  padding: 40px 20px;
}
.login-bg {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(230,193,92,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230,193,92,.04) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}
.login-card {
  position: relative;
  width: 520px; max-width: 94vw;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(4,14,28,.5);
  padding: 40px 42px 32px;
  animation: loginIn .4s ease;
}
@keyframes loginIn { from { transform: translateY(16px); opacity: 0; } to { transform: none; opacity: 1; } }
.login-brand { display: flex; align-items: center; gap: 14px; }
.login-brand .logo {
  width: 56px; height: 56px; border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 12px rgba(192,57,43,.15);
}
.logo-img {
  width: 88%; height: 88%; object-fit: contain;
}
.login-title .t1 {
  font-family: var(--font-title); font-size: 22px; font-weight: 700;
  color: var(--navy-800); letter-spacing: 1px;
}
.login-title .t2 {
  font-size: 10px; color: var(--gold-500); letter-spacing: 2px; margin-top: 3px;
}
.login-sub {
  margin-top: 8px; font-size: 12px; color: var(--ink-400);
  padding-bottom: 22px; border-bottom: 1px solid var(--line);
}
.login-hint {
  margin: 22px 0 14px; font-size: 13px; font-weight: 600; color: var(--ink-600);
}
.login-role-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.login-role-grid.two-cols { grid-template-columns: repeat(2, 1fr); }
.role-card {
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 18px 14px; cursor: pointer; text-align: center;
  transition: all .18s; position: relative; overflow: hidden;
}
.role-card:hover { border-color: var(--navy-400); transform: translateY(-2px); box-shadow: var(--shadow-md); }
.role-card.selected {
  border-color: var(--gold-500); background: linear-gradient(180deg, var(--gold-100), #fff);
  box-shadow: 0 0 0 3px rgba(184,134,11,.12);
}
.role-card .r-ico { font-size: 26px; color: var(--navy-600); }
.role-card.selected .r-ico { color: var(--gold-500); }
.role-card .r-name {
  font-family: var(--font-title); font-size: 15px; font-weight: 700; color: var(--navy-800); margin-top: 8px;
}
.role-card .r-desc { font-size: 10.5px; color: var(--ink-400); margin-top: 4px; line-height: 1.4; }
.role-card .r-tag {
  display: inline-block; margin-top: 10px; font-size: 10px;
  color: var(--gold-500); border: 1px solid var(--gold-300); border-radius: 9px; padding: 1px 8px;
}
.login-person { margin-top: 22px; }
.login-person .lp-label { font-size: 12px; color: var(--ink-600); margin-bottom: 6px; }
.login-select {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: var(--font-body); color: var(--ink-900); cursor: pointer;
}
.login-select:focus { outline: none; border-color: var(--navy-500); box-shadow: 0 0 0 3px rgba(36,80,138,.08); }
.login-btn {
  width: 100%; margin-top: 18px; padding: 12px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-500));
  color: #fff; border: none; border-radius: 8px; font-size: 15px; font-weight: 600;
  cursor: pointer; letter-spacing: 4px; font-family: var(--font-body);
  transition: all .15s;
}
.login-btn:hover { filter: brightness(1.08); box-shadow: 0 6px 20px rgba(36,80,138,.4); }
.login-foot { margin-top: 16px; text-align: center; font-size: 11px; color: var(--ink-400); }

/* 飞书一键登录 */
.login-divider {
  display: flex; align-items: center; gap: 12px; margin: 16px 0;
  color: var(--ink-400); font-size: 11px;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--line);
}
.login-btn.feishu-btn {
  background: linear-gradient(135deg, #3370ff, #245bdb);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.login-btn.feishu-btn:hover { filter: brightness(1.06); box-shadow: 0 6px 20px rgba(51,112,255,.35); }
.f-ico {
  width: 20px; height: 20px; border-radius: 5px; background: #fff; color: #3370ff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
}
.feishu-auth-box {
  margin-top: 14px; padding: 14px; border: 1px solid var(--line);
  border-radius: 10px; background: #f8fafc; text-align: center;
}
.fa-hint { font-size: 12px; color: var(--ink-600); margin-bottom: 10px; }
.fa-link { font-size: 12px; color: var(--navy-500); text-decoration: underline; display: inline-block; margin-bottom: 10px; }
.fa-qr { display: inline-block; }
.fa-qr img { width: 160px; height: 160px; border-radius: 6px; }
.fa-waiting { font-size: 12px; color: var(--amber); margin-top: 8px; }

/* 案/人维度切换 */
.dim-tabs {
  display: flex; gap: 6px; margin-bottom: 16px;
}
.dim-tab {
  padding: 6px 16px; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink-600);
  font-size: 12px; font-family: var(--font-body);
  transition: all .15s;
}
.dim-tab:hover { border-color: var(--navy-400); color: var(--navy-700); }
.dim-tab.active {
  background: var(--navy-700); color: #fff; border-color: var(--navy-700);
  font-weight: 600;
}

/* ============ 整体布局 ============ */
.app-shell { display: flex; min-height: 100vh; }

/* ============ 侧边栏 ============ */
.sidebar {
  width: 220px;
  background: linear-gradient(180deg, var(--navy-800) 0%, var(--navy-900) 100%);
  color: #cbd5e1;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  padding: 22px 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.brand .mark {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand .logo {
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  background: rgba(255,255,255,.95);
  box-shadow: 0 1px 4px rgba(0,0,0,.15);
}
.brand .logo .logo-img {
  width: 82%; height: 82%; object-fit: contain;
}
.brand .name {
  font-family: var(--font-title);
  color: #fff;
  font-size: 15px;
  letter-spacing: 1px;
  line-height: 1.3;
}
.brand .sub {
  font-size: 10px;
  color: var(--gold-300);
  letter-spacing: 2px;
  margin-top: 2px;
}

.nav { flex: 1; padding: 14px 10px; }
.nav-group { margin-bottom: 4px; }
.nav-label {
  font-size: 10px;
  color: #64748b;
  letter-spacing: 2px;
  padding: 10px 12px 5px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: 7px;
  cursor: pointer;
  font-size: 13px;
  color: #cbd5e1;
  transition: all .15s;
  margin-bottom: 1px;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-item.active {
  background: linear-gradient(90deg, rgba(184,134,11,.18), rgba(184,134,11,.06));
  color: var(--gold-300);
  font-weight: 600;
}
.nav-item .badge {
  margin-left: auto;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  border-radius: 9px;
  padding: 1px 7px;
  font-family: var(--font-num);
}
.nav-item .ico { width: 16px; text-align: center; opacity: .85; }

.sidebar-foot {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,.08);
  font-size: 11px;
  color: #64748b;
}

/* ============ 主区域 ============ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* 顶栏 */
.topbar {
  height: 56px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
  padding: 0 24px;
  gap: 16px;
  position: sticky; top: 0; z-index: 10;
}
.topbar .crumb { font-size: 14px; }
.topbar .crumb .sep { color: var(--ink-400); margin: 0 6px; }
.topbar .crumb .cur { font-family: var(--font-title); font-weight: 700; color: var(--navy-700); }

.spacer { flex: 1; }

/* 顶栏身份 chip（登录后锁定） */
.identity-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 14px 4px 6px;
  border: 1px solid var(--line); border-radius: 20px; background: #fff;
}
.identity-chip .avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-500), var(--navy-700));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-family: var(--font-title); font-weight: 600;
}
.identity-chip .who { font-size: 13px; font-weight: 600; color: var(--ink-900); }
.identity-chip .role-tag {
  font-size: 10px; color: var(--gold-500); font-weight: 600;
  border: 1px solid var(--gold-300); border-radius: 8px; padding: 1px 7px;
}
.scope-hint {
  color: var(--navy-600); font-size: 12px; margin: -8px 0 16px;
  padding: 8px 14px; background: var(--navy-100); border-radius: 6px; border-left: 3px solid var(--navy-500);
}

/* 身份切换（保留兼容） */
.identity-switch {
  display: flex; align-items: center; gap: 8px;
}
.identity-switch .label { font-size: 11px; color: var(--ink-400); }
.role-select {
  display: flex; gap: 4px;
  background: var(--bg);
  border-radius: 8px; padding: 3px;
  border: 1px solid var(--line);
}
.role-select button {
  border: none; background: transparent;
  padding: 6px 12px; border-radius: 6px;
  cursor: pointer; font-size: 12px; color: var(--ink-600);
  transition: all .15s; font-family: var(--font-body);
}
.role-select button:hover { color: var(--navy-700); }
.role-select button.active {
  background: var(--navy-700);
  color: #fff; font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.person-chip {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 6px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
}
.person-chip .avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: linear-gradient(135deg, var(--navy-500), var(--navy-700));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-family: var(--font-title); font-weight: 600;
}
.person-chip .who { font-size: 12px; font-weight: 600; color: var(--ink-900); }
.person-chip .role-tag { font-size: 10px; color: var(--gold-500); }
.person-select {
  border: 1px solid var(--line); border-radius: 6px;
  padding: 5px 8px; font-size: 12px; color: var(--ink-900);
  background: #fff; font-family: var(--font-body); cursor: pointer;
}

/* 内容区 */
.content { padding: 22px 24px 40px; }

/* ============ KPI 概览卡片 ============ */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.kpi-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.kpi-card::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--gold-400), var(--navy-500));
}
.kpi-card .kpi-label {
  font-size: 12px; color: var(--ink-400);
  letter-spacing: 1px;
}
.kpi-card .kpi-value {
  font-family: var(--font-num);
  font-size: 34px; font-weight: 700;
  color: var(--navy-800);
  margin: 6px 0 2px;
  letter-spacing: -0.5px;
}
.kpi-card .kpi-value.gold { color: var(--gold-500); }
.kpi-card .kpi-value .unit { font-size: 14px; font-weight: 500; color: var(--ink-400); margin-left: 3px; }
.kpi-card .kpi-sub { font-size: 11px; color: var(--ink-400); }
.kpi-card .kpi-sub .up { color: var(--green); }
.kpi-card .kpi-sub .down { color: var(--red); }

/* ============ 面板卡片 ============ */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}
.panel-head {
  display: flex; align-items: center;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.panel-head .title {
  font-family: var(--font-title);
  font-size: 15px; font-weight: 700;
  color: var(--navy-800);
  letter-spacing: .5px;
}
.panel-head .title::before {
  content: '';
  display: inline-block;
  width: 4px; height: 14px;
  background: var(--gold-500);
  border-radius: 2px;
  margin-right: 9px;
  vertical-align: -2px;
}
.panel-head .count {
  font-family: var(--font-num);
  font-size: 12px; color: var(--ink-400);
  margin-left: 10px;
}
.panel-head .actions { margin-left: auto; display: flex; gap: 8px; }
.panel-body { padding: 16px 20px; }

/* ============ 表格 ============ */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 11px; font-weight: 600;
  color: var(--ink-400);
  padding: 10px 12px;
  border-bottom: 2px solid var(--line);
  letter-spacing: 1px;
  white-space: nowrap;
}
.data-table td {
  padding: 12px;
  border-bottom: 1px solid #f0f3f7;
  font-size: 12.5px;
  vertical-align: middle;
}
.data-table tbody tr:hover { background: #f8fafc; }
.data-table .num { font-family: var(--font-num); text-align: right; }

/* 年度看板表格：数字列表头与数据统一右对齐（第一列保持左对齐） */
#yearly-monthly-table th:not(:first-child),
#yearly-quarterly-table th:not(:first-child) { text-align: right; }

/* 状态徽章 */
.badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .3px;
}
.badge.liq { background: #e8eef6; color: var(--navy-600); }
.badge.reorg { background: var(--gold-100); color: var(--gold-500); }
.badge.settle { background: #e6f4ea; color: var(--green); }
.badge.doing { background: #e8eef6; color: var(--navy-600); }
.badge.done { background: #e6f4ea; color: var(--green); }
.badge.overdue { background: var(--red-bg); color: var(--red-soft); }
.badge.warn { background: #fdf3e7; color: var(--amber); }
.badge.sent { background: #e8eef6; color: var(--navy-600); }
.badge.progress { background: #fdf3e7; color: var(--amber); }

/* 阶段点 */
.stage-dot {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-num); font-size: 12px; font-weight: 600;
}
.stage-dot .s { color: var(--navy-600); }
.stage-dot .bar { color: var(--ink-400); font-size: 10px; }

/* ============ 按钮 ============ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  font-size: 12px; font-weight: 500;
  font-family: var(--font-body);
  transition: all .15s;
}
.btn-primary {
  background: var(--navy-700);
  color: #fff;
}
.btn-primary:hover { background: var(--navy-600); }
.btn-gold {
  background: linear-gradient(135deg, var(--gold-400), var(--gold-500));
  color: #fff;
  box-shadow: 0 2px 8px rgba(184,134,11,.35);
}
.btn-gold:hover { filter: brightness(1.05); }
.btn-ghost {
  background: #fff; color: var(--navy-700);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--navy-400); background: #f8fafc; }
.btn-danger { background: #fff; color: var(--red-soft); border-color: #f0d4d0; }
.btn-danger:hover { background: var(--red-bg); }
.btn-sm { padding: 4px 10px; font-size: 11px; }

/* ============ 进度条 ============ */
.progress {
  height: 6px; background: #eef2f7; border-radius: 3px; overflow: hidden;
  min-width: 70px;
}
.progress .bar {
  height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--navy-500), var(--gold-400));
}

/* ============ 分栏 ============ */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(10,26,47,.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: 12px;
  width: 520px; max-width: 92vw;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
  display: flex; align-items: center;
}
.modal-head .title {
  font-family: var(--font-title); font-weight: 700;
  color: var(--navy-800); font-size: 15px;
}
.modal-head .close { margin-left: auto; cursor: pointer; color: var(--ink-400); font-size: 18px; }
.modal-body { padding: 20px; }
.modal-foot {
  padding: 14px 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 10px;
}

/* ============ 表单 ============ */
.form-row { margin-bottom: 14px; }
.form-row label {
  display: block; font-size: 12px; color: var(--ink-600);
  margin-bottom: 5px; font-weight: 500;
}
.form-row label .req { color: var(--red-soft); }
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--font-body);
  color: var(--ink-900);
  transition: border-color .15s;
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none; border-color: var(--navy-500);
  box-shadow: 0 0 0 3px rgba(36,80,138,.08);
}
.form-textarea { resize: vertical; min-height: 70px; }

/* ============ Toast ============ */
.toast {
  position: fixed; top: 20px; right: 20px;
  z-index: 200;
  background: var(--navy-800);
  color: #fff;
  padding: 12px 18px;
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  font-size: 13px;
  display: flex; align-items: center; gap: 10px;
  animation: slideIn .25s ease;
}
.toast .ico { color: var(--gold-300); font-size: 16px; }
@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* 空状态 */
.empty {
  text-align: center; padding: 40px;
  color: var(--ink-400); font-size: 13px;
}
.empty .big { font-size: 32px; margin-bottom: 8px; opacity: .5; }

/* 汇总数字行 */
.summary-strip {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 12px; margin-bottom: 16px;
}
.summary-strip .cell {
  background: linear-gradient(135deg, var(--navy-700), var(--navy-600));
  border-radius: 8px; padding: 14px 16px; color: #fff;
}
.summary-strip .cell.gold {
  background: linear-gradient(135deg, var(--gold-500), var(--gold-400));
}
.yearly-kpi-cell { transition: all .15s; cursor: pointer; overflow: visible; }
.kpi-clickable { transition: all .15s; }
.kpi-clickable:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,.1); }
.kpi-clickable.kpi-active { box-shadow: 0 0 0 2px #3370ff, 0 4px 12px rgba(51,112,255,.2); }
.yearly-kpi-cell:hover { box-shadow: inset 0 0 0 2px rgba(255,255,255,.3); transform: translateY(-1px); }
.yearly-kpi-cell.kpi-active { box-shadow: inset 0 0 0 3px rgba(255,255,255,.8); }
.summary-strip .cell .l { font-size: 11px; color: rgba(255,255,255,.7); letter-spacing: 1px; }
.summary-strip .cell .v { font-family: var(--font-num); font-size: 26px; font-weight: 700; margin-top: 3px; }
.summary-strip .cell .v .u { font-size: 12px; font-weight: 400; margin-left: 2px; opacity: .75; }

@media (max-width: 1200px) {
  .kpi-row, .summary-strip { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

/* ============ 案件筛选栏 ============ */
.filter-bar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  background: #f8fafc; border: 1px solid var(--line);
  border-radius: 8px; padding: 12px 14px; margin-bottom: 16px;
}
.fb-item { display: flex; flex-direction: column; gap: 4px; }
.fb-item label { font-size: 11px; color: var(--ink-500); letter-spacing: 1px; }
.fb-item .form-select {
  min-width: 110px; padding: 6px 8px; border: 1px solid var(--line);
  border-radius: 6px; font-size: 12px; background: #fff; color: var(--ink-800);
}
.fb-item.sort-item { margin-left: auto; }
.sort-group { display: flex; gap: 6px; }
.sort-group .form-select { min-width: 110px; }
#sort-dir { padding: 6px 10px; }

/* ============ 表格展开行（分期计划） ============ */
.case-row { cursor: pointer; }
.case-row:hover td { background: #f0f4f9; }
.fee-plan-row td { background: #fafbfd; padding: 0 !important; }
.fee-plan-box {
  padding: 12px 16px; border-top: 1px dashed var(--line);
}
.fee-plan-title {
  font-size: 12px; color: var(--ink-700); font-weight: 600; margin-bottom: 10px;
}
.fee-plan-line {
  display: flex; align-items: flex-start;
  position: relative; padding: 6px 0;
}
.fee-seg {
  flex: 1; position: relative; text-align: center;
  border-top: 2px solid var(--navy-300); padding-top: 10px;
}
.fee-seg.last { border-top-color: var(--gold-400); }
.fee-node-dot {
  position: absolute; top: -6px; left: 50%; transform: translateX(-50%);
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--navy-500); border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--navy-300);
}
.fee-seg.last .fee-node-dot { background: var(--gold-500); box-shadow: 0 0 0 1px var(--gold-400); }
.fee-node-label { font-size: 12px; font-weight: 600; color: var(--ink-800); }
.fee-node-date { font-size: 11px; color: var(--ink-500); margin-top: 2px; }
.fee-node-amt { font-size: 12px; color: var(--navy-700); font-weight: 600; margin-top: 2px; }
.fee-node-pct { font-size: 10px; color: var(--ink-400); margin-top: 2px; }

/* ============ 人员看板展开行 ============ */
.person-row { cursor: pointer; }
.person-row:hover td { background: #f0f4f9; }
.expand-arrow { color: var(--navy-500); font-size: 12px; }
.person-case-row td { background: #fafbfd; padding: 0 !important; }
.person-case-list { padding: 12px 16px; }
.pcl-head { font-size: 12px; color: var(--ink-700); font-weight: 600; margin-bottom: 8px; }
.sub-table { border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.sub-table th { background: #f0f4f9; font-size: 11px; }
.sub-table td { font-size: 12px; padding: 6px 10px; }

/* ============ 报酬期限甘特图 ============ */
.gantt-legend {
  font-size: 11px; color: var(--ink-500); margin-bottom: 10px;
  display: flex; align-items: center; gap: 4px;
}
.gantt-legend .dot {
  width: 10px; height: 10px; border-radius: 2px; background: var(--navy-400);
  display: inline-block;
}
.gantt-legend .dot.risk-high { background: var(--red-soft); }
.gantt-list { display: flex; flex-direction: column; gap: 6px; }
.gantt-row {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  font-size: 12px;
}
.gantt-row:hover .gantt-track { background: #eef2f7; }
.gantt-name {
  width: 200px; flex-shrink: 0; color: var(--ink-700);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gantt-track {
  flex: 1; height: 16px; background: #f0f4f9; border-radius: 3px;
  position: relative;
}
.gantt-bar {
  position: absolute; top: 3px; height: 10px; border-radius: 3px;
  background: linear-gradient(90deg, var(--navy-400), var(--navy-600));
  min-width: 4px;
}
.gantt-bar.risk-high { background: linear-gradient(90deg, var(--red-soft), #b5504a); }
.gantt-dur {
  width: 60px; flex-shrink: 0; text-align: right; color: var(--ink-500);
  font-size: 11px;
}

/* ============ 分期详情弹窗 ============ */
.fee-detail { padding: 4px 0; }
.fd-summary {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 14px; margin-bottom: 14px;
  font-size: 13px; color: var(--ink-700); line-height: 1.8;
}
.fd-summary strong { color: var(--navy-700); }
.fd-steps { display: flex; flex-direction: column; gap: 8px; }
.detail-seg {
  display: flex; align-items: center; gap: 14px;
  border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px;
}
.ds-idx {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--navy-700); color: #fff; font-size: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.ds-stage { font-size: 13px; font-weight: 600; color: var(--ink-800); width: 60px; }
.ds-date { font-size: 12px; color: var(--ink-500); flex: 1; }
.ds-amt { font-size: 13px; color: var(--navy-700); font-weight: 600; }

/* 角标 tooltip 美化 */
.badge { position: relative; }
.badge[title]:hover::after {
  content: attr(title);
  position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  background: rgba(30,41,59,.95); color: #fff; font-size: 11px; font-weight: 400;
  padding: 6px 10px; border-radius: 6px; white-space: pre-line;
  z-index: 100; min-width: 140px; max-width: 260px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  pointer-events: none; line-height: 1.5;
}
.badge[title]:hover::before {
  content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%) translateY(-4px);
  border: 5px solid transparent; border-bottom-color: rgba(30,41,59,.95);
  z-index: 100;
}

/* ============ 可点击行样式 ============ */
.action-row, .record-row { cursor: pointer; }
.action-row:hover td, .record-row:hover td { background: #eef2f9; }

/* ============ 案件/动作详情弹窗 ============ */
.case-detail, .action-detail, .report-preview { max-height: 70vh; overflow-y: auto; }
.cd-section { margin-bottom: 14px; }
.cd-title {
  font-size: 13px; font-weight: 700; color: var(--ink-800);
  margin-bottom: 8px; padding-bottom: 4px;
  border-bottom: 1px solid var(--line);
}
.cd-grid {
  display: grid; grid-template-columns: 100px 1fr;
  gap: 6px 12px; font-size: 13px;
}
.cd-label { color: var(--ink-500); font-weight: 500; }
.cd-val { color: var(--ink-800); }

.ad-content {
  background: #f8fafc; border: 1px solid var(--line);
  border-radius: 6px; padding: 10px 14px;
  font-size: 13px; color: var(--ink-700); line-height: 1.7;
}

/* ============ 履职报告预览 ============ */
.rp-head { text-align: center; margin-bottom: 14px; }
.rp-title { font-size: 18px; font-weight: 700; color: var(--ink-900); }
.rp-date { font-size: 12px; color: var(--ink-500); margin-top: 2px; }
.rp-unit { font-size: 12px; color: var(--ink-500); }
.rp-summary {
  background: #f8fafc; border: 1px solid var(--line); border-radius: 6px;
  padding: 10px 14px; font-size: 13px; color: var(--ink-700);
}
.rp-summary strong { color: var(--navy-700); }

/* KPI / tooltip hover */
.kpi-card[title], .cell[title] { cursor: help; }

/* 分期节点触发条件 */
.fee-node-trigger {
  font-size: 10px; color: var(--ink-400); margin-top: 2px;
  max-width: 120px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}
.detail-seg .ds-trigger {
  font-size: 11px; color: var(--ink-500); margin-top: 2px;
  max-width: 300px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap;
}

/* ========== OCR 文书识别样式 ========== */
.ocr-dropzone {
  border: 2px dashed #c9cdd4;
  border-radius: 12px;
  padding: 32px 20px;
  text-align: center;
  cursor: pointer;
  transition: all .2s;
  background: #fafbfc;
}
.ocr-dropzone:hover, .ocr-dropzone.ocr-dragover {
  border-color: #3370ff;
  background: #f0f5ff;
}
.ocr-dropzone-inner {
  pointer-events: none;
}
.ocr-flash {
  animation: ocrFlash .6s ease-in-out 3;
}
@keyframes ocrFlash {
  0%, 100% { box-shadow: none; }
  50% { box-shadow: 0 0 0 3px rgba(51,112,255,.4); }
}

/* ============ 督办任务红色左边框高亮 ============ */
.task-dubao {
  border-left: 3px solid #b5504a !important;
}
.task-dubao:hover td {
  background: #fdf2f0 !important;
}

/* ============ 案件详情增强 ============ */
.cd-section .kpi-row {
  margin-bottom: 12px;
}
.cd-section .kpi-card {
  padding: 12px 14px;
}
.cd-section .kpi-card .kpi-label {
  font-size: 11px;
}
.cd-section .kpi-card .kpi-value {
  font-size: 20px;
}

/* ============ 健康度列样式 ============ */
.badge.done { background: #e6f4ea; color: var(--green); }
.badge.warn { background: #fdf3e7; color: var(--amber); }
.badge.overdue { background: var(--red-bg); color: var(--red-soft); }

/* ============ 操作日志样式 ============ */
#action-log-section {
  margin-top: 12px;
}
#action-log-content {
  max-height: 150px;
  overflow-y: auto;
}

/* ============ 报酬收取台账 & 破产费用表格 ============ */
#fee-collection-section table,
#bankruptcy-expense-section table {
  font-size: 12px;
}
#fee-collection-section th,
#bankruptcy-expense-section th {
  font-size: 10px;
  padding: 8px 10px;
}
#fee-collection-section td,
#bankruptcy-expense-section td {
  padding: 8px 10px;
  font-size: 12px;
}

/* ============ 编辑表单双列布局 ============ */
.modal-body .grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}
@media (max-width: 600px) {
  .modal-body .grid-2 {
    grid-template-columns: 1fr;
  }
}
