@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Noto+Sans+SC:wght@400;500;600;700&display=swap');

/* ── Admin dashboard theme ─────────────────────────────── */
:root,
html[data-theme='deep-blue'] {
  --sidebar-bg: #1a1d2c;
  --sidebar-text: #a0aec0;
  --sidebar-text-active: #ffffff;
  --sidebar-hover: rgba(255, 255, 255, 0.06);
  --sidebar-active: rgba(99, 102, 241, 0.18);
  --sidebar-border: rgba(255, 255, 255, 0.08);
  --sidebar-w: 200px;
  --topbar-h: 56px;
  --content-bg: #f4f7f9;
  --card-bg: #ffffff;
  --card-border: #e8ecf1;
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  --text: #1a202c;
  --text-secondary: #64748b;
  --muted: #94a3b8;
  --primary: #4f46e5;
  --primary-hover: #4338ca;
  --accent: #3b82f6;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #06b6d4;
  --radius: 10px;
  --radius-lg: 12px;
  font-family: 'Inter', 'Noto Sans SC', 'Segoe UI', system-ui, sans-serif;
}

html[data-theme='sky-blue'] {
  --sidebar-bg: #1e3a5f;
  --content-bg: #eef6ff;
  --primary: #0284c7;
  --primary-hover: #0369a1;
}

html[data-theme='black'] {
  --sidebar-bg: #111111;
  --content-bg: #f0f0f0;
  --primary: #404040;
  --primary-hover: #262626;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  line-height: 1.55;
}

.hidden {
  display: none !important;
}

/* ── App shell ───────────────────────────────────────── */
.app-body {
  background: var(--content-bg);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform 0.25s ease, margin 0.25s ease;
  z-index: 100;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 0.85rem 0.85rem;
  border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, #6366f1, #3b82f6);
  color: #fff;
}

.sidebar-brand-name {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.02em;
}

.sidebar-brand-sub {
  font-size: 0.68rem;
  color: var(--sidebar-text);
  margin-top: 0.1rem;
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--sidebar-border);
  position: relative;
}

.sidebar-user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8b5cf6, #6366f1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.sidebar-user-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 108px;
}

.sidebar-user-role {
  font-size: 0.72rem;
  color: var(--sidebar-text);
}

.online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
  flex-shrink: 0;
}

.sidebar-user .online-dot {
  position: absolute;
  right: 0.85rem;
}

.sidebar-nav {
  padding: 0.45rem 0.5rem;
  flex: 0 0 auto;
}

.sidebar-nav-main {
  flex: 1;
}

.sidebar-nav-bottom {
  margin-top: auto;
  padding-top: 0.35rem;
  border-top: 1px solid var(--sidebar-border);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.55rem 0.7rem;
  margin-bottom: 0.12rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s, color 0.15s;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
}

.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  border-left: 3px solid #6366f1;
  padding-left: calc(0.7rem - 3px);
}

.nav-icon {
  flex-shrink: 0;
  opacity: 0.85;
}

.sidebar-ops {
  margin-top: auto;
  padding: 0.5rem 0.65rem 1rem;
  border-top: 1px solid var(--sidebar-border);
}

.sidebar-ops-block {
  margin-bottom: 0.35rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.15);
}

.sidebar-ops-block summary {
  padding: 0.55rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--sidebar-text);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.sidebar-ops-block summary::-webkit-details-marker {
  display: none;
}

.sidebar-ops-block summary::before {
  content: '▸ ';
  font-size: 0.65rem;
}

.sidebar-ops-block[open] summary::before {
  content: '▾ ';
}

.sidebar-ops-block > .panel-muted,
.sidebar-ops-block > .hint,
.sidebar-ops-block > .form-stack,
.sidebar-ops-block > .theme-picker,
.sidebar-ops-block > .btn,
.sidebar-ops-block > label,
.sidebar-ops-block > #trigger-msg,
.sidebar-ops-block > #sidebar-jenkins-panel,
.sidebar-ops-block > #sidebar-sync-panel {
  padding: 0 0.75rem 0.65rem;
}

.sidebar-ops-block .hint {
  font-size: 0.72rem;
  color: var(--sidebar-text);
  margin: 0 0.75rem 0.5rem;
  padding: 0 !important;
}

.sidebar-ops-block label {
  display: block;
  font-size: 0.75rem;
  color: var(--sidebar-text);
  margin-bottom: 0.5rem;
}

.sidebar-ops-block select,
.sidebar-ops-block input {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--sidebar-border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  color: #e2e8f0;
  font-size: 0.82rem;
}

.content-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.topbar {
  height: var(--topbar-h);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--card-border);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.topbar-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s;
}

.topbar-toggle:hover {
  background: var(--content-bg);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.breadcrumb-sep {
  color: var(--muted);
}

#breadcrumb-current {
  color: var(--text);
  font-weight: 500;
}

.topbar-online {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.user-display {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.main-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem 1.75rem 2rem;
}

.page-title-area {
  margin-bottom: 1.25rem;
}

.page-title-area h1,
#page-title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
}

.page-desc {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.page-tab-toolbar {
  margin-bottom: 0.85rem;
}

.page-tab-toolbar:empty,
.page-tab-toolbar:not(:has(.btn:not(.hidden))) {
  display: none;
  margin-bottom: 0;
}

.tab-panel {
  width: 100%;
}

.detail-card {
  margin-bottom: 0;
}

.detail-body-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.detail-body-stack > .caption {
  margin: 0 0 0.85rem;
}

.detail-body-stack > .metrics-row {
  margin: 0 0 0.85rem;
}

.detail-body-stack > .meta-block {
  margin: 0 0 0.85rem;
}

.detail-body-stack > .detail-steps-section {
  margin: 0 0 0.85rem;
}

.detail-expanders {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.detail-query-row label {
  display: block;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}

/* ── Stat cards ──────────────────────────────────────── */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.65rem;
  margin-bottom: 1rem;
}

.stat-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  color: #fff;
  overflow: hidden;
  min-height: 76px;
}

.stat-card--red { background: linear-gradient(135deg, #ef4444, #dc2626); }
.stat-card--purple { background: linear-gradient(135deg, #a855f7, #7c3aed); }
.stat-card--blue { background: linear-gradient(135deg, #3b82f6, #2563eb); }
.stat-card--teal { background: linear-gradient(135deg, #14b8a6, #0d9488); }
.stat-card--green { background: linear-gradient(135deg, #22c55e, #16a34a); }

.stat-card-icon {
  font-size: 1.15rem;
  opacity: 0.9;
  line-height: 1;
  margin-top: 0.15rem;
}

.stat-card-value {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
}

.stat-card-label {
  font-size: 0.72rem;
  opacity: 0.9;
  margin-top: 0.15rem;
}

.stat-card-link {
  position: absolute;
  top: 0.5rem;
  right: 0.6rem;
  z-index: 2;
  padding: 0.2rem 0.35rem;
  font-size: 0.68rem;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.stat-card-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  text-decoration: underline;
}

.stat-card-tag {
  position: absolute;
  top: 0.45rem;
  right: 3.2rem;
  z-index: 1;
  font-size: 0.6rem;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.25);
  pointer-events: none;
}

/* ── Overview sub-tabs ───────────────────────────────── */
.overview-subtabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.15rem;
  border-bottom: 2px solid var(--card-border);
}

.overview-subtab {
  padding: 0.65rem 1.25rem;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
}

.overview-subtab:hover {
  color: var(--text);
}

.overview-subtab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.overview-subpanel.hidden {
  display: none;
}

/* ── Dashboard board layout ────────────────────────── */
.dashboard-board {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 1rem;
  align-items: stretch;
}

.dashboard-sync-card,
.dashboard-metrics-card {
  margin-bottom: 0;
  height: 100%;
}

.dashboard-metrics-card .card-body {
  display: flex;
  align-items: center;
  min-height: 220px;
}

.key-metrics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 1.25rem;
  width: 100%;
}

.key-metric-tile {
  position: relative;
  padding: 0.85rem 0.75rem 0.85rem 1.5rem;
  background: var(--content-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
}

.key-metric-tile .key-metric-dot {
  position: absolute;
  left: 0.65rem;
  top: 1.15rem;
}

.key-metric-tile .key-metric-value {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.key-metric-tile .key-metric-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.15rem;
}

/* ── Sync bar chart ────────────────────────────────── */
.sync-chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.sync-chart-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sync-chart-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text);
}

.sync-chart-status {
  font-size: 0.78rem;
  font-weight: 500;
}

.sync-chart-status--success { color: var(--success); }
.sync-chart-status--failed { color: var(--danger); }
.sync-chart-status--info { color: var(--info); }
.sync-chart-status--warning { color: var(--warning); }

.sync-chart-bar-track {
  height: 10px;
  background: #e8ecf1;
  border-radius: 999px;
  overflow: hidden;
}

.sync-chart-bar {
  height: 100%;
  border-radius: 999px;
  transition: width 0.35s ease;
}

.sync-chart-bar--success { background: linear-gradient(90deg, #22c55e, #16a34a); }
.sync-chart-bar--failed { background: linear-gradient(90deg, #ef4444, #dc2626); }
.sync-chart-bar--info { background: linear-gradient(90deg, #06b6d4, #0891b2); }
.sync-chart-bar--warning { background: linear-gradient(90deg, #f59e0b, #d97706); }

.sync-chart-meta {
  margin-top: 0.35rem;
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-family: 'JetBrains Mono', monospace;
}

.sync-chart-message {
  margin-top: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  font-size: 0.8rem;
}

/* ── History table (compact) ─────────────────────────── */
.card-compact .card-header {
  padding: 0.85rem 1.15rem;
}

.card-compact .card-body-table {
  padding: 0.75rem 1.15rem 1rem;
}

.card-header-actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.hint-compact {
  margin: 0 0 0.65rem;
}

.pipelines-table-wrap {
  max-height: calc(100vh - 280px);
  min-height: 320px;
  overflow: auto;
  border: 1px solid var(--card-border);
  border-radius: 8px;
}

.pipelines-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.pipelines-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--content-bg);
  box-shadow: 0 1px 0 var(--card-border);
}

.pipelines-table td,
.pipelines-table th {
  padding: 0.55rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
  vertical-align: middle;
}

.pipelines-table .wf-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  color: var(--text-secondary);
  word-break: break-all;
  margin-top: 0.15rem;
}

.pipelines-table .pipeline-title {
  font-weight: 600;
  color: var(--text);
}

.pipelines-table .pipeline-actions {
  display: flex;
  gap: 0.3rem;
  flex-wrap: nowrap;
}

.pipelines-table .pipeline-actions .btn {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  white-space: nowrap;
}

/* ── Content grid & cards ────────────────────────────── */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  margin-bottom: 1rem;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--card-border);
}

.card-header h2 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.card-body {
  padding: 1rem 1.25rem 1.25rem;
}

.tab-panel.hidden {
  display: none;
}

.tab-panel h2,
.tab-panel h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 0.85rem;
}

.key-metrics {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.key-metric-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.key-metric-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.key-metric-dot--blue { background: #3b82f6; }
.key-metric-dot--green { background: #22c55e; }
.key-metric-dot--purple { background: #a855f7; }
.key-metric-dot--teal { background: #14b8a6; }

.key-metric-value {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.key-metric-label {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

/* ── Forms & buttons ─────────────────────────────────── */
.form-stack label {
  display: block;
  margin-bottom: 0.75rem;
  font-size: 0.78rem;
  color: var(--sidebar-text);
}

.form-stack input {
  display: block;
  width: 100%;
  margin-top: 0.3rem;
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--sidebar-border);
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.25);
  color: #e2e8f0;
  font-size: 0.82rem;
}

.form-stack input:focus {
  outline: none;
  border-color: rgba(99, 102, 241, 0.5);
}

.btn {
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  width: 100%;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
  background: var(--content-bg);
  color: var(--text);
  border: 1px solid var(--card-border);
}

.btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-warning {
  background: var(--warning);
  color: #fff;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

.btn-block {
  width: 100%;
}

.btn-danger {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: var(--danger);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.18);
}

.hint,
.caption {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.panel-muted {
  font-size: 0.8rem;
  color: var(--sidebar-text);
  line-height: 1.65;
}

.panel-muted code {
  color: #93c5fd;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.78rem;
}

.msg {
  margin-top: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 8px;
  font-size: 0.82rem;
  border: 1px solid transparent;
}

.msg.success {
  background: rgba(16, 185, 129, 0.12);
  color: var(--success);
  border-color: rgba(16, 185, 129, 0.3);
}

.msg.error {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.msg.warning {
  background: rgba(245, 158, 11, 0.12);
  color: var(--warning);
  border-color: rgba(245, 158, 11, 0.3);
}

.env-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.06em;
}

.env-badge.dev {
  background: rgba(59, 130, 246, 0.12);
  color: #2563eb;
  border: 1px solid rgba(59, 130, 246, 0.3);
}

.env-badge.prod {
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.theme-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.theme-btn {
  flex: 1 1 calc(33% - 0.25rem);
  min-width: 4rem;
  padding: 0.4rem 0.3rem;
  border-radius: 6px;
  border: 1px solid var(--sidebar-border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--sidebar-text);
  font-size: 0.72rem;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}

.theme-btn:hover {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.25);
}

.theme-btn.active {
  border-color: #6366f1;
  color: #fff;
  background: rgba(99, 102, 241, 0.25);
}

/* ── Data panels ─────────────────────────────────────── */
.sync-panel {
  margin: 0;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.metrics-inline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.metric-card {
  background: var(--content-bg);
  padding: 0.85rem;
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--card-border);
}

.metric-card .label {
  font-size: 0.72rem;
  color: var(--text-secondary);
}

.metric-card .value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 600;
  margin-top: 0.3rem;
  color: var(--text);
}

.alert {
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  margin-top: 0.6rem;
  font-size: 0.85rem;
  border: 1px solid;
}

.alert-success {
  background: rgba(16, 185, 129, 0.08);
  color: #059669;
  border-color: rgba(16, 185, 129, 0.3);
}

.alert-error {
  background: rgba(239, 68, 68, 0.08);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.alert-info {
  background: rgba(6, 182, 212, 0.08);
  color: #0891b2;
  border-color: rgba(6, 182, 212, 0.3);
}

.alert-warning {
  background: rgba(245, 158, 11, 0.08);
  color: #d97706;
  border-color: rgba(245, 158, 11, 0.3);
}

.pipelines-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pipeline-row {
  display: grid;
  grid-template-columns: 2fr repeat(4, minmax(70px, auto)) 150px;
  gap: 0.75rem;
  align-items: center;
  padding: 0.85rem 1rem;
  background: var(--content-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font-size: 0.875rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.pipeline-row:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.08);
}

.pipeline-row .wf-id {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: var(--text-secondary);
  word-break: break-all;
}

.pipeline-actions {
  display: flex;
  gap: 0.35rem;
}

.pipeline-actions .btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
}

.status-running { color: var(--info); font-weight: 500; }
.status-success { color: var(--success); font-weight: 500; }
.status-failed { color: var(--danger); font-weight: 500; }
.status-cancelled { color: var(--warning); font-weight: 500; }

.jenkins-job-row {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--sidebar-border);
  font-size: 0.78rem;
}

.jenkins-job-row:last-child {
  border-bottom: none;
}

.sync-project-card {
  margin-bottom: 0.85rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--card-border);
}

.sync-project-card:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card-bg);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

th,
td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--card-border);
}

th {
  background: var(--content-bg);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

tr:hover td {
  background: rgba(79, 70, 229, 0.03);
}

.detail-query-row {
  display: flex;
  gap: 0.75rem;
  align-items: flex-end;
  margin-bottom: 1rem;
}

.detail-query-row .grow {
  flex: 1 1 auto;
  min-width: 0;
  margin-bottom: 0;
}

.detail-query-row input {
  display: block;
  width: 100%;
  min-width: 16rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  background: var(--card-bg);
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.875rem;
}

.detail-query-row input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.detail-query-row .btn-primary {
  width: auto;
  flex-shrink: 0;
}

.metrics-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  margin: 1rem 0;
}

.meta-block {
  margin-bottom: 1rem;
  font-size: 0.9rem;
  padding: 0.85rem 1rem;
  background: var(--content-bg);
  border-radius: 8px;
  border: 1px solid var(--card-border);
}

.card-header-title-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-header-title-row h2 {
  margin: 0;
}

.overview-back-btn,
.detail-back-btn {
  flex-shrink: 0;
}

.detail-steps-section {
  margin-bottom: 1rem;
}

.detail-steps-section h3 {
  margin: 0 0 0.65rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.steps-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  max-height: none;
  overflow: visible;
}

.steps-list li {
  padding: 0.6rem 0.85rem;
  margin-bottom: 0.3rem;
  border-radius: 8px;
  font-size: 0.875rem;
  background: var(--content-bg);
  border: 1px solid var(--card-border);
}

.steps-list.steps-list--compact li {
  padding: 0.45rem 0.75rem;
  margin-bottom: 0.25rem;
  font-size: 0.82rem;
  line-height: 1.5;
  word-break: break-word;
  white-space: normal;
}

.expander {
  margin: 0.5rem 0;
  background: var(--content-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
}

.expander summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text-secondary);
}

.expander summary:hover {
  color: var(--primary);
}

.expander pre {
  margin: 0.65rem 0 0;
  padding: 0.75rem;
  background: #1e293b;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.78rem;
  font-family: 'JetBrains Mono', monospace;
  color: #e2e8f0;
  max-height: 400px;
}

.banner {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.85rem;
  border: 1px solid var(--card-border);
  background: rgba(59, 130, 246, 0.06);
  color: var(--text);
}

.error {
  color: var(--danger);
}

.error-hint {
  color: #fca5a5;
  font-size: 0.72rem;
  margin: 0.1rem 0 0.25rem;
  word-break: break-all;
}

.info {
  color: var(--text-secondary);
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.checkbox-row input {
  accent-color: var(--primary);
}

.section-divider {
  border: none;
  height: 1px;
  background: var(--card-border);
  margin: 1.25rem 0;
}

code {
  font-family: 'JetBrains Mono', monospace;
  color: var(--primary);
  font-size: 0.88em;
}

.permissions-catalog {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  color: var(--text-secondary);
}

.permissions-catalog li {
  margin-bottom: 0.3rem;
}

.perm-cell {
  min-width: 240px;
}

.perm-check {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0.1rem 0.65rem 0.1rem 0;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.perm-check input {
  accent-color: var(--primary);
}

.create-user-form {
  margin: 0.75rem 0 1rem;
}

.create-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem 1rem;
  margin-bottom: 0.75rem;
}

.create-user-field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.create-user-label {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.create-user-field input {
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--text);
}

.create-user-perms {
  margin-bottom: 0.75rem;
}

.perm-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.account-badge {
  display: inline-block;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.72rem;
  border: 1px solid var(--card-border);
  color: var(--text-secondary);
}

.account-badge--local_managed {
  color: var(--primary);
  border-color: rgba(79, 70, 229, 0.35);
}

.account-badge--local_env {
  color: #b45309;
  border-color: rgba(180, 83, 9, 0.35);
}

/* ── Responsive & sidebar collapse ───────────────────── */
.app-shell.sidebar-collapsed .sidebar {
  transform: translateX(calc(-1 * var(--sidebar-w)));
  margin-left: calc(-1 * var(--sidebar-w));
}

@media (max-width: 1200px) {
  .stat-cards {
    grid-template-columns: repeat(3, 1fr);
  }
  .dashboard-board {
    grid-template-columns: 1fr;
  }
  .content-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  .pipeline-row {
    grid-template-columns: 1fr;
  }
  .metrics-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .app-shell:not(.sidebar-collapsed) .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.2);
  }
  .main-content {
    padding: 1rem;
  }
  .stat-cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 0 0.85rem;
  }
  .user-display {
    display: none;
  }
}

.login-page {
  --bg-deep: #030818;
  --surface: rgba(8, 28, 68, 0.72);
  --surface2: rgba(12, 42, 96, 0.85);
  --glass: rgba(14, 55, 120, 0.35);
  --border: rgba(56, 189, 248, 0.28);
  --border-bright: rgba(96, 220, 255, 0.55);
  --login-text: #e8f4ff;
  --login-muted: #7eb8e8;
  --login-primary: #00d4ff;
  --login-primary-glow: rgba(0, 212, 255, 0.45);
  --login-accent: #3b82f6;
  --login-success: #34d399;
  --login-danger: #f87171;
  --login-warning: #fbbf24;
  --login-bg-gradient: radial-gradient(ellipse 120% 80% at 10% 0%, rgba(0, 120, 255, 0.35) 0%, transparent 55%),
    linear-gradient(165deg, #020610 0%, #061a42 35%, #0a2870 70%, #030818 100%);
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  color: var(--login-text);
  background: var(--bg-deep);
}

.login-page::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  background: var(--login-bg-gradient);
}

.login-page .scanline {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.03) 2px,
    rgba(0, 0, 0, 0.03) 4px
  );
  opacity: 0.35;
}

.login-page .theme-btn {
  border-color: var(--border);
  background: var(--glass);
  color: var(--login-muted);
}

.login-page .theme-btn.active {
  border-color: var(--login-primary);
  color: var(--login-text);
  background: rgba(0, 212, 255, 0.12);
}

.login-particles,
.login-orb {
  position: fixed;
  pointer-events: none;
  z-index: 0;
}

.login-orb {
  border-radius: 50%;
  filter: blur(60px);
  animation: loginOrbFloat 12s ease-in-out infinite;
}

.login-orb--1 {
  width: 320px;
  height: 320px;
  top: -80px;
  left: -60px;
  background: var(--login-primary-glow);
  opacity: 0.35;
}

.login-orb--2 {
  width: 240px;
  height: 240px;
  bottom: 10%;
  right: 5%;
  background: rgba(59, 130, 246, 0.35);
  animation-delay: -4s;
  opacity: 0.3;
}

.login-orb--3 {
  width: 180px;
  height: 180px;
  top: 40%;
  left: 35%;
  background: rgba(0, 212, 255, 0.2);
  animation-delay: -8s;
  opacity: 0.25;
}

@keyframes loginOrbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(24px, -18px) scale(1.06); }
  66% { transform: translate(-16px, 12px) scale(0.94); }
}

.login-topbar {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
}

.login-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.login-logo-mark {
  display: flex;
  color: var(--login-primary);
}

.login-topbar-name {
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  color: var(--login-primary);
  font-weight: 700;
}

.login-theme-picker {
  max-width: 280px;
}

.login-stage {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr min(440px, 42vw);
  gap: 2rem;
  align-items: center;
  min-height: calc(100vh - 80px);
  padding: 0 2.5rem 2.5rem;
  max-width: 1280px;
  margin: 0 auto;
}

.login-hero {
  padding: 1rem 2rem 1rem 0;
}

.login-hero-eyebrow {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--login-muted);
}

.login-hero-title {
  margin: 0 0 1rem;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  color: var(--login-text);
}

.login-hero-accent {
  background: linear-gradient(135deg, var(--login-primary) 0%, #60a5fa 50%, var(--login-accent) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-hero-desc {
  margin: 0 0 2rem;
  max-width: 420px;
  color: var(--login-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.login-pipeline-viz {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.login-pipe-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.6rem 0.7rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--glass);
  font-size: 0.72rem;
  color: var(--login-muted);
  white-space: nowrap;
}

.login-pipe-node--active {
  border-color: var(--border-bright);
  color: var(--login-primary);
  box-shadow: 0 0 20px var(--login-primary-glow);
}

.login-pipe-icon {
  font-size: 0.9rem;
}

.login-pipe-line {
  width: 20px;
  height: 2px;
  background: linear-gradient(90deg, var(--border), var(--login-primary), var(--border));
  flex-shrink: 0;
}

.login-hero-quote {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  font-style: italic;
  color: var(--login-muted);
  min-height: 1.5em;
}

.login-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.login-badge {
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  border: 1px solid var(--border);
  background: var(--glass);
  color: var(--login-muted);
}

.login-panel {
  display: flex;
  justify-content: center;
  align-items: center;
}

.login-card {
  position: relative;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: 20px;
  padding: 2.25rem 2rem 1.75rem;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(12px);
  overflow: hidden;
}

.login-greeting {
  margin: 0 0 0.35rem;
  font-size: 0.82rem;
  color: var(--login-primary);
}

.login-card-title {
  margin: 0 0 0.25rem;
  font-size: 1.55rem;
  color: var(--login-text);
}

.login-card-sub {
  margin: 0 0 1.5rem;
  font-size: 0.85rem;
  color: var(--login-muted);
}

.login-tabs {
  position: relative;
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1rem;
  padding: 0.3rem;
  border-radius: 14px;
  background: rgba(3, 12, 32, 0.5);
  border: 1px solid var(--border);
}

.login-tab-indicator {
  position: absolute;
  top: 0.3rem;
  left: 0.3rem;
  height: calc(100% - 0.6rem);
  width: calc(50% - 0.35rem);
  border-radius: 11px;
  background: var(--surface2);
  border: 1px solid var(--border-bright);
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
  pointer-events: none;
}

.login-tab-indicator.at-ldap {
  transform: translateX(calc(100% + 0.35rem));
}

.login-tab {
  position: relative;
  z-index: 1;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.65rem 0.5rem;
  border: none;
  border-radius: 11px;
  background: transparent;
  color: var(--login-muted);
  cursor: pointer;
  font-size: 0.85rem;
}

.login-tab.active {
  color: var(--login-primary);
}

.login-tab.hidden,
.login-tabs--single {
  display: none;
}

.login-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  font-size: 0.78rem;
  color: var(--login-muted);
  line-height: 1.5;
}

.login-hint-dot {
  flex-shrink: 0;
  width: 6px;
  height: 6px;
  margin-top: 0.45em;
  border-radius: 50%;
  background: var(--login-primary);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
}

.login-field-label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.78rem;
  color: var(--login-muted);
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--login-muted);
  pointer-events: none;
}

.login-input {
  width: 100%;
  padding: 0.75rem 2.75rem 0.75rem 2.65rem;
  background: rgba(3, 15, 40, 0.75);
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--login-text);
  font-size: 0.92rem;
}

.login-input:focus {
  outline: none;
  border-color: var(--login-primary);
  box-shadow: 0 0 0 3px var(--login-primary-glow);
}

.login-pwd-toggle {
  position: absolute;
  right: 0.65rem;
  padding: 0.35rem;
  border: none;
  background: transparent;
  color: var(--login-muted);
  cursor: pointer;
  border-radius: 6px;
}

.login-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.85rem 1.25rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--login-primary) 0%, #2563eb 55%, var(--login-accent) 100%);
  color: #021018;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}

.login-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.login-submit-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(2, 16, 24, 0.25);
  border-top-color: #021018;
  border-radius: 50%;
  animation: loginSpin 0.7s linear infinite;
}

@keyframes loginSpin {
  to { transform: rotate(360deg); }
}

.login-msg {
  margin-top: 1rem;
  padding: 0.65rem 0.85rem;
  border-radius: 10px;
  font-size: 0.85rem;
  border: 1px solid transparent;
}

.login-msg.success {
  background: rgba(52, 211, 153, 0.12);
  color: var(--login-success);
  border-color: rgba(52, 211, 153, 0.35);
}

.login-msg.error {
  background: rgba(248, 113, 113, 0.12);
  color: var(--login-danger);
}

.login-msg.warning {
  background: rgba(251, 191, 36, 0.12);
  color: var(--login-warning);
}

.login-footer-note {
  margin: 1.25rem 0 0;
  text-align: center;
  font-size: 0.72rem;
  color: var(--login-muted);
  opacity: 0.7;
}

.login-card a {
  color: var(--login-primary);
}

@media (max-width: 960px) {
  .login-stage {
    grid-template-columns: 1fr;
    padding: 0 1.25rem 2rem;
  }
  .login-hero {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .login-orb {
    animation: none !important;
  }
}

/* 弹窗：header + 可滚动 body + 固定 footer */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow: hidden;
}

.modal.hidden {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
}

.modal-panel {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 2rem));
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
  overflow: hidden;
}

.modal-panel--stacked {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(88vh, 640px);
}

.modal-panel--wide {
  width: min(680px, calc(100vw - 2rem));
  max-height: min(88vh, 680px);
}

.modal-header {
  padding: 1rem 1.2rem 0.85rem;
  border-bottom: 1px solid var(--card-border);
  background: var(--card-bg);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
}

.modal-header .hint {
  margin: 0.35rem 0 0;
}

.modal-panel-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.85rem 1.2rem;
  min-height: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  padding: 0.85rem 1.2rem 1rem;
  border-top: 1px solid var(--card-border);
  background: var(--card-bg);
}

.modal-field {
  display: block;
  margin-top: 0.85rem;
}

.modal-field--compact {
  margin-top: 0;
}

.modal-field input,
.modal-field select,
.modal-field textarea {
  width: 100%;
  margin-top: 0.35rem;
  padding: 0.55rem 0.65rem;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  font: inherit;
  background: var(--content-bg);
  color: var(--text);
}

.modal-field textarea {
  resize: vertical;
  min-height: 96px;
  max-height: 160px;
  line-height: 1.5;
}

#review-form-comment {
  min-height: 110px;
  max-height: 180px;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
}

.score-vote-section {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

.score-vote-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.score-vote-row:last-child {
  margin-bottom: 0;
}

.score-vote-label {
  flex: 0 0 96px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text);
}

.score-vote-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.score-btn {
  min-width: 2.4rem;
  padding: 0.28rem 0.55rem;
  border: 1px solid var(--card-border);
  border-radius: 999px;
  background: var(--content-bg);
  color: var(--text);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.score-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.score-btn.active {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.12);
  color: var(--primary);
  font-weight: 600;
}

.score-btn[data-value='2'].active,
.score-btn[data-value='1'].active {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.14);
  color: var(--success);
}

.score-btn[data-value='-1'].active,
.score-btn[data-value='-2'].active {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.12);
  color: var(--danger);
}

.merge-records-search {
  margin-bottom: 0.85rem;
  align-items: flex-end;
}

.merge-records-search label {
  min-width: 180px;
}

.merge-records-remark {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.review-comment-cell {
  min-width: 320px;
  max-width: 560px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
  vertical-align: top;
}

.reviews-table-wrap {
  overflow-x: auto;
}

.reviews-table td {
  vertical-align: top;
}

.review-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem 1rem;
}

.reviews-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.reviews-toolbar .hint {
  margin: 0;
  flex: 1 1 240px;
}

.reviews-toolbar-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ── System config toggles ───────────────────────────── */
.system-config-card .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.system-setting-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--border, #e5e7eb);
}

.system-setting-row:last-of-type {
  border-bottom: none;
}

.system-setting-text {
  flex: 1;
  min-width: 0;
}

.system-setting-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text, #1f2937);
  margin-bottom: 0.25rem;
}

.system-setting-desc {
  font-size: 0.8rem;
  color: var(--muted, #6b7280);
  line-height: 1.45;
}

.toggle-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  width: 44px;
  height: 24px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
  background: #6366f1;
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

.toggle-switch input:disabled + .toggle-slider {
  opacity: 0.55;
  cursor: not-allowed;
}

.toggle-switch input:disabled ~ .toggle-slider,
.toggle-switch input:disabled {
  cursor: not-allowed;
}
