/* 说明：审批配置页面的业务样式，与 shared/uiux-shared.css 共同使用。 */
:root {
  --bg:#f5f7fa; --panel:#fff; --surface:#fbfcfe; --line:#d9e2ec; --line-strong:#b8d1ec;
  --text:#23314d; --muted:#72809a; --brand:#0086d5; --brand-strong:#006faf; --brand-soft:#eef6ff;
  --good:#21a16a; --good-soft:#f0fbf5; --warn:#e05b5f; --warn-soft:#fff1f2; --accent:#f59e0b; --accent-soft:#fff5e8;
  --font:"PingFang SC","Avenir Next","Microsoft YaHei",sans-serif; --shadow:0 18px 48px rgba(35,49,77,.12);
}
* { box-sizing:border-box; }
body { margin:0; min-height:100vh; background:var(--bg); color:var(--text); font:13px/1.45 var(--font); overflow-x:hidden; }
button,input,select,textarea { font:inherit; }
button { cursor:pointer; }
h1,h2,h3,p { margin:0; }
.page { display:grid; gap:16px; padding:24px; }
.topbar,.panel { border:1px solid var(--line); border-radius:16px; background:var(--panel); }
.topbar { display:flex; justify-content:space-between; gap:16px; align-items:center; padding:16px 18px; }
.title-wrap { display:grid; gap:6px; min-width:0; }
.title-line { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.title-line h1 { font-size:22px; line-height:1.15; }
.subtle { color:var(--muted); overflow-wrap:anywhere; }
.toolbar,.tabs,.chips,.modal-footer,.tab-strip { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.actions { display:flex; align-items:center; gap:6px; flex-wrap:nowrap; white-space:nowrap; }
.field { display:block; color:var(--muted); font-size:12px; }
.field .input,.field .select,.field .textarea,.field .option-list { width:100%; margin-top:5px; }
.option-list { max-height:226px; overflow:auto; border:1px solid var(--line); border-radius:10px; background:#fff; }
.option-item { display:flex; align-items:center; width:100%; min-height:42px; padding:8px 10px; border:0; border-bottom:1px solid #eef2f7; background:#fff; color:var(--text); text-align:left; cursor:pointer; }
.option-item:last-child { border-bottom:0; }
.option-item:hover,.option-item.active { background:var(--brand-soft); color:var(--brand); }
.mark { margin-left:6px; font-weight:700; }
.mark-required { color:var(--warn); }
.mark-optional { color:var(--muted); font-weight:400; }
.input,.select,.textarea { height:36px; min-width:0; border:1px solid #d8e0ea; border-radius:10px; background:#fff; color:var(--text); padding:0 10px; }
.input:disabled,.select:disabled,.textarea:disabled,
.input[readonly],.select[readonly],.textarea[readonly] { color:#8a98ad; background:#eef2f7; border-color:#d8e0ea; cursor:not-allowed; }
.select { min-width:160px; }
.textarea { height:86px; padding:10px; resize:vertical; }

/* 按钮基本样式 */
.btn { display:inline-flex; align-items:center; justify-content:center; min-width:76px; height:34px; padding:0 12px; border:1px solid var(--line-strong); border-radius:10px; background:var(--brand-soft); color:#155ea6; font-weight:600; white-space:nowrap; transition:all 0.2s; }
.btn:hover { background:#e3f0ff; }
.btn-primary { background:var(--brand); border-color:var(--brand); color:#fff; }
.btn-primary:hover { background:var(--brand-strong); }
.btn-danger { color:var(--warn); background:var(--warn-soft); border-color:#f4b4b8; }
.btn-ghost { border:0; background:transparent; color:var(--brand); min-width:auto; padding:0 4px; }
.btn:disabled { color:#a6b1c2; background:transparent; border-color:transparent; cursor:not-allowed; }

/* 规则按钮（💡无阴影，Teal配色） */
.btn-bright {
  background: #06b6d4;
  color: #fff;
  border: 1px solid #0891b2;
  font-weight: 700;
  box-shadow: none;
}
.btn-bright:hover {
  background: #0891b2;
  border-color: #0e7490;
}

.pill { display:inline-flex; align-items:center; justify-content:center; min-width:86px; height:30px; padding:0 10px; border:0; border-radius:999px; background:#f6f8fb; color:var(--muted); font-size:12px; white-space:nowrap; }
.pill-main { color:var(--brand); background:var(--brand-soft); font-weight:700; }
.pill-good { color:var(--good); background:var(--good-soft); }
.pill-warn { color:var(--warn); background:var(--warn-soft); }
.pill-accent { color:#b76d00; background:var(--accent-soft); }

/* 页签布局与禁用状态 */
.tab-strip { width:100%; }
.tabs { padding:3px; border:1px solid var(--line); border-radius:12px; background:#f6f8fb; width:max-content; max-width:100%; }
.tab { width:112px; height:34px; border:0; border-radius:9px; background:transparent; color:var(--muted); transition:all 0.2s; }
.tab.active { border:1px solid #cfe0f2; background:#fff; color:var(--brand); font-weight:700; }

/* 坐席非班组长时，禁用并置灰Tab标签 */
.tab.tab-disabled {
  opacity: 0.45;
  cursor: not-allowed !important;
  color: var(--muted) !important;
  background: transparent !important;
  border: 0 !important;
}

/* 我的审批单专属高亮按钮（独立按钮，不和其他Tab合并） */
.tab-todo {
  background: var(--accent-soft) !important;
  color: #b76d00 !important;
  border: 1px dashed var(--accent) !important;
  font-weight: 600;
}
.tab-todo.active {
  background: var(--accent) !important;
  color: #fff !important;
  border: 1px solid var(--accent) !important;
}
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--warn);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  padding: 1px 5px;
  margin-left: 5px;
  min-width: 16px;
  height: 16px;
  line-height: 1;
}

.panel { display:grid; gap:14px; padding:16px; min-width:0; }
.section-head { display:flex; justify-content:space-between; gap:12px; align-items:flex-start; flex-wrap:wrap; }
.section-head h2 { font-size:20px; line-height:1.2; }
.filters { display:grid; grid-template-columns:repeat(4,minmax(140px,1fr)); gap:10px; padding:12px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.table-wrap { width:100%; min-width:0; max-width:100%; overflow:auto; border:1px solid var(--line); border-radius:14px; background:#fff; }
table { width:max-content; min-width:100%; border-collapse:separate; border-spacing:0; table-layout:auto; }
th,td { height:44px; padding:9px 10px; border-bottom:1px solid #eef2f7; text-align:left; vertical-align:middle; white-space:nowrap; }
th { position:sticky; top:0; z-index:2; background:#f6f9fc; color:#4f6b8c; font-weight:700; }
.sort-btn { display:inline-flex; align-items:center; gap:4px; padding:0; border:0; background:transparent; color:inherit; font:inherit; font-weight:700; cursor:pointer; }
.sort-btn::after { content:"↕"; color:#9aa8ba; font-size:11px; }
.sort-btn.active::after { content:attr(data-sort-mark); color:var(--brand); }
thead tr.filter-row th { top:44px; padding:6px 8px; background:#fbfcfe; }
.data-table th:last-child,.data-table td:last-child { position:sticky; right:0; z-index:3; width:var(--action-width, auto); min-width:var(--action-width, auto); background:#fff; box-shadow:-8px 0 14px rgba(35,49,77,.05); }
.roles-table { --action-width:72px; }
.teams-table { --action-width:150px; }
.classes-table { --action-width:218px; }
.todo-table { --action-width:150px; }
.data-table thead th:last-child { z-index:5; background:#f6f9fc; }
.data-table thead tr.filter-row th:last-child { z-index:5; background:#fbfcfe; }
.th-filter { width:100%; height:30px; border:1px solid #d8e0ea; border-radius:8px; padding:0 8px; color:var(--text); background:#fff; }
.pagination { display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:wrap; color:var(--muted); }
.pagination-actions { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.pagination-btn { min-width:32px; height:30px; padding:0 9px; border:1px solid var(--line); border-radius:8px; background:#fff; color:var(--text); font-weight:600; }
.pagination-btn.active { color:#fff; border-color:var(--brand); background:var(--brand); }
.pagination-btn:disabled { color:#a6b1c2; background:#f6f8fb; cursor:not-allowed; }
.pagination-size { display:flex; align-items:center; gap:6px; }
.pagination-size select { height:30px; min-width:78px; border:1px solid #d8e0ea; border-radius:8px; color:var(--text); background:#fff; }
tbody tr:hover { background:#fbfcfe; }
.status-action { cursor:pointer; font-weight:700; }
.empty { display:grid; place-items:center; gap:8px; min-height:150px; padding:24px; border:1px dashed #cfe0f2; border-radius:14px; color:var(--muted); background:#fbfcfe; text-align:center; }
.hidden { display:none !important; }

/* 弹窗设计：固定标题栏、❌关闭图标 */
.modal-layer { position:fixed; inset:0; z-index:20; display:grid; place-items:center; padding:20px; background:rgba(21,34,56,.32); }
.modal { width:min(920px,100%); max-height:88vh; overflow:auto; display:grid; gap:14px; padding:18px; border:1px solid var(--line); border-radius:16px; background:#fff; box-shadow:var(--shadow); position:relative; }
.modal-head {
  position: sticky;
  top: -18px;
  background: #fff;
  z-index: 10;
  padding-top: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.modal-title-wrap { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.modal-head h3 { font-size:18px; }

/* ❌关闭按钮样式 */
.modal-close-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}
.modal-close-btn:hover {
  background: #f1f5f9;
  color: var(--warn);
}

.modal-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:10px; width:100%; min-width:0; }
.compare { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.box { display:grid; gap:8px; padding:12px; border:1px solid var(--line); border-radius:12px; background:var(--surface); min-width:0; }
.detail-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); column-gap:24px; }
.detail-item { display:grid; grid-template-columns:88px minmax(0,1fr); gap:10px; align-items:start; min-width:0; padding:9px 0; border:0; border-bottom:1px solid #eef2f7; border-radius:0; background:transparent; }
.detail-item-wide { grid-column:1 / -1; }
.detail-item > b { color:#4f6b8c; font-size:12px; }
.detail-item > span { min-width:0; color:var(--text); white-space:normal; overflow-wrap:anywhere; }
.org-path { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }
.org-path i { color:#9aa8ba; font-style:normal; }
.org-lines { display:grid; gap:6px; }
.org-lines p { display:grid; grid-template-columns:72px minmax(0,1fr); gap:10px; align-items:start; margin:0; }
.org-label { color:var(--text); font-size:13px; font-weight:700; }
.org-value { min-width:0; color:var(--text); font-size:13px; font-weight:400; overflow-wrap:anywhere; }
.detail-stack { display:grid; gap:14px; }
.detail-box { width:100%; min-width:0; padding:0 0 16px; border:0; border-bottom:1px solid var(--line); border-radius:0; background:#fff; }
.detail-box:last-child { padding-bottom:0; border-bottom:0; }
.detail-title { display:flex; align-items:center; color:var(--text); }
.detail-box-warn .detail-title { color:var(--warn); }
.modal .box { background:#fff; }
.timeline { display:grid; gap:8px; }
.timeline li { margin-left:18px; color:var(--muted); }
.flow-board { display:grid; gap:12px; }
.guide-tabs { display:flex; gap:8px; overflow:auto; padding-bottom:2px; }
.guide-tab { min-width:auto; height:30px; padding:0 12px; border:1px solid var(--line); border-radius:999px; background:#fff; color:var(--muted); font-weight:700; white-space:nowrap; }
.guide-tab.active { color:var(--brand); border-color:#9dccf3; background:var(--brand-soft); }
.flow-section { display:grid; gap:10px; padding:12px; border:1px solid var(--line); border-radius:12px; background:#fff; }
.flow-section h4 { display:flex; align-items:center; gap:8px; flex-wrap:wrap; margin:0; font-size:15px; color:var(--text); }
.flow-row { display:flex; align-items:center; gap:8px; flex-wrap:nowrap; overflow:auto; padding-bottom:2px; }
.flow-step { display:inline-flex; align-items:center; gap:6px; min-height:34px; padding:7px 10px; border:1px solid #d9e2ec; border-radius:10px; background:#fbfcfe; color:var(--text); white-space:nowrap; }
.flow-step-soft { border-color:#d5e7f8; background:#f3f9ff; }
.flow-step-green { border-color:#cfead9; background:#f4fcf7; }
.flow-step-amber { border-color:#f4d59a; background:#fff9ed; }
.flow-arrow { color:#90a4bb; font-weight:700; }
.flow-badge { display:inline-flex; align-items:center; min-height:22px; padding:2px 8px; border-radius:999px; color:#d33f49; background:#fff1f2; font-size:12px; font-weight:700; }
.flow-tip { margin:0; color:#167044; font-weight:700; }
.flow-note { display:grid; gap:6px; margin:0; padding-left:18px; color:#b4232d; font-weight:700; }
.flow-section-danger { border-color:#f4b4b8; background:#fff7f8; }
.modal table { min-width:720px; }
.modal .ui-data-table table { width:100%; min-width:100%; }
.modal th,.modal td { position:static; right:auto; width:auto; min-width:0; box-shadow:none; }
.modal .ui-data-table th:last-child,
.modal .ui-data-table td:last-child { position:static; right:auto; width:auto; min-width:0; box-shadow:none; }
.option-list { display:grid; gap:6px; max-height:150px; overflow:auto; padding:6px; border:1px solid #d8e0ea; border-radius:10px; background:#fff; }
.option-item { display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:32px; padding:0 8px; border:0; border-radius:8px; background:#fff; color:var(--text); text-align:left; }
.option-item:hover,.option-item.active { background:var(--brand-soft); color:var(--brand); }
.inline-tag { display:inline-flex; align-items:center; height:20px; margin-left:6px; padding:0 6px; border-radius:999px; color:var(--brand); background:var(--brand-soft); font-size:12px; font-weight:700; }
.transfer { display:grid; grid-template-columns:1fr auto 1fr; gap:12px; align-items:stretch; }
.transfer-list { min-height:260px; max-height:300px; overflow:auto; border:1px solid var(--line); border-radius:12px; background:#fff; padding:8px; }
.transfer-item { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; min-height:44px; margin-bottom:6px; padding:8px; border:1px solid #eef2f7; border-radius:10px; background:#fff; text-align:left; color:var(--text); }
.transfer-item.selected { border-color: var(--brand); background: var(--brand-soft); }
.transfer-item span { white-space:nowrap; }
.transfer-item:hover { border-color:#9dccf3; }
.transfer-actions { display:grid; align-content:center; gap:8px; }
.toast { position:fixed; left:50%; top:50%; transform:translate(-50%,-50%); z-index:30; min-width:240px; padding:12px 16px; border:1px solid #b8e5cc; border-radius:10px; color:var(--good); background:var(--good-soft); box-shadow:var(--shadow); text-align:center; }

/* ===== 顶部吸顶开发工具栏 ===== */
.dev-toolbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 42px;
  padding: 6px 20px;
  background: linear-gradient(90deg, #1e293b 0%, #334155 100%);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid #475569;
}
.dev-toolbar-left { display:flex; align-items:center; gap:6px; }
.dev-toolbar-right { display:flex; align-items:center; gap:8px; flex-shrink:0; }
.dev-toolbar-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  background: rgba(255,255,255,.08);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: .5px;
}
.dev-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 6px;
  background: rgba(255,255,255,.08);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s;
}
.dev-btn:hover { background: rgba(255,255,255,.16); border-color:rgba(255,255,255,.25); }
.dev-btn.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.dev-btn-reset { border-color: rgba(251,191,36,.4); color: #fbbf24; }
.dev-btn-reset:hover { background: rgba(251,191,36,.15); }

/* ===== PRD 右侧栏 ===== */
.prd-sidebar {
  position: fixed;
  top: 42px; /* dev-toolbar height */
  right: 0;
  bottom: 0;
  width: 25%;
  min-width: 320px;
  max-width: 420px;
  background: #fff;
  border-left: 1px solid var(--line);
  box-shadow: -4px 0 24px rgba(35,49,77,.08);
  z-index: 40;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.prd-sidebar.open { transform: translateX(0); }
body.prd-open .page { margin-right: 25%; transition: margin-right .25s ease; }
body.prd-open .modal-layer { right: 25%; }

.prd-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: #f8fafc;
  flex-shrink: 0;
}
.prd-sidebar-header h3 { font-size: 15px; color: var(--text); margin: 0; }
.prd-sidebar-close {
  border: 0; background: transparent; color: var(--muted); font-size: 18px;
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%; cursor: pointer; transition: all .15s;
}
.prd-sidebar-close:hover { background: #f1f5f9; color: var(--warn); }

.prd-tabs {
  display: flex;
  gap: 2px;
  padding: 8px 12px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.prd-tab {
  flex: 1;
  border: 0;
  padding: 6px 2px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  background: transparent;
  color: var(--muted);
  transition: all .15s;
  text-align: center;
}
.prd-tab:hover {
  background: rgba(0,0,0,.03);
  color: var(--text);
}
.prd-tab.active {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
}

.prd-sidebar-body {
  flex: 1;
  overflow-y: auto;
  padding: 0;
}

/* PRD 可折叠区块 */
.prd-section {
  border-bottom: 1px solid #eef2f7;
}
.prd-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
  transition: background .15s;
}
.prd-section-header:hover { background: #f8fafc; }
.prd-section-header h4 {
  margin: 0;
  font-size: 14px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 6px;
}
.prd-section-header h4 .prd-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  font-size: 13px;
  flex-shrink: 0;
}
.prd-icon-req { background: #eef6ff; color: var(--brand); }
.prd-icon-field { background: #f0fbf5; color: var(--good); }
.prd-icon-rule { background: var(--accent-soft); color: #b76d00; }
.prd-icon-err { background: var(--warn-soft); color: var(--warn); }
.prd-chevron {
  font-size: 12px;
  color: var(--muted);
  transition: transform .2s;
  flex-shrink: 0;
}
.prd-section.open .prd-chevron { transform: rotate(90deg); }
.prd-section-body {
  display: none;
  padding: 0 16px 14px;
}
.prd-section.open .prd-section-body { display: block; }

.prd-content {
  font-size: 12.5px;
  line-height: 1.7;
  color: #475569;
}
.prd-content h5 {
  margin: 10px 0 4px;
  font-size: 13px;
  color: var(--text);
}
.prd-content p { margin: 4px 0; }
.prd-content ul, .prd-content ol {
  margin: 4px 0;
  padding-left: 18px;
}
.prd-content li { margin: 2px 0; }
.prd-content table {
  width: 100%;
  min-width: 0;
  font-size: 12px;
  border-collapse: collapse;
  margin: 6px 0;
}
.prd-content table th,
.prd-content table td {
  padding: 5px 8px;
  border: 1px solid #e2e8f0;
  text-align: left;
  white-space: normal;
  height: auto;
}
.prd-content table th { background: #f8fafc; font-weight: 700; color: #475569; }
.prd-content code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1f5f9;
  color: #be123c;
  font-size: 11.5px;
}

/* 批注功能 */
.prd-annotation-area {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
}
.prd-annotation-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-size: 12px;
  cursor: pointer;
  padding: 2px 0;
}
.prd-annotation-toggle:hover { text-decoration: underline; }
.prd-annotation-box {
  display: none;
  margin-top: 6px;
}
.prd-annotation-box.open { display: block; }
.prd-annotation-input {
  width: 100%;
  min-height: 60px;
  padding: 8px;
  border: 1px solid #d8e0ea;
  border-radius: 8px;
  background: #fffde7;
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
  resize: vertical;
  font-family: var(--font);
}
.prd-annotation-input:focus { outline: 0; border-color: var(--brand); }
.prd-annotation-saved {
  margin-top: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: #fffde7;
  border-left: 3px solid #f59e0b;
  font-size: 12px;
  line-height: 1.5;
  color: #78350f;
  white-space: pre-wrap;
}

@media (max-width:900px) {
  .page { padding:16px; }
  .topbar { align-items:flex-start; flex-direction:column; }
  .filters,.modal-grid,.compare,.detail-grid { grid-template-columns:1fr; }
  .detail-item-wide { grid-column:span 1; }
  .tabs { width:100%; }
  .tab { flex:1; width:auto; }
  table { width:100%; min-width:0; }
  thead { display:none; }
  .data-table th:last-child,.data-table td:last-child { position:static; width:auto; min-width:0; box-shadow:none; }
  tr { display:grid; padding:8px 0; border-bottom:1px solid #eef2f7; }
  td { display:grid; grid-template-columns:100px minmax(0,1fr); gap:8px; height:auto; border:0; }
  td::before { content:attr(data-label); color:var(--muted); font-size:12px; }
  .prd-sidebar { width:80%; min-width:280px; max-width:none; }
  body.prd-open .page { margin-right:0; }
}
