@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500&family=Inter:wght@400;500;600;700&display=swap');
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #0d1117; color: #c9d1d9; font-family: 'Inter', -apple-system, sans-serif; display: flex; min-height: 100vh; font-size: 14px; }
code, pre, .mono { font-family: 'Fira Code', 'JetBrains Mono', monospace; }

/* Sidebar */
.sidebar { width: 220px; background: #161b22; border-right: 1px solid #30363d; padding: 20px 0; flex-shrink: 0; display: flex; flex-direction: column; }
.sidebar .logo { padding: 0 20px 20px; font-size: 18px; font-weight: 700; color: #58a6ff; border-bottom: 1px solid #30363d; letter-spacing: -0.5px; }
.sidebar nav { padding: 10px 0; flex: 1; }
.sidebar nav a { display: block; padding: 10px 20px; color: #8b949e; text-decoration: none; font-size: 13px; font-weight: 500; transition: all 0.15s; }
.sidebar nav a:hover, .sidebar nav a.active { color: #e6edf3; background: #21262d; }
.sidebar nav a.active { border-left: 3px solid #58a6ff; padding-left: 17px; }

/* Status bar */
.status-bar { display: flex; gap: 20px; align-items: center; padding: 10px 24px; background: #161b22; border-bottom: 1px solid #30363d; font-size: 12px; }
.status-bar .stat { display: flex; align-items: center; gap: 6px; color: #8b949e; }
.status-bar .stat .val { color: #e6edf3; font-weight: 600; font-family: 'Fira Code', monospace; }
.status-bar .stat .val.good { color: #3fb950; }
.status-bar .stat .val.warn { color: #d29922; }
.status-bar .stat .val.bad { color: #f85149; }

/* Main */
.main { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.content { padding: 20px 24px; flex: 1; display: flex; flex-direction: column; gap: 20px; }

/* Lane cards */
.lanes-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; }
@media (max-width: 1400px) { .lanes-grid { grid-template-columns: repeat(3, 1fr); } }
.lane-card { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 14px; display: flex; flex-direction: column; min-height: 260px; transition: opacity 0.3s; }
.lane-card.stale { opacity: 0.5; }
.lane-card .lane-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.lane-card .lane-name { font-size: 13px; font-weight: 600; color: #e6edf3; }
.lane-card .lane-task { font-size: 12px; font-weight: 600; color: #c9d1d9; margin-bottom: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lane-card .lane-elapsed { font-size: 11px; color: #8b949e; margin-bottom: 8px; }
.lane-card .terminal { background: #0d1117; border: 1px solid #21262d; border-radius: 4px; padding: 8px 10px; font-family: 'Fira Code', monospace; font-size: 11px; line-height: 1.5; color: #8b949e; flex: 1; overflow: hidden; white-space: pre-wrap; word-break: break-all; }
.lane-card .lane-footer { font-size: 10px; color: #484f58; margin-top: 6px; }
.lane-card .stale-badge { font-size: 10px; color: #d29922; font-weight: 500; }

/* Status dots */
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot.green { background: #3fb950; }
.dot.green.pulse { animation: pulse 1.5s infinite; }
.dot.amber { background: #d29922; }
.dot.red { background: #f85149; }
.dot.grey { background: #484f58; }
.dot.blue { background: #58a6ff; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* Bottom panels */
.bottom-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel { background: #161b22; border: 1px solid #30363d; border-radius: 8px; padding: 16px; }
.panel h3 { font-size: 13px; font-weight: 600; color: #58a6ff; margin-bottom: 12px; }

/* Queue panel */
.queue-stats { display: flex; gap: 24px; margin-bottom: 12px; }
.queue-stat { text-align: center; }
.queue-stat .num { font-size: 24px; font-weight: 700; color: #e6edf3; font-family: 'Fira Code', monospace; }
.queue-stat .label { font-size: 10px; color: #8b949e; text-transform: uppercase; letter-spacing: 0.5px; }
.progress-bar { height: 4px; background: #21262d; border-radius: 2px; margin-bottom: 10px; }
.progress-bar .fill { height: 100%; background: #3fb950; border-radius: 2px; transition: width 0.5s; }
.wo-current { font-size: 13px; color: #e6edf3; font-weight: 600; margin-bottom: 8px; }
.queue-next { font-size: 12px; color: #8b949e; }
.queue-next .item { padding: 4px 0; border-bottom: 1px solid #21262d; }

/* Forge panel */
.cron-item { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px solid #21262d; font-size: 12px; }
.cron-item:last-child { border-bottom: none; }
.cron-item .name { color: #c9d1d9; }
.cron-item .time { color: #8b949e; font-family: 'Fira Code', monospace; font-size: 11px; }

/* Login page */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #0d1117; }
.login-box { background: #161b22; border: 1px solid #30363d; border-radius: 12px; padding: 40px; width: 340px; text-align: center; }
.login-box h1 { color: #58a6ff; font-size: 22px; margin-bottom: 8px; }
.login-box p { color: #8b949e; font-size: 13px; margin-bottom: 24px; }
.login-box input { width: 100%; padding: 12px; background: #0d1117; border: 1px solid #30363d; border-radius: 6px; color: #c9d1d9; font-size: 18px; text-align: center; letter-spacing: 8px; margin-bottom: 16px; font-family: 'Fira Code', monospace; }
.login-box input:focus { outline: none; border-color: #58a6ff; }
.login-box button { width: 100%; padding: 12px; background: #238636; border: none; border-radius: 6px; color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; }
.login-box button:hover { background: #2ea043; }
.login-box .error { color: #f85149; font-size: 13px; margin-bottom: 12px; }

/* Tasks page */
.tasks-filters { display: flex; gap: 8px; margin-bottom: 16px; }
.tasks-filters .tab { padding: 6px 14px; border-radius: 16px; font-size: 12px; font-weight: 500; background: #21262d; color: #8b949e; border: 1px solid #30363d; cursor: pointer; transition: all 0.15s; }
.tasks-filters .tab:hover { color: #c9d1d9; }
.tasks-filters .tab.active { background: #388bfd26; color: #58a6ff; border-color: #58a6ff; }

.task-list { display: flex; flex-direction: column; gap: 2px; }
.task-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: #161b22; border: 1px solid #30363d; border-radius: 6px; font-size: 13px; }
.task-row.in-progress { border-left: 3px solid #58a6ff; background: #161b2299; }
.task-row .badge { padding: 2px 8px; border-radius: 10px; font-size: 10px; font-weight: 700; letter-spacing: 0.5px; flex-shrink: 0; }
.badge.p9 { background: #f8514933; color: #f85149; }
.badge.p7 { background: #d2992233; color: #d29922; }
.badge.p5 { background: #58a6ff33; color: #58a6ff; }
.badge.p3 { background: #484f5833; color: #8b949e; }
.task-row .title { flex: 1; color: #e6edf3; }
.task-row .status { font-size: 11px; color: #8b949e; }
.task-row .time { font-size: 11px; color: #484f58; font-family: 'Fira Code', monospace; }

.completed-section { margin-top: 20px; }
.completed-section h3 { font-size: 13px; color: #8b949e; margin-bottom: 8px; }
.completed-section .task-row { opacity: 0.6; }

.add-task-form { display: flex; gap: 8px; margin-bottom: 16px; }
.add-task-form input { flex: 1; padding: 8px 12px; background: #0d1117; border: 1px solid #30363d; border-radius: 6px; color: #c9d1d9; font-size: 13px; }
.add-task-form input:focus { outline: none; border-color: #58a6ff; }
.add-task-form select { padding: 8px 12px; background: #0d1117; border: 1px solid #30363d; border-radius: 6px; color: #c9d1d9; font-size: 13px; }
.add-task-form button { padding: 8px 16px; background: #238636; border: none; border-radius: 6px; color: #fff; font-size: 13px; font-weight: 600; cursor: pointer; }
.add-task-form button:hover { background: #2ea043; }
