* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #0f0f1a; color: #e0e0e0; font-family: 'Segoe UI', system-ui, sans-serif; min-height: 100vh; }
a { color: inherit; text-decoration: none; }
.app { max-width: 1400px; margin: 0 auto; padding: 16px; }
.hidden { display: none !important; }

/* Header */
header { text-align: center; margin-bottom: 20px; }
h1 { font-size: 2rem; background: linear-gradient(135deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin-bottom: 12px; }
.tab-bar { display: inline-flex; gap: 4px; background: #12122a; padding: 4px; border-radius: 12px; }
.tab { padding: 10px 24px; border-radius: 10px; font-size: .9rem; font-weight: 600; color: #888; cursor: pointer; transition: all .2s; }
.tab:hover { color: #e0e0e0; background: #1a1a2e; }
.tab.active { background: #667eea; color: #fff; }

/* Stats bar */
.stats-bar { display: flex; gap: 12px; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; }
.stat-card { background: #12122a; border: 1px solid #1e1e3a; border-radius: 12px; padding: 16px 24px; text-align: center; min-width: 140px; }
.stat-card .value { font-size: 2rem; font-weight: 700; background: linear-gradient(135deg, #667eea, #764ba2); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.stat-card .label { font-size: .8rem; color: #888; margin-top: 4px; }

/* Toolbar */
.toolbar { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.search-bar { flex: 1; min-width: 200px; }
.search-bar input { width: 100%; padding: 12px 20px; border-radius: 12px; border: 1px solid #2a2a4a; background: #1a1a2e; color: #e0e0e0; font-size: 1rem; outline: none; }
.search-bar input:focus { border-color: #667eea; }
.filters { display: flex; gap: 8px; }
.filters select { padding: 10px 16px; border-radius: 10px; border: 1px solid #2a2a4a; background: #1a1a2e; color: #e0e0e0; font-size: .9rem; outline: none; cursor: pointer; }

/* Dashboard grid */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }

/* Project card */
.project-card { background: #12122a; border: 1px solid #1e1e3a; border-radius: 12px; padding: 16px; cursor: pointer; transition: all .2s; }
.project-card:hover { border-color: #667eea; transform: translateY(-2px); box-shadow: 0 4px 20px #667eea22; }
.project-card .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.project-card .name { font-weight: 700; font-size: 1rem; }
.project-card .desc { font-size: .85rem; color: #888; margin-bottom: 10px; }
.project-card .meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }

/* Badges */
.badge { padding: 3px 10px; border-radius: 6px; font-size: .7rem; font-weight: 600; }
.badge-server { background: #2d6a4f33; color: #52b788; }
.badge-category { background: #667eea33; color: #667eea; }
.badge-priority-1 { background: #e74c3c33; color: #e74c3c; }
.badge-priority-2 { background: #f39c1233; color: #f39c12; }

/* Status dot */
.status-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.status-dot.online { background: #4ade80; box-shadow: 0 0 8px #4ade8066; }
.status-dot.offline { background: #f87171; box-shadow: 0 0 8px #f8717166; }
.status-dot.unknown { background: #555; }

/* Phase progress bar */
.phase-bar { display: flex; gap: 2px; height: 6px; border-radius: 3px; overflow: hidden; }
.phase-bar .segment { flex: 1; background: #2a2a4a; border-radius: 2px; transition: background .3s; }
.phase-bar .segment.done { background: #667eea; }
.phase-score { font-size: .75rem; color: #667eea; margin-top: 4px; text-align: right; }

/* Kanban */
.kanban-board { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 20px; min-height: 60vh; }
.kanban-col { min-width: 200px; max-width: 220px; background: #12122a; border: 1px solid #1e1e3a; border-radius: 12px; padding: 12px; flex-shrink: 0; }
.kanban-col .col-header { font-size: .85rem; font-weight: 700; color: #667eea; margin-bottom: 10px; text-align: center; }
.kanban-col .col-count { font-size: .7rem; color: #888; font-weight: 400; }
.kanban-card { background: #1a1a2e; border: 1px solid #2a2a4a; border-radius: 8px; padding: 10px; margin-bottom: 8px; cursor: pointer; transition: all .2s; font-size: .85rem; }
.kanban-card:hover { border-color: #667eea; }
.kanban-card .kname { font-weight: 600; margin-bottom: 4px; }
.kanban-card .kserver { font-size: .7rem; color: #888; }

/* Health grid */
.health-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 10px; }
.health-card { background: #12122a; border: 1px solid #1e1e3a; border-radius: 10px; padding: 14px; display: flex; align-items: center; gap: 12px; }
.health-card .info { flex: 1; }
.health-card .hname { font-weight: 600; font-size: .9rem; }
.health-card .hurl { font-size: .75rem; color: #888; }
.health-card .hms { font-size: .8rem; color: #52b788; }
.health-card .hms.slow { color: #f39c12; }
.health-card .hms.down { color: #f87171; }

/* Modal */
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: #0008; z-index: 100; display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px); }
.modal { background: #12122a; border: 1px solid #2a2a4a; border-radius: 16px; padding: 28px; max-width: 700px; width: 95%; max-height: 85vh; overflow-y: auto; }
.modal h2 { font-size: 1.4rem; margin-bottom: 6px; }
.modal .mdesc { color: #888; margin-bottom: 20px; }
.modal .section-title { font-size: .9rem; font-weight: 700; color: #667eea; margin: 20px 0 10px; border-bottom: 1px solid #1e1e3a; padding-bottom: 6px; }
.modal .close-btn { position: absolute; top: 16px; right: 20px; font-size: 1.5rem; cursor: pointer; color: #888; }
.modal .close-btn:hover { color: #fff; }

/* Phase list in modal */
.phase-list { list-style: none; }
.phase-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid #1e1e3a; }
.phase-list li:last-child { border: none; }
.phase-list .pnum { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; background: #2a2a4a; color: #888; flex-shrink: 0; }
.phase-list .pnum.done { background: #667eea; color: #fff; }
.phase-list .pname { flex: 1; font-size: .9rem; }
.phase-list .pname.done { color: #667eea; }
.phase-list .pdeliverable { font-size: .75rem; color: #888; }

/* Links */
.link-list { display: flex; gap: 8px; flex-wrap: wrap; }
.link-badge { padding: 6px 14px; border-radius: 8px; font-size: .8rem; background: #1a1a2e; border: 1px solid #2a2a4a; color: #e0e0e0; transition: all .2s; }
.link-badge:hover { border-color: #667eea; color: #667eea; }

/* Supervision */
.supervision-page { display: flex; flex-direction: column; gap: 24px; }
.sup-section { background: #12122a; border: 1px solid #1e1e3a; border-radius: 16px; padding: 24px; }
.sup-title { font-size: 1.2rem; color: #667eea; margin-bottom: 16px; }
.sup-stats { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.sup-charts { display: grid; grid-template-columns: 1fr 2fr; gap: 16px; }
.chart-box { background: #1a1a2e; border-radius: 12px; padding: 16px; min-height: 250px; }
.chart-box-wide { min-height: 300px; }

/* Tasks */
.sup-tasks { display: flex; flex-direction: column; gap: 16px; }
.task-group-title { font-size: 1rem; color: #764ba2; margin-bottom: 8px; }
.task-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 10px; }
.task-card { background: #1a1a2e; border: 1px solid #2a2a4a; border-radius: 10px; padding: 14px; }
.task-card.doing { border-left: 3px solid #f39c12; }
.task-card.todo { border-left: 3px solid #667eea; }
.task-status-badge { font-size: .7rem; font-weight: 600; margin-bottom: 6px; }
.task-status-badge.doing { color: #f39c12; }
.task-status-badge.todo { color: #667eea; }
.task-title { font-weight: 600; margin-bottom: 8px; }
.task-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.task-progress { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.task-progress-bar { height: 4px; background: #667eea; border-radius: 2px; }
.task-progress span { font-size: .75rem; color: #888; }

/* Infra */
.sup-infra { display: flex; flex-direction: column; gap: 16px; }
.infra-server { background: #1a1a2e; border-radius: 12px; padding: 16px; }
.infra-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; flex-wrap: wrap; gap: 8px; }
.infra-name { font-weight: 700; font-size: 1rem; }
.infra-meta { font-size: .8rem; color: #888; }
.infra-services { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 6px; }
.infra-svc { display: flex; align-items: center; gap: 8px; font-size: .85rem; padding: 4px 0; }
.infra-bar { width: 4px; height: 20px; border-radius: 2px; flex-shrink: 0; }

/* Activity timeline */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 16px; padding: 12px 0; border-bottom: 1px solid #1e1e3a; align-items: center; }
.timeline-item:last-child { border: none; }
.timeline-time { font-size: .75rem; color: #888; min-width: 140px; flex-shrink: 0; }
.timeline-content { font-size: .9rem; display: flex; align-items: center; gap: 8px; }

/* Responsive */
@media (max-width: 600px) {
  .projects-grid { grid-template-columns: 1fr; }
  .app { padding: 10px; }
  h1 { font-size: 1.5rem; }
  .toolbar { flex-direction: column; }
  .sup-charts { grid-template-columns: 1fr; }
  .task-cards { grid-template-columns: 1fr; }
  .timeline-item { flex-direction: column; gap: 4px; }
  .timeline-time { min-width: auto; }
}
