/* ===== 全局 ===== */
:root {
    --sidebar-width: 250px;
    --sidebar-bg: #1a2332;
    --sidebar-hover: #2d3a4f;
    --sidebar-active: #3b82f6;
    --topbar-height: 60px;
    --body-bg: #f0f2f5;
    --card-shadow: 0 2px 8px rgba(0,0,0,.06);
    --card-shadow-hover: 0 8px 24px rgba(0,0,0,.12);
    --radius: 14px;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
    background: var(--body-bg);
    color: #1e293b;
}

/* ===== 布局 ===== */
.app-wrapper { display: flex; min-height: 100vh; }
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: #cbd5e1;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 1030;
    transition: transform .3s;
}
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: margin-left .3s;
}

/* ===== 侧边栏 ===== */
.sidebar-brand {
    padding: 20px 22px;
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid rgba(255,255,255,.08);
    background: rgba(0,0,0,.15);
}
.sidebar-brand i { font-size: 24px; color: #60a5fa; }
.sidebar-nav {
    flex: 1;
    padding: 12px 0;
    overflow-y: auto;
}
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 22px;
    color: #94a3b8;
    text-decoration: none;
    font-size: 14px;
    transition: all .2s;
    border-left: 3px solid transparent;
    margin: 2px 8px;
    border-radius: 8px;
}
.sidebar-nav .nav-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}
.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, rgba(59,130,246,.2), rgba(99,102,241,.1));
    color: #fff;
    border-left-color: var(--sidebar-active);
}
.sidebar-nav .nav-link i { font-size: 18px; width: 22px; text-align: center; }
.sidebar-footer { padding: 16px 22px; border-top: 1px solid rgba(255,255,255,.08); }

/* ===== 顶栏 ===== */
.topbar {
    height: var(--topbar-height);
    background: #fff;
    display: flex;
    align-items: center;
    padding: 0 24px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
    position: sticky;
    top: 0;
    z-index: 1020;
}
.content-body { padding: 24px; flex: 1; }

/* ===== 分区标题 ===== */
.section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px 0;
    padding: 14px 20px;
    border-radius: 12px;
    color: #fff;
}
.section-title.white-section {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}
.section-title.yellow-section {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}
.section-title i { font-size: 22px; }

/* ===== 数据卡片（美化版） ===== */
.stat-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--card-shadow);
    transition: all .25s ease;
    height: 100%;
    border: 1px solid rgba(0,0,0,.03);
    position: relative;
    overflow: hidden;
}
.stat-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-color, #3b82f6), transparent);
    opacity: .8;
}
.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--card-shadow-hover);
}
.stat-card .stat-icon {
    width: 52px; height: 52px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}
.stat-card .stat-value {
    font-size: 30px;
    font-weight: 800;
    margin: 10px 0 4px;
    letter-spacing: -0.5px;
    line-height: 1.2;
}
.stat-card .stat-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.stat-card .stat-trend { font-size: 12px; color: #94a3b8; margin-top: 2px; }

/* KPI卡片 */
.stat-card.kpi-card {
    border-left: 4px solid var(--accent-color, #3b82f6);
}
.stat-card.kpi-card::before { display: none; }

/* ===== 图表卡片 ===== */
.chart-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
    border: 1px solid rgba(0,0,0,.03);
}
.chart-card .chart-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1e293b;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chart-card .chart-title i { color: #3b82f6; }
.chart-container { width: 100%; }

/* ===== 表格卡片 ===== */
.table-card {
    background: #fff;
    border-radius: var(--radius);
    padding: 22px;
    box-shadow: var(--card-shadow);
    margin-bottom: 24px;
    border: 1px solid rgba(0,0,0,.03);
}
.table-card h6 {
    font-size: 16px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}
.table-card h6 i { color: #3b82f6; }
.table th {
    font-weight: 700;
    color: #475569;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .3px;
    border-bottom: 2px solid #e2e8f0;
    padding: 12px;
}
.table td { font-size: 14px; vertical-align: middle; padding: 12px; }
.table-hover tbody tr { transition: background .15s; }
.table-hover tbody tr:hover { background: #f8fafc; }

/* ===== 登录页 ===== */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #1e3a5f 100%);
    position: relative;
    overflow: hidden;
}
.login-wrapper::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,246,.15) 0%, transparent 70%);
    top: -200px; right: -200px;
}
.login-wrapper::after {
    content: '';
    position: absolute;
    width: 500px; height: 500px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(99,102,241,.1) 0%, transparent 70%);
    bottom: -150px; left: -150px;
}
.login-card {
    background: rgba(255,255,255,.97);
    border-radius: 20px;
    padding: 40px;
    width: 420px;
    max-width: 90%;
    box-shadow: 0 25px 70px rgba(0,0,0,.35);
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}
.login-logo {
    text-align: center;
    margin-bottom: 30px;
}
.login-logo i {
    font-size: 48px;
    color: #3b82f6;
}
.login-logo h3 {
    margin-top: 12px;
    font-weight: 700;
    color: #1e293b;
}
.login-logo p {
    color: #64748b;
    font-size: 14px;
    margin: 4px 0 0;
}

/* ===== 目标进度弹窗 ===== */
.goal-progress-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}
.goal-progress-item:last-child { border-bottom: none; }
.goal-progress-item .label { color: #64748b; font-size: 14px; }
.goal-progress-item .value { font-weight: 600; font-size: 16px; }
.progress-ring { display: flex; align-items: center; justify-content: center; }

/* ===== 报表表单 ===== */
.report-row {
    display: grid;
    grid-template-columns: 2fr 3fr 1fr auto;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}
.report-row input,
.report-row select,
.report-row textarea {
    border-radius: 8px;
}
@media (max-width: 768px) {
    .report-row { grid-template-columns: 1fr; }
}

/* ===== 徽章 ===== */
.badge-normal { background: #10b981; }
.badge-frozen { background: #ef4444; }

/* ===== 响应式 ===== */
/* 5列布局 */
.col-md-2-4 { flex: 0 0 auto; width: 20%; }
@media (max-width: 992px) {
    .col-md-2-4 { width: 50%; }
}
@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); }
    .sidebar.show { transform: translateX(0); }
    .main-content { margin-left: 0; }
}

/* ===== 工具类 ===== */
.text-danger-bold { color: #ef4444; font-weight: 700; }
.text-success-bold { color: #10b981; font-weight: 700; }
.cursor-pointer { cursor: pointer; }
.modal-body { padding: 24px; }

/* ===== 渐变按钮 ===== */
.btn-gradient-primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border: none;
    color: #fff;
    box-shadow: 0 2px 6px rgba(59,130,246,.3);
    transition: all .2s;
}
.btn-gradient-primary:hover {
    background: linear-gradient(135deg, #2563eb, #4f46e5);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59,130,246,.4);
}
.btn-gradient-primary:active { transform: translateY(0); }

.btn-gradient-warning {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    border: none;
    color: #fff;
    box-shadow: 0 2px 6px rgba(245,158,11,.3);
    transition: all .2s;
}
.btn-gradient-warning:hover {
    background: linear-gradient(135deg, #d97706, #ea580c);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245,158,11,.4);
}
.btn-gradient-warning:active { transform: translateY(0); }

/* ===== 通用按钮美化 ===== */
.btn {
    border-radius: 8px;
    font-weight: 500;
    transition: all .2s;
}
.btn-primary {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none;
    box-shadow: 0 2px 6px rgba(59,130,246,.25);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(59,130,246,.35);
}
.btn-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
    border: none;
    color: #fff;
    box-shadow: 0 2px 6px rgba(245,158,11,.25);
}
.btn-warning:hover {
    background: linear-gradient(135deg, #d97706, #b45309);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(245,158,11,.35);
}
.btn-success {
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    box-shadow: 0 2px 6px rgba(16,185,129,.25);
}
.btn-success:hover {
    background: linear-gradient(135deg, #059669, #047857);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16,185,129,.35);
}
.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: none;
    box-shadow: 0 2px 6px rgba(239,68,68,.25);
}
.btn-danger:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(239,68,68,.35);
}
.btn-outline-primary {
    border-color: #3b82f6;
    color: #3b82f6;
}
.btn-outline-primary:hover {
    background: #3b82f6;
    border-color: #3b82f6;
}
.btn-outline-danger {
    border-color: #ef4444;
    color: #ef4444;
}
.btn-outline-danger:hover {
    background: #ef4444;
    border-color: #ef4444;
}
.btn-outline-warning {
    border-color: #f59e0b;
    color: #d97706;
}
.btn-outline-warning:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}
.btn-outline-secondary:hover { transform: translateY(-1px); }
.btn-sm { border-radius: 6px; }
.btn-lg { border-radius: 10px; font-weight: 600; }

/* 分页按钮美化 */
.pagination .page-link {
    border-radius: 6px !important;
    margin: 0 2px;
    border: 1px solid #e2e8f0;
    color: #475569;
    min-width: 36px;
    text-align: center;
}
.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border-color: #3b82f6;
    box-shadow: 0 2px 6px rgba(59,130,246,.3);
}
.pagination .page-link:hover {
    background: #f1f5f9;
    color: #3b82f6;
}
