/* ============================================================
   美电智维 · 维保管理后台样式
   ============================================================ */

/* ---------- 变量 ---------- */
:root {
  --sidebar-w: 240px;
  --admin-bg: #f0f2f5;
  --admin-card: #ffffff;
  --admin-border: #e8eaed;
  --admin-text: #1a1a2e;
  --admin-text-2: #6b7280;
  --admin-text-3: #9ca3af;
  --primary: #0A7C66;
  --primary-light: #0d9278;
  --primary-bg: rgba(10, 124, 102, 0.08);
  --success: #16a34a;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #3b82f6;
  --purple: #8b5cf6;
  --teal: #14b8a6;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --admin-bg: #0f1115;
  --admin-card: #1a1d24;
  --admin-border: #2a2d35;
  --admin-text: #f0f0f0;
  --admin-text-2: #a0a3ab;
  --admin-text-3: #6b6e76;
  --admin-bg-2: #161920;
}

/* ---------- Reset ---------- */
* { margin: 0; padding: 0; box-sizing: border-box; }
.admin-body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--admin-bg);
  color: var(--admin-text);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

/* ---------- 后台登录页 ---------- */
.admin-login-page {
  position: fixed; inset: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0a7c66 0%, #064e3b 100%);
  overflow: hidden;
}
.admin-login-page:not(.active) { display: none; }
.admin-login-container { width: 100%; max-width: 420px; padding: 20px; position: relative; z-index: 2; }

/* ---------- 后台主体布局 ---------- */
.admin-app {
  display: flex;
  min-height: 100vh;
}

/* ---------- 侧边栏 ---------- */
.admin-sidebar {
  width: var(--sidebar-w);
  background: var(--admin-card);
  border-right: 1px solid var(--admin-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform 0.3s;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--admin-border);
}
.sidebar-logo svg { width: 28px; height: 28px; color: var(--primary); }
.sidebar-logo span { font-size: 18px; font-weight: 700; color: var(--admin-text); }

.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  color: var(--admin-text-2);
  text-decoration: none;
  font-size: 14px; font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: 4px;
  background: none; border: none; width: 100%;
  text-align: left;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item:hover { background: var(--admin-bg); color: var(--admin-text); }
.nav-item.active { background: var(--primary-bg); color: var(--primary); font-weight: 600; }
.nav-item.active svg { color: var(--primary); }

.sidebar-footer { padding: 12px; border-top: 1px solid var(--admin-border); }
.sidebar-icp { text-align: center; padding: 8px 0 4px; font-size: 11px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.sidebar-icp a { color: var(--admin-text-3); text-decoration: none; opacity: 0.6; }
.sidebar-icp a:hover { opacity: 1; }

/* ---------- 主内容 ---------- */
.admin-main {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 0;
  min-width: 0;
}

/* ---------- 顶栏 ---------- */
.admin-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 28px;
  background: var(--admin-card);
  border-bottom: 1px solid var(--admin-border);
  position: sticky; top: 0; z-index: 50;
}
.admin-header h2 { font-size: 20px; font-weight: 700; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.header-search {
  width: 280px;
  padding: 8px 14px;
  border: 1px solid var(--admin-border);
  border-radius: var(--radius-sm);
  background: var(--admin-bg);
  color: var(--admin-text);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.header-search:focus { border-color: var(--primary); }

.theme-toggle {
  width: 36px; height: 36px;
  border: 1px solid var(--admin-border);
  border-radius: 50%;
  background: var(--admin-card);
  color: var(--admin-text);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.theme-toggle:hover { border-color: var(--primary); color: var(--primary); }
.theme-toggle svg { width: 18px; height: 18px; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }

/* ---------- 视图容器 ---------- */
.admin-view { display: none; padding: 24px 28px; }
.admin-view.active { display: block; animation: fadeIn 0.3s; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- 统计卡片 ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--admin-card);
  border-radius: var(--radius);
  padding: 20px;
  display: flex; align-items: center; gap: 16px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--admin-border);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
  position: relative;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); }
.stat-card::after {
  content: '点击查看 →';
  position: absolute;
  bottom: 6px; right: 12px;
  font-size: 11px;
  color: var(--admin-text-3);
  opacity: 0;
  transition: opacity 0.2s;
}
.stat-card:hover::after { opacity: 1; }
.stat-icon {
  width: 48px; height: 48px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.stat-icon svg { width: 24px; height: 24px; }
.stat-primary .stat-icon { background: var(--primary-bg); color: var(--primary); }
.stat-success .stat-icon { background: rgba(22,163,74,0.1); color: var(--success); }
.stat-warning .stat-icon { background: rgba(245,158,11,0.1); color: var(--warning); }
.stat-info .stat-icon { background: rgba(59,130,246,0.1); color: var(--info); }
.stat-purple .stat-icon { background: rgba(139,92,246,0.1); color: var(--purple); }
.stat-teal .stat-icon { background: rgba(20,184,166,0.1); color: var(--teal); }
.stat-value { font-size: 28px; font-weight: 700; line-height: 1.2; }
.stat-label { font-size: 13px; color: var(--admin-text-2); margin-top: 2px; }

/* ---------- 面板 ---------- */
.panel {
  background: var(--admin-card);
  border-radius: var(--radius);
  border: 1px solid var(--admin-border);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--admin-border);
}
.panel-header h3 { font-size: 15px; font-weight: 600; }
.panel-body { padding: 16px 20px; }
.panel-action {
  background: none; border: none;
  color: var(--primary);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s;
}
.panel-action:hover { background: var(--primary-bg); }

.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* ---------- 数据表格 ---------- */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.data-table th {
  text-align: left;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--admin-text-2);
  border-bottom: 2px solid var(--admin-border);
  white-space: nowrap;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.data-table td {
  padding: 12px;
  border-bottom: 1px solid var(--admin-border);
  color: var(--admin-text);
}
.data-table tbody tr { transition: background 0.15s; }
.data-table tbody tr:hover { background: var(--admin-bg); }
.data-table tbody tr:last-child td { border-bottom: none; }

/* 表格中的状态标签 */
.tag {
  display: inline-flex; align-items: center;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.tag-good { background: rgba(22,163,74,0.1); color: var(--success); }
.tag-fair { background: rgba(245,158,11,0.1); color: var(--warning); }
.tag-poor { background: rgba(239,68,68,0.1); color: var(--danger); }
.tag-draft { background: rgba(156,163,175,0.15); color: var(--admin-text-3); }
.tag-ongoing { background: rgba(59,130,246,0.1); color: var(--info); }

/* 进度条 */
.progress-bar {
  width: 80px; height: 6px;
  background: var(--admin-bg);
  border-radius: 3px;
  overflow: hidden;
  display: inline-block;
  vertical-align: middle;
}
.progress-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s;
}
.progress-fill.complete { background: var(--success); }
.progress-fill.partial { background: var(--warning); }
.progress-fill.empty { background: var(--admin-text-3); }

/* 操作按钮 */
.row-actions { display: flex; gap: 6px; }
.btn-sm {
  padding: 5px 12px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: var(--admin-card);
  color: var(--admin-text-2);
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.btn-sm:hover { border-color: var(--primary); color: var(--primary); }
.btn-sm svg { width: 14px; height: 14px; }

/* ---------- 筛选栏 ---------- */
.filter-bar { display: flex; gap: 10px; }
.filter-select {
  padding: 6px 12px;
  border: 1px solid var(--admin-border);
  border-radius: 6px;
  background: var(--admin-card);
  color: var(--admin-text);
  font-size: 13px;
  cursor: pointer;
  outline: none;
}
.filter-select:focus { border-color: var(--primary); }

/* ---------- 人员/项目详情 ---------- */
.detail-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  border: 1px solid var(--admin-border);
  border-radius: 8px;
  background: var(--admin-card);
  color: var(--admin-text-2);
  font-size: 13px;
  cursor: pointer;
  margin-bottom: 16px;
  transition: all 0.2s;
}
.detail-back:hover { border-color: var(--primary); color: var(--primary); }
.detail-back svg { width: 16px; height: 16px; }

.detail-header-card {
  background: var(--admin-card);
  border-radius: var(--radius);
  border: 1px solid var(--admin-border);
  padding: 24px;
  margin-bottom: 20px;
  display: flex; align-items: center; gap: 20px;
}
.detail-avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; font-weight: 700;
  flex-shrink: 0;
}
.detail-info h3 { font-size: 20px; margin-bottom: 4px; }
.detail-info p { font-size: 13px; color: var(--admin-text-2); }
.detail-stats { display: flex; gap: 24px; margin-left: auto; }
.detail-stat { text-align: center; }
.detail-stat-value { font-size: 24px; font-weight: 700; color: var(--primary); }
.detail-stat-label { font-size: 12px; color: var(--admin-text-2); }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: flex-start; justify-content: center;
  overflow-y: auto;
  padding: 30px 20px;
}
.modal-overlay.show { display: flex; animation: fadeIn 0.2s; }
.modal-container {
  background: var(--admin-card);
  border-radius: var(--radius);
  width: 100%; max-width: 900px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--admin-border);
  position: sticky; top: 0;
  background: var(--admin-card);
  z-index: 10;
}
.modal-header h3 { font-size: 17px; font-weight: 600; }
.modal-actions { display: flex; align-items: center; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-print { background: var(--info); color: white; }
.btn-print:hover { background: #2563eb; }
.btn-export { background: var(--success); color: white; }
.btn-export:hover { background: #15803d; }
.modal-close {
  width: 32px; height: 32px;
  border: none;
  background: none;
  font-size: 24px;
  color: var(--admin-text-2);
  cursor: pointer;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { background: var(--admin-bg); color: var(--admin-text); }
.modal-body { padding: 24px; max-height: calc(100vh - 120px); overflow-y: auto; }

/* ---------- 弹窗内记录详情 ---------- */
.record-detail-section { margin-bottom: 24px; }
.record-detail-section h4 {
  font-size: 14px; font-weight: 600;
  padding-bottom: 8px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--primary);
  color: var(--primary);
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
}
.info-item { display: flex; gap: 8px; font-size: 13px; }
.info-item .label { color: var(--admin-text-2); min-width: 80px; flex-shrink: 0; }
.info-item .value { color: var(--admin-text); font-weight: 500; }

.inspect-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.inspect-table th {
  background: var(--admin-bg);
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--admin-text-2);
  border: 1px solid var(--admin-border);
}
.inspect-table td {
  padding: 8px 10px;
  border: 1px solid var(--admin-border);
}
.inspect-cat-row td {
  background: var(--primary-bg);
  font-weight: 600;
  color: var(--primary);
}
.result-normal { color: var(--success); font-weight: 700; }
.result-abnormal { color: var(--danger); font-weight: 700; }
.result-pending { color: var(--admin-text-3); }

.sign-row { display: flex; gap: 24px; margin-top: 12px; }
.sign-box { flex: 1; }
.sign-box p { font-size: 12px; color: var(--admin-text-2); margin-bottom: 6px; }
.sign-img { max-height: 60px; border: 1px solid var(--admin-border); border-radius: 6px; padding: 4px; }
.sign-empty { height: 50px; border: 1px dashed var(--admin-border); border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--admin-text-3); font-size: 12px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 30px; left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--admin-text);
  color: var(--admin-card);
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 2000;
  opacity: 0;
  transition: all 0.3s;
  pointer-events: none;
  box-shadow: var(--shadow-lg);
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.error { background: var(--danger); color: white; }
.toast.success { background: var(--success); color: white; }

/* ---------- Loading ---------- */
.loading-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(2px);
  z-index: 3000;
  display: none;
  align-items: center; justify-content: center;
  flex-direction: column; gap: 16px;
}
.loading-overlay.show { display: flex; }
.loading-spinner {
  width: 40px; height: 40px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p { color: white; font-size: 14px; }

/* ---------- 空状态 ---------- */
.empty-row td { text-align: center; padding: 40px; color: var(--admin-text-3); }

/* ============================================================
   打印样式
   ============================================================ */
#printArea {
  display: none;
}

@media print {
  body * { visibility: hidden; }
  #printArea, #printArea * { visibility: visible; }
  #printArea {
    display: block !important;
    position: absolute; left: 0; top: 0;
    width: 100%;
  }
  @page { margin: 15mm; }
}

/* 打印内容样式 */
.print-report {
  font-family: "SimSun", "宋体", serif;
  color: #000;
  width: 100%;
}
.print-report h1 {
  text-align: center;
  font-size: 20px;
  margin-bottom: 4px;
  letter-spacing: 2px;
}
.print-report .print-subtitle {
  text-align: center;
  font-size: 12px;
  color: #555;
  margin-bottom: 16px;
}
.print-report .print-info-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 13px;
}
.print-report .print-info-table td {
  padding: 6px 10px;
  border: 1px solid #999;
}
.print-report .print-info-table .lbl {
  background: #f0f0f0;
  font-weight: bold;
  width: 120px;
}
.print-report .print-inspect-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 16px;
}
.print-report .print-inspect-table th {
  background: #e8e8e8;
  padding: 6px 8px;
  border: 1px solid #999;
  text-align: center;
  font-weight: bold;
}
.print-report .print-inspect-table td {
  padding: 5px 8px;
  border: 1px solid #999;
  vertical-align: top;
}
.print-report .print-cat-row td {
  background: #f5f5f5;
  font-weight: bold;
  text-align: center;
}
.print-report .print-section-title {
  font-size: 14px;
  font-weight: bold;
  margin: 16px 0 8px;
  padding: 4px 8px;
  background: #f0f0f0;
  border-left: 4px solid #333;
}
.print-report .print-sign-row {
  display: flex; gap: 40px;
  margin-top: 20px;
  font-size: 13px;
}
.print-report .print-sign-box { flex: 1; }
.print-report .print-sign-line {
  border-bottom: 1px solid #333;
  height: 40px;
  margin-top: 4px;
}
.print-report .print-footer {
  text-align: center;
  font-size: 11px;
  color: #999;
  margin-top: 24px;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .header-search { width: 180px; }
}
@media (max-width: 768px) {
  .admin-sidebar { transform: translateX(-100%); }
  .admin-main { margin-left: 0; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .info-grid { grid-template-columns: 1fr; }
  .header-search { display: none; }
}

/* ---------- 增加项目按钮 ---------- */
.btn-add-project {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 16px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #0A7C66, #0a6d5e);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  box-shadow: 0 2px 8px rgba(10, 124, 102, .25);
}
.btn-add-project:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(10, 124, 102, .35);
}
.btn-add-project:active { transform: translateY(0); }

/* ---------- 项目标签 ---------- */
.tag-manual {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  background: rgba(139, 92, 246, .12);
  color: #7c3aed;
  vertical-align: middle;
}

/* ---------- 操作列 ---------- */
.action-cell { white-space: nowrap; }
.action-cell .btn-sm + .btn-sm { margin-left: 6px; }
.btn-danger-sm {
  background: rgba(239, 68, 68, .1) !important;
  color: #ef4444 !important;
  border: 1px solid rgba(239, 68, 68, .2) !important;
}
.btn-danger-sm:hover {
  background: rgba(239, 68, 68, .18) !important;
}
.btn-edit-sm {
  background: rgba(10, 124, 102, .1) !important;
  color: #0A7C66 !important;
  border: 1px solid rgba(10, 124, 102, .2) !important;
}
.btn-edit-sm:hover {
  background: rgba(10, 124, 102, .18) !important;
}

/* ---------- 增加项目弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  animation: modalFadeIn .2s ease;
}
@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.modal-box {
  background: var(--admin-bg, #fff);
  border-radius: 16px;
  width: 440px;
  max-width: 92vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .2);
  overflow: hidden;
  animation: modalSlideUp .25s cubic-bezier(.16, 1, .3, 1);
}
@keyframes modalSlideUp {
  from { transform: translateY(24px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--admin-border, #e5e7eb);
}
.modal-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--admin-text-1, #1f2937);
}
.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--admin-text-3, #9ca3af);
  transition: all .15s ease;
}
.modal-close:hover {
  background: rgba(0, 0, 0, .06);
  color: var(--admin-text-1, #1f2937);
}
.modal-close svg { width: 18px; height: 18px; }
.modal-body {
  padding: 22px 24px;
}
.modal-body .form-field {
  margin-bottom: 18px;
}
.modal-body .form-field:last-child { margin-bottom: 0; }
.modal-body .form-field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--admin-text-2, #4b5563);
  margin-bottom: 7px;
}
.modal-body .form-field .req { color: #ef4444; }
.modal-body .form-field input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--admin-border, #e5e7eb);
  border-radius: 10px;
  font-size: 14px;
  color: var(--admin-text-1, #1f2937);
  background: var(--admin-bg, #fff);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
  box-sizing: border-box;
}
.modal-body .form-field input:focus {
  border-color: var(--admin-primary, #0A7C66);
  box-shadow: 0 0 0 3px rgba(10, 124, 102, .1);
}
.modal-body .form-field input::placeholder {
  color: var(--admin-text-3, #9ca3af);
}
.modal-foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--admin-border, #e5e7eb);
}
.modal-foot button {
  padding: 9px 22px;
  border: none;
  border-radius: 9px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}
.btn-cancel {
  background: transparent;
  color: var(--admin-text-2, #4b5563);
  border: 1.5px solid var(--admin-border, #e5e7eb) !important;
}
.btn-cancel:hover {
  background: rgba(0, 0, 0, .04);
}
.btn-save {
  background: linear-gradient(135deg, var(--admin-primary, #0A7C66), #0a6d5e);
  color: #fff;
  box-shadow: 0 2px 8px rgba(10, 124, 102, .25);
}
.btn-save:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(10, 124, 102, .35);
}

/* 深色主题适配 */
[data-theme="dark"] .modal-box {
  background: #1e293b;
  box-shadow: 0 20px 60px rgba(0, 0, 0, .5);
}
[data-theme="dark"] .modal-head {
  border-bottom-color: rgba(255, 255, 255, .08);
}
[data-theme="dark"] .modal-head h3 { color: #f1f5f9; }
[data-theme="dark"] .modal-close { color: #64748b; }
[data-theme="dark"] .modal-close:hover {
  background: rgba(255, 255, 255, .08);
  color: #e2e8f0;
}
[data-theme="dark"] .modal-body .form-field label { color: #cbd5e1; }
[data-theme="dark"] .modal-body .form-field input {
  border-color: rgba(255, 255, 255, .1);
  background: #0f172a;
  color: #f1f5f9;
}
[data-theme="dark"] .modal-body .form-field input::placeholder { color: #475569; }
[data-theme="dark"] .modal-foot { border-top-color: rgba(255, 255, 255, .08); }
[data-theme="dark"] .btn-cancel {
  color: #cbd5e1;
  border-color: rgba(255, 255, 255, .12) !important;
}
[data-theme="dark"] .btn-cancel:hover { background: rgba(255, 255, 255, .06); }

/* ============================================================
   维修账单样式
   ============================================================ */

/* ---------- 账单弹窗 ---------- */
.modal-bill {
  width: 960px;
  max-width: 95vw;
}

/* ---------- 表单双列布局 ---------- */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-row-2 .form-field { margin-bottom: 14px; }
.form-row-2 .form-field select {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--admin-border, #e5e7eb);
  border-radius: 10px;
  font-size: 14px;
  color: var(--admin-text, #1f2937);
  background: var(--admin-card, #fff);
  outline: none;
  transition: border-color .2s ease;
  box-sizing: border-box;
  cursor: pointer;
}
.form-row-2 .form-field select:focus {
  border-color: var(--primary, #0A7C66);
  box-shadow: 0 0 0 3px rgba(10, 124, 102, .1);
}

/* ---------- 维修明细区域 ---------- */
.bill-items-section {
  margin: 16px 0;
  border: 1.5px solid var(--admin-border, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
}
.bill-items-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--admin-bg, #f0f2f5);
  border-bottom: 1px solid var(--admin-border, #e5e7eb);
}
.bill-items-header label {
  font-size: 14px;
  font-weight: 700;
  color: var(--admin-text, #1f2937);
}

/* 添加项目按钮 */
.btn-add-item {
  padding: 5px 14px;
  border: 1.5px dashed var(--primary, #0A7C66);
  border-radius: 8px;
  background: rgba(10, 124, 102, .06);
  color: var(--primary, #0A7C66);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
}
.btn-add-item:hover {
  background: rgba(10, 124, 102, .12);
  transform: translateY(-1px);
}

/* ---------- 明细表格 ---------- */
.bill-items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.bill-items-table th {
  padding: 8px 10px;
  text-align: left;
  font-weight: 600;
  font-size: 12px;
  color: var(--admin-text-2, #6b7280);
  background: var(--admin-bg, #f0f2f5);
  border-bottom: 1px solid var(--admin-border, #e5e7eb);
  white-space: nowrap;
}
.bill-items-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--admin-border, #e5e7eb);
}
.bill-items-table td input {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--admin-border, #e5e7eb);
  border-radius: 6px;
  font-size: 13px;
  color: var(--admin-text, #1f2937);
  background: var(--admin-card, #fff);
  outline: none;
  transition: border-color .2s ease;
  box-sizing: border-box;
}
.bill-items-table td input:focus {
  border-color: var(--primary, #0A7C66);
  box-shadow: 0 0 0 2px rgba(10, 124, 102, .08);
}
.bill-items-table tfoot td {
  padding: 10px;
  font-size: 13px;
  background: var(--admin-bg, #f0f2f5);
  border-top: 2px solid var(--admin-border, #e5e7eb);
  border-bottom: none;
}
.bill-items-table tbody tr:last-child td { border-bottom: none; }
.bi-subtotal { white-space: nowrap; }

/* ---------- 账单详情（弹窗内展示） ---------- */
.bill-detail { padding: 4px 0; }
.bill-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary, #0A7C66);
}
.bill-detail-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--admin-text, #1f2937);
}
.bill-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 24px;
  margin-bottom: 20px;
}
.bill-info-grid .info-item { font-size: 13px; }
.bill-summary {
  display: flex;
  gap: 24px;
  padding: 16px 20px;
  background: var(--admin-bg, #f0f2f5);
  border-radius: 10px;
  margin-bottom: 16px;
}
.bill-summary-item {
  font-size: 15px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.bill-summary-item span { color: var(--admin-text-2, #6b7280); }

/* ---------- 账单状态标签（补充） ---------- */
.tag-default {
  background: rgba(156, 163, 175, .15);
  color: var(--admin-text-3, #9ca3af);
}
.tag-info {
  background: rgba(59, 130, 246, .1);
  color: var(--info, #3b82f6);
}

/* ---------- 打印报价函样式 ---------- */
.print-quotation {
  font-family: "SimSun", "宋体", serif;
  color: #000;
  width: 100%;
  padding: 20px;
}
.print-quotation .quot-header {
  text-align: center;
  margin-bottom: 20px;
}
.print-quotation .quot-header h1 {
  font-size: 22px;
  letter-spacing: 4px;
  margin-bottom: 6px;
}
.print-quotation .quot-header .quot-sub {
  font-size: 13px;
  color: #555;
}
.print-quotation .quot-title {
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  margin: 20px 0;
  letter-spacing: 2px;
}
.print-quotation .quot-info {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 16px;
}
.print-quotation .quot-info td {
  padding: 6px 10px;
  border: 1px solid #999;
}
.print-quotation .quot-info .lbl {
  background: #f0f0f0;
  font-weight: bold;
  width: 100px;
}
.print-quotation .quot-items {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 16px;
}
.print-quotation .quot-items th {
  background: #e8e8e8;
  padding: 6px 8px;
  border: 1px solid #999;
  text-align: center;
  font-weight: bold;
}
.print-quotation .quot-items td {
  padding: 5px 8px;
  border: 1px solid #999;
  vertical-align: top;
}
.print-quotation .quot-items tfoot td {
  background: #f5f5f5;
  font-weight: bold;
}
.print-quotation .quot-remark {
  font-size: 12px;
  color: #555;
  margin: 12px 0;
  padding: 8px;
  border-left: 3px solid #999;
  background: #f9f9f9;
}
.print-quotation .quot-footer {
  display: flex;
  justify-content: space-between;
  margin-top: 30px;
  font-size: 13px;
}
.print-quotation .quot-footer .quot-sign {
  text-align: center;
}
.print-quotation .quot-footer .quot-sign p { margin-bottom: 4px; }
.print-quotation .quot-footer .quot-sign-line {
  border-bottom: 1px solid #333;
  width: 200px;
  height: 36px;
  margin: 0 auto;
}
.print-quotation .quot-bottom {
  text-align: center;
  font-size: 11px;
  color: #999;
  margin-top: 20px;
  border-top: 1px solid #ddd;
  padding-top: 10px;
}

/* ---------- 深色主题适配（账单） ---------- */
[data-theme="dark"] .form-row-2 .form-field select {
  border-color: rgba(255, 255, 255, .1);
  background: #0f172a;
  color: #f1f5f9;
}
[data-theme="dark"] .bill-items-section {
  border-color: rgba(255, 255, 255, .1);
}
[data-theme="dark"] .bill-items-header {
  background: rgba(255, 255, 255, .04);
  border-bottom-color: rgba(255, 255, 255, .08);
}
[data-theme="dark"] .bill-items-table th {
  background: rgba(255, 255, 255, .04);
  color: #a0a3ab;
  border-bottom-color: rgba(255, 255, 255, .08);
}
[data-theme="dark"] .bill-items-table td {
  border-bottom-color: rgba(255, 255, 255, .06);
}
[data-theme="dark"] .bill-items-table td input {
  border-color: rgba(255, 255, 255, .1);
  background: #0f172a;
  color: #f1f5f9;
}
[data-theme="dark"] .bill-items-table tfoot td {
  background: rgba(255, 255, 255, .04);
  border-top-color: rgba(255, 255, 255, .1);
}
[data-theme="dark"] .bill-summary {
  background: rgba(255, 255, 255, .04);
}

/* ---------- 响应式（账单） ---------- */
@media (max-width: 768px) {
  .modal-bill { width: 95vw; }
  .form-row-2 { grid-template-columns: 1fr; }
  .bill-items-table { font-size: 12px; }
  .bill-items-table th, .bill-items-table td { padding: 4px 6px; }
  .bill-info-grid { grid-template-columns: 1fr; }
  .bill-summary { flex-wrap: wrap; gap: 12px; }
}
