/* ============================================================
   管理后台全局样式
   Bootstrap 5 + 自定义扩展
   ============================================================ */

:root {
  --sidebar-width: 240px;
  --topbar-height: 56px;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --sidebar-bg: #1e293b;
  --sidebar-text: #cbd5e1;
  --sidebar-active: #3b82f6;
  --sidebar-hover: #334155;
  --topbar-bg: #ffffff;
  --body-bg: #f1f5f9;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;

  /* 状态颜色 */
  --status-scheduled: #94a3b8;
  --status-pending: #f59e0b;
  --status-active: #22c55e;
  --status-approved: #22c55e;
  --status-rejected: #ef4444;
  --status-executing: #f97316;
  --status-completed: #22c55e;
  --status-failed: #ef4444;
  --status-suspended: #eab308;
  --status-cancelled: #94a3b8;
  --status-expired: #94a3b8;
  --status-locked: #8b5cf6;
  --status-frozen: #64748b;
  --status-closed: #374151;

  /* 健康度颜色 */
  --health-good: #22c55e;
  --health-warning: #f97316;
  --health-danger: #ef4444;

  /* 告警颜色 */
  --alert-urgent: #ef4444;
  --alert-warning: #f59e0b;
  --alert-info: #3b82f6;
}

/* ── 全局重置 ── */
*, *::before, *::after { box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--body-bg);
  color: var(--text-primary);
  margin: 0;
  overflow-x: hidden;
}

/* ── 侧栏 ── */
.admin-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--sidebar-bg);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: #475569; border-radius: 2px; }

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid #334155;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}
.sidebar-brand .brand-icon {
  width: 32px; height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}

.sidebar-section {
  padding: 8px 0;
  border-bottom: 1px solid #334155;
}
.sidebar-section:last-child { border-bottom: none; }

.sidebar-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748b;
  padding: 8px 20px 4px;
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--sidebar-text);
  text-decoration: none;
  font-size: 13.5px;
  border-radius: 0;
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.sidebar-item:hover { background: var(--sidebar-hover); color: #fff; }
.sidebar-item.active { background: var(--primary); color: #fff; }
.sidebar-item .item-icon { width: 18px; text-align: center; flex-shrink: 0; font-size: 14px; }
.sidebar-item .item-badge {
  margin-left: auto;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}
.sidebar-item.fund-alert { background: rgba(239,68,68,0.15); }
.sidebar-item.fund-alert:hover { background: rgba(239,68,68,0.25); }
.sidebar-item.fund-alert.active { background: #ef4444; }

/* ── 顶栏 ── */
.admin-topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-width);
  right: 0;
  height: var(--topbar-height);
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--border-color);
  z-index: 999;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.topbar-breadcrumb { flex: 1; font-size: 13px; color: var(--text-secondary); }
.topbar-breadcrumb .current { color: var(--text-primary); font-weight: 500; }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.topbar-avatar {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 13px;
}
.topbar-username { font-weight: 500; }
.topbar-role-badge {
  font-size: 10px; font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  background: #dbeafe;
  color: #1d4ed8;
}
.topbar-role-badge.super_admin { background: #fef3c7; color: #92400e; }
.topbar-role-badge.finance { background: #d1fae5; color: #065f46; }
.topbar-role-badge.viewer { background: #f1f5f9; color: #475569; }

/* ── 主内容区 ── */
.admin-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 24px;
  min-height: calc(100vh - var(--topbar-height));
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-title { font-size: 20px; font-weight: 700; color: var(--text-primary); margin: 0; }
.page-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* ── 卡片 ── */
.admin-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.admin-card .card-title {
  font-size: 14px; font-weight: 600;
  color: var(--text-primary); margin-bottom: 16px;
  display: flex; align-items: center; gap: 8px;
}

/* ── 统计卡片 ── */
.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat-card .stat-label { font-size: 12px; color: var(--text-secondary); font-weight: 500; text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card .stat-value { font-size: 28px; font-weight: 700; color: var(--text-primary); margin: 6px 0 4px; line-height: 1; }
.stat-card .stat-value.large { font-size: 36px; }
.stat-card .stat-sub { font-size: 12px; color: var(--text-secondary); }
.stat-card .stat-icon {
  position: absolute; top: 16px; right: 16px;
  width: 40px; height: 40px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

/* ── 状态Badge ── */
.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.badge-status::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.bs-pending    { background: #fef3c7; color: #92400e; }
.bs-draft      { background: #f1f5f9; color: #475569; }
.bs-submitted  { background: #dbeafe; color: #1d4ed8; }
.bs-approved   { background: #d1fae5; color: #065f46; }
.bs-rejected   { background: #fee2e2; color: #991b1b; }
.bs-expired    { background: #f1f5f9; color: #6b7280; }
.bs-active     { background: #d1fae5; color: #065f46; }
.bs-frozen     { background: #f1f5f9; color: #475569; }
.bs-closed     { background: #f1f5f9; color: #374151; }
.bs-locked     { background: #ede9fe; color: #5b21b6; }
.bs-executing  { background: #ffedd5; color: #9a3412; }
.bs-completed  { background: #d1fae5; color: #065f46; }
.bs-failed     { background: #fee2e2; color: #991b1b; }
.bs-suspended  { background: #fef9c3; color: #713f12; }
.bs-cancelled  { background: #f1f5f9; color: #6b7280; }
.bs-scheduled  { background: #f1f5f9; color: #6b7280; }
.bs-generated  { background: #dbeafe; color: #1d4ed8; }
.bs-signed     { background: #d1fae5; color: #065f46; }
.bs-archived   { background: #e0e7ff; color: #3730a3; }
.bs-reviewed   { background: #d1fae5; color: #065f46; }
.bs-filed      { background: #dbeafe; color: #1d4ed8; }
.bs-confirmed  { background: #d1fae5; color: #065f46; }
.bs-calculated { background: #fef3c7; color: #92400e; }
.bs-under_review { background: #dbeafe; color: #1d4ed8; }
.bs-payment_pending { background: #fef3c7; color: #92400e; }
.bs-contract_generating { background: #e0e7ff; color: #3730a3; }
.bs-contract_generated  { background: #dbeafe; color: #1d4ed8; }
.bs-contract_signed     { background: #d1fae5; color: #065f46; }
.bs-ready_to_execute    { background: #cffafe; color: #0e7490; }
.bs-transfer_completed  { background: #d1fae5; color: #065f46; }
.bs-transfer_failed     { background: #fee2e2; color: #991b1b; }
.bs-invoice_pending     { background: #fef3c7; color: #92400e; }
.bs-invoice_generating  { background: #e0e7ff; color: #3730a3; }
.bs-invoice_issued      { background: #dbeafe; color: #1d4ed8; }
.bs-receipt_pending     { background: #fef3c7; color: #92400e; }
.bs-receipt_generated   { background: #d1fae5; color: #065f46; }

/* ── 补充状态 Badge ── */
/* 支付状态 */
.bs-unpaid           { background: #fef9c3; color: #713f12; }
.bs-paid             { background: #d1fae5; color: #065f46; }
.bs-refunded         { background: #e0e7ff; color: #3730a3; }
.bs-pending_payment  { background: #fef3c7; color: #92400e; }  /* 兼容别名 */
/* 流程状态 */
.bs-pending_review   { background: #dbeafe; color: #1d4ed8; }
.bs-in_progress      { background: #cffafe; color: #0e7490; }
.bs-processing       { background: #cffafe; color: #0e7490; }
.bs-reviewing        { background: #dbeafe; color: #1d4ed8; }
.bs-queued           { background: #e0e7ff; color: #5b21b6; }
.bs-generating       { background: #e0e7ff; color: #5b21b6; }
.bs-voided           { background: #f1f5f9; color: #6b7280; }
.bs-terminated       { background: #fce7f3; color: #9d174d; }
.bs-overdue          { background: #fee2e2; color: #991b1b; }
.bs-blocked          { background: #fee2e2; color: #991b1b; }
.bs-unknown          { background: #f1f5f9; color: #94a3b8; }
.bs-inactive         { background: #f1f5f9; color: #6b7280; }
.bs-reporting        { background: #ede9fe; color: #5b21b6; }
.bs-success          { background: #d1fae5; color: #065f46; }
.bs-resolved         { background: #d1fae5; color: #065f46; }
.bs-matched          { background: #d1fae5; color: #065f46; }
.bs-mismatched       { background: #fee2e2; color: #991b1b; }
.bs-created          { background: #f1f5f9; color: #475569; }
/* 税务 / 资金 */
.bs-filing           { background: #dbeafe; color: #1d4ed8; }
.bs-available        { background: #d1fae5; color: #065f46; }
.bs-allocated        { background: #cffafe; color: #0e7490; }
.bs-in_use           { background: #ffedd5; color: #9a3412; }
.bs-collected        { background: #ede9fe; color: #5b21b6; }
/* 节点健康状态 */
.bs-healthy          { background: #d1fae5; color: #065f46; }
.bs-warning          { background: #fef3c7; color: #92400e; }
.bs-critical         { background: #fee2e2; color: #991b1b; }
/* 转账 */
.bs-transfer_pending { background: #fef3c7; color: #92400e; }

/* ── 健康度标签 ── */
.health-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 12px; font-size: 11px; font-weight: 600;
}
.health-good    { background: #d1fae5; color: #065f46; }
.health-warning { background: #ffedd5; color: #9a3412; }
.health-danger  { background: #fee2e2; color: #991b1b; }

/* ── 角色Badge ── */
.role-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}
.role-super_admin { background: #fef3c7; color: #92400e; }
.role-admin       { background: #dbeafe; color: #1d4ed8; }
.role-finance     { background: #d1fae5; color: #065f46; }
.role-viewer      { background: #f1f5f9; color: #475569; }

/* ── 表格 ── */
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-secondary);
  padding: 10px 16px; border-bottom: 1px solid var(--border-color);
  background: #f8fafc; text-align: left; white-space: nowrap;
}
.admin-table td {
  padding: 12px 16px; border-bottom: 1px solid var(--border-color);
  font-size: 13px; color: var(--text-primary); vertical-align: middle;
}
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tbody tr:hover { background: #f8fafc; cursor: pointer; }
.admin-table.no-hover tbody tr:hover { background: none; cursor: default; }
.admin-table td.text-mono { font-family: 'SF Mono', 'Fira Code', monospace; font-size: 12px; }
.admin-table tr.row-danger { background: #fef2f2; }
.admin-table tr.row-danger:hover { background: #fee2e2; }
.admin-table tr.row-warning { background: #fffbeb; }

/* ── Tab 导航 ── */
.admin-tabs {
  display: flex;
  border-bottom: 2px solid var(--border-color);
  margin-bottom: 20px;
  gap: 0;
  overflow-x: auto;
}
.admin-tab {
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  transition: color 0.15s, border-color 0.15s;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.admin-tab:hover { color: var(--primary); }
.admin-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.admin-tab .tab-badge {
  display: inline-block;
  background: #e2e8f0;
  color: var(--text-secondary);
  font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 10px;
  margin-left: 6px;
}
.admin-tab.active .tab-badge { background: #dbeafe; color: var(--primary); }

/* ── 搜索/筛选栏 ── */
.filter-bar {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.filter-bar .form-control,
.filter-bar .form-select {
  font-size: 13px;
  height: 36px;
  border-color: var(--border-color);
}
.filter-bar .btn { height: 36px; font-size: 13px; }
.filter-search { min-width: 240px; }

/* ── 弹窗增强 ── */
.modal-confirm .modal-body { text-align: center; padding: 32px; }
.modal-confirm .modal-icon { font-size: 48px; margin-bottom: 16px; }
.modal-confirm .modal-msg { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.modal-confirm .modal-sub { font-size: 13px; color: var(--text-secondary); }

/* ── 流水线阶段栏 ── */
.pipeline-bar {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 24px;
  margin-bottom: 24px;
  overflow-x: auto;
  gap: 0;
}
.pipeline-stage {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
}
.pipeline-stage:hover { background: #f1f5f9; }
.pipeline-stage.active { background: #dbeafe; color: var(--primary); }
.pipeline-stage.completed { color: var(--health-good); }
.pipeline-stage.expired { color: var(--status-rejected); }
.pipeline-stage .stage-num {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  background: currentColor;
  color: #fff;
  flex-shrink: 0;
}
.pipeline-stage.active .stage-num { background: var(--primary); }
.pipeline-stage.completed .stage-num { background: var(--health-good); }
.pipeline-stage .stage-arrow {
  color: var(--border-color);
  margin: 0 4px;
  font-size: 16px;
}

/* ── 倒计时 ── */
.countdown {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 6px;
}
.countdown.green  { background: #d1fae5; color: #065f46; }
.countdown.yellow { background: #fef9c3; color: #713f12; }
.countdown.red    { background: #fee2e2; color: #991b1b; animation: pulse 1s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ── 告警卡片 ── */
.alert-card {
  border-radius: 10px;
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
}
.alert-card.urgent  { background: #fef2f2; border-left: 3px solid #ef4444; }
.alert-card.warning { background: #fffbeb; border-left: 3px solid #f59e0b; }
.alert-card.info    { background: #eff6ff; border-left: 3px solid #3b82f6; }
.alert-card .alert-icon { flex-shrink: 0; font-size: 16px; }
.alert-card .alert-body { flex: 1; }
.alert-card .alert-title { font-weight: 600; margin-bottom: 2px; }
.alert-card .alert-link {
  font-size: 12px; color: var(--primary); text-decoration: none;
  font-weight: 500;
}
.alert-card .alert-link:hover { text-decoration: underline; }

/* ── 待办条目 ── */
.todo-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 13px;
  gap: 12px;
}
.todo-item:last-child { border-bottom: none; }
.todo-item .todo-dot {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0;
}
.todo-item .todo-count {
  font-size: 18px; font-weight: 700; flex-shrink: 0;
  min-width: 32px; text-align: right;
}
.todo-item .todo-label { flex: 1; color: var(--text-secondary); }
.todo-item a { text-decoration: none; color: inherit; }
.todo-item a:hover .todo-label { color: var(--primary); }

/* ── 进度条增强 ── */
.progress-thin { height: 4px; border-radius: 2px; }
.progress-med  { height: 8px; border-radius: 4px; }

/* ── 时间线 ── */
.timeline { padding: 0; list-style: none; }
.timeline-item {
  position: relative;
  padding-left: 28px;
  padding-bottom: 20px;
}
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before {
  content: '';
  position: absolute;
  left: 7px; top: 24px; bottom: 0;
  width: 2px;
  background: var(--border-color);
}
.timeline-item:last-child::before { display: none; }
.timeline-dot {
  position: absolute;
  left: 0; top: 4px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px var(--border-color);
}
.timeline-time { font-size: 11px; color: var(--text-muted); }
.timeline-content { font-size: 13px; margin-top: 2px; }
.timeline-actor { font-size: 11px; color: var(--text-secondary); }

/* ── 空状态 ── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--text-secondary);
}
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; color: var(--text-muted); }
.empty-state .empty-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.empty-state .empty-sub { font-size: 13px; }

/* ── 行内操作按钮 ── */
.btn-action {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.btn-action-primary { background: #dbeafe; color: var(--primary); border-color: #bfdbfe; }
.btn-action-primary:hover { background: #bfdbfe; }
.btn-action-danger  { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.btn-action-danger:hover  { background: #fecaca; }
.btn-action-warning { background: #fef9c3; color: #713f12; border-color: #fef08a; }
.btn-action-success { background: #d1fae5; color: #065f46; border-color: #a7f3d0; }
.btn-action-neutral { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }

/* ── 分页 ── */
.admin-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--border-color);
  font-size: 13px;
}
.admin-pagination .page-info { color: var(--text-secondary); }
.pagination-btns { display: flex; gap: 4px; }
.pagination-btns .page-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  cursor: pointer;
  background: none;
  font-size: 13px;
  color: var(--text-primary);
  transition: all 0.15s;
}
.pagination-btns .page-btn:hover { background: #f1f5f9; }
.pagination-btns .page-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination-btns .page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Toast ── */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.admin-toast {
  background: #1e293b;
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  max-width: 320px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  pointer-events: all;
  animation: slideInRight 0.3s ease;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.admin-toast.toast-success { border-left: 4px solid var(--health-good); }
.admin-toast.toast-error   { border-left: 4px solid var(--alert-urgent); }
.admin-toast.toast-warning { border-left: 4px solid var(--alert-warning); }
.admin-toast.toast-info    { border-left: 4px solid var(--alert-info); }
.admin-toast .toast-icon   { flex-shrink: 0; font-size: 16px; }
.admin-toast .toast-close  { margin-left: auto; cursor: pointer; opacity: 0.6; }
.admin-toast .toast-close:hover { opacity: 1; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

/* ── 加载骨架屏 ── */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── 权限矩阵 ── */
.perm-table th, .perm-table td {
  text-align: center;
  font-size: 12px;
  padding: 8px 12px;
}
.perm-table td:first-child { text-align: left; font-weight: 500; }
.perm-yes  { color: #065f46; font-size: 16px; }
.perm-no   { color: #991b1b; font-size: 16px; }
.perm-read { color: #1d4ed8; font-size: 14px; }

/* ── 完整度进度条 ── */
.completeness-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.completeness-bar .progress { flex: 1; height: 6px; border-radius: 3px; }
.completeness-pct { font-weight: 600; min-width: 32px; color: var(--text-secondary); }

/* ── 节点余额看板 ── */
.node-balance-item {
  display: flex; align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
  gap: 12px; font-size: 13px;
}
.node-balance-item.pinned { background: #fefce8; margin: 0 -20px; padding: 10px 20px; border: 1px solid #fde68a; border-radius: 8px; margin-bottom: 4px; }
.node-balance-item .node-name { flex: 1; font-weight: 500; }
.node-balance-item .node-layer { font-size: 11px; color: var(--text-muted); }
.node-balance-item .node-amount { font-weight: 600; min-width: 100px; text-align: right; }

/* ── AI 调用历史 ── */
.ai-token-badge {
  font-size: 11px; background: #e0e7ff; color: #3730a3;
  padding: 1px 6px; border-radius: 10px; font-weight: 600;
}
.ai-cost-badge {
  font-size: 11px; background: #fef9c3; color: #713f12;
  padding: 1px 6px; border-radius: 10px; font-weight: 600;
}

/* ── 日历 ── */
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.1s;
  position: relative;
}
.cal-cell:hover { opacity: 0.8; transform: scale(1.05); }
.cal-cell.workday  { background: #f8fafc; color: var(--text-primary); }
.cal-cell.holiday  { background: #fee2e2; color: #991b1b; }
.cal-cell.workday-override { background: #d1fae5; color: #065f46; }
.cal-cell.weekend  { background: #f1f5f9; color: var(--text-muted); }
.cal-cell.today    { outline: 2px solid var(--primary); }
.cal-cell.other-month { opacity: 0.3; }
.cal-header-day { font-size: 11px; font-weight: 600; color: var(--text-muted); text-align: center; padding: 4px 0; }

/* ── 提示词编辑器 ── */
.prompt-editor {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 13px;
  line-height: 1.6;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 16px;
  width: 100%;
  resize: vertical;
  border: none;
  outline: none;
  min-height: 200px;
}
.prompt-variable { color: #fbbf24; font-weight: 600; }

/* ── 响应式 ── */
@media (max-width: 1024px) {
  :root { --sidebar-width: 64px; }
  .sidebar-item .item-label { display: none; }
  .sidebar-label { display: none; }
  .sidebar-brand span { display: none; }
}
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-sidebar.open { transform: translateX(0); }
  .admin-content { margin-left: 0; }
  .admin-topbar { left: 0; }
}
