:root {
  --primary: #4f46e5;
  --primary-light: #6366f1;
  --primary-dark: #4338ca;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --info: #06b6d4;
  --dark: #1e293b;
  --sidebar-bg: #1e1b4b;
  --body-bg: #f1f5f9;
  --card-border: #e2e8f0;
}
* { box-sizing: border-box; }
body {
  background: var(--body-bg);
  font-family: -apple-system, 'PingFang SC', 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--dark);
  margin: 0;
}
.sidebar {
  position: fixed; left: 0; top: 0; bottom: 0;
  width: 240px; background: var(--sidebar-bg); color: #c7d2fe;
  z-index: 1000; overflow-y: auto; transition: transform 0.3s;
}
.sidebar-header { padding: 20px 20px 16px; border-bottom: 1px solid rgba(255,255,255,0.08); }
.sidebar-header h5 { color: #fff; font-size: 16px; font-weight: 700; margin: 0; }
.sidebar-header small { color: #a5b4fc; font-size: 11px; }
.sidebar-user { padding: 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); display: flex; align-items: center; gap: 10px; }
.sidebar-user .avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--primary); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.sidebar-user .info { font-size: 13px; }
.sidebar-user .info strong { color: #fff; display: block; }
.sidebar-user .info span { color: #a5b4fc; font-size: 11px; }
.nav-section { padding: 14px 0 6px; }
.nav-section-title { padding: 0 20px 6px; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: #6366f1; font-weight: 700; }
.nav-item { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: #c7d2fe; text-decoration: none; font-size: 13px; cursor: pointer; border-left: 3px solid transparent; transition: all 0.15s; }
.nav-item:hover { background: rgba(99,102,241,0.15); color: #fff; }
.nav-item.active { background: rgba(79,70,229,0.25); border-left-color: var(--primary-light); color: #fff; font-weight: 600; }
.nav-item i { font-size: 16px; width: 20px; text-align: center; }
.nav-item .badge { margin-left: auto; font-size: 10px; padding: 2px 7px; border-radius: 10px; }
.main { margin-left: 240px; padding: 0; min-height: 100vh; }
.topbar { background: #fff; padding: 12px 24px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--card-border); position: sticky; top: 0; z-index: 999; }
.topbar h4 { margin: 0; font-size: 17px; font-weight: 700; }
.topbar .breadcrumb { margin: 0; font-size: 12px; }
.topbar-actions { display: flex; gap: 8px; }
.content { padding: 24px; }
.stat-card { background: #fff; border-radius: 12px; padding: 20px; display: flex; align-items: center; gap: 16px; border: 1px solid var(--card-border); box-shadow: 0 1px 3px rgba(0,0,0,0.04); transition: box-shadow 0.2s; }
.stat-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.stat-card .icon { width: 52px; height: 52px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 24px; color: #fff; flex-shrink: 0; }
.stat-card .value { font-size: 26px; font-weight: 800; line-height: 1.1; }
.stat-card .label { font-size: 12px; color: #64748b; }
.table-card { background: #fff; border-radius: 12px; border: 1px solid var(--card-border); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.table-card-header { padding: 16px 20px; border-bottom: 1px solid var(--card-border); display: flex; align-items: center; justify-content: space-between; }
.table-card-header h6 { margin: 0; font-weight: 700; font-size: 15px; }
.table { margin: 0; font-size: 13px; }
.table thead th { background: #f8fafc; font-size: 12px; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: 0.5px; border-bottom: 2px solid var(--card-border); white-space: nowrap; padding: 10px 16px; }
.table tbody td { padding: 10px 16px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tbody tr:hover { background: #f8fafc; }
.badge-status { font-size: 11px; padding: 3px 10px; border-radius: 6px; font-weight: 600; display: inline-flex; align-items: center; gap: 4px; }
.badge-pool { background: #dbeafe; color: #1e40af; }
.badge-making { background: #fef3c7; color: #92400e; }
.badge-done { background: #d1fae5; color: #065f46; }
.badge-paid { background: #c7d2fe; color: #3730a3; }
.badge-unpaid { background: #fee2e2; color: #991b1b; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.btn-sm-icon { width: 30px; height: 30px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; border: 1px solid var(--card-border); background: #fff; color: #475569; cursor: pointer; transition: all 0.15s; text-decoration: none; }
.btn-sm-icon:hover { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-sm-icon.danger:hover { background: var(--danger); border-color: var(--danger); }
.btn-sm-icon.success:hover { background: var(--success); border-color: var(--success); }
.btn-sm-icon.warning:hover { background: var(--warning, #e67e22); border-color: var(--warning, #e67e22); }
.btn-primary { background: var(--primary); border-color: var(--primary); font-size: 13px; }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn-outline-primary { color: var(--primary); border-color: var(--primary); font-size: 13px; }
.btn-outline-primary:hover { background: var(--primary); border-color: var(--primary); }
.btn-success { background: var(--success); border-color: var(--success); font-size: 13px; }
.btn-warning { background: var(--warning); border-color: var(--warning); font-size: 13px; color: #fff; }
.btn-danger { background: var(--danger); border-color: var(--danger); font-size: 13px; }
.btn-outline-secondary { font-size: 13px; }
.filter-bar { background: #fff; border-radius: 10px; padding: 14px 20px; border: 1px solid var(--card-border); margin-bottom: 20px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-bar select, .filter-bar input { font-size: 13px; border: 1px solid var(--card-border); border-radius: 6px; padding: 6px 10px; width: auto; }
.filter-bar .form-control { width: 200px; }
.filter-bar select { min-width: 120px; }
.cost-item-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; background: #f1f5f9; border: 1px solid var(--card-border); border-radius: 8px; font-size: 13px; cursor: pointer; transition: all 0.15s; user-select: none; }
.cost-item-chip:hover { border-color: var(--primary-light); background: #eef2ff; }
.cost-item-chip.selected { background: var(--primary); border-color: var(--primary); color: #fff; }
.cost-item-chip i { font-size: 14px; }
.sidebar-toggle { display: none; }
@media (max-width: 768px) { .sidebar { transform: translateX(-100%); } .sidebar.show { transform: translateX(0); } .main { margin-left: 0; } .sidebar-toggle { display: inline-flex; } }
.text-primary { color: var(--primary) !important; }
.text-success { color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning { color: var(--warning) !important; }
.fw-bold { font-weight: 700; }
.cursor-pointer { cursor: pointer; }
.divider { height: 1px; background: var(--card-border); margin: 16px 0; }
.receipt-preview { background: #fff; padding: 30px; border: 1px solid var(--card-border); border-radius: 8px; max-width: 580px; margin: 0 auto; }
.receipt-preview h3 { text-align: center; font-weight: 800; margin-bottom: 4px; }
.receipt-preview .receipt-sub { text-align: center; color: #64748b; font-size: 12px; margin-bottom: 20px; }
.receipt-preview table { width: 100%; font-size: 13px; }
.receipt-preview table td { padding: 6px 0; border-bottom: 1px dotted #e2e8f0; }
.receipt-preview table td:last-child { text-align: right; font-weight: 600; }
.receipt-preview .signature-area { margin-top: 30px; display: flex; justify-content: space-between; }
.receipt-preview .sig-box { text-align: center; }
.receipt-preview .sig-box .sig-name { width: 130px; min-height: 56px; border-bottom: 1px solid #475569; margin-bottom: 4px; display: flex; align-items: center; justify-content: center; font-family: 'KaiTi', 'STKaiti', '楷体', 'Segoe Script', cursive; font-size: 24px; font-weight: 700; color: #1e293b; white-space: nowrap; }
.receipt-preview .sig-box .sig-label { font-size: 12px; color: #475569; }
.role-badge-sm { font-size: 10px; padding: 2px 8px; border-radius: 4px; font-weight: 600; color: #fff; }
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline-item { display: flex; gap: 14px; padding-bottom: 18px; position: relative; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-item::before { content: ''; position: absolute; left: 15px; top: 30px; bottom: 0; width: 2px; background: #e2e8f0; }
.timeline-item:last-child::before { display: none; }
.timeline-item .dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; z-index: 1; }
.timeline-item .dot.done { background: var(--success); color: #fff; }
.timeline-item .dot.current { background: var(--warning); color: #fff; }
.timeline-item .dot.todo { background: #e2e8f0; color: #94a3b8; }
.timeline-item .content-area { padding-top: 4px; }
.timeline-item .content-area strong { font-size: 13px; display: block; margin-bottom: 2px; }
.timeline-item .content-area span { font-size: 12px; color: #64748b; }
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1e1b4b 0%, #4f46e5 100%); }
.login-box { background: #fff; border-radius: 16px; padding: 40px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.login-box h3 { text-align: center; margin-bottom: 6px; font-weight: 800; }
.login-box .sub { text-align: center; color: #64748b; font-size: 13px; margin-bottom: 28px; }
