/* ====== RESET ====== */
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: -apple-system, "Microsoft YaHei", "Segoe UI", sans-serif; background:#f0f2f5; color:#333; }

/* ====== LOGIN ====== */
.login-page { min-height:100vh; display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#1a237e 0%,#283593 50%,#3949ab 100%); }
.login-card { background:#fff; border-radius:12px; padding:40px; width:380px; box-shadow:0 8px 32px rgba(0,0,0,.2); text-align:center; }
.login-card h2 { font-size:22px; margin-bottom:4px; }
.login-subtitle { color:#888; font-size:14px; margin-bottom:24px; }
.login-logo { font-size:48px; margin-bottom:12px; }
.login-card .el-form-item { margin-bottom:20px; }

/* ====== NAV ====== */
.top-nav { position:fixed; top:0; left:0; right:0; height:56px; background:#1a237e; color:#fff; display:flex; align-items:center; justify-content:space-between; padding:0 24px; z-index:100; box-shadow:0 2px 8px rgba(0,0,0,.2); }
.top-nav .logo { font-size:18px; font-weight:700; white-space:nowrap; }
.top-nav .logo span { color:#ffd54f; }
.top-nav .user-info { display:flex; align-items:center; gap:12px; font-size:14px; white-space:nowrap; }
.top-nav .user-info .avatar { width:32px; height:32px; border-radius:50%; background:#5c6bc0; display:flex; align-items:center; justify-content:center; font-size:14px; }
.nav-tabs { display:flex; gap:4px; overflow:hidden; }
.nav-tabs a { color:rgba(255,255,255,.7); text-decoration:none; padding:8px 16px; border-radius:6px; font-size:13px; transition:all .2s; cursor:pointer; white-space:nowrap; }
.nav-tabs a:hover, .nav-tabs a.active { background:rgba(255,255,255,.15); color:#fff; }

/* ====== SIDEBAR ====== */
.sidebar { position:fixed; top:56px; left:0; bottom:0; width:220px; background:#fff; border-right:1px solid #e0e0e0; overflow-y:auto; z-index:90; }
.sidebar .menu-group { padding:12px 0; border-bottom:1px solid #f0f0f0; }
.sidebar .menu-group-title { font-size:11px; color:#999; padding:0 20px; margin-bottom:6px; text-transform:uppercase; letter-spacing:1px; }
.sidebar .menu-item { display:flex; align-items:center; padding:10px 20px; font-size:14px; color:#555; cursor:pointer; transition:all .15s; gap:10px; }
.sidebar .menu-item:hover { background:#e8eaf6; color:#1a237e; }
.sidebar .menu-item.active { background:#e8eaf6; color:#1a237e; font-weight:600; border-right:3px solid #1a237e; }
.sidebar .menu-item .icon { width:20px; text-align:center; font-size:16px; }
.sidebar .menu-item .badge { margin-left:auto; background:#ef5350; color:#fff; font-size:11px; padding:1px 6px; border-radius:10px; }

/* ====== MAIN ====== */
.main { margin-left:220px; margin-top:56px; padding:24px; min-height:calc(100vh - 56px); }

/* ====== CARDS ====== */
.card { background:#fff; border-radius:8px; box-shadow:0 1px 3px rgba(0,0,0,.08); margin-bottom:20px; overflow:hidden; }
.card-header { padding:16px 20px; border-bottom:1px solid #f0f0f0; display:flex; justify-content:space-between; align-items:center; }
.card-header h3 { font-size:16px; color:#1a237e; }
.card-body { padding:20px; }

/* ====== STAT CARDS ====== */
.stat-row { display:grid; grid-template-columns:repeat(4,1fr); gap:16px; margin-bottom:24px; }
.stat-row.cols-3 { grid-template-columns:repeat(3,1fr); }
.stat-card { background:#fff; border-radius:8px; padding:20px; box-shadow:0 1px 3px rgba(0,0,0,.08); position:relative; overflow:hidden; }
.stat-card .stat-icon { width:48px; height:48px; border-radius:12px; display:flex; align-items:center; justify-content:center; font-size:24px; position:absolute; right:16px; top:16px; }
.stat-card .stat-label { font-size:13px; color:#888; margin-bottom:8px; }
.stat-card .stat-value { font-size:28px; font-weight:700; }
.stat-card .stat-change { font-size:12px; margin-top:4px; }
.stat-card .stat-change.up { color:#4caf50; }
.stat-card .stat-change.down { color:#ef5350; }
.stat-card.blue .stat-icon { background:#e3f2fd; color:#1565c0; }
.stat-card.green .stat-icon { background:#e8f5e9; color:#2e7d32; }
.stat-card.orange .stat-icon { background:#fff3e0; color:#e65100; }
.stat-card.red .stat-icon { background:#fce4ec; color:#c62828; }

/* ====== TABLES ====== */
table { width:100%; border-collapse:collapse; font-size:13px; }
table th { background:#f5f5f5; padding:10px 12px; text-align:left; font-weight:600; color:#555; border-bottom:2px solid #e0e0e0; white-space:nowrap; }
table td { padding:10px 12px; border-bottom:1px solid #f0f0f0; }
table tr:hover { background:#fafafa; }

/* ====== STATUS TAGS ====== */
.tag { display:inline-block; padding:3px 10px; border-radius:12px; font-size:12px; font-weight:500; }
.tag.pending { background:#fff3e0; color:#e65100; }
.tag.approving { background:#e3f2fd; color:#1565c0; }
.tag.approved { background:#e8f5e9; color:#2e7d32; }
.tag.rejected { background:#fce4ec; color:#c62828; }
.tag.overdue { background:#ffebee; color:#d32f2f; font-weight:700; }
.tag.normal { background:#e8f5e9; color:#2e7d32; }
.tag.warning { background:#fff3e0; color:#e65100; }
.tag.danger { background:#ffebee; color:#c62828; }
.tag.done { background:#e0e0e0; color:#666; }
.tag.progress { background:#e3f2fd; color:#1565c0; }

/* ====== BUTTONS ====== */
.btn { display:inline-block; padding:8px 16px; border-radius:6px; font-size:13px; cursor:pointer; border:none; transition:all .15s; font-weight:500; }
.btn-primary { background:#1a237e; color:#fff; }
.btn-primary:hover { background:#283593; }
.btn-outline { background:transparent; border:1px solid #1a237e; color:#1a237e; }
.btn-outline:hover { background:#e8eaf6; }
.btn-sm { padding:5px 12px; font-size:12px; }
.btn-danger { background:#c62828; color:#fff; }
.btn-success { background:#2e7d32; color:#fff; }
.btn-group { display:flex; gap:8px; }

/* ====== FORMS ====== */
.form-group { margin-bottom:16px; }
.form-group label { display:block; font-size:13px; font-weight:600; color:#555; margin-bottom:6px; }
.form-group input, .form-group select, .form-group textarea { width:100%; padding:8px 12px; border:1px solid #ddd; border-radius:6px; font-size:13px; }
.form-group textarea { min-height:80px; resize:vertical; }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:16px; }

/* ====== PROGRESS BAR ====== */
.progress-bar { background:#e0e0e0; border-radius:10px; height:8px; overflow:hidden; }
.progress-bar .fill { height:100%; border-radius:10px; transition:width .3s; }
.progress-bar .fill.green { background:#4caf50; }
.progress-bar .fill.yellow { background:#ff9800; }
.progress-bar .fill.red { background:#ef5350; }
.progress-bar .fill.blue { background:#1a237e; }

/* ====== OKR ====== */
.okr-tree { padding-left:20px; }
.okr-item { border-left:3px solid #e0e0e0; padding:8px 16px; margin:8px 0; border-radius:0 8px 8px 0; background:#fff; }
.okr-item.company { border-left-color:#1a237e; }
.okr-item.dept { border-left-color:#1565c0; margin-left:24px; }
.okr-item.person { border-left-color:#42a5f5; margin-left:48px; }
.okr-item .okr-title { font-size:14px; font-weight:600; margin-bottom:6px; }
.okr-item .kr-list { font-size:12px; color:#666; }
.okr-item .kr-item { margin:4px 0; display:flex; align-items:center; gap:8px; }
.okr-item .kr-item .kr-label { flex:1; }
.okr-item .kr-item .kr-progress { width:120px; }
.okr-item .kr-item .kr-value { font-size:12px; font-weight:600; min-width:40px; text-align:right; }

/* ====== APPROVAL ====== */
.approval-steps { display:flex; align-items:center; gap:0; margin:16px 0; }
.approval-step { display:flex; flex-direction:column; align-items:center; flex:1; }
.approval-step .step-dot { width:32px; height:32px; border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:14px; margin-bottom:8px; }
.approval-step .step-dot.done { background:#4caf50; color:#fff; }
.approval-step .step-dot.current { background:#1a237e; color:#fff; animation:pulse 1.5s infinite; }
.approval-step .step-dot.wait { background:#e0e0e0; color:#999; }
.approval-step .step-name { font-size:12px; color:#555; text-align:center; }
.approval-step .step-status { font-size:11px; color:#999; }
@keyframes pulse { 0%,100%{box-shadow:0 0 0 0 rgba(26,35,126,.3)} 50%{box-shadow:0 0 0 8px rgba(26,35,126,0)} }

/* ====== INSPECTION ====== */
.photo-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; }
.photo-item { aspect-ratio:4/3; background:#f5f5f5; border-radius:8px; display:flex; flex-direction:column; align-items:center; justify-content:center; border:1px solid #e0e0e0; cursor:pointer; transition:all .2s; }
.photo-item:hover { border-color:#1a237e; box-shadow:0 2px 8px rgba(0,0,0,.1); }
.photo-item .photo-placeholder { font-size:36px; color:#ccc; }
.photo-item .photo-meta { font-size:11px; color:#999; margin-top:8px; }

/* ====== DASHBOARD ====== */
.dashboard-grid { display:grid; grid-template-columns:2fr 1fr; gap:20px; }
.task-list-item { display:flex; align-items:center; padding:10px 0; border-bottom:1px solid #f0f0f0; }
.task-list-item:last-child { border-bottom:none; }
.task-list-item .task-priority { width:4px; height:36px; border-radius:2px; margin-right:12px; }
.task-list-item .task-priority.p0 { background:#c62828; }
.task-list-item .task-priority.p1 { background:#e65100; }
.task-list-item .task-priority.p2 { background:#1565c0; }
.task-list-item .task-info { flex:1; }
.task-list-item .task-title { font-size:13px; font-weight:500; }
.task-list-item .task-meta { font-size:11px; color:#999; margin-top:2px; }
.task-list-item .task-deadline { font-size:12px; text-align:right; }
.task-list-item .task-deadline.urgent { color:#c62828; font-weight:700; }

/* ====== WATERMARK ====== */
.watermark { position:fixed; bottom:16px; right:16px; color:rgba(0,0,0,.06); font-size:14px; pointer-events:none; z-index:0; }

/* ====== TABS ====== */
.tabs { display:flex; gap:0; border-bottom:2px solid #e0e0e0; margin-bottom:16px; }
.tabs .tab { padding:10px 20px; font-size:13px; color:#888; cursor:pointer; border-bottom:2px solid transparent; margin-bottom:-2px; transition:all .15s; }
.tabs .tab:hover { color:#333; }
.tabs .tab.active { color:#1a237e; border-bottom-color:#1a237e; font-weight:600; }

/* ====== SEARCH ====== */
.search-bar { display:flex; gap:12px; align-items:center; margin-bottom:16px; }
.search-bar input { flex:1; padding:8px 12px; border:1px solid #ddd; border-radius:6px; font-size:13px; }
.search-bar select { padding:8px 12px; border:1px solid #ddd; border-radius:6px; font-size:13px; }

/* ====== PAGE LABEL ====== */
.page-label { display:inline-block; background:#e8eaf6; color:#1a237e; font-size:11px; padding:2px 8px; border-radius:4px; font-weight:600; margin-bottom:8px; }

/* ====== MISC ====== */
.text-muted { color:#999; }
.text-sm { font-size:12px; }
.text-right { text-align:right; }
.flex-between { display:flex; justify-content:space-between; align-items:center; }
.mb-8 { margin-bottom:8px; }
.mb-16 { margin-bottom:16px; }
.mt-16 { margin-top:16px; }
.empty-state { text-align:center; padding:40px; color:#999; }
.empty-state .empty-icon { font-size:48px; margin-bottom:12px; }
.divider { height:1px; background:#f0f0f0; margin:12px 0; }

/* ====== SCROLLBAR ====== */
.sidebar::-webkit-scrollbar { width:4px; }
.sidebar::-webkit-scrollbar-thumb { background:#ddd; border-radius:2px; }

/* ====== ELEMENT PLUS OVERRIDES ====== */
.el-button--primary { background:#1a237e !important; border-color:#1a237e !important; }
.el-button--primary:hover { background:#283593 !important; border-color:#283593 !important; }
.el-tabs__active-bar { background-color:#1a237e !important; }
.el-tabs__item.is-active { color:#1a237e !important; }
.el-menu-item.is-active { color:#1a237e !important; }

/* ====== RESPONSIVE ====== */
@media(max-width:1200px) {
  .stat-row { grid-template-columns:repeat(2,1fr); }
  .dashboard-grid { grid-template-columns:1fr; }
}

/* ====== MODAL ====== */
.modal-mask { position:fixed; top:0; left:0; width:100%; height:100%; background:rgba(0,0,0,.5); z-index:2000; display:flex; align-items:center; justify-content:center; }
.modal-box { background:#fff; border-radius:12px; width:90%; box-shadow:0 12px 40px rgba(0,0,0,.2); overflow:hidden; }
.modal-header { display:flex; align-items:center; justify-content:space-between; padding:16px 20px; border-bottom:1px solid #f0f0f0; }
.modal-header h3 { font-size:16px; font-weight:600; margin:0; }
.modal-close { background:none; border:none; font-size:18px; color:#999; cursor:pointer; line-height:1; padding:4px 8px; border-radius:4px; }
.modal-close:hover { color:#333; background:#f5f5f5; }
.modal-body { padding:20px; max-height:60vh; overflow-y:auto; }
.modal-body .form-group { margin-bottom:16px; }
.modal-body .form-group label { display:block; font-size:13px; font-weight:500; margin-bottom:6px; color:#555; }
.modal-footer { padding:16px 20px; border-top:1px solid #f0f0f0; display:flex; justify-content:flex-end; gap:8px; }


.stat-num { font-size:28px; font-weight:700; }
