/* 法智云 · 信用卡纠纷调解作业系统 — 浅色专业主题 */
:root {
  --primary: #1a3a6b;        /* 深靛蓝：法律行业稳重 */
  --primary-light: #2b5aa0;
  --accent: #b8860b;         /* 暗金 */
  --bg: #f4f6fa;
  --panel: #ffffff;
  --border: #dde3ee;
  --text: #1f2937;
  --text-secondary: #5b6472;
  --success: #1f7a3d;
  --warning: #b26a00;
  --danger: #c00000;
  --info: #0b5394;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(16, 24, 40, .08);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px;
}
button { font-family: inherit; }
.hidden { display: none !important; }

/* ---------- 登录页 ---------- */
#login-screen {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #16294d 0%, #1a3a6b 55%, #2b5aa0 100%);
}
.login-card {
  background: var(--panel); border-radius: 12px; padding: 40px 44px; width: 420px;
  box-shadow: 0 12px 40px rgba(0,0,0,.25);
}
.login-card .brand { text-align: center; margin-bottom: 28px; }
.login-card .brand .logo {
  width: 64px; height: 64px; border-radius: 14px; background: var(--primary);
  color: #fff; font-size: 26px; font-weight: 700; display: inline-flex;
  align-items: center; justify-content: center; margin-bottom: 12px;
}
.login-card h1 { font-size: 22px; color: var(--primary); letter-spacing: 1px; }
.login-card .sub { color: var(--text-secondary); font-size: 12px; margin-top: 6px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-secondary); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 6px;
  font-size: 14px; outline: none; transition: border-color .15s; background: #fff;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary-light); }
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: none;
  border-radius: 6px; cursor: pointer; font-size: 13px; transition: all .15s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { filter: brightness(1.1); }
.btn-ghost { background: #eef1f7; color: var(--text); }
.btn-ghost:hover { background: #e2e7f0; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn-block { width: 100%; justify-content: center; padding: 11px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.error-msg { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 18px; }
.login-tip { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--border);
  font-size: 12px; color: var(--text-secondary); line-height: 1.7; }

/* ---------- 主框架 ---------- */
#app-shell { display: flex; min-height: 100vh; }
#sidebar {
  width: 208px; background: #16294d; color: #cfd8e8; flex-shrink: 0;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
#sidebar .side-brand {
  padding: 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
}
#sidebar .side-brand .name { color: #fff; font-size: 18px; font-weight: 700; letter-spacing: 2px; }
#sidebar .side-brand .desc { font-size: 11px; color: #8fa3c4; margin-top: 3px; }
#nav { flex: 1; padding: 10px 0; overflow-y: auto; }
#nav .nav-item {
  padding: 11px 18px; cursor: pointer; font-size: 13.5px; display: flex;
  align-items: center; gap: 10px; border-left: 3px solid transparent; transition: all .15s;
}
#nav .nav-item:hover { background: rgba(255,255,255,.06); color: #fff; }
#nav .nav-item.active { background: rgba(43,90,160,.25); color: #fff; border-left-color: var(--accent); }
#nav .nav-item .ico { width: 18px; text-align: center; }
#nav .nav-section { padding: 10px 18px 4px; font-size: 11px; color: #6d81a8; letter-spacing: 1px; }
#sidebar .side-foot { padding: 12px 16px; border-top: 1px solid rgba(255,255,255,.08); font-size: 12px; }
#sidebar .side-foot .who { color: #fff; margin-bottom: 4px; }
#main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
#topbar {
  background: var(--panel); border-bottom: 1px solid var(--border); padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20;
}
#topbar .page-title { font-size: 17px; font-weight: 600; color: var(--primary); }
#topbar .page-sub { font-size: 12px; color: var(--text-secondary); margin-left: 12px; }
#content { padding: 22px 24px; flex: 1; }

/* ---------- 通用组件 ---------- */
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.panel-head { padding: 13px 18px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.panel-head .t { font-size: 15px; font-weight: 600; color: var(--primary); }
.panel-body { padding: 18px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: 1fr 1fr; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-5 { grid-template-columns: repeat(5, 1fr); }
@media (max-width: 1200px) { .grid-4, .grid-5 { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px) { .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; } #sidebar { width: 64px; } #nav .nav-item span:not(.ico), .side-brand .name, .side-brand .desc, .side-foot { display: none; } }

.stat-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat-card .label { font-size: 12px; color: var(--text-secondary); }
.stat-card .value { font-size: 26px; font-weight: 700; color: var(--primary); margin-top: 6px; font-variant-numeric: tabular-nums; }
.stat-card .extra { font-size: 11px; color: var(--text-secondary); margin-top: 4px; }
.stat-card.warn .value { color: var(--warning); }
.stat-card.ok .value { color: var(--success); }

table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th {
  background: #f0f3f9; color: #3a4a63; text-align: left; padding: 9px 10px;
  border-bottom: 1px solid var(--border); font-weight: 600; white-space: nowrap;
}
table.tbl td { padding: 9px 10px; border-bottom: 1px solid #eef1f6; vertical-align: middle; }
table.tbl tr:hover td { background: #f7f9fd; }
.mono { font-variant-numeric: tabular-nums; }
.money { font-variant-numeric: tabular-nums; color: #b03030; font-weight: 600; }

.tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; margin: 1px 2px; white-space: nowrap; }
.tag-blue { background: #e3ecfa; color: #1a3a6b; }
.tag-gold { background: #faf3dd; color: #8a6508; }
.tag-green { background: #e4f4e9; color: #1f7a3d; }
.tag-red { background: #fbe6e6; color: #c00000; }
.tag-gray { background: #eef0f4; color: #5b6472; }

.stage-pill { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; background: #e3ecfa; color: var(--primary); white-space: nowrap; }
.stage-pill.s-received { background: #eef0f4; color: #5b6472; }
.stage-pill.s-reviewed { background: #e3ecfa; color: #1a3a6b; }
.stage-pill.s-cleaned { background: #e3ecfa; color: #1a3a6b; }
.stage-pill.s-filed { background: #e0eefc; color: #0b5394; }
.stage-pill.s-preservation_applied, .stage-pill.s-preservation_served { background: #fdeef2; color: #a01238; }
.stage-pill.s-awaiting_callback, .stage-pill.s-outreach { background: #faf3dd; color: #8a6508; }
.stage-pill.s-mediating { background: #e8f0fd; color: #2b5aa0; }
.stage-pill.s-agreement, .stage-pill.s-judicial { background: #e4f4e9; color: #1f7a3d; }
.stage-pill.s-performing, .stage-pill.s-settled { background: #e4f4e9; color: #1f7a3d; }
.stage-pill.s-archived { background: #eceff5; color: #3a4a63; }
.stage-pill.s-returned { background: #fbe6e6; color: #c00000; }

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-bottom: 14px; }
.filter-bar .field { margin-bottom: 0; min-width: 130px; }
.filter-bar input, .filter-bar select { padding: 7px 10px; font-size: 13px; }

.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; margin-top: 12px; font-size: 12.5px; color: var(--text-secondary); }

/* 抽屉 */
.drawer-mask { position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 50; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 760px; max-width: 94vw; background: var(--bg);
  z-index: 51; box-shadow: -8px 0 30px rgba(0,0,0,.2); display: flex; flex-direction: column;
  animation: slidein .18s ease-out;
}
@keyframes slidein { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
.drawer-head { background: var(--primary); color: #fff; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; }
.drawer-head .title { font-size: 16px; font-weight: 600; }
.drawer-head .close { background: none; border: none; color: #fff; font-size: 20px; cursor: pointer; }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.5); z-index: 60; display: flex; align-items: center; justify-content: center; }
.modal { background: #fff; border-radius: 10px; width: 560px; max-width: 94vw; max-height: 88vh; overflow-y: auto; box-shadow: 0 16px 50px rgba(0,0,0,.3); }
.modal-head { padding: 14px 20px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; }
.modal-head .t { font-size: 15px; font-weight: 600; color: var(--primary); }
.modal-body { padding: 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* 时间线 */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 4px; bottom: 4px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding: 0 0 14px 12px; font-size: 12.5px; }
.tl-item::before { content: ""; position: absolute; left: -16px; top: 5px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary-light); border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); }
.tl-item .time { color: var(--text-secondary); font-size: 11.5px; }
.tl-item .what { margin-top: 2px; }

.toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%); z-index: 100;
  background: #1f2937; color: #fff; padding: 10px 22px; border-radius: 8px; font-size: 13.5px;
  box-shadow: 0 6px 24px rgba(0,0,0,.3); animation: dropin .2s;
}
@keyframes dropin { from { transform: translate(-50%,-12px); opacity: 0; } to { transform: translate(-50%,0); opacity: 1; } }
.toast.ok { background: #14532d; }
.toast.err { background: #7f1d1d; }

.upload-zone {
  border: 2px dashed var(--border); border-radius: 10px; padding: 26px; text-align: center;
  color: var(--text-secondary); cursor: pointer; transition: all .15s; background: #fafbfe;
}
.upload-zone:hover, .upload-zone.drag { border-color: var(--primary-light); background: #eef3fb; color: var(--primary); }
.upload-zone .big { font-size: 15px; margin-bottom: 4px; }
.upload-zone .small { font-size: 12px; }

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 14px; font-size: 13px; }
.kv .k { color: var(--text-secondary); }
.kv .v { word-break: break-all; }

.script-box { background: #fbf7ea; border: 1px solid #ecdfc0; border-radius: 8px; padding: 12px 14px; font-size: 12.5px; line-height: 1.8; white-space: pre-wrap; }
.forbid-list { background: #fdf0f0; border: 1px solid #f3d2d2; border-radius: 8px; padding: 12px 14px 12px 30px; font-size: 12.5px; line-height: 2.0; }
.progress-track { height: 8px; background: #edf0f6; border-radius: 4px; overflow: hidden; }
.progress-track > div { height: 100%; background: linear-gradient(90deg, var(--primary-light), var(--accent)); }
.call-btn { display: inline-flex; align-items: center; gap: 4px; background: var(--success); color: #fff; border-radius: 5px; padding: 3px 9px; font-size: 12px; text-decoration: none; }
.call-btn:hover { filter: brightness(1.1); }
.empty { text-align: center; color: var(--text-secondary); padding: 40px 0; font-size: 13px; }
.section-title { font-size: 13px; font-weight: 600; color: var(--primary); margin: 18px 0 10px; padding-left: 8px; border-left: 3px solid var(--accent); }
.note { font-size: 12px; color: var(--text-secondary); line-height: 1.8; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ---------- 推案作业 ---------- */
.dup-name { color: #d63031; font-weight: 700; }
.dup-badge { display: inline-block; padding: 1px 6px; border-radius: 8px; font-size: 10.5px; background: #fdecec; color: #c00000; border: 1px solid #f3c8c8; white-space: nowrap; }
.pushfile-cols { display: grid; grid-template-columns: 40% 1fr; gap: 18px; align-items: start; }

/* ---------- 保全作业中心（增量）----------
   以下 4 组类为本增量新增，除此之外不改动任何既有样式。
   .tabs/.tab        四页签容器与页签按钮
   .steps/.step      批次办理步骤条（6 步）
   .countdown-*      期限倒计时（正常 / 预警 / 强预警 / 已失效）
   .cell-error       核验未通过的单元格高亮
--------------------------------------------- */

/* 四页签 */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 16px; }
.tab {
  padding: 9px 18px; font-size: 13.5px; color: var(--text-secondary); cursor: pointer;
  border: 1px solid transparent; border-bottom: none; border-radius: 6px 6px 0 0;
  background: transparent; position: relative; top: 2px; transition: all .15s;
}
.tab:hover { color: var(--primary); background: #f2f5fb; }
.tab.active {
  color: var(--primary); font-weight: 600; background: var(--panel);
  border-color: var(--border); border-bottom: 2px solid var(--panel);
}
.tab .badge {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 9px;
  font-size: 11px; background: var(--accent); color: #fff; font-weight: 400;
}
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* 办理步骤条 */
.steps { display: flex; gap: 0; margin: 4px 0 16px; flex-wrap: wrap; }
.step {
  flex: 1; min-width: 96px; padding: 9px 8px; font-size: 12.5px; text-align: center;
  color: var(--text-secondary); background: #f0f3f9; position: relative;
  border-right: 2px solid var(--panel);
}
.step:first-child { border-radius: 6px 0 0 6px; }
.step:last-child { border-radius: 0 6px 6px 0; border-right: none; }
.step.active { background: var(--primary); color: #fff; font-weight: 600; }
.step.done { background: #e4f4e9; color: var(--success); }
.step.done.active { background: var(--primary); color: #fff; }

/* 期限倒计时 */
.countdown {
  display: inline-flex; align-items: baseline; gap: 3px; padding: 2px 9px;
  border-radius: 10px; font-size: 12px; background: #eef0f4; color: #5b6472; white-space: nowrap;
}
.countdown-days { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.countdown.lv-warn { background: #fdf3e0; color: var(--warning); }
.countdown.lv-danger { background: #fbe6e6; color: var(--danger); }
.countdown.lv-expired { background: #eceff5; color: #6b7280; text-decoration: line-through; }
.countdown-track { display: block; width: 54px; height: 4px; border-radius: 2px; background: rgba(0,0,0,.10); overflow: hidden; }
.countdown-track > i { display: block; height: 100%; background: currentColor; }

/* 核验未通过单元格 */
td.cell-error { background: #fdf0f0; box-shadow: inset 2px 0 0 var(--danger); }
tr.cell-error-row td { background: #fff8f8; }
@media (max-width: 1100px) { .pushfile-cols { grid-template-columns: 1fr; } }
