/* LightMES Industrial Theme */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif; background: #f5f5f5; color: #333; }
#app { height: 100%; }

/* Layout */
.app-wrapper { display: flex; height: 100vh; }
.sidebar { width: 220px; background: #1a1a1a; color: #fff; display: flex; flex-direction: column; transition: width 0.3s; flex-shrink: 0; overflow: hidden; }
.sidebar.collapsed { width: 64px; }
.sidebar-header { height: 56px; display: flex; align-items: center; padding: 0 16px; border-bottom: 1px solid #333; }
.sidebar-header .logo { font-size: 20px; font-weight: 700; color: #fff; white-space: nowrap; }
.sidebar-header .logo-mini { font-size: 18px; font-weight: 700; color: #fff; }
.sidebar-menu { flex: 1; overflow-y: auto; padding: 8px 0; }
.sidebar-menu::-webkit-scrollbar { width: 0; }

/* Menu Items */
.menu-group-title { padding: 12px 16px 4px; font-size: 12px; color: #666; text-transform: uppercase; letter-spacing: 1px; }
.menu-item { display: flex; align-items: center; height: 44px; padding: 0 16px; color: #ccc; cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.menu-item:hover { background: #333; color: #fff; }
.menu-item.is-active { background: #333; color: #fff; border-left: 3px solid #fff; }
.menu-item i { font-size: 18px; margin-right: 10px; width: 20px; text-align: center; }
.menu-item span { font-size: 14px; }

/* Main Content */
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; }
.topbar { height: 56px; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid #e0e0e0; flex-shrink: 0; }
.topbar-left { display: flex; align-items: center; gap: 16px; }
.topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar .collapse-btn { cursor: pointer; font-size: 20px; color: #666; }
.topbar .collapse-btn:hover { color: #333; }
.content-area { flex: 1; overflow-y: auto; padding: 20px; background: #f5f5f5; }

/* Page Header */
.page-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.page-title { font-size: 20px; font-weight: 600; color: #1a1a1a; }

/* Card Style */
.content-card { background: #fff; border-radius: 4px; padding: 16px; margin-bottom: 16px; border: 1px solid #e8e8e8; }
.content-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }

/* Filter Bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid #f0f0f0; }
.filter-bar .el-input, .filter-bar .el-select { width: 180px; }

/* Action Bar */
.action-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.action-bar-left { display: flex; gap: 8px; }
.action-bar-right { display: flex; gap: 8px; }

/* Data Table Override */
.el-table { --el-table-border-color: #e8e8e8; --el-table-header-bg-color: #fafafa; }
.el-table th { font-weight: 600; color: #333; }
.el-table .cell { padding: 0 12px; }

/* Stat Cards */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat-card { background: #fff; border: 1px solid #e8e8e8; border-radius: 4px; padding: 20px; }
.stat-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.stat-card .label { font-size: 14px; color: #666; margin-bottom: 8px; }
.stat-card .value { font-size: 28px; font-weight: 700; color: #1a1a1a; }
.stat-card .suffix { font-size: 14px; color: #999; margin-left: 4px; }
.stat-card .trend { font-size: 12px; margin-top: 4px; }
.stat-card .trend.up { color: #67c23a; }
.stat-card .trend.down { color: #f56c6c; }

/* Quick Entry */
.quick-entries { display: flex; gap: 16px; margin-bottom: 16px; }
.quick-entry { flex: 1; background: #fff; border: 1px solid #e8e8e8; border-radius: 4px; padding: 20px; text-align: center; cursor: pointer; transition: all 0.2s; }
.quick-entry:hover { border-color: #333; transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.quick-entry i { font-size: 32px; color: #333; margin-bottom: 8px; display: block; }
.quick-entry .text { font-size: 14px; color: #333; }

/* Info Grid */
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.info-item { display: flex; line-height: 32px; }
.info-item .label { width: 80px; color: #999; flex-shrink: 0; }
.info-item .value { color: #333; flex: 1; }

/* Progress Steps */
.progress-steps { display: flex; align-items: center; padding: 16px 0; }
.progress-step { display: flex; align-items: center; }
.progress-step .dot { width: 24px; height: 24px; border-radius: 50%; background: #e0e0e0; color: #999; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.progress-step .dot.active { background: #333; color: #fff; }
.progress-step .dot.done { background: #67c23a; color: #fff; }
.progress-step .name { margin: 0 8px; font-size: 13px; color: #666; }
.progress-step .name.active { color: #333; font-weight: 600; }
.progress-line { flex: 1; height: 2px; background: #e0e0e0; min-width: 20px; }
.progress-line.done { background: #67c23a; }

/* Gantt Chart */
.gantt-container { overflow-x: auto; background: #fff; }
.gantt-header { display: flex; background: #fafafa; border-bottom: 1px solid #e8e8e8; }
.gantt-resource-col { width: 120px; flex-shrink: 0; padding: 8px 12px; font-weight: 600; border-right: 1px solid #e8e8e8; }
.gantt-timeline { flex: 1; display: flex; }
.gantt-day { flex: 1; min-width: 60px; text-align: center; padding: 8px; border-right: 1px solid #f0f0f0; font-size: 12px; color: #666; }
.gantt-row { display: flex; border-bottom: 1px solid #f0f0f0; min-height: 48px; }
.gantt-row-label { width: 120px; flex-shrink: 0; padding: 12px; border-right: 1px solid #e8e8e8; font-size: 13px; display: flex; align-items: center; }
.gantt-row-bars { flex: 1; position: relative; display: flex; align-items: center; }
.gantt-bar { position: absolute; height: 28px; border-radius: 4px; display: flex; align-items: center; padding: 0 8px; font-size: 12px; color: #fff; cursor: pointer; }
.gantt-bar.status-0 { background: #909399; }
.gantt-bar.status-1 { background: #409eff; }
.gantt-bar.status-2 { background: #e6a23c; }
.gantt-bar.status-3 { background: #67c23a; }

/* Equipment Board */
.eqp-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.eqp-card { background: #fff; border: 1px solid #e8e8e8; border-radius: 4px; padding: 16px; cursor: pointer; transition: all 0.2s; }
.eqp-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.eqp-card .eqp-name { font-size: 15px; font-weight: 600; margin-bottom: 8px; }
.eqp-card .eqp-status { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 4px; }
.eqp-card .eqp-status .dot { width: 8px; height: 8px; border-radius: 50%; }
.eqp-card .eqp-info { font-size: 12px; color: #999; }

/* Status Colors */
.status-running { color: #67c23a; }
.status-idle { color: #409eff; }
.status-fault { color: #f56c6c; }
.status-maintain { color: #e6a23c; }
.status-stop { color: #909399; }

/* Trace Tree */
.trace-tree { display: flex; align-items: center; justify-content: center; padding: 32px; gap: 0; }
.trace-node { background: #fff; border: 2px solid #e0e0e0; border-radius: 8px; padding: 16px; min-width: 160px; text-align: center; cursor: pointer; transition: all 0.2s; }
.trace-node:hover { border-color: #333; }
.trace-node .node-title { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.trace-node .node-info { font-size: 12px; color: #666; }
.trace-arrow { display: flex; align-items: center; padding: 0 12px; }
.trace-arrow i { font-size: 24px; color: #999; }

/* Kanban */
.kanban-header { background: #1a1a1a; color: #fff; padding: 20px; text-align: center; }
.kanban-header h1 { font-size: 28px; font-weight: 700; }
.kanban-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kanban-stat { background: #fff; border: 1px solid #e8e8e8; border-radius: 4px; padding: 20px; text-align: center; }
.kanban-stat .label { font-size: 14px; color: #666; margin-bottom: 8px; }
.kanban-stat .value { font-size: 36px; font-weight: 700; color: #1a1a1a; }
.kanban-stat .unit { font-size: 14px; color: #999; }

/* Tabs Override */
.el-tabs__item { font-size: 14px; }
.el-tabs__item.is-active { font-weight: 600; }

/* Button Override */
.el-button--primary { background: #333; border-color: #333; }
.el-button--primary:hover { background: #555; border-color: #555; }

/* Pagination */
.pagination-wrapper { display: flex; justify-content: flex-end; padding-top: 16px; }

/* Detail Card */
.detail-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; }
.detail-title { font-size: 20px; font-weight: 600; }

/* Login Page */
.login-wrapper { height: 100vh; display: flex; align-items: center; justify-content: center; background: #f5f5f5; }
.login-card { width: 400px; background: #fff; border-radius: 4px; padding: 40px; border: 1px solid #e0e0e0; }
.login-title { text-align: center; margin-bottom: 32px; }
.login-title h2 { font-size: 24px; font-weight: 700; color: #1a1a1a; margin-bottom: 8px; }
.login-title p { font-size: 14px; color: #999; }

/* Scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #999; }
::-webkit-scrollbar-track { background: transparent; }

/* Chart Container */
.chart-container { width: 100%; height: 350px; }

/* Responsive */
@media (max-width: 1200px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
  .kanban-stats { grid-template-columns: repeat(2, 1fr); }
}
