* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100vh;
  text-align: center;
}
.loading h1 { font-size: 24px; color: #f8fafc; margin-bottom: 8px; }
.loading-sub { color: #64748b; font-size: 14px; }

/* Header */
.hd {
  padding: 20px 24px;
  text-align: center;
  border-bottom: 1px solid #1e293b;
  position: relative;
}
.hd h1 { font-size: 24px; color: #f8fafc; margin-bottom: 4px; }
.hd .sub { color: #64748b; font-size: 13px; }

/* Stats cards */
.sts {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 16px;
  flex-wrap: wrap;
}
.st {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 14px 24px;
  text-align: center;
  min-width: 130px;
}
.st .v { font-size: 28px; font-weight: 700; }
.st .l { font-size: 11px; color: #64748b; margin-top: 2px; }
.st.b .v { color: #38bdf8; }
.st.o .v { color: #fb923c; }
.st.g .v { color: #4ade80; }
.st.gr .v { color: #94a3b8; }

/* Charts */
.chs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 0 24px 16px;
  max-width: 1400px;
  margin: 0 auto;
}
.ch {
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 16px;
}
.ch h3 { font-size: 14px; color: #f1f5f9; margin-bottom: 10px; }
.ch canvas { max-height: 200px; }

/* Collapsible charts section */
.collapse-section { padding: 0 24px; }
.collapse-btn {
  background: #1e293b;
  border: 1px solid #334155;
  color: #94a3b8;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  margin-bottom: 8px;
}
.collapse-btn:hover { color: #38bdf8; border-color: #38bdf8; }
.charts-area {
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  max-height: 500px;
  opacity: 1;
}
.charts-area.collapsed {
  max-height: 0;
  opacity: 0;
  margin: 0;
  padding: 0;
}

/* Controls */
.ct {
  display: flex;
  gap: 12px;
  padding: 8px 24px;
  align-items: center;
  flex-wrap: wrap;
}
.ct input,
.ct select {
  background: #1e293b;
  border: 1px solid #334155;
  color: #e2e8f0;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.ct input { width: 250px; }
.ct input:focus,
.ct select:focus { border-color: #38bdf8; }
.ct label { font-size: 12px; color: #64748b; }

/* Refresh button */
.rb {
  background: #2563eb;
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  position: absolute;
  top: 16px;
  right: 24px;
}
.rb:hover { background: #1d4ed8; }
.rb:disabled { background: #475569; cursor: not-allowed; }

/* Back link */
.back-link {
  color: #64748b;
  text-decoration: none;
  font-size: 13px;
  display: inline-block;
  margin-bottom: 12px;
}
.back-link:hover { color: #38bdf8; }

/* Gantt table */
.gw { overflow-x: auto; padding: 0 24px 24px; }
table.g {
  border-collapse: collapse;
  font-size: 12px;
  white-space: nowrap;
}
table.g th {
  background: #334155;
  color: #94a3b8;
  padding: 6px 10px;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 3;
  border-bottom: 2px solid #475569;
}
table.g td {
  padding: 5px 10px;
  border-bottom: 1px solid #1e293b44;
}
table.g a {
  color: #38bdf8;
  font-weight: 600;
  text-decoration: none;
}
table.g a:hover { text-decoration: underline; }

/* Sticky columns */
.sk { position: sticky; left: 0; z-index: 2; min-width: 75px; }
.ss {
  position: sticky;
  left: 75px;
  z-index: 2;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Cell styles */
.dt { font-size: 11px; }
.wh {
  font-size: 9px;
  writing-mode: vertical-lr;
  text-orientation: mixed;
  padding: 4px 2px;
  min-width: 18px;
  color: #64748b;
}
.st-badge {
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: default;
}
.epic-cell {
  max-width: 140px;
  min-width: 120px;
}
.epic-cell a {
  color: #a78bfa !important;
  text-decoration: none;
  font-size: 11px;
}

/* Epic progress bar */
.epic-bar-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
}
.epic-bar {
  position: relative;
  height: 18px;
  background: #0f172a;
  border: 1px solid #334155;
  border-radius: 4px;
  overflow: hidden;
}
.epic-bar-fill {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  background: linear-gradient(90deg, #8b5cf6 0%, #a78bfa 100%);
  transition: width 0.3s ease;
}
.epic-bar-label {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #f8fafc;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}
.epic-bar-link:hover .epic-bar {
  border-color: #a78bfa;
}
.act-cell { font-size: 11px; min-width: 120px; }
.act-tip { cursor: default; position: relative; }

/* Sortable columns */
.srt { cursor: pointer; user-select: none; }
.srt:hover { color: #38bdf8; }
.srt.asc::after { content: ' ▲'; font-size: 8px; }
.srt.desc::after { content: ' ▼'; font-size: 8px; }

/* Tooltip */
.tooltip {
  position: fixed;
  background: #1e293b;
  border: 1px solid #475569;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 12px;
  color: #e2e8f0;
  max-width: 400px;
  white-space: pre-wrap;
  word-wrap: break-word;
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  pointer-events: none;
  line-height: 1.5;
}

/* Notes footer */
.notes {
  max-width: 1200px;
  margin: 24px auto;
  padding: 20px 24px;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  font-size: 13px;
  color: #94a3b8;
}
.notes h3 {
  color: #f1f5f9;
  font-size: 14px;
  margin-bottom: 12px;
}
.notes div { margin-bottom: 10px; }
.notes div:last-child { margin-bottom: 0; }
.notes strong { color: #e2e8f0; }
.notes code {
  background: #334155;
  padding: 1px 6px;
  border-radius: 4px;
}

@media (max-width: 900px) {
  .chs { grid-template-columns: 1fr; }
}
