/* ===== RESET & BASE ===== */
* { margin:0; padding:0; box-sizing:border-box; }
:root {
  --primary: #7CB342;
  --primary-dark: #558B2F;
  --primary-light: #DCEDC8;
  --success: #7CB342;
  --warning: #f59e0b;
  --danger: #dc2626;
  --info: #0891b2;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --sidebar-width: 240px;
  --topbar-height: 60px;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.1);
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--gray-100);
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.6;
}
a { text-decoration: none; color: var(--primary); }
button { cursor: pointer; font-family: inherit; }

/* ===== LOGIN ===== */
.login-page {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #33691E 0%, #7CB342 50%, #558B2F 100%);
}
.login-card {
  background: #fff; padding: 48px 40px; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  width: 400px; max-width: 90vw; text-align: center;
}
.login-logo { margin-bottom: 32px; }
.logo-icon { font-size: 48px; margin-bottom: 12px; }
.login-card h1 { font-size: 24px; color: var(--gray-800); margin-bottom: 8px; }
.login-card p { color: var(--gray-500); font-size: 14px; }
.login-form { text-align: left; }
.login-error { color: var(--danger); font-size: 13px; margin-top: 12px; min-height: 20px; }
.login-hint { margin-top: 24px; padding-top: 24px; border-top: 1px solid var(--gray-200); color: var(--gray-400); font-size: 12px; }
.login-hint p { margin-bottom: 4px; }

/* ===== LAYOUT ===== */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-width); background: var(--gray-900); color: #fff;
  display: flex; flex-direction: column; position: fixed; top:0; left:0; bottom:0;
  z-index: 100; transition: transform 0.3s;
}
.sidebar-header {
  padding: 20px 24px; display: flex; align-items: center; gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.logo-icon-sm { font-size: 24px; }
.sidebar-title { font-size: 18px; font-weight: 600; }
.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }
.nav-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 24px;
  color: rgba(255,255,255,0.6); transition: all 0.2s; font-size: 14px;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,0.05); }
.nav-item.active { color: #fff; background: var(--primary); }
.nav-icon { font-size: 18px; width: 20px; text-align: center; }
.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,0.1); }
.user-badge { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.user-avatar {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary);
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-weight: 600; font-size: 14px;
}
.user-info-sm { display: flex; flex-direction: column; }
.user-name-sm { font-size: 13px; font-weight: 500; color: #fff; }
.user-role-sm { font-size: 11px; color: rgba(255,255,255,0.5); text-transform: uppercase; }
.btn-logout {
  width: 100%; padding: 8px; background: rgba(255,255,255,0.1); border: none;
  color: rgba(255,255,255,0.7); border-radius: 6px; font-size: 13px; transition: 0.2s;
}
.btn-logout:hover { background: var(--danger); color: #fff; }

.main-content { flex: 1; margin-left: var(--sidebar-width); display: flex; flex-direction: column; }
.topbar {
  height: var(--topbar-height); background: #fff; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.menu-toggle { display: none; background: none; border: none; font-size: 20px; }
.page-title { font-size: 18px; font-weight: 600; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.current-date { color: var(--gray-500); font-size: 13px; }
.notification-badge {
  position: relative; cursor: pointer; font-size: 20px;
}
.notif-count {
  position: absolute; top: -6px; right: -8px; background: var(--danger);
  color: #fff; font-size: 10px; min-width: 16px; height: 16px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  padding: 0 4px; font-weight: 600;
}
.notif-panel {
  position: absolute; top: 48px; right: 0; width: 340px; max-height: 420px; overflow-y: auto;
  background: #fff; border: 1px solid var(--gray-200); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12); z-index: 1000;
}
.notif-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; border-bottom: 1px solid var(--gray-200);
  font-weight: 600; font-size: 14px; color: #1f2937;
}
.btn-link {
  background: none; border: none; color: var(--primary); cursor: pointer;
  font-size: 12px; padding: 2px 4px;
}
.notif-empty { padding: 24px 14px; text-align: center; color: #9ca3af; font-size: 13px; }
.notif-item {
  padding: 10px 14px; border-bottom: 1px solid #f1f5f9; cursor: pointer;
}
.notif-item:last-child { border-bottom: none; }
.notif-item.is-unread { background: #F1F8E9; }
.notif-title { font-size: 13px; font-weight: 600; color: #1f2937; margin-bottom: 3px; }
.notif-item.is-unread .notif-title::before { content: '●'; color: var(--primary); margin-right: 6px; font-size: 10px; }
.notif-msg { font-size: 12px; color: #4b5563; line-height: 1.5; }
.notif-time { font-size: 11px; color: #9ca3af; margin-top: 4px; }
.notif-section-title {
  padding: 8px 14px 4px; font-size: 12px; font-weight: 700; color: #1B5E43;
  background: #f8fafc; border-bottom: 1px solid #f1f5f9;
}
.task-overdue { color: #dc2626; font-weight: 600; }
.task-left { color: #d97706; font-weight: 600; }
.content-area { padding: 24px; flex: 1; }

/* ===== 站内合规待办提醒弹窗 ===== */
.cr-pop {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(15, 23, 42, 0.38);
  display: flex; align-items: center; justify-content: center;
  animation: cr-fade 0.18s ease;
}
@keyframes cr-fade { from { opacity: 0; } to { opacity: 1; } }
.cr-card {
  width: 380px; max-width: 90vw; background: #fff;
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 24px 60px rgba(0,0,0,0.28);
}
.cr-head {
  display: flex; align-items: center; gap: 8px;
  padding: 14px 16px; border-bottom: 1px solid #eef2f7;
  background: #f8fafc;
}
.cr-icon { font-size: 18px; }
.cr-title { font-weight: 600; font-size: 15px; color: #1f2937; }
.cr-close {
  margin-left: auto; border: none; background: none;
  font-size: 22px; line-height: 1; cursor: pointer; color: #9ca3af;
}
.cr-close:hover { color: #4b5563; }
.cr-body { padding: 18px 16px; font-size: 14px; color: #374151; line-height: 1.7; }
.cr-body p { margin: 0 0 8px; }
.cr-body b { color: #111827; }
.cr-list { margin: 4px 0 6px; padding-left: 18px; }
.cr-list li { margin: 4px 0; }
.cr-list b { color: #111827; }
.cr-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; border-top: 1px solid #eef2f7; gap: 10px;
}
.cr-skip { font-size: 12px; color: #6b7280; display: flex; align-items: center; gap: 4px; cursor: pointer; }
.cr-actions { display: flex; gap: 8px; margin-left: auto; }

/* ===== PAGES ===== */
.page { display: none; }
.page.active { display: block; }

/* ===== CARDS ===== */
.card {
  background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 20px; overflow: hidden;
}
.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.card-header h3 { font-size: 15px; font-weight: 600; }
.card-link { font-size: 13px; }
.card-body { padding: 20px; }
.card-wide { grid-column: span 2; }

/* 即将到期事项卡片：红色高亮 */
.upcoming-highlight {
  border: 2px solid #dc2626;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12), var(--shadow);
}
.upcoming-highlight > .card-header {
  background: linear-gradient(90deg, #fef2f2 0%, #fff 60%);
  border-bottom: 1px solid #fecaca;
}
.upcoming-highlight > .card-header h3 {
  color: #dc2626;
}

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

/* ===== STAT CARDS ===== */
.report-period-banner {
  display: inline-block; margin-bottom: 14px; padding: 8px 16px;
  background: var(--primary-soft, #F1F8E9); color: var(--primary, #7CB342);
  font-size: 15px; font-weight: 600; border-radius: 10px;
  border: 1px solid var(--primary-border, #C5E1A5);
}
.stat-cards {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px; margin-bottom: 20px;
}
.stat-card {
  background: #fff; border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 16px;
}
.stat-card.highlight {
  background: linear-gradient(135deg, #F1F8E9, #F1F8E9);
  border: 1px solid #C5E1A5;
}
.stat-card.highlight .stat-label { color: var(--gray-600); font-weight: 600; }
.stat-card.highlight .stat-value { color: #558B2F; }
.stat-icon {
  width: 48px; height: 48px; border-radius: 12px; display: flex;
  align-items: center; justify-content: center; font-size: 24px;
}
.stat-info { flex: 1; }
.stat-label { font-size: 12px; color: var(--gray-500); margin-bottom: 4px; }
.stat-value { font-size: 22px; font-weight: 700; color: var(--gray-800); }
.stat-change { font-size: 12px; }
.stat-change.up { color: var(--success); }
.stat-change.down { color: var(--danger); }

/* ===== COMPACT STAT CARDS (cash page) ===== */
.stat-cards.compact {
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}
.stat-cards.compact .stat-card {
  padding: 10px 12px;
  gap: 10px;
}
.stat-cards.compact .stat-icon {
  width: 32px; height: 32px; border-radius: 8px; font-size: 16px;
}
.stat-cards.compact .stat-label { font-size: 11px; margin-bottom: 2px; }
.stat-cards.compact .stat-value { font-size: 15px; }

/* ===== TABLES ===== */
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table th {
  text-align: left; padding: 10px 12px; background: var(--gray-50);
  font-weight: 600; color: var(--gray-600); border-bottom: 1px solid var(--gray-200);
  white-space: nowrap;
}
.data-table th.text-right { text-align: right; }
.data-table th.col-filter { cursor: pointer; user-select: none; }
.data-table th.col-filter:hover { background: var(--gray-200); color: var(--primary); }
.data-table th.col-filter .cf-flag {
  display: inline-block; margin-left: 4px; font-size: 10px; line-height: 1;
  color: var(--primary); font-weight: 700;
}
.data-table th.col-filter .cf-flag::after { content: " ⇅"; color: var(--gray-400); }
.data-table th.col-filter.filtered .cf-flag::after { content: " ▼"; color: var(--primary); }
.mini-ptable { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
.mini-ptable th { text-align: left; padding: 4px 6px; background: var(--gray-50); color: var(--gray-600); font-weight: 600; }
.mini-ptable td { padding: 4px 6px; border-bottom: 1px solid var(--gray-100); }
.mini-ptable th, .mini-ptable td { text-align: left; }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--gray-100); }
.data-table tbody tr:hover { background: var(--gray-50); }
.data-table .actions { display: flex; gap: 6px; }

/* ===== STATUS BADGES ===== */
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 12px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
}
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-in_progress { background: #DCEDC8; color: #33691E; }
.badge-completed { background: #DCEDC8; color: #33691E; }
.badge-overdue { background: #fee2e2; color: #991b1b; }
.badge-sent { background: #DCEDC8; color: #33691E; }
.badge-cancelled { background: var(--gray-200); color: var(--gray-600); }
.badge-outstanding { background: #fef3c7; color: #92400e; }
.badge-partial { background: #DCEDC8; color: #33691E; }
.badge-collected { background: #DCEDC8; color: #33691E; }
.badge-draft { background: var(--gray-200); color: var(--gray-600); }
.badge-signed { background: #DCEDC8; color: #33691E; }
.badge-active { background: #DCEDC8; color: #33691E; }
.badge-inactive { background: var(--gray-200); color: var(--gray-600); }
.badge-info { background: #DCEDC8; color: #33691E; }
.badge-success { background: #DCEDC8; color: #33691E; }
.badge-warning { background: #fef3c7; color: #92400e; }

/* ===== AR 应收明细：表头内联筛选 + 备注星标 + Overdue 看板 ===== */
.ar-table thead .filter-row th {
  padding: 3px 3px;
  background: var(--gray-50, #f8fafc);
  border-top: 1px solid var(--gray-200);
}
.ar-table thead th {
  vertical-align: top;
  text-align: left;
  white-space: nowrap;
}
.ar-table thead th input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-top: 5px;
  padding: 3px 5px;
  border: 1px solid var(--gray-300);
  border-radius: 5px;
  font-size: 11px;
  background: #fff;
  color: var(--text);
  text-align: left;
}
.ar-table thead th input::placeholder { color: var(--gray-500); }
.note-star {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  padding: 2px 4px;
  line-height: 1;
}
.note-star:hover { transform: scale(1.25); }
/* 催收计划：按销售负责人分组表头行 + 备注单元格截断 */
#collection-plan-table .group-header td {
  background: var(--brand-50, #F1F8E9);
  font-weight: 600;
  color: var(--brand-700, #558B2F);
  padding: 7px 10px;
  border-top: 2px solid var(--brand-200, #C5E1A5);
}
#collection-plan-table .note-cell {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#ar-overdue-board { margin-top: 16px; }
.overdue-block { margin-bottom: 16px; }
.overdue-block .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.overdue-block .card-header h3 { margin: 0; }
.overdue-summary {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-500);
}
.overdue-table th, .overdue-table td { white-space: nowrap; }

/* ===== AR 应收记录筛选面板 ===== */
.ar-filter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px 12px;
}
.ar-filter-grid input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--gray-300);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg);
  color: var(--text);
}
.ar-filter-grid input::placeholder { color: var(--gray-500); }
.filter-actions {
  margin-top: 12px;
  display: flex;
  gap: 8px;
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border: none; border-radius: 6px; font-size: 13px; font-weight: 500;
  transition: all 0.2s; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-secondary { background: var(--gray-100); color: var(--gray-700); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-success { background: var(--success); color: #fff; }
.btn-block { width: 100%; justify-content: center; }
.btn-sm { padding: 4px 10px; font-size: 12px; }

/* ===== TOOLBAR ===== */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; flex-wrap: wrap; gap: 12px;
}
.toolbar-left, .toolbar-right { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.cp-range {
  display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-left: 14px; padding-left: 14px; border-left: 1px solid var(--gray-200);
  font-size: 13px; color: var(--gray-600);
}
.cp-range label { font-weight: 500; }
.cp-range input[type="date"] {
  padding: 6px 10px; border: 1px solid var(--gray-300); border-radius: 6px;
  font-size: 13px; background: #fff; color: var(--gray-800);
}
.cp-range input[type="date"]:focus { outline: none; border-color: var(--primary); }
.cp-range-sep { color: var(--gray-400); }
.filter-select {
  padding: 8px 12px; border: 1px solid var(--gray-300); border-radius: 6px;
  font-size: 13px; background: #fff; cursor: pointer;
}
.filter-select:focus { outline: none; border-color: var(--primary); }

/* ===== TABS ===== */
.tab-bar {
  display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 2px solid var(--gray-200);
}
.tab-btn {
  padding: 10px 20px; background: none; border: none; border-bottom: 2px solid transparent;
  font-size: 14px; color: var(--gray-500); margin-bottom: -2px; transition: 0.2s;
}
.tab-btn:hover { color: var(--gray-700); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 16px; }
.form-group label {
  display: block; margin-bottom: 6px; font-weight: 500; font-size: 13px; color: var(--gray-700);
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--gray-300);
  border-radius: 6px; font-size: 14px; font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light);
}
.form-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.form-actions { display: flex; gap: 12px; margin-top: 20px; }

/* 通用分页条 */
.pager { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 12px 4px 4px; font-size: 13px; color: #4b5563; }
.pager-info { font-weight: 600; color: #374151; }
.pager-size { display: inline-flex; align-items: center; gap: 6px; }
.pager-size select { padding: 4px 8px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff; font-size: 13px; cursor: pointer; }
.pager-nav { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; }
.pager-page { min-width: 56px; text-align: center; color: #6b7280; }
.pager-nav .btn { min-width: 64px; }

/* ===== 模块权限勾选（用户管理） ===== */
.perm-grid { display: flex; flex-wrap: wrap; gap: 10px 18px; padding: 10px 12px;
  background: var(--gray-50, #f7f8fa); border: 1px solid var(--gray-200); border-radius: 8px; }
.perm-check { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.perm-check input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.perm-check input:disabled { cursor: not-allowed; opacity: 0.55; }
.perm-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--gray-500, #8a94a6); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; top:0; left:0; right:0; bottom:0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 1000;
}
.modal {
  background: #fff; border-radius: 12px; width: 600px; max-width: 90vw;
  max-height: 85vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header {
  padding: 20px 24px; border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
  background: none; border: none; font-size: 24px; color: var(--gray-400);
  width: 32px; height: 32px; border-radius: 6px; display: flex;
  align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--gray-100); color: var(--gray-700); }
.modal-body { padding: 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--gray-200);
  display: flex; justify-content: flex-end; gap: 12px;
}

/* ===== IMPORT ===== */
.import-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px; margin-top: 16px;
}
.import-item {
  padding: 20px; border: 1px solid var(--gray-200); border-radius: 8px; text-align: center;
}
.import-item h4 { margin-bottom: 12px; font-size: 15px; }
.import-actions { display: flex; gap: 8px; justify-content: center; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 2000;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  padding: 12px 20px; border-radius: 8px; color: #fff; font-size: 14px;
  box-shadow: var(--shadow-lg); animation: slideIn 0.3s ease;
  max-width: 400px;
}
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-info { background: var(--info); }
@keyframes slideIn { from { transform: translateX(400px); } to { transform: translateX(0); } }

/* ===== UTILITIES ===== */
.text-muted { color: var(--gray-500); }
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-danger { color: var(--danger); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.font-bold { font-weight: 600; }
.report-period { color: var(--gray-600); font-size: 13px; }
.danger-day { color: var(--danger); font-weight: 600; }
.warning-day { color: var(--warning); font-weight: 600; }
.success-day { color: var(--success); font-weight: 600; }
.admin-only { display: none; }
.admin-only.visible { display: flex; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .card-wide { grid-column: span 1; }
  .form-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: block; }
  .stat-cards, .stat-cards.compact { grid-template-columns: 1fr 1fr; }
  .modal { width: 95vw; }
}
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .data-table { font-size: 12px; }
  .data-table th, .data-table td { padding: 8px 6px; }
}

/* ===== SIGNING ANALYSIS ===== */
.analysis-section { margin-bottom: 24px; }
.analysis-section .section-head { display: flex; align-items: center; justify-content: space-between; margin: 8px 0 12px; }
.analysis-section h3 { font-size: 17px; margin: 0; }
.empty-hint { padding: 22px 16px; text-align: center; color: var(--gray-500); font-size: 14px; background: var(--gray-100); border-radius: 8px; margin: 12px 0; }
.sub-block { margin: 14px 0 18px; }
/* 嵌套分布块（渠道/生源/申校）的层级缩进 */
.sub-block .sub-block { margin: 10px 0; padding-left: 12px; border-left: 2px solid var(--gray-100, #f1f5f9); }
.sub-block h4 { font-size: 14px; margin: 0 0 10px; color: var(--gray-700); display: flex; align-items: center; gap: 10px; }
/* ===== 区块折叠 ===== */
.collapsible > .sub-head { display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; padding: 6px 0; }
.collapsible > .sub-head h4 { margin: 0; }
.sub-head-actions { display: flex; align-items: center; gap: 8px; }
.collapse-btn { background: #fff; border: 1px solid var(--gray-200, #e5e7eb); border-radius: 6px; min-width: 26px; height: 26px; padding: 0 8px; cursor: pointer; font-size: 12px; line-height: 1; color: #475569; display: inline-flex; align-items: center; justify-content: center; }
.collapse-btn:hover { background: var(--gray-50, #f8fafc); }
.collapsible.collapsed > .sub-body { display: none; }
/* 应收明细可折叠卡片 */
.card.collapsible > .card-header { cursor: pointer; display: flex; align-items: center; justify-content: space-between; }
.card.collapsible > .card-header h3 { margin: 0; }
.card.collapsible.collapsed > .card-body { display: none; }
.collapse-btn { font-size: 14px; color: var(--gray-500); transition: transform .15s; }
.analysis-wrap.collapsible > .section-head { cursor: pointer; }
.analysis-wrap.collapsible > .section-head .collapse-btn { margin-left: 10px; }
.chart-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 10px; }
.echart-box { width: 100%; height: 260px; }
.card-title { font-size: 13px; font-weight: 600; color: var(--gray-600); padding: 12px 14px 0; }
.stat-sub { font-size: 12px; color: var(--gray-500); margin-top: 2px; }
.pos { color: var(--success); font-weight: 600; }
.neg { color: var(--danger); font-weight: 600; }
@media (max-width: 768px) { .chart-row { grid-template-columns: 1fr; } }
