/* ===================================
   梧州骑楼城商业管理系统 - 主样式
   =================================== */

:root {
  --primary: #1a56db;
  --primary-dark: #1240a8;
  --primary-light: #e8f0fe;
  --success: #0e9f6e;
  --success-light: #e3f9f0;
  --warning: #c27803;
  --warning-light: #fef3c7;
  --danger: #e02424;
  --danger-light: #fde8e8;
  --info: #0694a2;
  --info-light: #e4f5f8;
  --purple: #7e3af2;
  --purple-light: #f0e8ff;
  --sidebar-w: 220px;
  --header-h: 58px;
  --text: #111827;
  --text-muted: #6b7280;
  --border: #e5e7eb;
  --bg: #f3f4f6;
  --card-bg: #fff;
  --radius: 8px;
  --shadow: 0 1px 4px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif; color: var(--text); background: var(--bg); }

/* ---- 登录页 ---- */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #0f2c6e 0%, #1a56db 50%, #0694a2 100%);
  position: relative; overflow: hidden;
}
.login-bg {
  position: absolute; inset: 0; overflow: hidden;
}
.login-bg::before {
  content: ''; position: absolute;
  width: 600px; height: 600px; border-radius: 50%;
  background: rgba(255,255,255,0.04);
  top: -200px; right: -100px;
}
.login-bg::after {
  content: ''; position: absolute;
  width: 400px; height: 400px; border-radius: 50%;
  background: rgba(255,255,255,0.04);
  bottom: -100px; left: -100px;
}
.login-box {
  background: rgba(255,255,255,0.98);
  border-radius: 16px; padding: 40px 36px;
  width: 420px; position: relative; z-index: 10;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-logo { text-align: center; margin-bottom: 32px; }
.logo-icon {
  width: 64px; height: 64px; border-radius: 16px;
  background: linear-gradient(135deg, #1a56db, #0694a2);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px; font-size: 28px; color: white;
  box-shadow: 0 8px 20px rgba(26,86,219,0.4);
}
.login-logo h1 { font-size: 22px; font-weight: 700; color: #111; }
.login-logo p { color: #6b7280; font-size: 13px; margin-top: 4px; }
.login-form .form-group { margin-bottom: 18px; }
.login-form label { display: block; font-weight: 600; margin-bottom: 6px; color: #374151; font-size: 13px; }
.login-form label i { margin-right: 6px; color: var(--primary); }
.login-form input, .login-form select {
  width: 100%; padding: 10px 14px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 14px; transition: border-color 0.2s;
  background: #f9fafb;
}
.login-form input:focus, .login-form select:focus { outline: none; border-color: var(--primary); background: white; }
.btn-login {
  width: 100%; padding: 12px; background: linear-gradient(135deg, var(--primary), #0694a2);
  color: white; border: none; border-radius: var(--radius); font-size: 15px;
  font-weight: 600; cursor: pointer; margin-top: 8px; transition: opacity 0.2s;
  box-shadow: 0 4px 12px rgba(26,86,219,0.4);
}
.btn-login:hover { opacity: 0.92; }
.login-footer { text-align: center; color: #9ca3af; font-size: 12px; margin-top: 24px; }

/* ---- 主应用 ---- */
.hidden { display: none !important; }
.main-app { display: flex; flex-direction: column; height: 100vh; overflow: hidden; }

/* 顶部导航 */
.top-header {
  height: var(--header-h); background: white;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 16px;
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.header-left { display: flex; align-items: center; gap: 12px; min-width: 240px; }
.menu-toggle {
  width: 36px; height: 36px; border: none; background: none;
  border-radius: 8px; cursor: pointer; font-size: 16px; color: #4b5563;
  display: flex; align-items: center; justify-content: center;
}
.menu-toggle:hover { background: var(--bg); }
.brand { display: flex; align-items: center; gap: 8px; }
.brand-icon {
  width: 32px; height: 32px; background: linear-gradient(135deg, var(--primary), #0694a2);
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px;
}
.brand-name { font-weight: 700; font-size: 15px; color: #111; }
.header-center { flex: 1; display: flex; justify-content: center; }
.quick-search {
  display: flex; align-items: center; background: var(--bg);
  border-radius: 20px; padding: 6px 14px; gap: 8px; width: 320px;
  border: 1.5px solid transparent;
}
.quick-search:focus-within { border-color: var(--primary); background: white; }
.quick-search i { color: #9ca3af; }
.quick-search input { border: none; background: none; outline: none; font-size: 13px; width: 100%; }
.header-right { display: flex; align-items: center; gap: 16px; position: relative; }
.header-notices { position: relative; cursor: pointer; padding: 4px; }
.header-notices i { font-size: 18px; color: #4b5563; }
.badge {
  position: absolute; top: -4px; right: -4px;
  background: var(--danger); color: white;
  font-size: 10px; font-weight: 700; border-radius: 10px;
  padding: 1px 5px; min-width: 16px; text-align: center;
}
.header-user {
  display: flex; align-items: center; gap: 8px;
  cursor: pointer; padding: 6px 10px; border-radius: 8px;
}
.header-user:hover { background: var(--bg); }
.user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7e3af2);
  color: white; font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.notice-panel {
  position: absolute; top: 56px; right: 0; width: 360px;
  background: white; border-radius: 12px; box-shadow: var(--shadow-md);
  border: 1px solid var(--border); z-index: 200; overflow: hidden;
}
.panel-header {
  padding: 14px 16px; font-weight: 700; font-size: 14px;
  border-bottom: 1px solid var(--border); background: #f9fafb;
  display: flex; align-items: center; gap: 8px;
}
.notice-list { max-height: 320px; overflow-y: auto; }
.notice-item {
  padding: 12px 16px; border-bottom: 1px solid #f3f4f6;
  font-size: 13px; display: flex; align-items: flex-start; gap: 10px;
  cursor: pointer; transition: background 0.15s;
}
.notice-item:hover { background: #f9fafb; }
.notice-item.urgent i { color: var(--danger); }
.notice-item.warn i { color: var(--warning); }
.notice-item.info i { color: var(--primary); }

/* 侧边栏 */
.app-body { display: flex; margin-top: var(--header-h); height: calc(100vh - var(--header-h)); overflow: hidden; }
.sidebar {
  width: var(--sidebar-w); background: white;
  border-right: 1px solid var(--border);
  overflow-y: auto; flex-shrink: 0;
  transition: transform 0.25s;
}
.sidebar.collapsed { transform: translateX(-100%); margin-left: calc(-1 * var(--sidebar-w)); }
.sidebar-nav { padding: 12px 0; }
.nav-section { margin-bottom: 4px; }
.nav-section-title {
  padding: 8px 16px 4px;
  font-size: 11px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; cursor: pointer; color: #4b5563;
  font-size: 13.5px; position: relative; transition: all 0.15s;
  border-radius: 0;
}
.nav-item:hover { background: var(--primary-light); color: var(--primary); }
.nav-item.active {
  background: var(--primary-light); color: var(--primary);
  font-weight: 600; border-left: 3px solid var(--primary);
}
.nav-item i { width: 18px; text-align: center; font-size: 14px; }
.nav-badge {
  margin-left: auto; background: var(--danger);
  color: white; font-size: 10px; border-radius: 10px;
  padding: 1px 6px; font-weight: 700;
}

/* 主内容区 */
.main-content {
  flex: 1; overflow-y: auto; padding: 20px;
  background: var(--bg);
}
.module-panel { display: none; }
.module-panel.active { display: block; }

/* 页面标题 */
.page-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px;
}
.page-header h2 { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.page-header h2 i { color: var(--primary); }
.page-actions { display: flex; align-items: center; gap: 10px; }
.time-badge { font-size: 12px; color: var(--text-muted); background: white; padding: 4px 10px; border-radius: 20px; border: 1px solid var(--border); }

/* 按钮 */
.btn {
  padding: 7px 16px; border-radius: var(--radius); font-size: 13px;
  font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  border: 1.5px solid transparent; transition: all 0.15s;
}
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: white; color: #374151; border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-sm { padding: 4px 12px; font-size: 12px; }

/* KPI卡片 */
.kpi-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 20px;
}
@media (max-width: 1400px) { .kpi-grid { grid-template-columns: repeat(3, 1fr); } }
.kpi-card {
  background: white; border-radius: 12px; padding: 18px 16px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  position: relative; overflow: hidden;
}
.kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kpi-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
}
.kpi-card.primary .kpi-icon { background: var(--primary-light); color: var(--primary); }
.kpi-card.success .kpi-icon { background: var(--success-light); color: var(--success); }
.kpi-card.warning .kpi-icon { background: var(--warning-light); color: var(--warning); }
.kpi-card.danger .kpi-icon { background: var(--danger-light); color: var(--danger); }
.kpi-card.info .kpi-icon { background: var(--info-light); color: var(--info); }
.kpi-card.purple .kpi-icon { background: var(--purple-light); color: var(--purple); }
.kpi-value { font-size: 22px; font-weight: 800; line-height: 1; }
.kpi-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.kpi-sub { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.kpi-trend {
  position: absolute; top: 12px; right: 12px;
  font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 4px;
}
.kpi-trend.up { color: var(--success); background: var(--success-light); }
.kpi-trend.down { color: var(--danger); background: var(--danger-light); }
.kpi-trend.neutral { color: var(--text-muted); background: var(--bg); }
.kpi-trend.urgent { color: var(--warning); background: var(--warning-light); }

/* 图表区 */
.chart-row { display: grid; grid-template-columns: 1fr 400px; gap: 14px; margin-bottom: 20px; }
.chart-card { background: white; border-radius: 12px; padding: 18px; box-shadow: var(--shadow); }
.chart-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.chart-header h3 { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.chart-header h3 i { color: var(--primary); }
.chart-legend { display: flex; gap: 12px; font-size: 12px; }
.legend-item { display: flex; align-items: center; gap: 4px; }
.legend-item.income span { width: 12px; height: 3px; background: var(--primary); display: inline-block; border-radius: 2px; }
.legend-item.actual span { width: 12px; height: 3px; background: var(--success); display: inline-block; border-radius: 2px; }
.donut-wrap { display: flex; align-items: center; gap: 20px; }
.donut-legend { display: flex; flex-direction: column; gap: 10px; }
.dl-item { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.dot.green { background: var(--success); }
.dot.gray { background: #9ca3af; }
.dot.orange { background: #f59e0b; }
.dot.blue { background: var(--primary); }

/* 租控图 */
.section-card { background: white; border-radius: 12px; padding: 18px; box-shadow: var(--shadow); margin-bottom: 20px; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.section-header h3 { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.section-header h3 i { color: var(--primary); }
.filter-row { display: flex; gap: 6px; }
.filter-btn {
  padding: 4px 12px; border-radius: 20px; font-size: 12px;
  border: 1.5px solid var(--border); background: white; cursor: pointer; transition: all 0.15s;
}
.filter-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.filter-btn:hover:not(.active) { border-color: var(--primary); color: var(--primary); }
.rent-map {
  display: grid; grid-template-columns: repeat(auto-fill, 88px);
  gap: 8px; padding: 8px 0;
}
.map-cell {
  height: 68px; border-radius: 8px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; transition: transform 0.15s, box-shadow 0.15s;
  border: 2px solid transparent;
}
.map-cell:hover { transform: scale(1.05); box-shadow: 0 4px 12px rgba(0,0,0,0.15); z-index: 1; position: relative; }
.map-cell .cell-id { font-size: 11px; font-weight: 700; }
.map-cell .cell-name { font-size: 10px; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 80px; }
.map-cell .cell-area { font-size: 10px; opacity: 0.8; }
.map-cell.rented { background: #d1fae5; border-color: #6ee7b7; color: #065f46; }
.map-cell.vacant { background: #fee2e2; border-color: #fca5a5; color: #991b1b; }
.map-cell.renovating { background: #fef3c7; border-color: #fcd34d; color: #92400e; }
.map-cell.pending { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.map-cell.temp { background: #f3f4f6; border-color: #d1d5db; color: #374151; }
.map-legend { display: flex; gap: 16px; font-size: 12px; margin-top: 12px; flex-wrap: wrap; }
.map-legend span { display: flex; align-items: center; gap: 6px; }
.dot-icon {
  width: 10px; height: 10px; border-radius: 3px; display: inline-block;
}
.dot-icon.green { background: var(--success); }
.dot-icon.red { background: var(--danger); }
.dot-icon.orange { background: #f59e0b; }
.dot-icon.blue { background: var(--primary); }
.dot-icon.gray { background: #9ca3af; }

/* 两栏布局 */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.mini-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mini-table th { padding: 8px 10px; background: #f9fafb; color: var(--text-muted); font-size: 12px; text-align: left; border-bottom: 1px solid var(--border); }
.mini-table td { padding: 8px 10px; border-bottom: 1px solid #f9fafb; }
.mini-table tr:last-child td { border-bottom: none; }
.warn-text { color: var(--warning); font-weight: 700; }
.info-text { color: var(--info); font-weight: 700; }
.danger-text { color: var(--danger); font-weight: 700; }

/* 过滤栏 */
.filter-bar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap;
}
.search-input, .filter-bar input, .filter-bar select {
  padding: 7px 12px; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 13px; background: white; outline: none;
}
.search-input { min-width: 200px; }
.filter-bar input:focus, .filter-bar select:focus { border-color: var(--primary); }

/* 数据表格 */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); }
.table-wrap-scroll { overflow-y: auto; max-height: 65vh; }
.data-table { width: 100%; border-collapse: collapse; background: white; }
.data-table th {
  padding: 10px 14px; background: #f9fafb;
  text-align: left; font-size: 12px; font-weight: 700; color: #374151;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
/* sticky 表头（需配合 .table-wrap-scroll 或容器 overflow） */
.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  /* 确保 sticky 时背景不透明 */
  background: #f0f2f5;
}
.data-table td {
  padding: 10px 14px; border-bottom: 1px solid #f3f4f6;
  font-size: 13px; color: var(--text); white-space: nowrap;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: #f9fafb; }
/* ---- 统计栏 ---- */
.table-stats-bar {
  display: flex; flex-wrap: wrap; gap: 8px 24px;
  padding: 12px 16px; margin-top: 1px;
  background: linear-gradient(135deg, #f0f4ff 0%, #f8fafc 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 13px; color: var(--text-muted);
  align-items: center;
}
.table-stats-bar .stat-item {
  display: flex; align-items: center; gap: 6px;
  white-space: nowrap;
}
.table-stats-bar .stat-item .stat-icon {
  font-size: 14px; width: 20px; text-align: center;
}
.table-stats-bar .stat-item .stat-num {
  font-weight: 700; color: var(--primary); font-size: 14px;
}
.table-stats-bar .stat-item .stat-label {
  color: var(--text-muted); font-size: 12px;
}
.table-stats-bar .stat-sep {
  width: 1px; height: 20px; background: var(--border);
}

.table-footer { display: flex; align-items: center; justify-content: space-between; padding: 12px 4px; color: var(--text-muted); font-size: 12px; }

/* 状态标签 */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 600;
}
.tag-green { background: var(--success-light); color: var(--success); }
.tag-red { background: var(--danger-light); color: var(--danger); }
.tag-yellow { background: var(--warning-light); color: var(--warning); }
.tag-blue { background: var(--primary-light); color: var(--primary); }
.tag-gray { background: #f3f4f6; color: #6b7280; }
.tag-purple { background: var(--purple-light); color: var(--purple); }
.tag-orange { background: #fff3e0; color: #e65100; }

/* 操作按钮 */
.action-btns { display: flex; gap: 6px; }
.action-btn {
  padding: 3px 10px; border-radius: 4px; font-size: 12px;
  cursor: pointer; border: 1px solid var(--border); background: white;
  color: var(--text-muted); transition: all 0.15s;
}
.action-btn:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.action-btn.danger:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-light); }

/* Tab */
.tab-row {
  display: flex; gap: 0; border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}
.tab-btn {
  padding: 9px 18px; background: none; border: none;
  font-size: 13.5px; cursor: pointer; color: var(--text-muted);
  font-weight: 600; transition: color 0.15s; position: relative;
  display: flex; align-items: center; gap: 6px;
}
.tab-btn.active { color: var(--primary); }
.tab-btn.active::after {
  content: ''; position: absolute; bottom: -2px; left: 0; right: 0;
  height: 2px; background: var(--primary); border-radius: 2px 2px 0 0;
}
.tab-content { display: none; }
.tab-content.active { display: block; }
.badge-small {
  background: var(--danger); color: white;
  font-size: 10px; padding: 1px 5px; border-radius: 10px; font-weight: 700;
}

/* 统计卡片 */
.stat-cards-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 16px 0; }
.stat-card {
  background: white; border-radius: 10px; padding: 20px 24px;
  box-shadow: var(--shadow); min-width: 140px; text-align: center;
}
.stat-num { font-size: 28px; font-weight: 800; color: var(--primary); }
.stat-label { font-size: 12px; color: var(--text-muted); margin-top: 6px; }

/* 报表 */
.report-controls { display: flex; gap: 10px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.date-input, .select-input { padding: 7px 12px; border: 1.5px solid var(--border); border-radius: var(--radius); font-size: 13px; }
.report-summary { display: flex; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.report-kpi { background: white; border-radius: 10px; padding: 16px 24px; box-shadow: var(--shadow); text-align: center; }
.rk-num { font-size: 24px; font-weight: 800; color: var(--primary); }
.rk-label { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* 审批列表 */
.approval-list { display: flex; flex-direction: column; gap: 12px; }
.approval-card {
  background: white; border-radius: 12px; padding: 18px;
  box-shadow: var(--shadow); border-left: 4px solid var(--primary);
}
.approval-card .ac-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.approval-card .ac-title { font-weight: 700; font-size: 14px; }
.approval-card .ac-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.approval-card .ac-actions { display: flex; gap: 8px; }
.approval-card.urgent { border-left-color: var(--danger); }
.approval-card.normal { border-left-color: var(--primary); }

/* 设置页 */
.settings-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.settings-card {
  background: white; border-radius: 12px; padding: 24px;
  box-shadow: var(--shadow); cursor: pointer; transition: all 0.2s;
  text-align: center;
}
.settings-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border: 1.5px solid var(--primary); }
.settings-card i { font-size: 32px; color: var(--primary); margin-bottom: 12px; }
.settings-card h3 { font-size: 15px; font-weight: 700; margin-bottom: 6px; }
.settings-card p { font-size: 12px; color: var(--text-muted); }
.settings-sub { margin-top: 20px; }
.sub-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.sub-header h3 { font-size: 16px; font-weight: 700; }

/* 通知网格 */
.notice-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.notice-grid-item { background: white; border-radius: 10px; padding: 16px; box-shadow: var(--shadow); }
.notice-grid-item h4 { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.notice-grid-item p { font-size: 12px; color: var(--text-muted); }

/* 费用配置 */
.fee-config-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.fee-config-card { background: white; border-radius: 12px; padding: 20px; box-shadow: var(--shadow); }
.fee-config-card h4 { font-size: 14px; font-weight: 700; margin-bottom: 12px; color: var(--primary); border-bottom: 1px solid var(--border); padding-bottom: 8px; }
.fee-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px solid #f9fafb; }
.fee-row:last-child { border: none; }
.fee-row span:last-child { font-weight: 700; color: var(--text); }

/* 弹窗 */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 500;
}
.modal-box {
  background: white; border-radius: 16px; width: 600px; max-width: 95vw;
  max-height: 85vh; display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
  padding: 18px 24px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.modal-header h3 { font-size: 16px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #6b7280; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* 表单 */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label { font-size: 13px; font-weight: 600; color: #374151; }
.form-item label .req { color: var(--danger); }
.form-item input, .form-item select, .form-item textarea {
  padding: 8px 12px; border: 1.5px solid var(--border);
  border-radius: var(--radius); font-size: 13px;
}
.form-item input:focus, .form-item select:focus, .form-item textarea:focus {
  outline: none; border-color: var(--primary);
}
.form-item textarea { resize: vertical; min-height: 80px; }

/* 详情面板 */
.detail-panel {
  position: fixed; right: 0; top: var(--header-h);
  width: 460px; height: calc(100vh - var(--header-h));
  background: white; border-left: 1px solid var(--border);
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  z-index: 200; display: flex; flex-direction: column;
  transition: transform 0.25s;
}
.detail-panel.hidden { transform: translateX(100%); }
.detail-panel-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; justify-content: space-between; align-items: center;
}
.detail-panel-header h3 { font-size: 15px; font-weight: 700; }
.detail-panel-header button { background: none; border: none; font-size: 18px; cursor: pointer; color: #6b7280; }
.detail-panel-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.detail-section { margin-bottom: 18px; }
.detail-section h4 { font-size: 12px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 10px; }
.detail-row { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px solid #f3f4f6; font-size: 13px; }
.detail-row:last-child { border: none; }
.detail-row .label { color: var(--text-muted); }
.detail-row .value { font-weight: 600; }

/* 分页 */
.pagination { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.page-size-box { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); }
.page-size-box select { padding: 3px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; background: white; cursor: pointer; }
.page-nav-box { display: flex; align-items: center; gap: 6px; }
.page-info { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.page-btn { padding: 4px 10px; border: 1px solid var(--border); border-radius: 4px; font-size: 12px; cursor: pointer; background: white; white-space: nowrap; }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn:hover:not(.active):not(:disabled) { border-color: var(--primary); color: var(--primary); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; right: 24px;
  background: #1f2937; color: white;
  padding: 12px 20px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,0.2);
  z-index: 1000; display: flex; align-items: center; gap: 8px;
  animation: slideUp 0.3s ease;
}
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.warn { background: var(--warning); }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* 分隔线 */
.divider { height: 1px; background: var(--border); margin: 16px 0; }

/* 步骤审批流 */
.approval-flow { display: flex; align-items: center; gap: 0; margin: 12px 0; }
.flow-step { display: flex; flex-direction: column; align-items: center; position: relative; }
.flow-step-dot {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700;
  background: white; z-index: 1;
}
.flow-step-dot.done { background: var(--success); border-color: var(--success); color: white; }
.flow-step-dot.current { background: var(--primary); border-color: var(--primary); color: white; }
.flow-step-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; white-space: nowrap; }
.flow-line { height: 2px; width: 40px; background: var(--border); }
.flow-line.done { background: var(--success); }

/* 滚动条 */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
