/* ===== KPMG 风格 - 深蓝主调、专业简洁 ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #00338D;
  --primary-dark: #002566;
  --primary-light: #e6ecf5;
  --primary-accent: #005EB8;
  --cyan: #00A3E0;
  --cyan-light: #e0f4fc;
  --success: #2d8c4a;
  --success-light: #eaf7ee;
  --warning: #e6a817;
  --warning-light: #fef9e7;
  --danger: #c41230;
  --danger-light: #fde8ec;
  --info: #005EB8;
  --info-light: #e6ecf5;
  --bg: #f4f6f9;
  --bg-white: #fff;
  --text: #1a1a2e;
  --text-secondary: #4a4f5c;
  --text-muted: #8c9199;
  --border: #e1e4e8;
  --border-light: #f0f2f5;
  --radius: 6px;
  --radius-lg: 10px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow: 0 2px 8px rgba(0,0,0,0.07);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --sidebar-width: 230px;
  --header-height: 56px;
  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
html, body {
  height: 100%; font-family: var(--font); font-size: 14px;
  color: var(--text); background: var(--bg); line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--primary-accent); text-decoration: none; }
a:hover { color: var(--primary); }
button { cursor: pointer; border: none; outline: none; font-family: inherit; }
input, select, textarea { font-family: inherit; font-size: 14px; outline: none; }
table { border-collapse: collapse; width: 100%; }

/* ===== Login Page ===== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #00338D 0%, #005EB8 40%, #00A3E0 100%);
  position: relative; overflow: hidden;
}
.login-page::before {
  content: ''; position: absolute; top: -50%; right: -20%;
  width: 600px; height: 600px; border-radius: 50%;
  background: rgba(255,255,255,0.04); pointer-events: none;
}
.login-page::after {
  content: ''; position: absolute; bottom: -30%; left: -15%;
  width: 500px; height: 500px; border-radius: 50%;
  background: rgba(255,255,255,0.03); pointer-events: none;
}
.login-card {
  background: var(--bg-white); border-radius: 12px; padding: 44px 40px;
  width: 420px; box-shadow: 0 16px 48px rgba(0,20,60,0.25);
  position: relative; z-index: 1;
}
.login-card h1 {
  text-align: center; color: var(--primary); font-size: 24px;
  font-weight: 700; margin-bottom: 6px; letter-spacing: 0.5px;
}
.login-card .subtitle {
  text-align: center; color: var(--text-muted); font-size: 13px;
  margin-bottom: 36px; font-weight: 400;
}
.form-group { margin-bottom: 20px; }
.form-group label {
  display: block; margin-bottom: 6px; font-weight: 600; font-size: 13px;
  color: var(--text-secondary); letter-spacing: 0.3px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); transition: all 0.2s; background: #fafbfc;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  border-color: var(--primary-accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(0,94,184,0.1);
}
.form-error { color: var(--danger); font-size: 12px; margin-top: 4px; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 20px; border-radius: var(--radius); font-size: 14px;
  font-weight: 600; transition: all 0.2s; letter-spacing: 0.2px;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 2px 8px rgba(0,51,141,0.3); }
.btn-success { background: var(--success); color: #fff; }
.btn-success:hover { background: #23703a; box-shadow: 0 2px 8px rgba(45,140,74,0.3); }
.btn-danger { background: #fff; color: var(--danger); border: 1.5px solid var(--danger); }
.btn-danger:hover { background: var(--danger-light); }
.btn-warning { background: #fff; color: #b8860b; border: 1.5px solid var(--warning); }
.btn-warning:hover { background: var(--warning-light); }
.btn-default { background: #fff; color: var(--text); border: 1.5px solid var(--border); }
.btn-default:hover { border-color: var(--primary-accent); color: var(--primary-accent); background: #fafbfc; }
.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 4px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== AI Pre-Audit Queue ===== */
.ai-pre-page { display: flex; flex-direction: column; gap: 16px; }
.ai-pre-head {
  display: flex; align-items: flex-start; justify-content: flex-end; gap: 16px;
}
.ai-pre-head h2 {
  margin: 0 0 2px; font-size: 26px; line-height: 1.2; color: var(--text);
}
.ai-pre-head p {
  margin: 0; color: var(--text-secondary); font-size: 13px;
}
.ai-pre-head-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
}
.ai-pre-search {
  width: 310px; height: 40px; display: flex; align-items: center; gap: 8px;
  padding: 0 12px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: #fff;
}
.ai-pre-search span {
  width: 14px; height: 14px; border: 2px solid #64748b; border-radius: 50%; position: relative; flex: 0 0 auto;
}
.ai-pre-search span::after {
  content: ''; position: absolute; width: 6px; height: 2px; right: -5px; bottom: -3px;
  background: #64748b; transform: rotate(45deg); border-radius: 2px;
}
.ai-pre-search input {
  border: 0; background: transparent; width: 100%; height: 100%; color: var(--text);
}
.ai-pre-stat-grid {
  display: none;
}
.ai-pre-top-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 300px);
  gap: 12px;
  margin-bottom: 16px;
  align-items: stretch;
}
.ai-pre-top-panel > .ai-pipeline-card,
.ai-pre-top-panel > .ai-budget-notice {
  height: 100%;
  min-height: 0;
  box-sizing: border-box;
}
.ai-pipeline-card {
  margin-bottom: 0;
  padding: 12px 10px 10px;
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.ai-pipeline-chart-wrap {
  position: relative;
  padding: 0;
  border-radius: var(--radius);
  width: 100%;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
@keyframes ai-pipeline-stripe-move {
  0% { background-position: 0 0; }
  100% { background-position: 22px 0; }
}
.ai-pipeline-flow-chart {
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: 12px 8px;
  overflow: visible;
  padding: 10px 6px 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  flex: 1 1 auto;
}
.ai-pipeline-flow-chart .flow-segment {
  flex: 1 1 136px;
  min-width: 128px;
  max-width: 180px;
  gap: 4px;
  display: flex;
  align-items: stretch;
  align-self: stretch;
}
.ai-pipeline-flow-chart .flow-segment .flow-step {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 100%;
  align-self: stretch;
}
.ai-pipeline-flow-chart .flow-step {
  min-width: 0;
  min-height: 172px;
  padding: 14px 10px 12px;
  border: 1px solid rgba(0, 51, 141, 0.1);
  border-radius: 10px;
}
.ai-pipeline-flow-chart .flow-step.runtime-pass {
  border-color: rgba(45, 140, 74, 0.22);
  box-shadow: 0 2px 10px rgba(45, 140, 74, 0.08);
}
.ai-pipeline-flow-chart .flow-step.runtime-running {
  border-color: rgba(0, 163, 224, 0.45);
  animation: ai-pipeline-node-glow 1.5s ease-in-out infinite;
  overflow: hidden;
}
.ai-pipeline-flow-chart .flow-step.runtime-running::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 35%, rgba(0, 163, 224, 0.28) 50%, transparent 65%);
  animation: ai-pipeline-step-scan 1.8s ease-in-out infinite;
  pointer-events: none;
}
.ai-pipeline-flow-chart .flow-step-num {
  width: 32px;
  height: 32px;
  font-size: 13px;
  margin-bottom: 8px;
}
.ai-pipeline-flow-chart .flow-step-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.35;
}
.ai-pipeline-flow-chart .flow-step-desc {
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.ai-pipeline-flow-chart .flow-runtime-badge {
  width: 22px;
  height: 22px;
  font-size: 12px;
}
.ai-pipeline-flow-chart .flow-arrow {
  display: inline-flex;
  align-items: center;
  flex: 0 0 34px;
  min-width: 34px;
  height: 32px;
  padding: 0 2px;
  box-sizing: border-box;
  align-self: center;
}
.ai-pipeline-flow-chart .ai-flow-arrow-link {
  position: relative;
  flex: 1 1 auto;
  height: 8px;
  min-width: 20px;
  background: #d4d8df;
  border-radius: 6px 0 0 6px;
  overflow: hidden;
}
.ai-pipeline-flow-chart .ai-flow-arrow-link-fill {
  position: relative;
  display: block;
  height: 100%;
  width: 0;
  border-radius: 6px 0 0 6px;
  background: linear-gradient(180deg, #1578b8 0%, #0d5f96 100%);
  transition: width 0.45s ease;
  overflow: hidden;
}
.ai-pipeline-flow-chart .ai-flow-arrow-link-fill::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    -45deg,
    rgba(255, 255, 255, 0.14) 0,
    rgba(255, 255, 255, 0.14) 6px,
    rgba(255, 255, 255, 0) 6px,
    rgba(255, 255, 255, 0) 12px
  );
  background-size: 18px 18px;
  pointer-events: none;
}
.ai-pipeline-flow-chart .ai-flow-arrow-tip {
  flex: 0 0 auto;
  width: 0;
  height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 8px solid #d4d8df;
  transition: border-color 0.35s ease;
}
.ai-pipeline-flow-chart .ai-flow-arrow-done .ai-flow-arrow-link-fill {
  width: 100%;
}
.ai-pipeline-flow-chart .ai-flow-arrow-done .ai-flow-arrow-link-fill::after {
  animation: ai-pipeline-stripe-move 0.85s linear infinite;
}
.ai-pipeline-flow-chart .ai-flow-arrow-done .ai-flow-arrow-tip {
  border-left-color: #0d5f96;
}
.ai-pipeline-flow-chart .ai-flow-arrow-live .ai-flow-arrow-link-fill {
  width: 72%;
}
.ai-pipeline-flow-chart .ai-flow-arrow-live .ai-flow-arrow-link-fill::after {
  animation: ai-pipeline-stripe-move 0.65s linear infinite;
}
.ai-pipeline-flow-chart .ai-flow-arrow-live .ai-flow-arrow-tip {
  border-left-color: #1578b8;
}
.ai-pipeline-flow-chart .ai-flow-arrow-idle .ai-flow-arrow-link-fill {
  width: 0;
}
.ai-pipeline-flow-chart .ai-flow-arrow-idle .ai-flow-arrow-tip {
  opacity: 0.55;
}
.ai-pipeline-flow-chart.flow-chart {
  justify-content: center;
  align-items: stretch;
  flex-wrap: wrap;
  gap: 12px 8px;
  padding: 10px 6px 14px;
  width: 100%;
  max-width: 100%;
}
.ai-pipeline-flow-chart.flow-chart .flow-segment {
  flex: 1 1 136px;
  min-width: 128px;
  max-width: 180px;
}
.ai-pipeline-branch-flow.flow-chart {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  min-width: 820px;
  padding: 10px 8px 12px;
}
.ai-pipeline-branch-flow .ai-flow-stage {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}
.ai-pipeline-branch-flow .ai-flow-stage .flow-step {
  width: 82px;
  min-width: 82px;
  min-height: 104px;
  padding: 12px 6px 9px;
}
.ai-pipeline-branch-flow .flow-step-num {
  width: 28px;
  height: 28px;
  margin-bottom: 6px;
  font-size: 12px;
}
.ai-pipeline-branch-flow .flow-step-name {
  font-size: 12px;
  margin-bottom: 3px;
}
.ai-pipeline-branch-flow .flow-step-desc {
  font-size: 10px;
  line-height: 1.35;
}
.ai-pipeline-branch-flow .ai-flow-choice-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 0 0 174px;
  min-width: 174px;
  padding: 8px;
  border: 1px dashed rgba(0, 51, 141, 0.18);
  border-radius: 10px;
  background: rgba(245, 248, 252, 0.74);
}
.ai-pipeline-branch-flow .ai-flow-detect-group {
  flex-basis: 186px;
  min-width: 186px;
}
.ai-pipeline-branch-flow .ai-flow-group-title {
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}
.ai-pipeline-branch-flow .ai-flow-choice-nodes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.ai-pipeline-branch-flow .ai-flow-choice-nodes .flow-step {
  width: 100%;
  min-width: 0;
  min-height: 96px;
  padding: 10px 5px 8px;
}
.ai-pipeline-branch-flow .ai-flow-bypass-note {
  height: 14px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 14px;
  text-align: center;
}
.ai-pipeline-branch-flow .flow-arrow {
  flex: 0 0 22px;
  min-width: 22px;
  }
.ai-pipeline-branch-flow .ai-flow-arrow-label { display: none; }
@keyframes ai-pipeline-node-glow {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(0, 163, 224, 0.28), 0 4px 18px rgba(0, 94, 184, 0.18);
  }
  50% {
    box-shadow: 0 0 0 3px rgba(0, 163, 224, 0.52), 0 8px 26px rgba(0, 163, 224, 0.32);
  }
}
@keyframes ai-pipeline-step-scan {
  0% { transform: translateX(-120%); }
  100% { transform: translateX(120%); }
}
@media (max-width: 1200px) {
  .ai-pipeline-branch-flow.flow-chart {
    min-width: 780px;
  }
  .ai-pipeline-branch-flow .ai-flow-stage .flow-step {
    width: 78px;
    min-width: 78px;
  }
  .ai-pipeline-branch-flow .ai-flow-choice-group {
    flex-basis: 164px;
    min-width: 164px;
  }
  .ai-pipeline-branch-flow .ai-flow-detect-group {
    flex-basis: 176px;
    min-width: 176px;
  }
  .ai-pipeline-flow-chart .flow-segment {
    flex-basis: 128px;
    min-width: 118px;
    max-width: 170px;
  }
  .ai-pipeline-flow-chart .flow-step {
    min-height: 164px;
    padding: 12px 8px 10px;
  }
  .ai-pipeline-flow-chart .flow-step-name { font-size: 12px; }
  .ai-pipeline-flow-chart .flow-step-desc { font-size: 10px; }
}
.ai-budget-notice {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
  min-height: 100%;
  padding: 18px 20px 16px;
  border: 1px solid #cfe0f5;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.ai-budget-notice.ai-process-feed {
  justify-content: flex-start;
}
.ai-process-feed-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.ai-budget-notice-dot,
.ai-process-feed-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
  background: #2d8c4a;
  box-shadow: 0 0 0 0 rgba(45, 140, 74, 0.45);
  animation: ai-budget-pulse 1.8s ease-out infinite;
}
.ai-process-feed-dot[data-tone="primary"] {
  background: var(--primary-accent);
  box-shadow: 0 0 0 0 rgba(0, 94, 184, 0.4);
  animation-name: ai-process-dot-pulse-primary;
}
.ai-process-feed-dot[data-tone="warning"] {
  background: #e6a817;
  box-shadow: 0 0 0 0 rgba(230, 168, 23, 0.4);
  animation-name: ai-process-dot-pulse-warning;
}
.ai-process-feed-head strong {
  flex: 1 1 auto;
  font-size: 15px;
  color: var(--primary);
  min-width: 0;
}
.ai-process-feed-tag {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  color: #0b6bcb;
  background: rgba(11, 107, 203, 0.1);
  letter-spacing: 0.02em;
}
.ai-process-feed-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1 1 auto;
  min-height: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
}
.ai-process-feed-body.is-switching {
  opacity: 0;
  transform: translateY(6px);
}
.ai-process-feed-metric {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}
.ai-process-feed-metric em {
  font-style: normal;
  color: var(--primary);
}
.ai-process-feed-body small {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
  min-height: 36px;
}
.ai-process-feed-dots {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 4px;
}
.ai-process-feed-dots i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #c5d3e8;
  transition: width 0.25s ease, background 0.25s ease;
}
.ai-process-feed-dots i.active {
  width: 18px;
  border-radius: 999px;
  background: var(--primary-accent);
}
.ai-budget-bump {
  animation: ai-budget-bump .45s ease;
}
@keyframes ai-budget-pulse {
  0% { box-shadow: 0 0 0 0 rgba(45, 140, 74, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(45, 140, 74, 0); }
  100% { box-shadow: 0 0 0 0 rgba(45, 140, 74, 0); }
}
@keyframes ai-process-dot-pulse-primary {
  0% { box-shadow: 0 0 0 0 rgba(0, 94, 184, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(0, 94, 184, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 94, 184, 0); }
}
@keyframes ai-process-dot-pulse-warning {
  0% { box-shadow: 0 0 0 0 rgba(230, 168, 23, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(230, 168, 23, 0); }
  100% { box-shadow: 0 0 0 0 rgba(230, 168, 23, 0); }
}
@keyframes ai-budget-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.12); color: #009a63; }
  100% { transform: scale(1); }
}
.ai-pre-stat-grid {
  display: none;
}
.ai-pre-stat {
  min-height: 116px; padding: 18px; background: #fff; border: 1px solid var(--border);
  border-top: 3px solid var(--primary); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; justify-content: space-between;
}
.ai-pre-stat span { color: var(--text-muted); font-size: 13px; font-weight: 600; }
.ai-pre-stat strong { display: block; font-size: 30px; line-height: 1; color: var(--primary); }
.ai-pre-stat em { font-style: normal; color: var(--text-secondary); font-size: 12px; }
.ai-pre-stat-red { border-top-color: var(--danger); }
.ai-pre-stat-red strong { color: var(--danger); }
.ai-pre-stat-orange, .ai-pre-stat-amber { border-top-color: var(--warning); }
.ai-pre-stat-orange strong, .ai-pre-stat-amber strong { color: #b8860b; }
.ai-pre-stat-green { border-top-color: var(--success); }
.ai-pre-stat-green strong { color: var(--success); }
.ai-pre-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 570px;
  gap: 16px;
  align-items: stretch;
}
.ai-pre-list-card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
  width: 100%;
  height: 100%;
  box-sizing: border-box;
}
.ai-pre-detail {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  width: 570px;
  min-width: 570px;
  max-width: 570px;
  box-sizing: border-box;
}
.ai-pre-list-card .ai-pre-table-wrap {
  flex: 1 1 auto;
  min-height: 0;
}
.ai-pre-list-card > .pagination {
  margin-top: auto;
  flex-shrink: 0;
}
.ai-pre-filter-row {
  min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; border-bottom: 1px solid var(--border); background: #fbfcff;
}
.ai-pre-filter-row strong { display: block; font-size: 16px; color: var(--text); }
.ai-pre-pending-meta {
  font-weight: 600;
  color: var(--text-secondary);
}
.ai-pre-pending-meta em {
  font-style: normal;
  color: var(--primary);
  font-weight: 700;
}
.ai-pre-filter-tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.ai-pre-filter-tabs button {
  height: 34px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px;
  background: #fff; color: var(--text-secondary); font-size: 12px; font-weight: 600;
}
.ai-pre-filter-tabs button.active {
  border-color: #55b7b0; background: #e8fbf8; color: #006b62;
}
.ai-pre-filter-tabs em {
  margin-left: 6px; font-style: normal; color: var(--primary); font-weight: 700;
}
.ai-pre-table-wrap {
  overflow: auto;
  min-width: 0;
}
.ai-pre-table {
  width: 100%;
  min-width: 1040px;
  table-layout: fixed;
}
.ai-pre-apply-time {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
}
.ai-pre-duration {
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  white-space: nowrap;
}
.ai-pre-duration-live {
  color: var(--primary-accent);
}
.ai-pre-table th {
  height: 42px; padding: 10px 14px; text-align: left; background: #fff; color: var(--text-muted);
  font-size: 12px; font-weight: 700; border-bottom: 1px solid var(--border);
}
.ai-pre-table td {
  padding: 14px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text);
}
.ai-pre-table tr { cursor: pointer; transition: background .18s; }
.ai-pre-table tbody tr:hover { background: #f7fbff; }
.ai-pre-table tbody tr.active { background: #eaf7f5; box-shadow: inset 3px 0 0 #0f9f8f; }
.ai-pre-table tbody tr.ai-pre-row-processing {
  background: linear-gradient(90deg, rgba(0, 163, 224, 0.1), rgba(0, 163, 224, 0.02));
  box-shadow: inset 3px 0 0 var(--primary-accent);
  animation: ai-pre-row-pulse 1.4s ease-in-out infinite;
}
.ai-pre-table tbody tr.ai-pre-row-processing.active {
  background: linear-gradient(90deg, rgba(0, 163, 224, 0.14), rgba(15, 159, 143, 0.06));
  box-shadow: inset 3px 0 0 var(--primary-accent);
}
.ai-pre-table tbody tr.ai-pre-row-completed {
  background: #f8fdf9;
}
.ai-pre-table tbody tr.ai-pre-row-completed.active {
  background: #eefaf3;
  box-shadow: inset 3px 0 0 var(--success);
}
.ai-pre-table tbody.is-shifting tr:first-child {
  opacity: 0;
  transform: translateX(-16px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}
.ai-pre-pill-live {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.ai-pre-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--primary-accent);
  animation: ai-pre-live-dot 1.2s ease-in-out infinite;
}
@keyframes ai-pre-row-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.03); }
}
@keyframes ai-pre-live-dot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.82); }
}
.ai-pre-table td > span:not(.ai-pre-pill) {
  display: block; margin-top: 3px; color: var(--text-muted); font-size: 11px;
}
.ai-pre-score { display: flex; align-items: center; gap: 8px; min-width: 86px; }
.ai-pre-score span {
  position: relative; display: block; width: 54px; height: 8px; margin: 0;
  border-radius: 999px; background: #e5e7eb; overflow: hidden;
}
.ai-pre-score { position: relative; color: var(--primary); }
.ai-pre-score span i {
  position: absolute; left: 0; top: 0; bottom: 0; display: block; border-radius: inherit;
  background: currentColor;
}
.ai-pre-score strong { z-index: 1; font-size: 12px; }
.ai-pre-score-green { color: var(--success); }
.ai-pre-score-orange { color: var(--warning); }
.ai-pre-score-amber { color: #c45c00; }
.ai-pre-score-red { color: var(--danger); }
.ai-pre-cell-empty {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.ai-pre-pill {
  display: inline-flex; align-items: center; justify-content: center; min-width: 62px;
  height: 26px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
  border: 1px solid var(--border); white-space: nowrap;
}
.ai-pre-pill-red { color: var(--danger); background: var(--danger-light); border-color: #f3bcc8; }
.ai-pre-pill-orange { color: #9a6a00; background: var(--warning-light); border-color: #f4dc87; }
.ai-pre-pill-amber { color: #9a4500; background: #fff0e6; border-color: #f5c9a8; }
.ai-pre-pill-green { color: var(--success); background: var(--success-light); border-color: #bde5ca; }
.ai-pre-pill-blue { color: var(--primary); background: var(--primary-light); border-color: #bad0ec; }
.ai-pre-pill-gray { color: #667085; background: #f2f4f7; border-color: #dfe3ea; }
.ai-pre-detail {
  position: relative;
  padding: 0;
  min-height: 100%;
}
.ai-pre-detail-empty {
  padding: 16px;
  justify-content: center;
}
.ai-pre-detail-body {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 16px;
  overflow: hidden;
}
.ai-pre-detail-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.ai-pre-detail-head span { color: var(--text-muted); font-size: 12px; font-weight: 700; }
.ai-pre-detail-head h3 { margin: 4px 0; font-size: 20px; color: var(--text); }
.ai-pre-detail-head p { margin: 0; color: var(--text-secondary); font-size: 12px; }
.ai-pre-detail-head-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.ai-pre-detail-metric {
  display: flex;
  align-items: center;
  gap: 8px;
}
.ai-pre-detail-metric > span {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  white-space: nowrap;
}
.ai-pre-detail-pending {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 280px;
  padding: 28px 24px;
  margin-top: 8px;
  text-align: center;
  border: 1px dashed #d5deea;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fbfcff 0%, #f4f7fb 100%);
}
.ai-pre-detail-pending-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #98a2b3;
  background: #eef1f6;
}
.ai-pre-detail-pending strong {
  font-size: 16px;
  color: var(--text);
}
.ai-pre-detail-pending p {
  margin: 0;
  max-width: 280px;
  font-size: 12px;
  line-height: 1.65;
  color: var(--text-secondary);
}
.ai-pre-detail-processing {
  border-color: rgba(0, 163, 224, 0.28);
  background: linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
}
.ai-pre-detail-processing .ai-pre-detail-pending-icon {
  color: var(--primary-accent);
  background: rgba(0, 163, 224, 0.12);
  animation: ai-pre-live-dot 1.2s ease-in-out infinite;
}
.ai-pre-detail-progress {
  margin: 10px 0 12px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 163, 224, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #f7fbff 0%, #eef6ff 100%);
}
.ai-pre-detail-progress-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.ai-pre-detail-progress-head > span {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}
.ai-pre-detail-progress-track {
  height: 6px;
  border-radius: 999px;
  background: #dce8f5;
  overflow: hidden;
  margin-bottom: 6px;
}
.ai-pre-detail-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1578b8, #00a3e0);
  transition: width 0.45s ease;
}
.ai-pre-detail-progress small {
  display: block;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-secondary);
}
.ai-pre-detail-reveal {
  opacity: 0;
  transform: translateY(10px);
  max-height: 0;
  overflow: hidden;
  transition: opacity 0.38s ease, transform 0.38s ease, max-height 0.45s ease, margin 0.38s ease;
  margin: 0;
}
.ai-pre-detail-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
  max-height: 1200px;
  margin-bottom: 0;
}
.ai-pre-detail-head-metrics.is-revealed .ai-pre-score,
.ai-pre-detail-head-metrics.is-revealed .ai-pre-pill,
.ai-pre-detail-head-metrics.is-revealed .ai-pre-cell-empty {
  animation: ai-pre-metric-reveal 0.45s ease;
}
@keyframes ai-pre-metric-reveal {
  0% { opacity: 0; transform: scale(0.92); }
  100% { opacity: 1; transform: scale(1); }
}
.ai-pre-detail-finished .ai-pre-detail-reveal.is-visible {
  animation: none;
}
.ai-pre-actions.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}
.ai-pre-actions.is-disabled .btn.disabled,
.ai-pre-actions.is-disabled a.disabled {
  cursor: not-allowed;
}
.ai-pre-summary {
  margin: 14px 0; padding: 12px 14px; border-left: 4px solid var(--primary);
  background: #f6f9fe; border-radius: var(--radius);
}
.ai-pre-summary strong { display: block; font-size: 14px; margin-bottom: 4px; }
.ai-pre-summary span { color: var(--text-secondary); font-size: 12px; }
.ai-pre-conclusion-slot.is-pending .ai-pre-summary-pending {
  border-left-color: #c5d3e8;
  background: #f8fafc;
}
.ai-pre-conclusion-slot.is-pending .ai-pre-summary-pending strong { color: var(--text-muted); }
.ai-pre-conclusion-slot.is-ready .ai-pre-summary-ready {
  animation: ai-pre-conclusion-reveal 0.42s ease;
}
@keyframes ai-pre-conclusion-reveal {
  0% { opacity: 0.35; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}
.ai-pre-proof-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px;
}
.ai-pre-proof-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}
.ai-pre-proof-title { font-weight: 800; margin-bottom: 8px; }
.ai-pre-proof-card dl { display: grid; grid-template-columns: 74px 1fr; row-gap: 6px; margin: 0; font-size: 12px; }
.ai-pre-proof-card dt { color: var(--text-muted); }
.ai-pre-proof-card dd { margin: 0; color: var(--text); font-weight: 700; text-align: right; }
.ai-pre-risk-section {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 12px;
}
.ai-pre-risk-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
}
.ai-pre-risk-list.is-collapsed .ai-pre-risk-item:nth-child(n+3) {
  display: none;
}
.ai-pre-risk-list.is-collapsed {
  position: relative;
  max-height: 168px;
}
.ai-pre-risk-list.is-collapsed::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28px;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 88%);
}
.ai-pre-risk-list.is-expanded {
  overflow: auto;
  max-height: none;
}
.ai-pre-risk-list.is-expanded::after {
  display: none;
}
.ai-pre-risk-toggle {
  align-self: center;
  margin-top: 8px;
  padding: 4px 10px;
  border: none;
  background: transparent;
  color: var(--primary-accent);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}
.ai-pre-risk-toggle:hover {
  text-decoration: underline;
}
.ai-pre-risk-item {
  display: grid; grid-template-columns: 46px 1fr; gap: 10px; padding: 10px;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
}
.ai-pre-risk-item > span {
  height: 24px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; font-size: 11px; font-weight: 800;
}
.ai-pre-risk-item strong { display: block; font-size: 13px; margin-bottom: 2px; }
.ai-pre-risk-item p { margin: 0; color: var(--text-secondary); font-size: 12px; line-height: 1.5; }
.ai-pre-risk-red { border-color: #f2bfca; background: #fff7f8; }
.ai-pre-risk-red > span { color: var(--danger); background: var(--danger-light); }
.ai-pre-risk-orange { border-color: #f4dc87; background: #fffdf5; }
.ai-pre-risk-orange > span { color: #9a6a00; background: var(--warning-light); }
.ai-pre-risk-blue { border-color: #bad0ec; background: #f7fbff; }
.ai-pre-risk-blue > span { color: var(--primary); background: var(--primary-light); }
.ai-pre-risk-green { border-color: #bde5ca; background: #f8fdf9; }
.ai-pre-risk-green > span { color: var(--success); background: var(--success-light); }
.ai-pre-risk-gray { border-color: #d9dee8; background: #f8f9fb; }
.ai-pre-risk-gray > span { color: #667085; background: #eef1f6; }
.audit-detail-ai-pre-detail .ai-pre-summary {
  margin-bottom: 12px;
}
.audit-detail-pre-flow-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 4px 0 10px;
}
.audit-detail-pre-flow-title strong {
  font-size: 14px;
  color: var(--text);
}
.audit-detail-pre-flow-title span {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
}
.audit-detail-pre-flow {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.audit-detail-pre-flow-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 10px;
  border: 1px solid var(--border);
  border-left-width: 4px;
  border-radius: var(--radius);
  background: #fff;
}
.audit-detail-pre-flow-green { border-left-color: var(--success); background: #f8fdf9; }
.audit-detail-pre-flow-orange { border-left-color: #e6a817; background: #fffdf5; }
.audit-detail-pre-flow-red { border-left-color: var(--danger); background: #fff7f8; }
.audit-detail-pre-flow-gray { border-left-color: #b9c0cc; background: #fbfcfe; }
.audit-detail-pre-flow-blue { border-left-color: var(--primary-accent); background: #f7fbff; }
.audit-detail-pre-flow-main {
  min-width: 0;
}
.audit-detail-pre-flow-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.audit-detail-pre-flow-head strong {
  font-size: 13px;
  color: var(--text);
}
.audit-detail-pre-flow-head span {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}
.audit-detail-pre-flow-main p {
  margin: 0 0 6px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}
.audit-detail-pre-flow-dimension {
  margin-bottom: 6px;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(0, 94, 184, 0.07);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.45;
}
.audit-detail-pre-flow-main ul {
  margin: 0;
  padding-left: 16px;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}
.audit-detail-pre-flow-factors {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}
.audit-detail-pre-flow-factors span {
  padding: 3px 7px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}
.ai-pre-detail-bottom {
  display: grid; grid-template-columns: minmax(190px, 1fr) minmax(160px, .9fr); gap: 10px;
  margin-bottom: 12px;
  flex-shrink: 0;
}
.ai-pre-detail-bottom-single {
  grid-template-columns: 1fr;
}
.ai-pre-invoice-preview {
  min-height: 176px; position: relative; overflow: hidden; border: 1px solid #cddde9; border-radius: var(--radius);
  background:
    linear-gradient(#dceaf4 1px, transparent 1px),
    linear-gradient(90deg, #dceaf4 1px, transparent 1px),
    #fbfdff;
  background-size: 22px 22px;
  padding: 20px 16px;
}
.ai-pre-paper-lines { display: flex; flex-direction: column; gap: 9px; }
.ai-pre-paper-lines span { height: 8px; border-radius: 999px; background: #d2dfeb; }
.ai-pre-paper-meta {
  position: absolute; left: 16px; bottom: 12px; display: flex; flex-direction: column; gap: 2px;
}
.ai-pre-paper-meta strong { color: var(--primary); }
.ai-pre-paper-meta em { font-style: normal; color: var(--text-muted); font-size: 11px; }
.ai-pre-paper-meta b { color: var(--danger); }
.ai-pre-stamp {
  position: absolute;
  right: 24px;
  top: 118px;
  z-index: 4;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  border: 5px double currentColor;
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-16deg);
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 0;
  background: rgba(255,255,255,.68);
  box-shadow: inset 0 0 0 6px rgba(255,255,255,.42), 0 10px 26px rgba(16, 24, 40, .08);
  pointer-events: none;
  opacity: .9;
  mix-blend-mode: multiply;
}
.ai-pre-stamp::before {
  content: '';
  position: absolute;
  inset: 9px;
  border: 1px solid currentColor;
  border-radius: 50%;
}
.ai-pre-stamp-low {
  color: var(--success);
}
.ai-pre-stamp-medium {
  color: #b77900;
}
.ai-pre-stamp-high {
  color: var(--danger);
}
@media (max-width: 760px) {
  .ai-pre-stamp {
    right: 16px;
    top: 106px;
    width: 72px;
    height: 72px;
    font-size: 15px;
    border-width: 4px;
  }
}
.ai-pre-action-card {
  border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; background: #fff;
}
.ai-pre-action-card strong { display: block; margin-bottom: 6px; }
.ai-pre-action-card p { margin: 0 0 10px; color: var(--text-secondary); font-size: 12px; line-height: 1.6; }
.ai-pre-action-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.ai-pre-action-meta span {
  padding: 4px 8px; border-radius: 999px; background: #f2f5f8; color: var(--text-secondary); font-size: 11px;
}
.ai-pre-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  padding: 12px 16px 16px; border-top: 1px solid var(--border);
  margin-top: auto;
  flex-shrink: 0;
}

/* ===== Layout ===== */
.app-layout { display: flex; height: 100vh; }

/* Sidebar - KPMG Deep Navy */
.sidebar {
  width: var(--sidebar-width); min-width: var(--sidebar-width);
  background: linear-gradient(180deg, #001f3f 0%, #002b5c 30%, #00338D 100%);
  color: #fff; display: flex; flex-direction: column; overflow-y: auto;
  box-shadow: 2px 0 12px rgba(0,0,0,0.08);
}
.sidebar-logo {
  padding: 18px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  background: rgba(0,0,0,0.12);
}
.sidebar-brand-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
  text-align: left;
}
.sidebar-brand-name {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 1px;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
}
.sidebar-brand-desc {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0;
  color: rgba(255,255,255,0.78);
  line-height: 1.3;
}
.sidebar-logo .icon { font-size: 20px; margin-right: 6px; }

/* ===== KPMG Brand Elements ===== */
.kpmg-brand {
  display: inline-block; font-size: 28px; font-weight: 900; letter-spacing: 2px;
  color: var(--primary); font-family: "Segoe UI", "Arial", sans-serif;
}
.kpmg-brand-sm {
  font-size: 17px; font-weight: 900; letter-spacing: 1.5px;
  color: var(--cyan); font-family: "Segoe UI", "Arial", sans-serif;
}
.sidebar-logo .kpmg-brand-sm {
  flex: 0 0 auto;
  align-self: center;
}
.sidebar-logo .logo-divider {
  flex: 0 0 auto;
  align-self: stretch;
  width: 1px;
  height: auto;
  min-height: 30px;
  margin: 0 10px;
  background: rgba(255,255,255,0.2);
}
.logo-divider {
  display: inline-block; width: 1px; height: 16px; background: rgba(255,255,255,0.2);
  margin: 0 10px; vertical-align: middle;
}

/* Bell icon (SVG-like) */
.bell-icon {
  display: inline-block; width: 16px; height: 16px;
  background: currentColor; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z'/%3E%3C/svg%3E") no-repeat center;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 22c1.1 0 2-.9 2-2h-4c0 1.1.9 2 2 2zm6-6v-5c0-3.07-1.63-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.64 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z'/%3E%3C/svg%3E") no-repeat center;
  mask-size: contain; -webkit-mask-size: contain;
  color: var(--text-secondary);
}
.sidebar-nav { flex: 1; padding: 8px 0; }
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 12px 24px;
  color: rgba(255,255,255,0.65); cursor: pointer; transition: all 0.2s;
  font-size: 14px; border-left: 3px solid transparent;
  letter-spacing: 0.3px; margin: 2px 0;
}
.nav-item:hover {
  color: #fff; background: rgba(255,255,255,0.06);
  border-left-color: rgba(255,255,255,0.3);
}
.nav-item.active {
  color: #fff; background: rgba(0,163,224,0.18);
  border-left-color: var(--cyan);
}
.nav-item .badge { margin-left: auto; }
.main-area { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

/* Header */
.header {
  position: relative;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  padding: 0 28px 0 0;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  z-index: 10;
  background: var(--bg-white);
}
.header-slogan {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 0 240px 0 28px;
  overflow: hidden;
  border: none;
  border-radius: 0;
  background:
    linear-gradient(90deg, rgba(0, 51, 141, 0.08) 0%, rgba(0, 163, 224, 0.08) 45%, rgba(255, 255, 255, 0.92) 100%),
    repeating-linear-gradient(135deg, rgba(0, 94, 184, 0.07) 0 1px, transparent 1px 9px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.82);
  white-space: nowrap;
}
.header-slogan::after {
  content: '';
  position: absolute;
  top: -28px;
  right: -20px;
  width: 118px;
  height: 82px;
  border: 1px solid rgba(0, 94, 184, 0.12);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 163, 224, 0.12), rgba(0, 163, 224, 0));
  pointer-events: none;
}
.slogan-mark {
  position: relative;
  z-index: 1;
  display: inline-flex;
  flex: 0 0 30px;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 5px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-accent) 62%, var(--cyan) 100%);
  box-shadow: 0 5px 12px rgba(0, 51, 141, 0.22);
}
.slogan-mark::before,
.slogan-mark::after,
.slogan-mark i {
  content: '';
  position: absolute;
  border-radius: 2px;
  background: #fff;
}
.slogan-mark::before {
  width: 12px;
  height: 8px;
  top: 8px;
  left: 7px;
  opacity: 0.95;
}
.slogan-mark::after {
  width: 15px;
  height: 3px;
  right: 6px;
  bottom: 8px;
  transform: rotate(-35deg);
}
.slogan-mark i {
  width: 5px;
  height: 13px;
  right: 8px;
  top: 7px;
  opacity: 0.82;
}
.slogan-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1px;
  min-width: 0;
}
.slogan-copy strong {
  overflow: hidden;
  color: #08204a;
  font-family: "Segoe UI Semibold", "Microsoft YaHei", var(--font);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.22;
  text-overflow: ellipsis;
}
.slogan-copy em {
  overflow: hidden;
  color: var(--primary-accent);
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 1.5px;
  line-height: 1;
  text-transform: uppercase;
  text-overflow: ellipsis;
}
.header-right {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
  padding: 0;
  background: transparent;
}
.header-notify {
  position: relative; cursor: pointer; font-size: 17px; color: var(--text-secondary);
  padding: 6px; border-radius: 8px; transition: background 0.2s;
}
.header-notify:hover { background: var(--bg); }
.header-notify .dot {
  position: absolute; top: 4px; right: 4px; width: 8px; height: 8px;
  background: var(--danger); border-radius: 50%; border: 2px solid #fff;
}
.user-dropdown {
  display: flex; align-items: center; gap: 8px; cursor: pointer;
  padding: 5px 10px; border-radius: var(--radius); transition: background 0.2s;
}
.user-dropdown:hover { background: var(--bg); }
.user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; box-shadow: 0 2px 6px rgba(0,51,141,0.2);
}
.user-name { font-size: 13px; font-weight: 500; color: var(--text); }
.user-dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: 100%; right: 0; margin-top: 8px;
  background: #fff; border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  min-width: 150px; padding: 4px 0; z-index: 100; display: none;
  border: 1px solid var(--border);
}
.dropdown-menu.show { display: block; }
.dropdown-item {
  padding: 10px 16px; cursor: pointer; font-size: 13px;
  transition: background 0.2s; display: flex; align-items: center; gap: 8px;
}
.dropdown-item:hover { background: var(--bg); }

.content { flex: 1; padding: 24px 28px; overflow-y: auto; background: var(--bg); }

@media (max-width: 760px) {
  .header {
    padding-right: 16px;
  }
  .header-slogan {
    padding-right: 150px;
  }
  .slogan-copy strong {
    font-size: 12px;
  }
  .slogan-copy em {
    display: none;
  }
  .header-right {
    gap: 10px;
    flex-shrink: 0;
  }
}

/* ===== Cards & Containers ===== */
.page-title {
  font-size: 22px; font-weight: 700; margin-bottom: 22px;
  color: var(--primary); letter-spacing: 0.3px;
}
.card {
  background: var(--bg-white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 22px; margin-bottom: 18px;
  border: 1px solid var(--border);
}
.card-title {
  font-size: 16px; font-weight: 700; margin-bottom: 16px; color: var(--text);
  letter-spacing: 0.2px;
}

/* Stats */
.stat-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 22px; }
.stat-row.stat-row-5 { grid-template-columns: repeat(5, 1fr); }
.stat-row.stat-row-5 .stat-card:nth-child(4) { border-top: 3px solid var(--danger); }
.stat-row.stat-row-5 .stat-card:nth-child(5) { border-top: 3px solid var(--warning); }
.stat-row.stat-row-4 { grid-template-columns: repeat(4, 1fr); }
.stat-row.stat-row-6 { grid-template-columns: repeat(6, 1fr); }
.stat-row.stat-row-3 { grid-template-columns: repeat(3, 1fr); }
.stat-card-reject-mix { border-top: 3px solid var(--danger); }
.stat-card {
  background: var(--bg-white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 22px;
  display: flex; flex-direction: column; gap: 8px;
  border: 1px solid var(--border); transition: box-shadow 0.2s;
}
.stat-card:hover { box-shadow: var(--shadow); }
.queue-status-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.queue-status-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-height: 72px;
  padding: 14px 16px 14px 18px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  width: 100%;
  font: inherit;
  appearance: none;
  box-shadow: none;
  overflow: hidden;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.queue-status-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.18s ease;
}
.queue-status-card:hover {
  border-color: rgba(0, 94, 184, 0.28);
  background: #fafbfd;
}
.queue-status-card.active {
  border-color: rgba(0, 51, 141, 0.32);
  background: linear-gradient(105deg, rgba(0, 94, 184, 0.07) 0%, #fff 58%);
}
.queue-status-card.active::before {
  background: var(--primary);
}
.queue-status-card-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.queue-status-card-value {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  letter-spacing: -0.02em;
}
.queue-status-card.active .queue-status-card-value {
  color: var(--primary);
}
.queue-status-card.queue-status-pending.active .queue-status-card-value { color: #c98700; }
.queue-status-card.queue-status-pending.active::before { background: #e6a817; }
.queue-status-card.queue-status-reviewing.active .queue-status-card-value { color: #0077b6; }
.queue-status-card.queue-status-reviewing.active::before { background: #00a3e0; }
.queue-status-card.queue-status-done.active .queue-status-card-value { color: #2d8c4a; }
.queue-status-card.queue-status-done.active::before { background: #2d8c4a; }
.stat-card .label { font-size: 13px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.5px; }
.stat-card .value { font-size: 30px; font-weight: 700; color: var(--text); letter-spacing: -0.5px; }
.stat-card .desc { font-size: 12px; color: var(--text-muted); margin-top: 6px; display: block; }
.stat-value-frac { display: inline-flex; align-items: baseline; gap: 2px; }
.stat-frac-pending { color: var(--primary); font-size: 30px; font-weight: 700; }
.stat-frac-sep { color: var(--text-muted); font-size: 22px; font-weight: 500; }
.stat-frac-total { color: var(--text-secondary); font-size: 26px; font-weight: 600; }
.stat-card-audit-mix { border-top: 3px solid var(--primary); }
.stat-card-rate-mix .stat-frac-pending { font-size: 26px; }
.stat-card-rate-mix .stat-frac-total { font-size: 22px; color: var(--text-muted); }
.stat-card:nth-child(1) { border-top: 3px solid var(--primary); }
.stat-card:nth-child(1) .value { color: var(--primary); }
.stat-card:nth-child(2) { border-top: 3px solid var(--warning); }
.stat-card:nth-child(2) .value { color: var(--warning); }
.stat-card:nth-child(3) { border-top: 3px solid var(--success); }
.stat-card:nth-child(3) .value { color: var(--success); }
.stat-card:nth-child(4) { border-top: 3px solid var(--cyan); }
.stat-card:nth-child(4) .value { color: var(--cyan); }

.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-bottom: 22px; }
.chart-card {
  background: var(--bg-white); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: 22px; border: 1px solid var(--border);
}

/* ===== Table ===== */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
table th, table td {
  padding: 11px 16px; text-align: left; border-bottom: 1px solid var(--border-light);
  font-size: 13px;
}
table th {
  background: #f8f9fb; font-weight: 700; color: var(--text-secondary);
  white-space: nowrap; text-transform: uppercase; font-size: 11px;
  letter-spacing: 0.5px; border-bottom: 2px solid var(--border);
}
table tbody tr { transition: background 0.15s; }
table tbody tr:hover { background: #f8f9fb; }
table tbody tr:last-child td { border-bottom: none; }

/* ===== Tags ===== */
.tag {
  display: inline-block; padding: 3px 10px; border-radius: 4px; font-size: 12px;
  font-weight: 600; white-space: nowrap; letter-spacing: 0.2px;
}
.tag-blue { background: var(--info-light); color: var(--primary-accent); }
.tag-green { background: var(--success-light); color: var(--success); }
.tag-orange { background: var(--warning-light); color: #b8860b; }
.tag-red { background: var(--danger-light); color: var(--danger); }
.tag-purple { background: #f3e8f7; color: #6D2077; }
.tag-default { background: #f2f3f5; color: #666; }

/* ===== Badge ===== */
.badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px;
  font-size: 11px; font-weight: 700; color: #fff;
  background: var(--cyan); box-shadow: 0 1px 3px rgba(0,163,224,0.3);
}

/* ===== Tabs ===== */
.tabs {
  display: flex; gap: 0; border-bottom: 2px solid var(--border);
  margin-bottom: 18px;
}
.rules-tabs {
  align-items: center;
  justify-content: space-between;
}
.rules-tab-list {
  display: flex;
  align-items: center;
  gap: 0;
}
.rules-tab-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.tab-item {
  padding: 11px 22px; cursor: pointer; font-size: 14px; font-weight: 500;
  color: var(--text-muted); border-bottom: 2px solid transparent;
  margin-bottom: -2px; transition: all 0.2s;
  display: flex; align-items: center; gap: 6px; letter-spacing: 0.2px;
}
.tab-item:hover { color: var(--primary-accent); background: rgba(0,51,141,0.03); }
.tab-item.active {
  color: var(--primary); border-bottom-color: var(--primary);
  font-weight: 700;
}

/* ===== Progress Bar ===== */
.progress-bar {
  height: 6px; background: #eef0f4; border-radius: 3px; overflow: hidden;
  width: 120px;
}
.progress-bar-fill { height: 100%; border-radius: 3px; transition: width 0.5s ease; }
.progress-bar-fill.danger { background: linear-gradient(90deg, #c41230, #e84855); }
.progress-bar-fill.warning { background: linear-gradient(90deg, #e6a817, #f0c040); }
.progress-bar-fill.success { background: linear-gradient(90deg, #2d8c4a, #45b860); }

/* ===== Progress Circle ===== */
.progress-circle {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
}
.progress-circle svg { transform: rotate(-90deg); }
.progress-circle .percent {
  position: absolute; font-size: 16px; font-weight: 700;
}

/* ===== Search Bar ===== */
.search-bar {
  display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; align-items: center;
}
.search-input {
  padding: 9px 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
  width: 260px; transition: all 0.2s; background: #fafbfc;
}
.search-input:focus {
  border-color: var(--primary-accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(0,94,184,0.08);
}
.search-select {
  padding: 9px 14px; border: 1.5px solid var(--border); border-radius: var(--radius);
  background: #fafbfc; cursor: pointer;
}

/* ===== Alert ===== */
.alert {
  padding: 13px 18px; border-radius: var(--radius); font-size: 13px;
  margin-bottom: 18px; display: flex; align-items: flex-start; gap: 10px;
  border-left: 4px solid;
}
.alert-info { background: var(--info-light); border-color: var(--primary-accent); color: #003366; }
.alert-warning { background: var(--warning-light); border-color: var(--warning); color: #7a5a00; }
.alert-danger { background: var(--danger-light); border-color: var(--danger); color: #8b0a1e; }
.alert-success { background: var(--success-light); border-color: var(--success); color: #1a5c2e; }

/* ===== Charts ===== */
.bar-chart {
  display: flex; align-items: flex-end; gap: 16px; height: 200px; padding-top: 20px;
}
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bar-col .bar {
  width: 100%; max-width: 52px; border-radius: 6px 6px 0 0;
  transition: height 0.6s ease;
}
.bar-col .bar.primary {
  background: linear-gradient(180deg, #00338D, #005EB8);
}
.bar-col .bar.info {
  background: linear-gradient(180deg, #00A3E0, #5cc8f0);
}
.bar-col .label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.bar-col .val { font-size: 12px; font-weight: 700; color: var(--text-secondary); }

.stacked-bar-chart {
  display: flex; align-items: flex-end; gap: 16px; height: 200px; padding-top: 20px;
}
.stacked-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.stacked-col .stack { width: 100%; max-width: 52px; display: flex; flex-direction: column; justify-content: flex-end; }
.stacked-col .stack-seg { width: 100%; }
.stacked-col .stack-seg.green { background: #2d8c4a; }
.stacked-col .stack-seg.orange { background: #e6a817; }
.stacked-col .stack-seg.red { background: #c41230; }
.stacked-col .stack-seg:first-child { border-radius: 6px 6px 0 0; }
.stacked-col .stack-seg:last-child { border-radius: 0 0 6px 6px; }
.stacked-col .stack-seg:only-child { border-radius: 6px; }
.stacked-col .label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.stacked-col .val { font-size: 12px; font-weight: 700; color: var(--text-secondary); }

/* ===== Descriptions ===== */
.desc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.desc-item {
  padding: 13px 18px; border-bottom: 1px solid var(--border-light); display: flex;
}
.desc-label { color: var(--text-muted); min-width: 80px; font-size: 13px; font-weight: 500; }
.desc-value { color: var(--text); font-size: 13px; flex: 1; font-weight: 500; }
.desc-item:nth-child(odd) { border-right: 1px solid var(--border-light); }
.desc-item:last-child, .desc-item:nth-last-child(2) { border-bottom: none; }

/* ===== Collapse / Accordion ===== */
.collapse {
  border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px;
  overflow: hidden; background: #fff;
}
.collapse-header {
  padding: 13px 18px; background: #fafbfc; cursor: pointer; display: flex;
  align-items: center; justify-content: space-between; font-weight: 600;
  font-size: 14px; transition: background 0.2s; letter-spacing: 0.2px;
}
.collapse-header:hover { background: #f0f3f7; }
.collapse-header .arrow { transition: transform 0.3s; font-size: 12px; }
.collapse.open .collapse-header .arrow { transform: rotate(180deg); }
.collapse-body { padding: 16px 18px; display: none; }
.collapse.open .collapse-body { display: block; }
.collapse-danger { border-left: 4px solid var(--danger); }
.collapse-warning { border-left: 4px solid var(--warning); }
.collapse-info { border-left: 4px solid var(--primary-accent); }
.collapse-danger .collapse-header { background: #fef8f9; }
.collapse-warning .collapse-header { background: #fefcf6; }
.collapse-info .collapse-header { background: #f6f9fd; }

/* ===== Timeline ===== */
.timeline { padding-left: 8px; }
.timeline-item {
  display: flex; gap: 14px; padding-bottom: 18px; position: relative;
}
.timeline-item::before {
  content: ''; width: 10px; height: 10px; border-radius: 50%; min-width: 10px;
  margin-top: 4px; background: var(--primary-accent);
  box-shadow: 0 0 0 3px rgba(0,94,184,0.12);
}
.timeline-item .tl-content { flex: 1; }
.timeline-item .tl-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.timeline-item .tl-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,20,50,0.5); display: flex; align-items: center;
  justify-content: center; z-index: 1000;
  backdrop-filter: blur(2px);
}
.modal {
  background: #fff; border-radius: 12px; padding: 28px; width: 540px;
  max-width: 92vw; box-shadow: 0 16px 48px rgba(0,20,60,0.25);
  max-height: 80vh; overflow-y: auto;
}
.modal.modal-wide { width: 620px; }
.rule-edit-row:hover { background: rgba(0, 51, 141, 0.04); }
.rules-layer-table {
  table-layout: fixed;
}
.rules-layer-table .rules-col-id { width: 120px; }
.rules-layer-table .rules-col-name { width: 180px; }
.rules-layer-table .rules-col-desc { width: auto; }
.rules-layer-table .rules-col-scene { width: 105px; }
.rules-layer-table .rules-col-points { width: 105px; }
.rules-layer-table .rules-col-enabled { width: 78px; }
.rules-layer-table .rules-col-action { width: 88px; }
.rules-layer-table th,
.rules-layer-table td {
  vertical-align: middle;
}
.rules-layer-table td:nth-child(3) {
  white-space: normal;
  line-height: 1.45;
}
.modal-title { font-size: 17px; font-weight: 700; margin-bottom: 18px; color: var(--primary); }
.modal-body { margin-bottom: 22px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 12px; }

/* ===== Invoice Card ===== */
.invoice-cards { display: flex; flex-wrap: wrap; gap: 12px; }
.invoice-card {
  width: 185px; padding: 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: all 0.2s;
  display: flex; align-items: center; gap: 10px; background: #fafbfc;
}
.invoice-card:hover {
  border-color: var(--primary-accent);
  box-shadow: 0 4px 12px rgba(0,51,141,0.08);
  transform: translateY(-1px);
}
.invoice-icon {
  width: 42px; height: 42px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; font-size: 20px; flex-shrink: 0;
}
.invoice-icon.flight { background: #e6f0fd; }
.invoice-icon.train { background: #fef8ed; }
.invoice-icon.hotel { background: #eaf6ee; }
.invoice-icon.taxi { background: #f3eaf7; }
.invoice-icon.food { background: #fde8ec; }
.invoice-info { font-size: 12px; }
.invoice-info .amt { font-weight: 700; color: var(--danger); font-size: 14px; }
.invoice-info .type { color: var(--text-muted); font-size: 11px; font-weight: 500; }

/* ===== Switch Toggle ===== */
.switch { position: relative; display: inline-block; width: 46px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
  background: #c8ccd4; border-radius: 24px; transition: 0.3s;
}
.switch .slider::before {
  content: ''; position: absolute; height: 20px; width: 20px; left: 2px; bottom: 2px;
  background: #fff; border-radius: 50%; transition: 0.3s; box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(22px); }

/* ===== Result Page ===== */
.result-page { text-align: center; padding: 60px 20px; }
.result-icon { font-size: 64px; margin-bottom: 16px; }
.result-page h2 { font-size: 24px; margin-bottom: 10px; color: var(--primary); font-weight: 700; }
.result-page p { color: var(--text-secondary); margin-bottom: 24px; font-size: 14px; }

/* ===== Misc ===== */
.rule-card-header {
  padding: 11px 18px; border-radius: var(--radius) var(--radius) 0 0;
  color: #fff; font-weight: 700; font-size: 14px; letter-spacing: 0.3px;
}
.rule-card-header.danger { background: var(--danger); }
.rule-card-header.warning { background: var(--warning); color: #4a3a00; }
.rule-card-header.info { background: var(--primary-accent); }
.rule-card-body {
  border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius); padding: 0;
  margin-bottom: 18px; background: #fff;
}
.rule-card-body .table-wrap { border: none; border-radius: 0; }
.rules-import-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 12px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.rules-import-hint { font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.rules-import-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.rules-import-modal-wrap { width: 640px; max-width: calc(100vw - 32px); }
.rules-import-modal { display: flex; flex-direction: column; gap: 16px; }
.rules-import-info.card-lite {
  padding: 14px 16px;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.rules-import-info strong { display: block; margin-bottom: 8px; font-size: 14px; color: var(--primary); }
.rules-import-info ul { margin: 0; padding-left: 18px; color: var(--text-secondary); font-size: 13px; line-height: 1.65; }
.rules-import-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.rules-import-meta-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
}
.rules-import-meta-item span { color: var(--text-muted); }
.rules-import-meta-item b { color: var(--text); font-weight: 600; }
.rules-import-file-zone {
  padding: 14px 16px;
  border: 1px dashed #c5d3e8;
  border-radius: 8px;
  background: #fbfdff;
}
.rules-import-file-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  font-size: 13px;
}
.rules-import-file-head strong { color: var(--text); }
.rules-import-file-head span { color: var(--text-muted); }
.rules-import-file-input { display: none; }
.rules-import-file-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.rules-import-file-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 160px;
  overflow: auto;
}
.rules-import-file-list li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
}
.rules-import-file-list li + li { margin-top: 8px; }
.rules-import-file-empty { grid-template-columns: 1fr; color: var(--text-muted); justify-content: center; text-align: center; }
.rules-import-file-index {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #eef4ff;
  color: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}
.rules-import-file-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rules-import-file-size { color: var(--text-muted); font-size: 12px; white-space: nowrap; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.clickable { color: var(--primary-accent); cursor: pointer; font-weight: 500; }
.clickable:hover { color: var(--primary); text-decoration: underline; }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mb-8 { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.empty-state-loading {
  min-height: 120px;
  padding: 0;
}
.text-center { text-align: center; }
.text-right { text-align: right; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-center { display: flex; align-items: center; }
.gap-8 { gap: 8px; }
.gap-16 { gap: 16px; }
.summary-tags { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ===== Voucher Thumbnails ===== */
.voucher-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 12px; }
.voucher-thumb {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: all 0.2s;
  background: #fff; box-shadow: var(--shadow-sm);
}
.voucher-thumb:hover {
  border-color: var(--primary-accent);
  box-shadow: 0 6px 16px rgba(0,51,141,0.1);
  transform: translateY(-2px);
}
.voucher-img {
  height: 105px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 4px; position: relative;
}
.voucher-img::after {
  content: '点击查看'; position: absolute; bottom: 5px; right: 8px;
  font-size: 10px; color: rgba(0,0,0,0.25); font-weight: 500;
}
.voucher-icon { font-size: 34px; }
.voucher-label { font-size: 11px; font-weight: 600; opacity: 0.6; letter-spacing: 0.3px; }
.voucher-name {
  padding: 8px 10px 2px; font-size: 12px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text);
}
.voucher-meta { padding: 0 10px 8px; font-size: 11px; color: var(--text-muted); }

/* ===== Voucher Detail Modal ===== */
.voucher-modal-body { text-align: center; }
.voucher-modal-img {
  width: 100%; max-height: 400px; border-radius: var(--radius);
  border: 1px solid var(--border); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  padding: 60px 20px; margin-bottom: 16px;
}
.voucher-modal-img .voucher-big-icon { font-size: 80px; }
.voucher-modal-img .voucher-big-label { font-size: 18px; color: var(--text-secondary); font-weight: 500; }
.voucher-modal-img .voucher-big-hint { font-size: 13px; color: var(--text-muted); }
.voucher-modal-info { text-align: left; }
.voucher-modal-info .desc-grid { margin-top: 8px; }

/* ===== PS Check Cards ===== */
.ps-check-card {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  margin-bottom: 12px; overflow: hidden; transition: all 0.2s; background: #fff;
}
.ps-check-card:hover { border-color: var(--primary-accent); box-shadow: var(--shadow-sm); }
.ps-check-card.ps-clean { border-left: 4px solid var(--success); }
.ps-check-card.ps-suspicious { border-left: 4px solid var(--warning); }
.ps-check-card.ps-tampered { border-left: 4px solid var(--danger); }
.ps-check-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 18px; gap: 16px; flex-wrap: wrap; cursor: pointer;
  transition: background 0.15s;
}
.ps-check-card.ps-clean .ps-check-header { background: #fafcfa; }
.ps-check-card.ps-suspicious .ps-check-header { background: #fefcf6; }
.ps-check-card.ps-tampered .ps-check-header { background: #fef8f9; }
.ps-check-invoice { display: flex; align-items: center; gap: 10px; }
.ps-inv-type { font-size: 13px; font-weight: 600; }
.ps-inv-amt { font-size: 15px; font-weight: 700; color: var(--danger); }
.ps-check-summary { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ps-check-details { border-top: 1px solid var(--border-light); padding: 0; }
.ps-check-table { width: 100%; }
.ps-check-thead {
  display: grid; grid-template-columns: 1.2fr 0.7fr 0.5fr 2.2fr;
  padding: 9px 18px; background: #f8f9fb; font-size: 11px; font-weight: 700;
  color: var(--text-secondary); gap: 8px; text-transform: uppercase;
  letter-spacing: 0.5px;
}
.ps-check-row {
  display: grid; grid-template-columns: 1.2fr 0.7fr 0.5fr 2.2fr;
  padding: 9px 18px; font-size: 12px; align-items: center;
  border-bottom: 1px solid #f5f6f8; gap: 8px;
}
.ps-check-row:last-child { border-bottom: none; }
.ps-check-row:hover { background: #fafbfc; }
.ps-check-name { font-weight: 600; }
.ps-check-detail {
  color: var(--text-muted); font-size: 11px; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

/* ===== Voucher Image Preview (Big) ===== */
.image-preview-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,20,50,0.6); display: flex; align-items: center;
  justify-content: center; z-index: 2000; cursor: pointer;
  backdrop-filter: blur(2px);
}
.image-preview-content {
  background: #fff; border-radius: 16px; padding: 28px; max-width: 720px;
  width: 92vw; max-height: 90vh; overflow-y: auto; cursor: default;
  box-shadow: 0 24px 64px rgba(0,20,60,0.3);
}
.image-preview-content .preview-img-area {
  width: 100%; height: 320px; border-radius: var(--radius);
  border: 1px solid var(--border); display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px;
  margin-bottom: 18px;
}
.image-preview-content .preview-big-icon { font-size: 80px; }
.image-preview-content .preview-title { font-size: 17px; font-weight: 700; color: var(--text); }
.image-preview-content .preview-subtitle { font-size: 13px; color: var(--text-muted); }
.image-preview-close {
  position: absolute; top: 12px; right: 16px; font-size: 20px; cursor: pointer;
  color: var(--text-muted); background: none; border: none;
}
.image-preview-close:hover { color: var(--text); }

/* ===== Toast Notification ===== */
.toast {
  position: fixed; top: 24px; left: 50%;
  transform: translateX(-50%) translateY(-120px);
  padding: 13px 30px; border-radius: var(--radius); font-size: 14px; font-weight: 600;
  z-index: 3000; opacity: 0; transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(0,0,0,0.12); pointer-events: none;
  letter-spacing: 0.2px;
}
.toast.toast-show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-success { background: #fff; color: var(--success); border: 1.5px solid #b7e4c7; }
.toast-info { background: #fff; color: var(--primary-accent); border: 1.5px solid #c4d8f0; }
.toast-warning { background: #fff; color: #b8860b; border: 1.5px solid #f0d880; }
.toast-error { background: #fff; color: var(--danger); border: 1.5px solid #f0b8c0; }

/* ===== System Integration ===== */
.system-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 16px;
}
.system-card {
  border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  background: #fff; transition: all 0.2s; overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.system-card:hover {
  border-color: var(--primary-accent);
  box-shadow: 0 6px 20px rgba(0,51,141,0.08);
  transform: translateY(-1px);
}
.sys-card-header {
  display: flex; align-items: center; gap: 12px; padding: 15px 18px;
  border-bottom: 1px solid var(--border-light); background: #fafbfc;
}
.sys-icon { font-size: 30px; flex-shrink: 0; }
.sys-info { flex: 1; min-width: 0; }
.sys-name { font-size: 14px; font-weight: 700; color: var(--text); }
.sys-version { font-size: 11px; color: var(--text-muted); margin-top: 3px; }
.sys-status { display: flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.sys-status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.sys-status-dot.green { background: var(--success); box-shadow: 0 0 8px rgba(45,140,74,0.4); }
.sys-status-dot.orange { background: var(--warning); box-shadow: 0 0 8px rgba(230,168,23,0.4); animation: pulse-dot 1.5s infinite; }
.sys-status-dot.red { background: var(--danger); box-shadow: 0 0 8px rgba(196,18,48,0.4); }
@keyframes pulse-dot { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.sys-card-body { padding: 14px 18px; }
.sys-desc {
  font-size: 12px; color: var(--text-secondary); margin-bottom: 12px;
  line-height: 1.6;
}
.sys-endpoint { margin-bottom: 10px; display: flex; flex-direction: column; gap: 4px; }
.sys-endpoint .desc-label { font-size: 11px; }
.sys-endpoint code {
  font-size: 11px; background: #f4f6f9; padding: 3px 10px; border-radius: 4px;
  color: var(--text-secondary); word-break: break-all;
}
.sys-meta {
  display: flex; flex-direction: column; gap: 3px; font-size: 11px;
  color: var(--text-muted);
}
.sys-card-footer {
  padding: 12px 18px; border-top: 1px solid var(--border-light);
  display: flex; gap: 8px; justify-content: flex-end; background: #fafbfc;
}
.sys-card-footer .btn { font-size: 11px; padding: 5px 12px; }

/* ===== Flow Chart — 横向箭头，自动换行（无横向滚动） ===== */
.flow-chart {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px 8px;
  overflow: visible;
  padding: 16px 8px;
  width: 100%;
  max-width: 100%;
}
.flow-chart-wrap { min-height: 0; }
.flow-segment {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 150px;
  min-width: 0;
  max-width: 100%;
}
.flow-segment .flow-step {
  flex: 1 1 auto;
  min-width: 96px;
  max-width: none;
  width: 100%;
}
.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 10px;
  border-radius: 10px;
  position: relative;
  transition: transform 0.2s, opacity 0.3s;
  box-sizing: border-box;
}
.flow-step:hover { transform: translateY(-2px); }
.flow-step.source { background: linear-gradient(135deg, #e6f0fd, #cddff5); }
.flow-step.bridge { background: linear-gradient(135deg, #fef8ed, #faeac8); }
.flow-step.platform { background: linear-gradient(135deg, #eef3fa, #d8e4f8); }
.flow-step-num {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(0, 51, 141, 0.3);
}
.flow-step-name { font-size: 12px; font-weight: 700; color: var(--text); margin-bottom: 3px; line-height: 1.3; }
.flow-step-system { font-size: 10px; color: var(--primary-accent); margin-bottom: 5px; font-weight: 600; line-height: 1.3; }
.flow-step-desc { font-size: 10px; color: var(--text-muted); line-height: 1.45; }
.flow-segment .flow-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--primary-accent);
  padding: 0 2px;
  margin-top: 0;
  flex: 0 0 auto;
  align-self: center;
  font-weight: bold;
  line-height: 1;
}
.flow-step-dim { opacity: 0.45; filter: grayscale(0.15); }
.flow-runtime-badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  z-index: 2;
}
.flow-step.runtime-pass .flow-runtime-badge { color: var(--success); border: 2px solid var(--success); }
.flow-step.runtime-fail .flow-runtime-badge { color: var(--danger); border: 2px solid var(--danger); }
.flow-step.runtime-warn .flow-runtime-badge { color: #b8860b; border: 2px solid #e6a817; }
.flow-step.runtime-skip .flow-runtime-badge { color: #9aa3b2; border: 2px solid #c5cad3; }
.flow-step.runtime-running {
  box-shadow: 0 0 0 2px var(--primary-accent);
  animation: pipeline-pulse 1s ease-in-out infinite;
}
.flow-step.runtime-pending .flow-runtime-badge { color: #9aa3b2; border: 2px solid #dde1e8; }
.flow-sub-steps { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.flow-sub-tag {
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #eef0f4;
  color: var(--text-muted);
}
.flow-sub-tag.fail { background: #fde8ec; color: var(--danger); }
.flow-legend-note { color: var(--text-muted); font-weight: 400; font-size: 11px; }

.flow-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 24px;
  justify-content: center;
  margin-top: 12px;
  font-size: 12px;
  font-weight: 500;
}
.flow-legend span { display: flex; align-items: center; gap: 8px; }
.flow-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.flow-dot.source { background: #cddff5; }
.flow-dot.bridge { background: #faeac8; }
.flow-dot.platform { background: #d8e4f8; }

.flow-align-hint { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; }
.flow-align-hint a { color: var(--primary-accent); font-weight: 600; }

.e2e-history-card { margin-top: 0; }
.e2e-voucher-history { padding: 4px 0 8px; }
.e2e-voucher-history-border {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}
.e2e-voucher-history-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.e2e-voucher-history-title { font-size: 14px; font-weight: 600; color: var(--text); }
.e2e-voucher-history-meta { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.e2e-history-card .pipeline-summary { margin-top: 12px; }
.e2e-sim-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  margin-left: 6px;
  border-radius: 8px;
  background: #f4f0ff;
  color: #6b4fc7;
  vertical-align: middle;
}

@media (max-width: 640px) {
  .flow-segment { flex: 1 1 100%; justify-content: center; }
  .flow-segment .flow-step { max-width: 280px; }
  .flow-step-desc { font-size: 9px; }
}
@media (max-width: 480px) {
  .flow-segment .flow-step { min-width: 0; }
  .flow-step-system { display: none; }
}

/* ===== Health Monitor ===== */
.health-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 14px;
}
.health-card {
  border: 1.5px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; background: #fff; transition: box-shadow 0.2s;
}
.health-card:hover { box-shadow: var(--shadow); }
.health-header {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 13px; font-weight: 600; margin-bottom: 12px;
}
.health-latency {
  font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 12px;
}
.health-latency.good { background: #eaf7ee; color: var(--success); }
.health-latency.warn { background: #fef9e7; color: #b8860b; }
.health-latency.bad { background: #fde8ec; color: var(--danger); }
.health-bar-wrap {
  height: 6px; background: #eef0f4; border-radius: 3px; overflow: hidden;
  margin-bottom: 10px;
}
.health-bar { height: 100%; border-radius: 3px; transition: width 0.8s ease; }
.health-meta {
  display: flex; justify-content: space-between; font-size: 11px;
  color: var(--text-muted); font-weight: 500;
}

/* ===== Dashboard Animations ===== */
@keyframes cardEnter {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: 200px 0; }
}
@keyframes countUp {
  from { opacity: 0; transform: scale(0.6); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes barGrow {
  from { height: 0; opacity: 0; }
  to   { opacity: 1; }
}

.card-enter {
  animation: cardEnter 0.6s ease both;
  animation-delay: var(--enter-delay, 0s);
}

/* ===== Counter Animation ===== */
.counter {
  display: inline-block;
  animation: countUp 0.6s ease-out both;
  animation-delay: var(--enter-delay, 0s);
}

/* ===== Live Stat Update Animation ===== */
@keyframes statPulse {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.08); color: var(--primary-accent); }
  100% { transform: scale(1); }
}
.stat-updated {
  animation: statPulse 0.5s ease;
}

/* Stat value transition */
.stat-card .value {
  transition: color 0.3s ease;
}

/* ===== Insight Panel ===== */
.insight-panel {
  background: linear-gradient(135deg, #f0f5ff 0%, #e8f0fe 50%, #f8f9fb 100%);
  border: 1.5px solid #c5d5f0;
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}
.insight-panel::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  animation: shimmer 3s infinite;
}
.insight-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.insight-icon { font-size: 22px; }
.insight-title {
  font-size: 16px; font-weight: 700; color: var(--primary);
  letter-spacing: 0.3px;
}
.insight-badge {
  display: inline-flex; align-items: center;
  padding: 2px 10px; border-radius: 10px; font-size: 10px;
  font-weight: 700; color: #fff; background: var(--primary-accent);
  letter-spacing: 0.5px;
}
.insight-badge.pulse { animation: pulse 2s infinite; }

/* ===== Insight Carousel ===== */
.insight-carousel {
  position: relative; min-height: 56px;
  overflow: hidden;
}
.insight-slide {
  position: absolute; top: 0; left: 0; right: 0;
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-radius: var(--radius);
  font-size: 13px; line-height: 1.6;
  opacity: 0; transform: translateX(30px);
  transition: all 0.5s ease;
  pointer-events: none;
}
.insight-slide.active {
  opacity: 1; transform: translateX(0);
  pointer-events: auto;
  position: relative;
}
.insight-slide.exit {
  opacity: 0; transform: translateX(-30px);
}
.insight-slide.insight-warning {
  background: var(--warning-light); border-left: 3px solid var(--warning);
}
.insight-slide.insight-danger {
  background: var(--danger-light); border-left: 3px solid var(--danger);
}
.insight-slide.insight-info {
  background: var(--info-light); border-left: 3px solid var(--primary-accent);
}
.insight-slide.insight-success {
  background: #eaf7ee; border-left: 3px solid var(--success);
}
.insight-item-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.insight-item-msg { color: var(--text-secondary); font-weight: 500; }

/* Insight dots */
.insight-dots {
  display: flex; justify-content: center; gap: 8px; margin-top: 12px;
}
.insight-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ccd6e0; cursor: pointer;
  transition: all 0.3s ease;
}
.insight-dot.active {
  background: var(--primary-accent); width: 20px; border-radius: 4px;
}
.insight-dot:hover { background: var(--primary); }

/* ===== Rank List ===== */
.rank-list { display: flex; flex-direction: column; gap: 2px; }
.rank-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--radius);
  transition: all 0.25s;
  animation: fadeInUp 0.4s ease both;
  animation-delay: var(--rank-delay, 0s);
}
.rank-item:hover { background: #f4f6f9; transform: translateX(4px); }
.rank-item.rank-1 { background: linear-gradient(90deg, #fffdf0, transparent); }
.rank-item.rank-2 { background: linear-gradient(90deg, #f8f9fb, transparent); }
.rank-item.rank-3 { background: linear-gradient(90deg, #fdf5f0, transparent); }
.rank-num {
  width: 28px; text-align: center; font-size: 18px; font-weight: 700;
  flex-shrink: 0;
}
.rank-info { flex: 1; min-width: 0; }
.rank-name { font-size: 13px; font-weight: 600; color: var(--text); display: block; }
.rank-dept { font-size: 11px; color: var(--text-muted); }
.rank-amount {
  font-size: 14px; font-weight: 700; color: var(--primary);
  white-space: nowrap;
}

/* ===== AI Rate Trend Chart ===== */
.ai-rate-trend {
  display: flex; align-items: flex-end; gap: 20px;
  height: 180px; padding-top: 16px; justify-content: center;
}
.rate-col {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  flex: 1; max-width: 48px;
}
.rate-val {
  font-size: 12px; font-weight: 700; color: var(--text-secondary);
}
.rate-bar-wrap {
  width: 100%; height: 140px; display: flex; align-items: flex-end;
  background: #f4f6f9; border-radius: 6px; overflow: hidden;
}
.rate-bar {
  width: 100%; border-radius: 6px 6px 0 0;
  animation: barGrow 0.8s ease-out both;
  animation-delay: var(--rate-delay, 0s);
  transition: height 0.4s ease;
}
.rate-bar.rate-good { background: linear-gradient(180deg, #45b860, #2d8c4a); }
.rate-bar.rate-warn { background: linear-gradient(180deg, #f0c040, #e6a817); }
.rate-bar.rate-bad  { background: linear-gradient(180deg, #e84855, #c41230); }
.rate-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.rate-legend {
  display: flex; gap: 20px; justify-content: center; margin-top: 12px;
  font-size: 11px; color: var(--text-muted);
}
.rate-legend span { display: flex; align-items: center; gap: 6px; }
.rate-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.rate-dot.rate-good { background: #2d8c4a; }
.rate-dot.rate-warn { background: #e6a817; }
.rate-dot.rate-bad  { background: #c41230; }

/* ===== Trend Badge ===== */
.trend-badge {
  display: inline-block; font-size: 11px; font-weight: 600;
  padding: 2px 8px; border-radius: 10px; margin-left: 4px;
}
.trend-up     { color: var(--success); background: var(--success-light); }
.trend-down   { color: var(--danger); background: var(--danger-light); }
.trend-stable { color: var(--text-muted); background: #f2f3f5; }

/* ===== Chart Bar Animation ===== */
.bar-col .bar {
  animation: barGrow 0.7s ease-out both;
  animation-delay: var(--bar-delay, 0s);
}
.stacked-col .stack-seg {
  animation: barGrow 0.7s ease-out both;
  animation-delay: var(--bar-delay, 0s);
}

.voucher-preview-img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px 6px 0 0; }

.upload-layout {
  display: grid;
  grid-template-columns: minmax(300px, 1fr) minmax(340px, 1.15fr);
  gap: 16px;
  width: 100%;
  max-width: 100%;
  align-items: start;
}
@media (max-width: 960px) {
  .upload-layout { grid-template-columns: 1fr; }
}
.voucher-upload-page {
  width: 100%;
  max-width: 100%;
}
.voucher-upload-page .upload-form-card,
.voucher-upload-page .recent-upload-card {
  width: 100%;
  min-width: 0;
}
.recent-upload-card {
  display: flex;
  flex-direction: column;
  min-height: 320px;
  max-height: calc(100vh - 220px);
}
.recent-upload-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.voucher-upload-page .recent-upload-table {
  width: 100%;
  font-size: 12px;
}
.recent-upload-table th,
.recent-upload-table td {
  padding: 8px 6px;
  white-space: nowrap;
}
.recent-file-cell {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.recent-time-cell { font-size: 11px; color: var(--text-muted); }
.upload-result-card { min-height: 320px; }
.pre-audit-flow-card .flow-chart { width: 100%; overflow: visible; }
.pre-audit-flow-card .card-title + .pipeline-timeline-wrap .flow-chart-wrap {
  justify-content: flex-start;
}

.pre-audit-flow-page { max-width: 100%; }
.pre-audit-flow-toolbar {
  display: flex; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap;
}
.pre-audit-back-btn { flex-shrink: 0; font-weight: 600; }
.pre-audit-flow-title-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pre-audit-flow-title { margin: 0; font-size: 22px; }
.pre-audit-history-tag {
  font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 12px;
  background: #eef0f4; color: var(--text-muted);
}
.pre-audit-meta-card { margin-bottom: 16px; }
.pre-audit-meta-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px 20px;
  font-size: 13px;
}
.pre-audit-meta-grid .meta-label { display: block; font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.pre-audit-flow-card .pipeline-timeline-wrap { padding: 8px 4px 0; }

.recent-upload-hint { font-size: 12px; color: var(--text-muted); margin: 0 0 10px; padding: 0 4px; }
.recent-upload-table .recent-upload-row { cursor: pointer; transition: background 0.15s; }
.recent-upload-table .recent-upload-row:hover { background: rgba(0, 51, 141, 0.05); }
.recent-flow-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 8px;
  background: #e8f1fc; color: var(--primary-accent);
}

/* ===== Pre-audit pipeline timeline ===== */
.pipeline-live-dot {
  display: inline-block; margin-left: 8px; font-size: 11px; font-weight: 600;
  color: var(--primary-accent); animation: pipeline-pulse 1.2s ease-in-out infinite;
}
@keyframes pipeline-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
.pipeline-timeline-wrap { padding: 4px 0; }
.pipeline-progress {
  height: 4px; background: #eef0f4; border-radius: 2px; margin-bottom: 14px; overflow: hidden;
}
.pipeline-progress-bar {
  height: 100%; background: linear-gradient(90deg, var(--primary), var(--primary-accent));
  border-radius: 2px; transition: width 0.35s ease;
}
.pipeline-timeline { display: flex; flex-direction: column; gap: 0; max-height: 420px; overflow-y: auto; }
.pipeline-step-item {
  display: flex; gap: 12px; padding: 10px 8px; border-left: 3px solid #e2e6ed;
  margin-left: 10px; transition: opacity 0.25s, background 0.2s;
}
.pipeline-step-item.pipeline-hidden { opacity: 0.35; }
.pipeline-step-item.running {
  border-left-color: var(--primary-accent); background: rgba(0, 51, 141, 0.06);
}
.pipeline-step-item.pass { border-left-color: var(--success); }
.pipeline-step-item.fail { border-left-color: var(--danger); }
.pipeline-step-item.warn { border-left-color: #e6a817; }
.pipeline-step-item.skip { border-left-color: #c5cad3; }
.pipeline-step-marker {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; background: #eef0f4; color: var(--text-muted);
}
.pipeline-step-item.running .pipeline-step-marker {
  background: var(--primary); color: #fff; animation: pipeline-pulse 0.8s infinite;
}
.pipeline-step-item.pass .pipeline-step-marker { background: #eaf7ee; color: var(--success); }
.pipeline-step-item.fail .pipeline-step-marker { background: #fde8ec; color: var(--danger); }
.pipeline-step-item.warn .pipeline-step-marker { background: #fef9e7; color: #b8860b; }
.pipeline-step-item.skip .pipeline-step-marker { background: #f4f5f7; color: #9aa3b2; }
.pipeline-step-body { flex: 1; min-width: 0; }
.pipeline-step-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px;
}
.pipeline-step-name { font-size: 13px; font-weight: 600; color: var(--text); }
.pipeline-layer-tag {
  font-size: 10px; padding: 2px 6px; border-radius: 4px;
  background: #eef3fa; color: var(--primary); font-weight: 600;
}
.pipeline-duration { font-size: 10px; color: var(--text-muted); margin-left: auto; }
.pipeline-step-detail { font-size: 12px; color: var(--text-secondary); line-height: 1.5; }
.pipeline-summary {
  display: flex; align-items: center; gap: 16px; margin-top: 16px; padding: 14px 16px;
  border-radius: var(--radius); border: 1px solid var(--border);
}
.pipeline-summary.pass { background: #f0faf3; border-color: #c8e6d0; }
.pipeline-summary.fail { background: #fef5f6; border-color: #f5c6cb; }
.pipeline-summary.warn { background: #fefbf3; border-color: #faeac8; }
.pipeline-summary-score { font-size: 28px; font-weight: 700; color: var(--primary); }
.pipeline-summary-score span { font-size: 13px; font-weight: 500; color: var(--text-muted); }
.pipeline-summary-label { font-size: 14px; font-weight: 600; }
.pipeline-summary-hits { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.upload-ps-block { border-top: 1px solid var(--border-light); margin-top: 8px; padding-top: 4px; }
.upload-dropzone {
  border: 2px dashed var(--border); border-radius: 10px; padding: 28px 16px;
  text-align: center; cursor: pointer; transition: border-color 0.2s, background 0.2s;
  background: var(--bg-secondary);
}
.upload-dropzone:hover, .upload-dropzone.dragover { border-color: var(--primary-accent); background: rgba(0, 51, 141, 0.04); }
.upload-icon { font-size: 40px; margin-bottom: 8px; }
.upload-link { color: var(--primary-accent); text-decoration: underline; }
.upload-hint, .upload-file-name { font-size: 12px; color: var(--text-muted); margin-top: 6px; }
.upload-file-name { color: var(--primary); font-weight: 600; }
.upload-result-header { margin-bottom: 12px; }
.ela-preview-wrap { margin-top: 12px; }
.ela-preview-img { max-width: 100%; border-radius: 8px; border: 1px solid var(--border); }
.preview-label { font-size: 12px; color: var(--text-muted); margin-bottom: 6px; }
.ps-check-row { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.ps-check-row:last-child { border-bottom: none; }

.audit-modal-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--text-secondary);
}
.audit-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.queue-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.queue-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-white);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}
.queue-filter-check {
  display: none;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
}
.queue-filter-btn.active .queue-filter-check {
  display: inline-block;
}
.queue-filter-btn:hover {
  border-color: var(--primary-accent);
  color: var(--primary-accent);
}
.queue-filter-btn.active {
  font-weight: 600;
  color: #fff;
}
.queue-filter-btn.queue-filter-pass.active {
  background: var(--success);
  border-color: var(--success);
}
.queue-filter-btn.queue-filter-warning.active {
  background: var(--warning);
  border-color: var(--warning);
  color: #1a1a2e;
}
.queue-filter-btn.queue-filter-reject.active {
  background: var(--danger);
  border-color: var(--danger);
}
.queue-material-cell,
.queue-action-cell {
  display: grid;
  gap: 5px;
  align-items: start;
}
.queue-list-table td.queue-type-merchant > span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}
.queue-list-table td.queue-apply-time,
.queue-list-table td.queue-eval-time {
  font-size: 12px;
  white-space: nowrap;
  color: var(--text-secondary);
}
.queue-risk-cell {
  display: grid;
  gap: 4px;
  align-items: start;
  min-width: 96px;
}
.queue-risk-cell > span:not(.ai-pre-pill) {
  font-size: 11px;
  line-height: 1.25;
  color: var(--text-muted);
  white-space: nowrap;
}
.queue-material-cell span:not(.tag) {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}
.threshold-config-card {
  display: grid;
  gap: 16px;
}
.threshold-config-form {
  display: grid;
  gap: 16px;
}
.threshold-section {
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfe;
}
.threshold-section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  flex-wrap: wrap;
}
.threshold-section-head strong {
  color: var(--primary);
  font-size: 15px;
}
.threshold-section-head span {
  color: var(--text-muted);
  font-size: 12px;
}
.threshold-section-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  text-align: right;
}
.threshold-slider-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.threshold-weight-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.threshold-slider-row {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dfe6f1;
  border-radius: 8px;
  background: #fff;
}
.threshold-slider-head,
.threshold-slider-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.threshold-slider-head span {
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}
.threshold-slider-head b {
  color: var(--primary);
  font-size: 16px;
}
.threshold-slider-foot {
  color: var(--text-muted);
  font-size: 11px;
}
.threshold-slider-foot small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.threshold-range {
  width: 100%;
  accent-color: var(--primary);
}
.threshold-slider-pass .threshold-range,
.threshold-slider-pass .threshold-slider-head b { accent-color: var(--success); color: var(--success); }
.threshold-slider-warn .threshold-range,
.threshold-slider-warn .threshold-slider-head b { accent-color: var(--warning); color: #9a6a00; }
.threshold-slider-reject .threshold-range,
.threshold-slider-reject .threshold-slider-head b,
.threshold-slider-danger .threshold-range,
.threshold-slider-danger .threshold-slider-head b { accent-color: var(--danger); color: var(--danger); }
.threshold-band-preview {
  position: relative;
  display: block;
  overflow: visible;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  background: #fff;
}
.threshold-band-track {
  position: relative;
  display: flex;
  min-height: 38px;
  overflow: visible;
  border-radius: 7px;
  touch-action: none;
  user-select: none;
}
.threshold-band-preview span {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 9px 10px;
  text-align: center;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  box-sizing: border-box;
}
.threshold-band-preview .band-high { color: #8a1026; background: #fde8ed; }
.threshold-band-preview .band-reject { color: var(--danger); background: var(--danger-light); }
.threshold-band-preview .band-warn { color: #9a6a00; background: var(--warning-light); }
.threshold-band-preview .band-pass { color: var(--success); background: var(--success-light); }
.threshold-weight-band-preview span {
  min-width: 0;
}
.threshold-weight-band-preview span:empty {
  padding-left: 0;
  padding-right: 0;
}
.threshold-band-handle {
  position: absolute;
  top: 50%;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--primary-accent);
  box-shadow: 0 2px 8px rgba(0, 51, 141, 0.24);
  cursor: ew-resize;
  transform: translate(-50%, -50%);
  z-index: 5;
  touch-action: none;
}
.threshold-band-handle:hover,
.threshold-band-handle:focus-visible,
.threshold-band-track.is-dragging .threshold-band-handle {
  background: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 163, 224, 0.2), 0 2px 10px rgba(0, 51, 141, 0.3);
}
.threshold-weight-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.threshold-risk-summary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.threshold-weight-summary div {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
}
.threshold-risk-summary div {
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.threshold-weight-summary span,
.threshold-remark-section label span {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  margin-bottom: 4px;
}
.threshold-weight-summary b {
  font-size: 18px;
  color: var(--primary);
}
.threshold-risk-summary b {
  font-size: 24px;
  line-height: 1;
}
.threshold-risk-summary .btn {
  min-width: 64px;
  justify-content: center;
}
.threshold-risk-summary .risk-range-high {
  border-color: #f1c4cc;
  background: var(--danger-light);
}
.threshold-risk-summary .risk-range-high span {
  color: var(--danger);
}
.threshold-risk-summary .risk-range-high b {
  color: var(--danger);
}
.threshold-risk-summary .risk-range-mid {
  border-color: #f7df9b;
  background: var(--warning-light);
}
.threshold-risk-summary .risk-range-mid span {
  color: #9a6a00;
}
.threshold-risk-summary .risk-range-mid b {
  color: #9a6a00;
}
.threshold-risk-summary .risk-range-low {
  border-color: #badbcc;
  background: var(--success-light);
}
.threshold-risk-summary .risk-range-low span {
  color: var(--success);
}
.threshold-risk-summary .risk-range-low b {
  color: var(--success);
}
.threshold-weight-summary .ok b { color: var(--success); }
.threshold-weight-summary .warn {
  border-color: #f1c4cc;
  background: #fff7f8;
}
.threshold-weight-summary .warn b { color: var(--danger); }
.threshold-remark-section input {
  width: min(520px, 100%);
}
#save-thresholds-btn {
  width: 164px;
  margin: 16px 0 0 auto;
}
@media (max-width: 900px) {
  .threshold-slider-grid,
  .threshold-weight-grid,
  .threshold-band-preview,
  .threshold-weight-summary {
    grid-template-columns: 1fr;
  }
  #save-thresholds-btn {
    width: 144px;
  }
}
.specialist-panel {
  border-left: 4px solid var(--primary-accent);
}
.specialist-panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.specialist-kpi-grid,
.recon-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}
.specialist-kpi-grid div,
.recon-item {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
}
.specialist-kpi-grid span,
.recon-item span {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.specialist-kpi-grid b,
.recon-item b {
  font-size: 14px;
  color: var(--text);
}
.specialist-hints {
  display: grid;
  gap: 8px;
}
.specialist-hint {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.45;
}
.specialist-hint span {
  color: var(--text-secondary);
}
.specialist-hint-danger { border-color: #f0b8c0; background: #fff7f8; }
.specialist-hint-warn { border-color: #f0d880; background: #fffaf0; }
.specialist-hint-info { border-color: #c4d8f0; background: #f5f9ff; }
.specialist-hint-ok { border-color: #b7e4c7; background: #f6fff9; }
.reconciliation-panel {
  border-left: 4px solid var(--cyan);
}
.recon-item b.ok { color: var(--success); }
.recon-item b.warn { color: var(--danger); }
.recon-warning,
.recon-ok {
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 13px;
  line-height: 1.5;
}
.recon-warning {
  color: #8a5a00;
  background: #fff8e6;
  border: 1px solid #f0d880;
}
.recon-ok {
  color: var(--success);
  background: #f6fff9;
  border: 1px solid #b7e4c7;
}
.audit-front-panel {
  margin-bottom: 16px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.audit-result-banner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 20px 22px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, #f7fbff 0%, #eef5ff 100%);
}
.audit-result-pass .audit-result-banner { background: linear-gradient(135deg, #f0faf3 0%, #e5f6eb 100%); }
.audit-result-warn .audit-result-banner,
.audit-result-review .audit-result-banner { background: linear-gradient(135deg, #fff9eb 0%, #fff1cc 100%); }
.audit-result-fail .audit-result-banner { background: linear-gradient(135deg, #fff1f3 0%, #fde2e7 100%); }
.audit-result-main {
  min-width: 0;
}
.audit-front-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.audit-result-title {
  font-size: 30px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--primary);
}
.audit-result-pass .audit-result-title { color: var(--success); }
.audit-result-warn .audit-result-title,
.audit-result-review .audit-result-title { color: #9a6a00; }
.audit-result-fail .audit-result-title { color: var(--danger); }
.audit-result-subtitle {
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.audit-result-tier-title {
  display: flex;
  align-items: center;
  gap: 10px;
}
.audit-result-tier-title .ai-pre-pill {
  font-size: 22px;
  padding: 8px 18px;
  border-radius: 999px;
}
.audit-threshold-hint {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
}
.audit-score-breakdown {
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfe;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.audit-score-breakdown.score-focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(0, 51, 141, 0.10), 0 12px 28px rgba(0, 51, 141, 0.12);
}
.audit-score-breakdown-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 12px;
}
.audit-score-breakdown-head strong {
  font-size: 15px;
  color: var(--text);
}
.audit-score-breakdown-head span {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}
.audit-score-breakdown-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}
.audit-score-breakdown-summary div {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.audit-score-breakdown-summary span {
  display: block;
  margin-bottom: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.audit-score-breakdown-summary b {
  font-size: 18px;
  color: var(--primary);
}
.audit-score-breakdown-summary b.is-deduct {
  color: var(--danger);
}
.audit-score-breakdown-summary b.is-final {
  color: var(--primary);
  font-size: 20px;
}
.audit-score-breakdown-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.audit-score-breakdown-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.audit-score-breakdown-table th,
.audit-score-breakdown-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.audit-score-breakdown-table th {
  background: #f3f6fb;
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.audit-score-breakdown-table .audit-score-action-col {
  width: 122px;
  text-align: right;
  white-space: nowrap;
}
.audit-score-breakdown-table td small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--text-muted);
}
.audit-score-breakdown-table td.is-deduct {
  color: var(--danger);
  font-weight: 700;
}
.audit-score-dimension-row td {
  background: #fff;
}
.audit-score-detail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 96px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid #bfdbfe;
  border-radius: 6px;
  background: #eef6ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}
.audit-score-detail-btn:hover {
  border-color: var(--primary);
  background: #e0efff;
}
.audit-score-detail-btn.is-open {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}
.audit-score-no-detail {
  color: var(--text-muted);
}
.audit-score-factor-row td {
  padding: 0 12px 12px;
  background: #f8fbff;
}
.audit-score-factor-panel {
  margin-left: 2px;
  border: 1px solid #dbe7f5;
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}
.audit-score-factor-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.audit-score-factor-table th,
.audit-score-factor-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.audit-score-factor-table th {
  background: #f7f9fc;
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
}
.audit-score-factor-table tr:last-child td {
  border-bottom: none;
}
.audit-score-factor-table td small {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
}
.audit-score-factor-table td.is-deduct {
  color: var(--danger);
  font-weight: 800;
}
.audit-score-breakdown-subhead {
  margin: 14px 0 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.audit-score-dimension-table-wrap {
  margin-bottom: 4px;
}
.audit-score-breakdown-table .audit-score-total-row td {
  background: #f0f6ff;
  border-bottom: none;
}
.audit-score-breakdown-table .audit-score-total-row small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
}
.audit-score-empty-note {
  padding: 12px 14px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-secondary);
  background: #fff;
}
.audit-detail-score-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 16px;
  align-items: start;
  margin-bottom: 16px;
}
.audit-detail-score-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.audit-detail-score-main {
  min-width: 0;
}
.audit-score-jump-card {
  width: 100%;
  padding: 24px;
  text-align: center;
  border: 1px solid var(--border);
}
.audit-score-jump-card .progress-circle {
  width: 122px !important;
  height: 122px !important;
}
.audit-score-jump-card .progress-circle svg {
  width: 122px;
  height: 122px;
  overflow: visible;
}
.audit-score-jump-card .progress-circle circle {
  stroke-width: 9;
}
.audit-score-jump-card .progress-circle .percent {
  font-size: 24px;
  font-weight: 900;
}
.finance-expense-sheet {
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}
.finance-sheet-title {
  margin-bottom: 18px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0;
}
.finance-sheet-title span {
  margin-left: 8px;
  font-size: 20px;
}
.finance-sheet-meta {
  display: grid;
  grid-template-columns: minmax(170px, 260px) minmax(0, 1fr);
  gap: 8px 22px;
  max-width: 780px;
  margin-bottom: 18px;
  font-size: 14px;
}
.finance-sheet-meta div {
  display: contents;
}
.finance-sheet-meta b {
  color: var(--text);
  font-weight: 800;
}
.finance-sheet-meta span {
  color: var(--text);
  font-weight: 500;
}
.finance-sheet-table-wrap {
  overflow-x: auto;
  border-top: 1px solid #cfd6e0;
}
.finance-sheet-table {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
  font-size: 13px;
}
.finance-sheet-table th,
.finance-sheet-table td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.finance-sheet-table th {
  color: var(--text);
  font-weight: 800;
  background: #fff;
}
.finance-sheet-table th span,
.finance-sheet-table td span {
  display: block;
  margin-top: 4px;
  color: var(--text-secondary);
  font-weight: 500;
}
.finance-sheet-table td:nth-child(7),
.finance-sheet-table td:nth-child(8) {
  font-weight: 700;
  white-space: nowrap;
}
.original-voucher-docs-card {
  padding: 18px;
}
.original-voucher-docs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.original-voucher-doc {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.original-voucher-doc-preview {
  height: 150px;
  border-bottom: 1px solid var(--border);
  background: #f7f9fc;
  cursor: default;
}
.original-voucher-doc-preview.has-image {
  cursor: zoom-in;
}
.original-voucher-doc-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.original-voucher-doc-image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 8px;
  color: var(--text-muted);
  font-size: 28px;
  font-weight: 800;
}
.original-voucher-doc-image-placeholder span {
  font-size: 12px;
  font-weight: 600;
}
.original-voucher-doc-head {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}
.original-voucher-doc-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 6px;
  font-weight: 800;
}
.original-voucher-doc-title {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.original-voucher-doc-sub {
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.original-voucher-doc-head > span {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: #f3f6fb;
  color: var(--text-secondary);
}
.original-voucher-doc-amount {
  padding: 12px 12px 0;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
}
.original-voucher-doc-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 10px;
  padding: 12px;
}
.original-voucher-doc-fields div {
  min-width: 0;
}
.original-voucher-doc-fields span {
  display: block;
  margin-bottom: 3px;
  font-size: 11px;
  color: var(--text-muted);
}
.original-voucher-doc-fields b {
  display: block;
  font-size: 12px;
  color: var(--text);
  word-break: break-word;
}
.original-voucher-doc-vat .original-voucher-doc-icon {
  background: #fff1f0;
  color: #cf1322;
}
.original-voucher-doc-rail .original-voucher-doc-icon {
  background: #e6f7ff;
  color: #0050b3;
}
.original-voucher-doc-trip .original-voucher-doc-icon {
  background: #f6ffed;
  color: #237804;
}
@media (max-width: 1100px) {
  .original-voucher-docs {
    grid-template-columns: 1fr;
  }
  .audit-detail-ai-pre-grid {
    grid-template-columns: 1fr;
  }
  .audit-detail-ai-pre-wrap .ai-pre-detail {
    border-right: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
  }
  .audit-detail-ai-score-side .audit-score-breakdown {
    border-radius: 0 0 8px 8px;
  }
}
.audit-detail-tabs-card {
  margin-top: 18px;
  padding: 0;
  overflow: hidden;
}
.audit-detail-score-main > .audit-detail-tabs-card:first-child {
  margin-top: 0;
}
.audit-detail-tabs {
  display: flex;
  gap: 4px;
  padding: 10px 12px 0;
  border-bottom: 1px solid var(--border);
  background: #f8fafc;
  overflow-x: auto;
}
.audit-detail-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.audit-detail-tab span {
  min-width: 20px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #eaf1fb;
  color: var(--primary);
  font-size: 11px;
  text-align: center;
}
.audit-detail-tab.active {
  border-color: var(--border);
  background: #fff;
  color: var(--primary);
}
.audit-detail-tab-panels {
  padding: 16px;
  background: #fff;
}
.audit-detail-tab-panel {
  display: none;
}
.audit-detail-tab-panel.active {
  display: block;
}
.audit-detail-tab-panel > .card {
  margin-bottom: 14px;
}
.audit-detail-tab-panel > .card:last-child {
  margin-bottom: 0;
}
.audit-detail-ai-pre-wrap {
  min-width: 0;
}
.audit-detail-ai-pre-wrap .ai-pre-detail {
  width: 100%;
  min-width: 0;
  max-width: none;
  box-sizing: border-box;
  border: 1px solid var(--border);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  box-shadow: none;
}
.audit-detail-ai-pre-wrap .ai-pre-detail-body {
  padding: 16px;
}
.audit-detail-ai-pre-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.1fr) minmax(360px, 0.95fr);
  gap: 0;
  align-items: stretch;
}
.audit-detail-ai-score-side {
  min-width: 0;
}
.audit-detail-ai-score-side .audit-score-breakdown {
  height: 100%;
  border-radius: 0 8px 8px 0;
}
.audit-result-score {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 5px solid rgba(0, 73, 144, 0.14);
  background: rgba(255, 255, 255, 0.78);
  color: var(--primary);
}
.audit-result-score span {
  font-size: 30px;
  font-weight: 800;
  line-height: 1;
}
.audit-result-score b {
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-muted);
}
.audit-front-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px 16px 4px;
  margin-bottom: 14px;
}
.audit-front-kpis div {
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
}
.audit-front-kpis span {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  color: var(--text-muted);
}
.audit-ai-flow-title {
  padding: 0 16px 10px;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.audit-process-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px 16px;
}
.audit-process-step {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  min-width: 0;
}
.audit-process-index {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  background: #eef3fa;
  color: var(--primary);
}
.audit-process-name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}
.audit-process-ai {
  display: inline-block;
  margin-bottom: 7px;
  padding: 4px 7px;
  border-radius: 999px;
  background: #eef5ff;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
}
.audit-process-detail {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.audit-process-pass { border-left: 3px solid var(--success); }
.audit-process-warn,
.audit-process-running { border-left: 3px solid var(--warning); }
.audit-process-fail { border-left: 3px solid var(--danger); }
.data-source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}
.data-source-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.data-source-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.data-source-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}
.data-source-meta {
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.data-source-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  font-size: 12px;
}
.data-source-body .wide {
  grid-column: 1 / -1;
}
.data-source-body span {
  display: block;
  color: var(--text-muted);
  margin-bottom: 3px;
}
.data-source-body b {
  color: var(--text-secondary);
  line-height: 1.4;
}
.data-source-body .ai-use {
  padding: 8px;
  border-radius: var(--radius);
  background: #f5f9ff;
  border: 1px solid #c4d8f0;
}
.data-source-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.integration-edit-form .form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}
.integration-edit-form .form-group {
  margin-bottom: 14px;
}
.connection-test-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
  font-size: 13px;
  color: var(--text-secondary);
}
.ai-processing-card {
  border-left: 4px solid var(--primary-accent);
}
.ai-stage-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}
.ai-stage {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
}
.ai-stage-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
.ai-stage-title {
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 5px;
}
.ai-stage-detail {
  min-height: 54px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.ai-stage-metric {
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary-accent);
}
.manual-sync-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.manual-sync-step {
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.manual-sync-marker {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #eef3fa;
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}
.manual-sync-title {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 4px;
}
.manual-sync-detail {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-secondary);
}
.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.dashboard-filter-bar {
  margin-bottom: 18px;
  align-items: flex-end;
}
.dashboard-filter-bar.filter-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  padding: 12px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.dashboard-filter-bar.filter-inline .dashboard-filter-block {
  flex-wrap: nowrap;
}
.dashboard-filter-bar.filter-inline .dashboard-filter-time {
  flex: 1 1 420px;
  min-width: 0;
}
.dashboard-filter-bar.filter-inline .dashboard-filter-dept {
  flex: 0 0 220px;
}
.dashboard-filter-bar.filter-inline .dashboard-custom-dates {
  flex: 1 1 100%;
  margin-top: 2px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-light);
}
.dashboard-filter-bar.filter-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  align-items: start;
  padding: 14px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.dashboard-filter-bar.filter-grid-2 .dashboard-custom-dates {
  grid-column: 1 / -1;
}
.dashboard-filter-block {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.dashboard-filter-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 36px;
}
.dashboard-dept-select {
  flex: 1;
  min-width: 0;
  max-width: 100%;
}
.dashboard-custom-dates .dashboard-date-input {
  max-width: 150px;
}
.dashboard-date-sep {
  font-size: 13px;
  color: var(--text-muted);
}
#dash-time-filters .queue-filter-btn.active,
.audit-filter-time-group .queue-filter-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* ===== Audit list filter panel (queue / history) ===== */
.audit-filter-panel {
  background: var(--bg-white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 16px;
  overflow: hidden;
}
.audit-filter-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  border-bottom: 1px solid var(--border-light);
}
.audit-filter-panel-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}
.audit-filter-panel-hint {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  font-size: 12px;
}
.audit-filter-panel-body {
  padding: 14px 16px 12px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
  align-items: start;
}
.audit-filter-panel-body.audit-filter-inline {
  grid-template-columns: minmax(180px, 1.05fr) minmax(128px, 0.72fr) minmax(300px, 1.65fr) minmax(250px, 1.35fr) minmax(190px, 1fr);
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 14px;
}
.audit-filter-panel-body.audit-filter-inline-history {
  grid-template-columns: minmax(170px, 0.95fr) minmax(120px, 0.65fr) minmax(280px, 1.45fr) minmax(230px, 1.2fr) minmax(190px, 1fr) minmax(170px, 0.9fr);
}
.audit-filter-panel-body .audit-filter-summary {
  grid-column: 1 / -1;
}
.audit-filter-panel-body.audit-filter-inline .audit-filter-summary {
  grid-column: auto;
  min-width: 0;
  flex-wrap: nowrap;
  gap: 8px;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.audit-filter-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 10px 14px;
  align-items: start;
  min-width: 0;
}
.audit-filter-panel-body .audit-filter-row {
  grid-template-columns: 1fr;
  gap: 6px;
}
.audit-filter-panel-body.audit-filter-inline .audit-filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.audit-filter-panel-body .audit-filter-row-label {
  padding-top: 0;
}
.audit-filter-panel-body.audit-filter-inline .audit-filter-row-label,
.audit-filter-panel-body.audit-filter-inline .audit-filter-summary-label {
  flex: 0 0 auto;
  width: auto;
  min-width: auto;
  padding-top: 0;
  white-space: nowrap;
}
.audit-filter-panel-body.audit-filter-inline .audit-filter-row-body,
.audit-filter-panel-body.audit-filter-inline .queue-filter-group {
  flex-wrap: nowrap;
}
.audit-filter-panel-body.audit-filter-inline .summary-tags {
  flex-wrap: nowrap;
  overflow: hidden;
}
.audit-filter-panel-body.audit-filter-inline .summary-tags .tag {
  max-width: 118px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .audit-filter-panel-body,
  .dashboard-filter-bar.filter-grid-2 {
    grid-template-columns: 1fr;
  }
  .audit-filter-panel-body.audit-filter-inline,
  .audit-filter-panel-body.audit-filter-inline-history {
    grid-template-columns: 1fr;
    overflow-x: visible;
  }
  .audit-filter-panel-body.audit-filter-inline .audit-filter-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .audit-filter-panel-body.audit-filter-inline .audit-filter-summary {
    grid-column: 1;
    flex-wrap: wrap;
    padding-top: 10px;
    border-top: 1px dashed var(--border-light);
  }
  .audit-filter-panel-body.audit-filter-inline .audit-filter-row-body,
  .audit-filter-panel-body.audit-filter-inline .queue-filter-group,
  .audit-filter-panel-body.audit-filter-inline .summary-tags {
    flex-wrap: wrap;
  }
}
@media (max-width: 640px) {
  .audit-filter-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}
.audit-filter-row-search {
  align-items: center;
}
.audit-filter-row-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  padding-top: 8px;
  line-height: 1.3;
  text-transform: none;
}
.audit-filter-row-search .audit-filter-row-label {
  padding-top: 0;
}
.audit-filter-row-body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.audit-filter-search-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}
.audit-filter-dept-select {
  width: 100%;
  max-width: 100%;
}
.audit-filter-time-group .queue-filter-btn.active,
.audit-filter-time-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.audit-filter-custom-dates {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin-top: 4px;
}
.audit-filter-date-input {
  max-width: 150px;
}
.audit-filter-date-sep {
  font-size: 13px;
  color: var(--text-muted);
}
.audit-filter-legend {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-left: 4px;
  font-size: 12px;
}
.audit-filter-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 10px;
  margin-top: 2px;
  border-top: 1px dashed var(--border-light);
}
.audit-filter-summary-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  min-width: 72px;
}
.audit-filter-summary .summary-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.queue-filter-btn .filter-count {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.85;
  margin-left: 2px;
}
.queue-filter-btn.active .filter-count {
  opacity: 1;
}

/* ===== Dashboard analytics (audit specialist) ===== */
.dashboard-analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}
.dashboard-analytics-grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.dashboard-analytics-grid-4 .chart-card {
  min-width: 0;
  padding: 18px;
}
.dashboard-analytics-grid-4 .dash-donut-layout {
  gap: 14px;
}
.dashboard-analytics-grid-4 .dash-donut-ring {
  width: 120px;
  height: 120px;
}
.dashboard-analytics-grid-4 .dash-donut-hole {
  inset: 18px;
}
.dashboard-analytics-grid-4 .dash-donut-value {
  font-size: 12px;
}
.dashboard-analytics-grid-4 .dash-legend {
  min-width: 120px;
}
.dashboard-analytics-grid-4 .dash-mini-table th,
.dashboard-analytics-grid-4 .dash-mini-table td {
  padding: 6px 7px;
  font-size: 11px;
}
.dash-panel .dash-panel-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 14px;
  line-height: 1.5;
}
.card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.dash-panel-kpi {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.dash-donut-layout {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}
.dash-donut-ring {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.dash-donut-hole {
  position: absolute;
  inset: 22px;
  border-radius: 50%;
  background: var(--bg-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  box-shadow: inset 0 0 0 1px var(--border-light);
}
.dash-donut-title { font-size: 11px; color: var(--text-muted); }
.dash-donut-value { font-size: 14px; font-weight: 700; color: var(--primary); }
.dash-legend {
  list-style: none;
  margin: 0;
  padding: 0;
  flex: 1;
  min-width: 160px;
}
.dash-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid var(--border-light);
}
.dash-legend-item:last-child { border-bottom: none; }
.dash-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}
.dash-legend-label { flex: 1; color: var(--text); font-weight: 500; }
.dash-legend-val { color: var(--text-secondary); font-weight: 600; white-space: nowrap; }
.dash-dept-table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}
.dash-mini-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.dash-mini-table th,
.dash-mini-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}
.dash-mini-table th {
  color: var(--text-muted);
  font-weight: 600;
  background: #fafbfc;
}
.dash-line-wrap { padding: 4px 0; }
.dash-line-svg { width: 100%; max-width: 100%; height: auto; display: block; min-height: 200px; }
.dash-line-path { stroke-linecap: round; stroke-linejoin: round; }
.dash-line-dot { cursor: pointer; transition: r 0.15s; }
.dash-month-hover:hover .dash-line-dot { r: 6; }
.dash-grid-line { stroke: #e8ecf1; stroke-width: 1; stroke-dasharray: 4 3; }
.dash-y-label { font-size: 10px; fill: var(--text-muted); }
.dash-y-title { font-size: 10px; fill: var(--text-muted); font-weight: 600; }
.dash-axis-label { font-size: 10px; fill: var(--text-muted); }
.dash-chart-tooltip {
  position: fixed;
  z-index: 10000;
  max-width: 280px;
  padding: 10px 12px;
  background: rgba(26, 32, 44, 0.94);
  color: #fff;
  font-size: 12px;
  line-height: 1.55;
  white-space: pre-line;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  pointer-events: none;
}
.dash-chart-hover { cursor: default; }
.dash-legend-item.dash-chart-hover:hover,
.dash-emp-row.dash-chart-hover:hover,
.dash-spark-col.dash-chart-hover:hover,
.dash-mini-table tr.dash-chart-hover:hover {
  background: #f4f8fc;
}
.dash-priority-card.dash-chart-hover:hover {
  border-color: var(--primary-accent);
}
.dash-line-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  margin-top: 10px;
  font-size: 11px;
  color: var(--text-muted);
}
.dash-line-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dash-line-legend-item i {
  width: 12px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}
.dash-emp-list { display: flex; flex-direction: column; gap: 12px; }
.dash-emp-row {
  animation: fadeInUp 0.4s ease both;
  animation-delay: var(--emp-delay, 0s);
}
.dash-emp-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  margin-bottom: 4px;
}
.dash-emp-rank {
  width: 20px;
  font-weight: 700;
  color: var(--primary);
}
.dash-emp-name { font-weight: 600; color: var(--text); }
.dash-emp-dept { flex: 1; color: var(--text-muted); font-size: 11px; }
.dash-emp-amt { font-weight: 700; color: var(--primary); }
.dash-emp-bar-track {
  height: 8px;
  background: #eef1f5;
  border-radius: 4px;
  overflow: hidden;
}
.dash-emp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #00338D, #005EB8);
  border-radius: 4px;
  transition: width 0.5s ease;
}
.dash-emp-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-muted);
}
.dash-risk-good { color: var(--success); }
.dash-risk-warn { color: var(--warning); }
.dash-risk-bad { color: var(--danger); }
.dash-emp-alert { color: var(--danger); font-weight: 600; }
.dash-ai-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: stretch;
}
.dash-ai-spark {
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
}
.dash-ai-spark-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.dash-spark-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 100px;
  justify-content: space-between;
}
.dash-spark-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.dash-spark-val { font-size: 10px; font-weight: 700; color: var(--text-muted); }
.dash-spark-bar {
  width: 100%;
  max-width: 28px;
  border-radius: 4px 4px 0 0;
  min-height: 4px;
}
.dash-spark-bar.good { background: linear-gradient(180deg, #45b860, #2d8c4a); }
.dash-spark-bar.warn { background: linear-gradient(180deg, #f0c040, #e6a817); }
.dash-spark-bar.bad { background: linear-gradient(180deg, #e84855, #c41230); }
.dash-spark-bar.info { background: linear-gradient(180deg, #2f7ed8, #005EB8); }
.dash-spark-bar.empty { background: #dde2e8; }
.dash-spark-label { font-size: 10px; color: var(--text-muted); }
.dash-rule-layer-row {
  height: 112px;
  gap: 12px;
}
.dash-rule-layer-col {
  min-width: 72px;
}
.dash-rule-layer-meta {
  min-height: 28px;
  font-size: 10px;
  line-height: 1.35;
  color: var(--text-secondary);
  text-align: center;
  word-break: keep-all;
}
.dash-priority-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.dash-priority-card {
  display: block;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s, border-color 0.2s, transform 0.2s;
  animation: fadeInUp 0.35s ease both;
  animation-delay: var(--card-delay, 0s);
}
.dash-priority-card:hover {
  border-color: var(--primary-accent);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.dash-priority-card.urgent {
  border-left: 4px solid var(--danger);
  background: linear-gradient(90deg, #fef8f9 0%, #fff 40%);
}
.dash-priority-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.dash-priority-info { flex: 1; min-width: 0; }
.dash-priority-id { font-size: 13px; font-weight: 600; color: var(--primary); }
.dash-priority-emp { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.dash-priority-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.dash-rule-hits { display: flex; flex-wrap: wrap; gap: 4px; margin-left: auto; }
.dash-cockpit-kpis .stat-card {
  min-height: 134px;
}
.dash-kpi-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.dash-kpi-top span:last-child {
  color: var(--text-muted);
  font-size: 12px;
}
.dash-live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--success) !important;
  font-weight: 700;
}
.dash-live-indicator::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 3px var(--success-light);
}
.dash-kpi-frac {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}
.dash-kpi-frac b {
  color: var(--primary);
  font-size: 30px;
}
.dash-kpi-frac i {
  color: var(--text-muted);
  font-style: normal;
  font-size: 24px;
}
.dash-kpi-frac em {
  color: var(--text);
  font-style: normal;
  font-size: 24px;
  font-weight: 700;
}
.dash-kpi-danger { border-top-color: var(--danger) !important; }
.dash-kpi-warning { border-top-color: var(--warning) !important; }
.dash-kpi-success { border-top-color: var(--success) !important; }
.dash-kpi-danger .value { color: var(--danger) !important; }
.dash-kpi-warning .value { color: var(--warning) !important; }
.dash-kpi-success .value { color: var(--success) !important; }
.dash-outcome-kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.dash-outcome-kpi-card {
  min-height: 130px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 14px;
  border: 1px solid #dfe6ee;
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.dash-outcome-kpi-card:hover {
  box-shadow: var(--shadow);
}
.dash-outcome-primary {
  border-color: #b7c8df;
  box-shadow: 0 2px 10px rgba(0, 51, 141, 0.08);
}
.dash-outcome-kpi-card span {
  display: block;
  margin-bottom: 8px;
  color: #62718a;
  font-size: 14px;
  font-weight: 600;
}
.dash-outcome-kpi-card strong {
  display: flex;
  align-items: baseline;
  gap: 4px;
  color: var(--text);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.05;
}
.dash-outcome-kpi-card strong em {
  color: #536178;
  font-size: 14px;
  font-style: normal;
  font-weight: 700;
}
.dash-outcome-kpi-card small {
  display: block;
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
}
.dash-outcome-positive { color: #009a63; }
.dash-outcome-warn { color: #a46a00; }
.dash-outcome-muted { color: #65758f; }
.dash-outcome-icon {
  position: relative;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: #f0f4f8;
  color: var(--primary);
}
.dash-outcome-primary .dash-outcome-icon {
  background: var(--primary);
  color: #fff;
}
.dash-outcome-icon::before,
.dash-outcome-icon::after {
  content: '';
  position: absolute;
  inset: 15px;
  border: 3px solid currentColor;
}
.dash-outcome-icon-pulse::before {
  inset: 17px 13px;
  border: 0;
  border-bottom: 3px solid currentColor;
  clip-path: polygon(0 62%, 23% 62%, 33% 18%, 47% 82%, 60% 48%, 76% 48%, 86% 30%, 100% 30%, 100% 43%, 82% 43%, 72% 62%, 58% 62%, 48% 88%, 33% 43%, 27% 74%, 0 74%);
  background: currentColor;
}
.dash-outcome-icon-pulse::after { display: none; }
.dash-outcome-icon-trend::before {
  inset: 16px 14px;
  border: 0;
  border-left: 4px solid currentColor;
  border-top: 4px solid currentColor;
  transform: rotate(45deg);
}
.dash-outcome-icon-trend::after {
  inset: auto 13px 16px auto;
  width: 24px;
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-35deg);
}
.dash-outcome-icon-clock::before {
  border-radius: 50%;
}
.dash-outcome-icon-clock::after {
  left: 27px;
  top: 18px;
  width: 10px;
  height: 15px;
  border: 0;
  border-left: 3px solid currentColor;
  border-bottom: 3px solid currentColor;
}
.dash-outcome-icon-shield::before {
  inset: 13px 17px;
  border-radius: 14px 14px 18px 18px;
  clip-path: polygon(50% 0, 100% 18%, 90% 70%, 50% 100%, 10% 70%, 0 18%);
}
.dash-outcome-icon-shield::after { display: none; }
.dash-outcome-icon-signal::before {
  inset: 16px 12px;
  border: 0;
  background: currentColor;
  clip-path: polygon(0 58%, 18% 58%, 27% 22%, 41% 78%, 52% 42%, 68% 42%, 79% 62%, 100% 62%, 100% 74%, 72% 74%, 62% 55%, 48% 55%, 40% 86%, 27% 42%, 21% 70%, 0 70%);
}
.dash-outcome-icon-signal::after { display: none; }
.dash-outcome-icon-team::before {
  inset: 12px 17px auto;
  width: 18px;
  height: 18px;
  border-radius: 50%;
}
.dash-outcome-icon-team::after {
  inset: auto 12px 13px;
  height: 18px;
  border-radius: 16px 16px 6px 6px;
}
.dash-outcome-icon-doc::before {
  inset: 12px 15px 14px;
  border-radius: 3px;
  background: currentColor;
  border: 0;
}
.dash-outcome-icon-doc::after {
  inset: 16px 18px auto;
  height: 3px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 6px 0 #fff, 0 12px 0 #fff;
}
.dash-outcome-icon-percent::before {
  inset: 14px;
  border-radius: 50%;
  border-width: 3px;
}
.dash-outcome-icon-percent::after {
  inset: auto 14px 14px auto;
  width: 14px;
  height: 14px;
  border: 0;
  border-radius: 50%;
  background: currentColor;
  box-shadow: -18px -18px 0 -11px currentColor;
}
.dash-outcome-icon-alert::before {
  inset: 13px 16px 12px;
  border: 0;
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: currentColor;
}
.dash-outcome-icon-alert::after {
  left: 29px;
  top: 20px;
  width: 3px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 12px 0 #fff;
}
.dashboard-reference-grid {
  display: grid;
  grid-template-columns: minmax(560px, 1.45fr) minmax(320px, 0.85fr);
  gap: 18px;
  margin-bottom: 18px;
}
.dash-agent-chain,
.dash-capacity-panel {
  min-height: 300px;
}
.dash-agent-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding-top: 18px;
}
.dash-agent-steps::before {
  content: '';
  position: absolute;
  top: 56px;
  left: 9%;
  right: 9%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(0, 51, 141, 0.08), rgba(0, 163, 224, 0.62), rgba(45, 140, 74, 0.54));
  box-shadow: 0 0 18px rgba(0, 94, 184, 0.16);
}
.dash-agent-step {
  position: relative;
  min-height: 112px;
  overflow: hidden;
  padding: 52px 12px 12px;
  border: 1px solid #d8e3f0;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 251, 255, 0.98) 100%);
  box-shadow: 0 10px 28px rgba(0, 31, 63, 0.07);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.dash-agent-step::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  opacity: 0.92;
}
.dash-agent-step::after {
  content: '';
  position: absolute;
  right: -30px;
  bottom: -34px;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(0, 94, 184, 0.18);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 163, 224, 0.14), rgba(0, 163, 224, 0));
  pointer-events: none;
}
.dash-agent-step:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 94, 184, 0.38);
  box-shadow: 0 14px 34px rgba(0, 51, 141, 0.12);
}
.dash-agent-step i {
  position: absolute;
  top: 50px;
  right: -10px;
  z-index: 4;
  width: 20px;
  height: 20px;
  border-top: 2px solid rgba(0, 163, 224, 0.5);
  border-right: 2px solid rgba(0, 163, 224, 0.5);
  background: #f8fbff;
  transform: rotate(45deg);
}
.dash-agent-node {
  position: absolute;
  top: 20px;
  left: 13px;
  right: 13px;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.dash-agent-node span {
  position: relative;
  width: 15px;
  height: 15px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(45, 140, 74, 0.16), 0 0 18px rgba(45, 140, 74, 0.35);
}
.dash-agent-node span::after {
  content: '';
  position: absolute;
  inset: -8px;
  border: 1px solid rgba(45, 140, 74, 0.18);
  border-radius: 50%;
}
.dash-agent-node em {
  color: rgba(0, 51, 141, 0.18);
  font-size: 24px;
  font-style: normal;
  font-weight: 800;
  line-height: 1;
}
.dash-agent-step-head {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 7px;
  margin-bottom: 0;
}
.dash-agent-step-head b {
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
  white-space: nowrap;
}
.dash-agent-step-head span {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  padding: 3px 8px;
  border: 1px solid #cfe4fb;
  border-radius: 999px;
  background: #edf7ff;
  color: var(--primary-accent);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.dash-agent-evidence-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.dash-agent-evidence-item {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  min-height: 80px;
  padding: 12px;
  border: 1px solid #e1e8f1;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #f7fbff 100%);
}
.dash-agent-evidence-item span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #eef6ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}
.dash-agent-evidence-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}
.dash-agent-evidence-head b {
  color: var(--text);
  font-size: 13px;
}
.dash-agent-evidence-head em {
  flex: 0 0 auto;
  color: var(--success);
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
}
.dash-agent-evidence-item p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.55;
}
.dash-capacity-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.dash-capacity-card {
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
}
.dash-capacity-card > b {
  display: block;
  margin-bottom: 12px;
  color: var(--text);
  font-size: 14px;
}
.dash-capacity-card div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 6px 0;
  color: var(--text-secondary);
  font-size: 12px;
}
.dash-capacity-card strong {
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
}
.dash-capacity-close-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
  margin-top: 12px;
}
.dash-capacity-close-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #e1e8f1;
  border-radius: 8px;
  background: #fff;
}
.dash-capacity-close-item > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #eef6ff;
  color: var(--primary);
  font-size: 12px;
  font-weight: 800;
}
.dash-capacity-close-item div div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.dash-capacity-close-item b {
  color: var(--text);
  font-size: 13px;
}
.dash-capacity-close-item strong {
  color: var(--primary);
  font-size: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
}
.dash-capacity-close-item p {
  margin: 0;
  color: var(--text-secondary);
  font-size: 12px;
  line-height: 1.5;
}
.dash-mini-sla-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dash-mini-sla-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12px;
}
.dash-mini-sla-head b {
  color: var(--text);
}
.dash-mini-sla-head span,
.dash-mini-sla-row small {
  color: var(--text-muted);
  font-size: 11px;
}
.dash-mini-sla-track {
  height: 8px;
  margin: 7px 0 3px;
  overflow: hidden;
  border-radius: 4px;
  background: #eef1f5;
}
.dash-mini-sla-track i {
  display: block;
  height: 100%;
  border-radius: 4px;
}
.dash-mini-sla-track i.red { background: var(--danger); }
.dash-mini-sla-track i.orange { background: var(--warning); }
.dash-mini-sla-track i.green { background: var(--success); }
.dash-mini-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.dash-mini-metric {
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}
.dash-mini-metric span,
.dash-mini-metric small {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
}
.dash-mini-metric b {
  display: block;
  margin: 7px 0 4px;
  color: var(--text);
  font-size: 18px;
}
.dash-mini-metric.danger b { color: var(--danger); }
.dash-mini-metric.warn b { color: var(--warning); }
.dash-mini-metric.ok b { color: var(--success); }
.dash-data-health-mini {
  display: grid;
  grid-template-columns: 0.95fr 1.05fr;
  gap: 12px;
  align-items: stretch;
}
.dash-health-gauge {
  display: flex;
  min-height: 132px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}
.dash-health-gauge b {
  color: var(--success);
  font-size: 30px;
  line-height: 1;
}
.dash-health-gauge span,
.dash-health-gauge small {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 11px;
}
.dash-health-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-health-lines div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 12px;
}
.dash-health-lines span {
  color: var(--text-muted);
}
.dash-health-lines b {
  color: var(--text);
}
.dash-pro-header {
  margin: 18px 0 12px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.dash-pro-header .dash-panel-desc {
  margin: 6px 0 0;
}
.dash-pro-kpi-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.dash-pro-kpi-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.dash-pro-kpi-card span,
.dash-pro-kpi-card small {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
}
.dash-pro-kpi-card b {
  display: block;
  margin: 8px 0 6px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.15;
}
.dash-pro-kpi-danger { border-top-color: var(--danger); }
.dash-pro-kpi-warning { border-top-color: var(--warning); }
.dash-pro-kpi-success { border-top-color: var(--success); }
.dash-pro-grid {
  align-items: stretch;
}
.dash-bar-list,
.dash-type-list,
.dash-band-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.dash-bar-row,
.dash-type-row,
.dash-band-row {
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fff;
}
.dash-bar-head,
.dash-bar-meta,
.dash-type-main,
.dash-type-meta,
.dash-band-label,
.dash-band-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.dash-bar-head strong,
.dash-type-main b,
.dash-band-label b {
  color: var(--text);
  font-size: 13px;
}
.dash-bar-head span,
.dash-bar-meta,
.dash-type-main span,
.dash-type-meta,
.dash-band-label span,
.dash-band-meta {
  color: var(--text-muted);
  font-size: 11px;
}
.dash-bar-track,
.dash-type-track,
.dash-band-track {
  height: 8px;
  margin: 8px 0;
  overflow: hidden;
  border-radius: 4px;
  background: #eef1f5;
}
.dash-bar-fill,
.dash-type-track i,
.dash-band-track i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--primary-accent);
}
.dash-bar-fill.red { background: var(--danger); }
.dash-bar-fill.orange { background: var(--warning); }
.dash-bar-fill.blue { background: var(--primary-accent); }
.dash-sla-grid,
.dash-layer-summary,
.dash-quality-grid,
.dash-data-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.dash-quality-grid,
.dash-data-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.dash-sla-card,
.dash-layer-summary > div,
.dash-quality-grid > div,
.dash-data-metrics > div {
  min-height: 82px;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fafbfc;
}
.dash-sla-card.red { border-left: 4px solid var(--danger); }
.dash-sla-card.orange { border-left: 4px solid var(--warning); }
.dash-sla-card.green { border-left: 4px solid var(--success); }
.dash-sla-card span,
.dash-layer-summary span,
.dash-quality-grid span,
.dash-data-metrics span {
  display: block;
  color: var(--text-muted);
  font-size: 11px;
}
.dash-sla-card b,
.dash-layer-summary b,
.dash-quality-grid b,
.dash-data-metrics b {
  display: block;
  margin: 8px 0 4px;
  color: var(--text);
  font-size: 20px;
}
.dash-sla-card small,
.dash-layer-summary small,
.dash-quality-grid small {
  color: var(--text-muted);
  font-size: 11px;
}
.dash-layer-summary {
  margin-top: 10px;
}
.dash-quality-grid .danger,
.dash-data-metrics .danger { color: var(--danger); }
.dash-quality-grid .ok,
.dash-data-metrics .ok { color: var(--success); }
.dash-heat-wrap {
  overflow-x: auto;
}
.dash-heat-table td,
.dash-heat-table th {
  white-space: nowrap;
}
.dash-heat-cell {
  display: inline-flex;
  min-width: 32px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 700;
}
.dash-heat-cell.high {
  color: #fff;
  background: var(--danger);
}
.dash-heat-cell.mid {
  color: #4a3200;
  background: #ffe7a3;
}
.dash-heat-cell.low {
  color: var(--success);
  background: #e8f6ed;
}
.dash-data-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.dash-data-row {
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) 70px 56px;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 12px;
}
.dash-data-row b {
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-data-row span,
.dash-data-row em {
  color: var(--text-muted);
  font-style: normal;
  text-align: right;
}

@media (max-width: 1100px) {
  .queue-status-cards,
  .stat-row.stat-row-4,
  .stat-row.stat-row-5,
  .stat-row.stat-row-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-reference-grid { grid-template-columns: 1fr; }
  .dash-outcome-kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .ai-pre-top-panel,
  .ai-pre-layout { grid-template-columns: 1fr; }
  .ai-pre-detail {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .dash-agent-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-agent-step i { display: none; }
  .dash-agent-steps::before { display: none; }
  .dashboard-analytics-grid,
  .dashboard-analytics-grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-ai-panel { grid-template-columns: 1fr; }
  .dash-pro-kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-quality-grid,
  .dash-data-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 760px) {
  .audit-detail-score-layout {
    grid-template-columns: 1fr;
  }
  .audit-detail-tabs-card {
    margin-left: 0;
  }
}

@media (max-width: 640px) {
  .queue-status-cards,
  .stat-row.stat-row-4,
  .stat-row.stat-row-5,
  .stat-row.stat-row-6,
  .dashboard-reference-grid,
  .dash-outcome-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dash-agent-steps,
  .dash-agent-evidence-grid,
  .dash-capacity-grid,
  .dashboard-analytics-grid,
  .dashboard-analytics-grid-4,
  .dash-mini-metric-grid,
  .dash-data-health-mini {
    grid-template-columns: 1fr;
  }
  .dash-pro-kpi-grid,
  .dash-sla-grid,
  .dash-layer-summary,
  .dash-quality-grid,
  .dash-data-metrics {
    grid-template-columns: 1fr;
  }
  .dashboard-filter-bar.filter-inline .dashboard-filter-dept {
    flex: 1 1 180px;
  }
  .ai-pre-top-panel,
  .ai-pre-layout {
    grid-template-columns: 1fr;
  }
  .ai-pre-detail {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
  .dash-bar-head,
  .dash-bar-meta,
  .dash-type-main,
  .dash-type-meta,
  .dash-band-label,
  .dash-band-meta {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
}
.pagination:last-child {
  border-bottom: none;
  border-top: 1px solid var(--border-light);
}
.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
}
.pagination-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.progress-circle .percent-negative {
  font-size: 13px;
}

/* ===== Competition Showcase ===== */
.competition-hero {
  margin: -24px -28px 22px;
  padding: 46px 56px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(0, 31, 63, 0.98) 0%, rgba(0, 51, 141, 0.96) 54%, rgba(0, 94, 184, 0.92) 100%);
  border-bottom: 6px solid var(--cyan);
}
.competition-kicker {
  color: #9fe7ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.competition-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr);
  gap: 40px;
  align-items: start;
}
.competition-hero h1 {
  max-width: 780px;
  font-size: 42px;
  line-height: 1.18;
  font-weight: 800;
  margin-bottom: 18px;
}
.competition-hero p {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 17px;
  line-height: 1.75;
}
.competition-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}
.competition-score-panel {
  background: rgba(255, 255, 255, 0.98);
  color: var(--text);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
}
.competition-score-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  margin-bottom: 14px;
}
.competition-score-row {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border-light);
}
.competition-score-row strong {
  color: var(--primary);
  font-size: 24px;
  line-height: 1;
}
.competition-score-row b {
  display: block;
  color: var(--text);
  font-size: 14px;
  margin-bottom: 4px;
}
.competition-score-row span {
  display: block;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}
.competition-bonus {
  margin-top: 14px;
  padding: 12px 14px;
  background: var(--cyan-light);
  color: var(--primary-dark);
  border-left: 4px solid var(--cyan);
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
}
.competition-section {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
  margin-bottom: 18px;
  box-shadow: var(--shadow-sm);
}
.competition-section-head span {
  display: inline-block;
  color: var(--primary-accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.competition-section-head h2 {
  color: var(--primary);
  font-size: 26px;
  line-height: 1.25;
  margin-bottom: 20px;
}
.competition-problem-grid,
.competition-innovation-grid,
.competition-quality-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.competition-problem-grid > div,
.competition-innovation-grid > div {
  padding: 18px;
  border-top: 4px solid var(--primary);
  background: #f8fafc;
  border-radius: 6px;
}
.competition-problem-grid b,
.competition-innovation-grid b {
  display: block;
  color: var(--text);
  font-size: 15px;
  margin-bottom: 8px;
}
.competition-problem-grid p,
.competition-innovation-grid p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.65;
}
.competition-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(330px, 0.9fr);
  gap: 26px;
}
.competition-timeline {
  display: grid;
  gap: 12px;
}
.competition-step {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 14px;
  align-items: start;
  padding: 14px;
  background: #f8fafc;
  border-left: 4px solid var(--cyan);
  border-radius: 6px;
}
.competition-step i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-style: normal;
  font-weight: 800;
  font-size: 12px;
}
.competition-step b,
.competition-step span {
  display: block;
}
.competition-step b {
  color: var(--text);
  margin-bottom: 3px;
}
.competition-step span {
  color: var(--text-secondary);
  font-size: 13px;
}
.competition-proof-card {
  background: var(--primary-light);
  border: 1px solid #cbd8ec;
  border-radius: 8px;
  padding: 24px;
}
.competition-proof-card h3 {
  color: var(--primary);
  font-size: 18px;
  margin-bottom: 14px;
}
.competition-proof-card ul {
  padding-left: 18px;
  color: var(--text-secondary);
  line-height: 1.85;
}
.competition-quality {
  border-bottom: 4px solid var(--cyan);
}
.competition-quality-grid > div {
  padding: 18px;
  background: var(--primary);
  color: #fff;
  border-radius: 6px;
}
.competition-quality-grid strong,
.competition-quality-grid span {
  display: block;
}
.competition-quality-grid strong {
  font-size: 16px;
  margin-bottom: 8px;
}
.competition-quality-grid span {
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.55;
}

@media (max-width: 1200px) {
  .competition-hero-grid,
  .competition-two-col {
    grid-template-columns: 1fr;
  }
  .competition-problem-grid,
  .competition-innovation-grid,
  .competition-quality-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .competition-hero {
    padding: 34px 24px;
  }
  .competition-hero h1 {
    font-size: 30px;
  }
  .competition-problem-grid,
  .competition-innovation-grid,
  .competition-quality-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== Audit AI Assistant ===== */
.audit-ai-assistant {
  position: fixed;
  right: 22px;
  top: auto;
  bottom: 28px;
  transform: none;
  z-index: 1200;
  pointer-events: none;
}
.audit-ai-float {
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  background:
    radial-gradient(circle at 72% 18%, rgba(255,255,255,0.58) 0 7px, transparent 8px),
    linear-gradient(135deg, #00338d 0%, #005eb8 58%, #00a3e0 100%);
  color: #fff;
  box-shadow: 0 16px 38px rgba(0, 51, 141, 0.32);
  cursor: pointer;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  pointer-events: auto;
  animation: audit-ai-bounce 1.8s ease-in-out infinite;
  position: relative;
  overflow: hidden;
}
.audit-ai-float::before {
  content: "";
  position: absolute;
  inset: 1px;
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: 50%;
  pointer-events: none;
}
.audit-ai-float::after {
  content: "";
  position: absolute;
  right: 10px;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #20e3ff;
  box-shadow: 0 0 0 4px rgba(32, 227, 255, 0.18), 0 0 16px rgba(32, 227, 255, 0.85);
}
.audit-ai-float.is-paused {
  animation-play-state: paused;
}
.audit-ai-float:hover {
  transform: translateY(-2px);
  box-shadow: 0 20px 44px rgba(0, 51, 141, 0.38);
}
.audit-ai-float-icon {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}
.audit-ai-float-icon svg {
  width: 38px;
  height: 38px;
}
.audit-ai-bot-face {
  fill: rgba(255,255,255,0.20);
  stroke: rgba(255,255,255,0.95);
  stroke-width: 2;
}
.audit-ai-bot-antenna,
.audit-ai-bot-headset,
.audit-ai-bot-ear,
.audit-ai-bot-smile,
.audit-ai-bot-mic {
  fill: none;
  stroke: #fff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.audit-ai-bot-headset,
.audit-ai-bot-ear {
  opacity: 0.9;
}
.audit-ai-bot-spark,
.audit-ai-bot-eye {
  fill: #9fe7ff;
  stroke: #fff;
  stroke-width: 0.8;
}
.audit-ai-bot-spark {
  filter: drop-shadow(0 0 5px rgba(159, 231, 255, 0.9));
}
.audit-ai-float-text {
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0;
  white-space: nowrap;
}
@keyframes audit-ai-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.audit-ai-panel {
  position: absolute;
  right: 0;
  top: auto;
  bottom: 84px;
  transform: none;
  width: min(420px, calc(100vw - 126px));
  max-height: min(640px, calc(100vh - 52px));
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  pointer-events: auto;
}
.audit-ai-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  background: #f7fbff;
  border-bottom: 1px solid var(--border);
}
.audit-ai-back {
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--primary);
  cursor: pointer;
  font-size: 24px;
  line-height: 22px;
}
.audit-ai-back:hover {
  border-color: var(--primary);
  background: #f2f8ff;
}
.audit-ai-panel-head strong,
.audit-ai-panel-head span {
  display: block;
}
.audit-ai-panel-head strong {
  color: var(--primary);
  font-size: 15px;
  line-height: 1.3;
}
.audit-ai-panel-head span {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}
.audit-ai-close {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.audit-ai-close:hover {
  color: var(--text);
  border-color: var(--primary);
}
.audit-ai-messages {
  flex: 1;
  min-height: 250px;
  overflow-y: auto;
  padding: 16px;
  background: #fbfcfe;
}
.audit-ai-msg {
  display: flex;
  margin-bottom: 12px;
}
.audit-ai-msg-user {
  justify-content: flex-end;
}
.audit-ai-bubble {
  max-width: 88%;
  padding: 11px 13px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border);
  word-break: break-word;
}
.audit-ai-msg-user .audit-ai-bubble {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.audit-ai-examples {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 8px 0 4px;
}
.audit-ai-example {
  border: 1px solid #d7e3f3;
  background: #fff;
  border-radius: 6px;
  padding: 9px 10px;
  color: var(--primary);
  font-size: 12px;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.audit-ai-example:hover {
  border-color: var(--primary);
  background: #f2f8ff;
}
.audit-ai-loading {
  color: var(--text-muted);
}
.audit-ai-loading span {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--cyan);
  animation: audit-ai-pulse 1s ease-in-out infinite;
}
@keyframes audit-ai-pulse {
  0%, 100% { opacity: 0.35; transform: scale(0.85); }
  50% { opacity: 1; transform: scale(1); }
}
.audit-ai-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: #fff;
}
.audit-ai-input-row textarea {
  min-width: 0;
  height: 88px;
  min-height: 88px;
  max-height: 88px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 10px;
  font-size: 13px;
  line-height: 1.45;
  outline: none;
  resize: none;
  overflow-y: auto;
  font-family: inherit;
}
.audit-ai-input-row textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 51, 141, 0.08);
}
.audit-ai-input-row #audit-ai-send {
  align-self: stretch;
  min-height: 88px;
  padding-left: 14px;
  padding-right: 14px;
}

@media (max-width: 760px) {
  .audit-ai-assistant {
    right: 14px;
    top: auto;
    bottom: 18px;
    transform: none;
  }
  .audit-ai-float {
    width: 64px;
    height: 64px;
    border-radius: 50%;
  }
  .audit-ai-float-icon,
  .audit-ai-float-icon svg {
    width: 32px;
    height: 32px;
  }
  .audit-ai-float-text {
    font-size: 9px;
  }
  .audit-ai-panel {
    position: fixed;
    right: 12px;
    left: 12px;
    bottom: 86px;
    top: auto;
    transform: none;
    width: auto;
    max-height: calc(100vh - 120px);
  }
}
