:root {
  --primary: #1AAD19;
  --primary-dark: #158f14;
  --primary-light: #e8f8e8;
  --primary-ultra: #f0faf0;
  --accent: #FF6B35;
  --bg: #f0f2f5;
  --sidebar-bg: #1a1a2e;
  --sidebar-text: #a0a8c0;
  --sidebar-active: #ffffff;
  --sidebar-hover: rgba(255,255,255,0.08);
  --sidebar-section: rgba(255,255,255,0.25);
  --white: #ffffff;
  --text: #1a1a2e;
  --text-muted: #8892a4;
  --border: #e8ecf0;
  --red: #e74c3c;
  --orange: #f39c12;
  --blue: #3498db;
  --purple: #9b59b6;
  --sidebar-w: 240px;
  --topbar-h: 60px;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 24px rgba(0,0,0,0.10);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'PingFang SC', 'Helvetica Neue', sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; font-size: 13px; }

/* ===== 登录页 ===== */
#login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #0f0c29, #302b63, #24243e);
  position: relative; overflow: hidden;
}
#login-page::before {
  content: ''; position: absolute; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(26,173,25,0.15) 0%, transparent 70%);
  top: -100px; left: -100px; border-radius: 50%;
}
#login-page::after {
  content: ''; position: absolute; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(52,152,219,0.1) 0%, transparent 70%);
  bottom: -50px; right: -50px; border-radius: 50%;
}
.login-box {
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px; padding: 48px 44px; width: 420px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.4);
  position: relative; z-index: 1;
}
.login-logo { text-align: center; margin-bottom: 36px; }
.login-logo .icon {
  width: 72px; height: 72px; background: linear-gradient(135deg, #1AAD19, #0d7a0c);
  border-radius: 20px; display: inline-flex; align-items: center; justify-content: center;
  font-size: 26px; color: white; font-weight: 800; margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(26,173,25,0.4);
}
.login-logo h1 { font-size: 22px; font-weight: 700; color: white; }
.login-logo p { font-size: 13px; color: rgba(255,255,255,0.5); margin-top: 6px; }
.login-form input {
  width: 100%; padding: 14px 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 10px; font-size: 14px; margin-bottom: 12px;
  font-family: inherit; color: white; transition: all 0.2s;
}
.login-form input::placeholder { color: rgba(255,255,255,0.35); }
.login-form input:focus { outline: none; border-color: var(--primary); background: rgba(255,255,255,0.12); }
.login-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, #1AAD19, #0d7a0c);
  color: white; border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  font-family: inherit; transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(26,173,25,0.4);
}
.login-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(26,173,25,0.5); }
.login-error { color: #ff6b6b; font-size: 13px; margin-top: 10px; text-align: center; display: none; }

/* ===== 主界面 ===== */
#main-page { display: none; }
.layout { display: flex; min-height: 100vh; }

/* 侧边栏 */
.sidebar {
  width: var(--sidebar-w); background: var(--sidebar-bg);
  position: fixed; top: 0; left: 0; height: 100vh;
  display: flex; flex-direction: column; z-index: 100;
  border-right: 1px solid rgba(255,255,255,0.05);
}
.sidebar-logo {
  padding: 24px 20px; border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 12px;
}
.sidebar-logo .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, #1AAD19, #0d7a0c);
  border-radius: 10px; display: flex; align-items: center;
  justify-content: center; color: white; font-weight: 800; font-size: 15px;
  box-shadow: 0 4px 12px rgba(26,173,25,0.3);
}
.sidebar-logo .logo-text { }
.sidebar-logo .logo-name { font-size: 15px; font-weight: 700; color: white; }
.sidebar-logo .logo-sub { font-size: 11px; color: var(--sidebar-section); margin-top: 2px; }
.sidebar-nav { flex: 1; padding: 16px 12px; overflow-y: auto; }
.nav-section {
  font-size: 10px; color: var(--sidebar-section);
  padding: 12px 10px 6px; letter-spacing: 1px; text-transform: uppercase; font-weight: 600;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--sidebar-text); margin-bottom: 2px;
  transition: all 0.15s; position: relative;
}
.nav-item:hover { background: var(--sidebar-hover); color: white; }
.nav-item.active { background: var(--primary); color: white; font-weight: 500; }
.nav-item.active .nav-icon { opacity: 1; }
.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: var(--red); color: white;
  border-radius: 10px; padding: 1px 7px; font-size: 11px; font-weight: 600;
  display: none;
}
.sidebar-footer { padding: 16px 12px; border-top: 1px solid rgba(255,255,255,0.06); }
.logout-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--sidebar-text); transition: all 0.15s;
}
.logout-btn:hover { background: rgba(231,76,60,0.15); color: var(--red); }

/* 主内容区 */
.main-content { margin-left: var(--sidebar-w); flex: 1; }
.topbar {
  background: white; border-bottom: 1px solid var(--border);
  padding: 0 32px; height: var(--topbar-h);
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 50;
  box-shadow: 0 1px 0 var(--border);
}
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-title { font-size: 17px; font-weight: 700; }
.topbar-breadcrumb { font-size: 13px; color: var(--text-muted); }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar-time { font-size: 13px; color: var(--text-muted); }
.topbar-admin { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; }
.admin-avatar {
  width: 32px; height: 32px; background: var(--primary);
  border-radius: 8px; display: flex; align-items: center;
  justify-content: center; color: white; font-size: 12px; font-weight: 700;
}
.content-area { padding: 28px 32px; }
.page { display: none; }
.page.active { display: block; }

/* ===== 统计卡片 ===== */
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: white; border-radius: var(--radius); padding: 22px 24px;
  border: 1px solid var(--border); box-shadow: var(--shadow);
  position: relative; overflow: hidden; transition: transform 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-card::after {
  content: ''; position: absolute; right: -20px; top: -20px;
  width: 80px; height: 80px; border-radius: 50%;
  opacity: 0.08;
}
.stat-card.green::after { background: var(--primary); }
.stat-card.blue::after { background: var(--blue); }
.stat-card.orange::after { background: var(--orange); }
.stat-card.red::after { background: var(--red); }
.stat-icon { font-size: 24px; margin-bottom: 12px; }
.stat-label { font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.stat-num { font-size: 32px; font-weight: 800; line-height: 1; }
.stat-card.green .stat-num { color: var(--primary); }
.stat-card.blue .stat-num { color: var(--blue); }
.stat-card.orange .stat-num { color: var(--orange); }
.stat-card.red .stat-num { color: var(--red); }
.stat-sub { font-size: 12px; color: var(--text-muted); margin-top: 8px; }
.stat-trend { font-size: 12px; margin-top: 4px; }
.stat-trend.up { color: var(--primary); }
.stat-trend.down { color: var(--red); }

/* ===== 卡片 ===== */
.card {
  background: white; border-radius: var(--radius);
  border: 1px solid var(--border); box-shadow: var(--shadow);
  overflow: hidden; margin-bottom: 24px;
}
.card-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 15px; font-weight: 700; }
.card-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.card-actions { display: flex; align-items: center; gap: 8px; }

/* ===== 按钮 ===== */
.btn {
  padding: 7px 16px; border-radius: 7px; border: none;
  cursor: pointer; font-size: 13px; font-family: inherit;
  font-weight: 500; transition: all 0.15s; display: inline-flex;
  align-items: center; gap: 5px;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-danger { background: var(--red); color: white; }
.btn-danger:hover { background: #c0392b; }
.btn-warning { background: var(--orange); color: white; }
.btn-warning:hover { background: #d68910; }
.btn-ghost { background: transparent; color: var(--text-muted); border: 1px solid var(--border); }
.btn-ghost:hover { background: var(--bg); color: var(--text); }
.btn-sm { padding: 5px 10px; font-size: 12px; }

/* ===== 表格 ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: #fafbfc; }
th {
  padding: 11px 16px; text-align: left; font-weight: 600;
  color: var(--text-muted); border-bottom: 1px solid var(--border);
  white-space: nowrap; font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px;
}
td { padding: 13px 16px; border-bottom: 1px solid #f5f7fa; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--primary-ultra); }
.td-actions { display: flex; gap: 6px; flex-wrap: nowrap; }

/* ===== 徽章 ===== */
.badge {
  display: inline-flex; align-items: center; padding: 3px 9px;
  border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-green { background: var(--primary-light); color: var(--primary); }
.badge-red { background: #fde8e8; color: var(--red); }
.badge-orange { background: #fef3e2; color: var(--orange); }
.badge-blue { background: #e8f4fd; color: var(--blue); }
.badge-purple { background: #f3e8fd; color: var(--purple); }
.badge-gray { background: #f5f5f5; color: #888; }

/* ===== 搜索栏 ===== */
.toolbar { display: flex; gap: 10px; margin-bottom: 16px; align-items: center; flex-wrap: wrap; }
.search-input {
  padding: 9px 14px 9px 36px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; font-family: inherit;
  width: 260px; background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23aaa' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='m21 21-4.35-4.35'/%3E%3C/svg%3E") no-repeat 12px center;
  transition: border-color 0.2s;
}
.search-input:focus { outline: none; border-color: var(--primary); }
.filter-select {
  padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; font-family: inherit;
  background: white; cursor: pointer; color: var(--text);
}
.filter-select:focus { outline: none; border-color: var(--primary); }
.toolbar-right { margin-left: auto; display: flex; gap: 8px; }

/* ===== 分页 ===== */
.pagination {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px; border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-muted);
}
.page-btns { display: flex; gap: 4px; }
.page-btn {
  padding: 5px 11px; border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; background: white; font-size: 12px; color: var(--text);
  transition: all 0.15s;
}
.page-btn:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== 弹窗 ===== */
.modal-overlay {
  display: none; position: fixed; top:0; left:0; width:100%; height:100%;
  background: rgba(0,0,0,0.5); z-index: 1000;
  align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
}
.modal-overlay.show { display: flex; }
.modal {
  background: white; border-radius: 16px; padding: 28px;
  width: 520px; max-width: 90vw; max-height: 85vh;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  display: flex; flex-direction: column;
}
.modal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-header h3 { font-size: 17px; font-weight: 700; }
.modal-close { width: 28px; height: 28px; border-radius: 6px; border: none; background: var(--bg); cursor: pointer; font-size: 16px; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.modal-close:hover { background: var(--border); }
.modal-body { flex: 1; overflow-y: auto; }
.modal-footer { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.detail-row { display: flex; gap: 12px; margin-bottom: 12px; padding-bottom: 12px; border-bottom: 1px solid #f5f5f5; }
.detail-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.detail-label { color: var(--text-muted); min-width: 80px; flex-shrink: 0; font-size: 13px; }
.detail-value { color: var(--text); font-size: 13px; font-weight: 500; }

/* ===== 表单 ===== */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.form-input, .form-textarea {
  width: 100%; padding: 10px 14px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 13px; font-family: inherit;
  transition: border-color 0.2s; color: var(--text);
}
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--primary); }
.form-textarea { resize: vertical; min-height: 120px; line-height: 1.6; }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 60px 24px; color: var(--text-muted); }
.empty-state .empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 14px; }
.loading-state { text-align: center; padding: 48px; color: var(--text-muted); }

/* ===== 概览布局 ===== */
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }

/* ===== 保险页 ===== */
.alert-banner {
  background: linear-gradient(135deg, #fff8e1, #fff3cd);
  border: 1px solid #ffc107; border-radius: 10px;
  padding: 14px 18px; margin-bottom: 20px;
  display: flex; align-items: center; gap: 10px; font-size: 13px; color: #856404;
}

/* ===== 系统设置 ===== */
.settings-section { margin-bottom: 32px; }
.settings-section-title { font-size: 15px; font-weight: 700; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }

/* ===== 响应式 ===== */
@media (max-width: 1200px) {
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .overview-grid { grid-template-columns: 1fr; }
}
.table-wrap {
  overflow-x: auto;
}

.table-wrap table {
  white-space: nowrap;
}
