* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif; background: #f5f7fa; }

/* ===== 登录页面 ===== */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #1869ff 0%, #4a90d9 100%); }
.login-card { background: #ffffff; border-radius: 12px; padding: 40px; width: 380px; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.login-logo { text-align: center; margin-bottom: 30px; }
.login-logo svg { width: 48px; height: 48px; }
.login-logo h1 { font-size: 22px; color: #1869ff; margin-top: 12px; font-weight: 700; }
.login-form .form-group { margin-bottom: 20px; }
.login-form label { display: block; font-size: 14px; color: #5a6478; margin-bottom: 6px; }
.login-form input { width: 100%; padding: 12px 16px; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 15px; color: #333; transition: border-color .2s; }
.login-form input:focus { outline: none; border-color: #1869ff; }
.login-form .btn-login { width: 100%; padding: 12px; background: #1869ff; color: #fff; border: none; border-radius: 8px; font-size: 16px; font-weight: 600; cursor: pointer; transition: background .2s; }
.login-form .btn-login:hover { background: #0f5ed8; }
.login-form .btn-login:disabled { background: #a0c4ff; cursor: not-allowed; }
.login-error { color: #ff6b6b; font-size: 14px; text-align: center; margin-bottom: 16px; }
.login-subtitle { text-align: center; color: #5a6478; font-size: 15px; margin-bottom: 24px; }
.login-entries { display: flex; gap: 16px; }
.login-entry { flex: 1; padding: 24px 16px; border: 2px solid #e8e8e8; border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .2s, box-shadow .2s; text-align: center; }
.login-entry:hover { border-color: #1869ff; box-shadow: 0 4px 12px rgba(24,105,255,0.12); }
.admin-entry:hover { border-color: #1869ff; }
.user-entry:hover { border-color: #52c41a; }
.entry-icon { margin-bottom: 12px; }
.entry-icon svg { width: 40px; height: 40px; }
.admin-entry .entry-icon svg { stroke: #1869ff; }
.user-entry .entry-icon svg { stroke: #52c41a; }
.entry-title { font-size: 16px; font-weight: 600; color: #333; margin-bottom: 6px; }
.entry-desc { font-size: 12px; color: #888; }
.btn-back { width: 100%; padding: 10px; margin-top: 12px; background: none; border: 1px solid #d9d9d9; border-radius: 8px; color: #5a6478; font-size: 14px; cursor: pointer; transition: border-color .2s; }
.btn-back:hover { border-color: #1869ff; color: #1869ff; }

/* ===== 注册表单 ===== */
.btn-register-link { display: block; text-align: center; margin-top: 16px; color: #1869ff; font-size: 14px; text-decoration: none; }
.btn-register-link:hover { text-decoration: underline; }
.register-card { width: 460px; }
.login-form .form-row { display: flex; margin-bottom: 20px; }
.login-form .form-row .form-group { flex: 1; margin-bottom: 0; }
.login-form .form-row .form-group:first-child { margin-right: 16px; }
.login-form select { width: 100%; padding: 12px 16px; border: 1px solid #d9d9d9; border-radius: 8px; font-size: 15px; color: #333; transition: border-color .2s; background: #fff; }
.login-form select:focus { outline: none; border-color: #1869ff; }

/* ===== 主布局 ===== */
.erp-layout { display: flex; min-height: 100vh; }
.sidebar { width: 220px; background: #ffffff; display: flex; flex-direction: column; flex-shrink: 0; border-right: 1px solid #e8ecf0; }
.sidebar-logo { padding: 20px 16px; display: flex; align-items: center; border-bottom: 1px solid #e8ecf0; }
.sidebar-logo svg { width: 28px; height: 28px; margin-right: 10px; }
.sidebar-logo span { font-size: 18px; font-weight: 700; color: #1869ff; }
.sidebar-nav { padding: 12px 0; flex: 1; overflow-y: auto; }
.nav-item { display: flex; align-items: center; width: 100%; padding: 12px 16px; background: transparent; border: none; color: #5a6478; cursor: pointer; transition: all .2s; text-align: left; font-size: 14px; }
.nav-item:hover { background: #eef4ff; color: #1869ff; }
.nav-item.active { background: #1869ff; color: #ffffff; }
.nav-item.active svg { stroke: #ffffff; }
.nav-icon { margin-right: 12px; width: 20px; height: 20px; display: flex; align-items: center; justify-content: center; }
.main-area { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.top-bar { background: #ffffff; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; box-shadow: 0 1px 4px rgba(0,0,0,0.04); border-bottom: 1px solid #e8ecf0; }
.top-bar h2 { font-size: 18px; font-weight: 600; color: #1a1a1a; }
.top-bar .user-info { display: flex; align-items: center; }
.top-bar .user-name { font-size: 14px; color: #5a6478; margin-right: 12px; }
.top-bar .btn-logout { padding: 6px 16px; background: #f5f7fa; color: #5a6478; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 13px; cursor: pointer; }
.top-bar .btn-logout:hover { background: #e8ecf0; }
.content-body { flex: 1; padding: 24px; overflow-y: auto; }

/* ===== 通用组件 ===== */
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.filters { display: flex; align-items: center; }
.filters select, .filters input { padding: 6px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; margin-right: 8px; }
.btn-primary { padding: 8px 20px; background: #1869ff; color: #fff; border: none; border-radius: 6px; font-size: 14px; cursor: pointer; }
.btn-primary:hover { background: #0f5ed8; }
.btn-primary:disabled { background: #a0c4ff; cursor: not-allowed; }
.btn-default { padding: 8px 20px; background: #f5f7fa; color: #5a6478; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; cursor: pointer; }
.btn-default:hover { background: #e8ecf0; }
.btn-danger { padding: 4px 12px; background: #ff6b6b; color: #fff; border: none; border-radius: 4px; font-size: 12px; cursor: pointer; }
.btn-danger:hover { background: #e85555; }

.summary-cards { display: flex; margin-bottom: 16px; }
.summary-card { background: #ffffff; border-radius: 8px; padding: 16px 20px; flex: 1; box-shadow: 0 2px 8px rgba(0,0,0,0.04); border: 1px solid #e8ecf0; margin-right: 16px; }
.summary-card:last-child { margin-right: 0; }
.summary-label { font-size: 13px; color: #888; margin-bottom: 6px; }
.summary-value { font-size: 22px; font-weight: 700; }
.summary-value.blue { color: #1869ff; }
.summary-value.red { color: #ff6b6b; }
.summary-value.green { color: #52c41a; }

.data-table { width: 100%; background: #ffffff; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,0.04); border: 1px solid #e8ecf0; }
.data-table th { background: #f0f5ff; padding: 12px 16px; text-align: left; font-size: 13px; color: #1869ff; font-weight: 600; border-bottom: 1px solid #e8ecf0; }
.data-table td { padding: 12px 16px; font-size: 14px; color: #333; border-bottom: 1px solid #f0f0f0; }
.data-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.data-table td.empty { text-align: center; color: #999; padding: 40px; }
.data-table td.positive { color: #52c41a; }
.data-table td.negative { color: #ff6b6b; }
.data-table tr:hover { background: #f8faff; }

/* ===== 对话框 ===== */
.dialog-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 1000; }
.dialog { background: #ffffff; border-radius: 12px; padding: 24px; width: 500px; max-height: 80vh; overflow-y: auto; box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
.dialog h3 { font-size: 18px; color: #1a1a1a; margin-bottom: 20px; }
.dialog .form-row { margin-bottom: 16px; }
.dialog .form-row label { display: block; font-size: 14px; color: #5a6478; margin-bottom: 6px; }
.dialog .form-row input, .dialog .form-row select { width: 100%; padding: 8px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; }
.dialog .form-row input:focus, .dialog .form-row select:focus { outline: none; border-color: #1869ff; }
.dialog-actions { display: flex; justify-content: flex-end; margin-top: 20px; }
.dialog-actions button { margin-left: 12px; }

/* ===== 标签 ===== */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.tag-blue { background: #eef4ff; color: #1869ff; }
.tag-green { background: #e8f8e8; color: #52c41a; }
.tag-red { background: #ffe8e8; color: #ff6b6b; }
.tag-orange { background: #fff3e0; color: #ff9800; }
.tag-gray { background: #f0f0f0; color: #888; }

/* ===== 超管看板 ===== */
.dashboard-stats { display: flex; margin-bottom: 24px; }
.dashboard-stat { background: #ffffff; border-radius: 8px; padding: 20px; flex: 1; box-shadow: 0 2px 8px rgba(0,0,0,0.04); border: 1px solid #e8ecf0; margin-right: 16px; text-align: center; }
.dashboard-stat:last-child { margin-right: 0; }
.dashboard-stat .stat-icon { width: 40px; height: 40px; margin: 0 auto 12px; }
.dashboard-stat .stat-value { font-size: 24px; font-weight: 700; color: #1869ff; }
.dashboard-stat .stat-label { font-size: 14px; color: #888; margin-top: 4px; }

/* ===== 期间选择器 ===== */
.period-selector { display: flex; align-items: center; }
.period-selector select, .period-selector input { padding: 6px 12px; border: 1px solid #d9d9d9; border-radius: 6px; font-size: 14px; margin-right: 8px; }

/* ===== 空状态 ===== */
.empty-state { text-align: center; padding: 60px 20px; color: #999; }
.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: 0.3; }
.empty-state p { font-size: 16px; }

/* ===== 利润报表 ===== */
.report-section { background: #ffffff; border-radius: 8px; padding: 20px; margin-bottom: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); border: 1px solid #e8ecf0; }
.report-section h4 { font-size: 16px; color: #1869ff; margin-bottom: 12px; }
.report-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.report-row:last-child { border-bottom: none; }
.report-row .label { color: #5a6478; }
.report-row .value { font-weight: 600; color: #333; }
.report-row .value.positive { color: #52c41a; }
.report-row .value.negative { color: #ff6b6b; }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-logo span, .nav-label { display: none; }
  .summary-cards { flex-direction: column; }
  .summary-card { margin-right: 0; margin-bottom: 8px; }
}