/* ===== DEV ROADMAP — Full Page Command Center ===== */

/* --- PAGE CONTAINER --- */
.plan-page {
  padding: 0;
  max-width: 100%;
  min-height: 100vh;
}

/* --- HEADER BAR --- */
.plan-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid rgba(0,212,255,0.1);
  background: rgba(10,14,26,0.6);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.plan-title {
  font-size: 18px;
  font-weight: 800;
  color: #00d4ff;
  letter-spacing: 2px;
}

.plan-subtitle {
  font-size: 11px;
  color: rgba(255,255,255,0.35);
  margin-top: 2px;
}

.plan-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.plan-live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #00e676;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.plan-pulse {
  width: 8px;
  height: 8px;
  background: #00e676;
  border-radius: 50%;
  display: inline-block;
  animation: planPulse 1.5s ease-in-out infinite;
}

@keyframes planPulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 4px #00e676; }
  50% { opacity: 0.4; box-shadow: 0 0 12px #00e676; }
}

.plan-refresh-timer {
  font-size: 11px;
  color: rgba(255,255,255,0.3);
  font-family: monospace;
  min-width: 28px;
  text-align: center;
}

.plan-refresh-btn {
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.2);
  color: #00d4ff;
  font-size: 14px;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.plan-refresh-btn:hover {
  background: rgba(0,212,255,0.2);
  transform: rotate(90deg);
}

/* --- TOP GRID (Progress + Metrics) --- */
.plan-top-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  padding: 20px 24px;
}

.plan-overview-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
}

.plan-version {
  font-size: 10px;
  color: rgba(255,255,255,0.3);
  margin-bottom: 12px;
  line-height: 1.4;
  max-height: 2.8em;
  overflow: hidden;
}

.plan-ring-wrap {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 12px;
}

.plan-ring-svg {
  width: 140px;
  height: 140px;
}

.plan-ring-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
}

.plan-ring-pct {
  font-size: 32px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
}

.plan-ring-label {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
  margin-top: 2px;
}

.plan-pending-count {
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  margin-bottom: 12px;
}

.plan-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}

.plan-stat {
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.plan-stat-green { color: #00e676; background: rgba(0,230,118,0.1); }
.plan-stat-yellow { color: #ffab00; background: rgba(255,171,0,0.1); }
.plan-stat-red { color: #ff5252; background: rgba(255,82,82,0.1); }
.plan-stat-gray { color: #888; background: rgba(255,255,255,0.05); }

/* --- METRICS GRID --- */
.plan-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.plan-metric {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-left: 3px solid;
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  transition: all 0.2s;
}

.plan-metric:hover {
  background: rgba(255,255,255,0.04);
  transform: translateY(-1px);
}

.plan-metric-icon {
  font-size: 20px;
  flex-shrink: 0;
  margin-top: 2px;
}

.plan-metric-body {
  min-width: 0;
}

.plan-metric-val {
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.plan-metric-title {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.5px;
  margin-top: 2px;
}

.plan-metric-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.25);
  margin-top: 1px;
}

/* --- CONTROLS (Filters + Search) --- */
.plan-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.plan-filter-row {
  display: flex;
  gap: 6px;
}

.plan-filter {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.5);
  font-size: 11px;
  padding: 6px 12px;
  border-radius: 20px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}

.plan-filter:hover {
  background: rgba(0,212,255,0.08);
  border-color: rgba(0,212,255,0.2);
  color: #00d4ff;
}

.plan-filter.active {
  background: rgba(0,212,255,0.12);
  border-color: rgba(0,212,255,0.4);
  color: #00d4ff;
}

.plan-search {
  flex: 1;
  max-width: 300px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  color: #fff;
  outline: none;
  transition: border-color 0.2s;
}

.plan-search::placeholder { color: rgba(255,255,255,0.2); }
.plan-search:focus { border-color: rgba(0,212,255,0.4); }

/* --- MAIN GRID (Phases + Side) --- */
.plan-main-grid {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 20px;
  padding: 20px 24px;
}

.plan-section-head {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.35);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* --- PHASES --- */
.plan-phases-col {
  min-width: 0;
}

.plan-phase {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.05);
  background: rgba(255,255,255,0.015);
  margin-bottom: 6px;
  transition: all 0.2s;
}

.plan-phase:hover {
  border-color: rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.025);
}

.plan-ps-done { border-left: 3px solid #00e676; }
.plan-ps-warning { border-left: 3px solid #ffab00; }
.plan-ps-danger { border-left: 3px solid #ff5252; }
.plan-ps-not-started { border-left: 3px solid #444; }

.plan-phase-head {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
}

.plan-phase-head:hover { background: rgba(255,255,255,0.03); }

.plan-ph-icon { font-size: 14px; flex-shrink: 0; }
.plan-ph-id { font-size: 10px; color: rgba(255,255,255,0.25); font-weight: 600; min-width: 30px; }
.plan-ph-name { font-size: 12px; color: rgba(255,255,255,0.85); font-weight: 600; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plan-ph-pct { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.5); min-width: 36px; text-align: right; }
.plan-ph-count { font-size: 10px; color: rgba(255,255,255,0.3); min-width: 36px; text-align: right; }
.plan-ph-arrow { font-size: 10px; color: rgba(255,255,255,0.25); margin-left: 4px; transition: transform 0.2s; }

.plan-new-badge {
  font-size: 8px;
  font-weight: 700;
  color: #00d4ff;
  background: rgba(0,212,255,0.12);
  border: 1px solid rgba(0,212,255,0.25);
  padding: 1px 5px;
  border-radius: 4px;
  letter-spacing: 0.5px;
  margin-left: 4px;
}

.plan-phase-bar {
  height: 3px;
  background: rgba(255,255,255,0.04);
  margin: 0 12px 2px;
  border-radius: 2px;
  overflow: hidden;
}

.plan-phase-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.6s ease;
}

.plan-fill-done { background: #00e676; }
.plan-fill-warning { background: #ffab00; }
.plan-fill-danger { background: #ff5252; }
.plan-fill-not-started { background: #444; }

/* --- TASKS --- */
.plan-tasks {
  padding: 4px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-top: 1px solid rgba(255,255,255,0.04);
  max-height: 400px;
  overflow-y: auto;
}

.plan-task {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  font-size: 11px;
  line-height: 1.4;
  transition: background 0.15s;
}

.plan-task:hover { background: rgba(255,255,255,0.03); }

.plan-t-done { opacity: 0.5; }
.plan-t-done .plan-t-text { text-decoration: line-through; }
.plan-t-pending .plan-t-text { color: rgba(255,255,255,0.7); }
.plan-t-critical { background: rgba(255,82,82,0.06); border: 1px solid rgba(255,82,82,0.12); }
.plan-t-blocked { opacity: 0.6; }

.plan-t-check { font-size: 14px; flex-shrink: 0; }
.plan-t-id { font-size: 9px; color: rgba(255,255,255,0.2); font-weight: 600; min-width: 32px; margin-top: 1px; }
.plan-t-text { color: rgba(255,255,255,0.6); flex: 1; min-width: 0; }
.plan-t-note { font-size: 9px; color: #ffab00; width: 100%; margin-left: 52px; }
.plan-t-blocked-tag { font-size: 9px; color: #ff9800; background: rgba(255,152,0,0.1); padding: 1px 5px; border-radius: 3px; }
.plan-t-crit-tag { font-size: 8px; font-weight: 700; color: #ff5252; background: rgba(255,82,82,0.12); border: 1px solid rgba(255,82,82,0.2); padding: 1px 5px; border-radius: 3px; letter-spacing: 0.5px; }

.plan-empty {
  text-align: center;
  color: rgba(255,255,255,0.3);
  padding: 30px;
  font-size: 13px;
}

/* --- SIDE COLUMN --- */
.plan-side-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.plan-side-card {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 12px;
  padding: 14px;
}

.plan-side-title {
  font-size: 11px;
  font-weight: 700;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

/* Next Actions */
.plan-next-card {
  background: rgba(0,212,255,0.03);
  border-color: rgba(0,212,255,0.15);
}

.plan-next-item {
  padding: 6px 0;
  font-size: 12px;
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}

.plan-next-item:last-child { border-bottom: none; }

/* Blocked */
.plan-blocked-card {
  background: rgba(255,82,82,0.04);
  border-color: rgba(255,82,82,0.2);
}

.plan-blocked-item {
  padding: 6px 0;
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  border-bottom: 1px solid rgba(255,82,82,0.08);
}

.plan-blocked-item:last-child { border-bottom: none; }

.plan-blocked-id {
  font-size: 9px;
  font-weight: 700;
  color: #ff5252;
  margin-right: 6px;
}

.plan-blocked-text {
  color: rgba(255,255,255,0.6);
}

.plan-blocked-reason {
  display: block;
  font-size: 10px;
  color: #ff9800;
  margin-top: 2px;
  margin-left: 0;
}

/* Activity Feed */
.plan-activity-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.03);
}

.plan-activity-item:last-child { border-bottom: none; }

.plan-act-icon {
  font-size: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

.plan-act-body { min-width: 0; flex: 1; }

.plan-act-title {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-act-detail {
  font-size: 9px;
  color: rgba(255,255,255,0.3);
  margin-top: 1px;
}

.plan-activity-empty {
  text-align: center;
  color: rgba(255,255,255,0.2);
  font-size: 12px;
  padding: 16px;
}

/* Waves */
.plan-wave {
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 11px;
  margin-bottom: 4px;
  border: 1px solid rgba(255,255,255,0.04);
  transition: background 0.2s;
}

.plan-wave:hover { background: rgba(255,255,255,0.03); }

.wave-done { border-color: rgba(0,230,118,0.15); background: rgba(0,230,118,0.03); }
.wave-partial { border-color: rgba(255,171,0,0.15); background: rgba(255,171,0,0.03); }
.wave-pending { border-color: rgba(255,255,255,0.05); }

.plan-wave-name {
  color: rgba(255,255,255,0.6);
  font-weight: 500;
}

/* --- GANTT TIMELINE --- */
.plan-gantt {
  padding: 20px 24px 30px;
}

.plan-gantt-scroll {
  overflow-x: auto;
  padding-bottom: 10px;
}

.plan-gantt-rows {
  min-width: 600px;
}

.plan-gantt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 3px;
}

.plan-gantt-label {
  font-size: 9px;
  font-weight: 600;
  color: rgba(255,255,255,0.35);
  min-width: 50px;
  max-width: 50px;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-gantt-track {
  flex: 1;
  height: 16px;
  background: rgba(255,255,255,0.03);
  border-radius: 4px;
  overflow: hidden;
}

.plan-gantt-bar {
  height: 100%;
  border-radius: 4px;
  font-size: 8px;
  font-weight: 700;
  color: rgba(255,255,255,0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: width 0.6s ease;
  min-width: 0;
}

.gantt-done { background: linear-gradient(90deg, #00e676, #00c853); }
.gantt-progress { background: linear-gradient(90deg, #ffab00, #ff8f00); }
.gantt-danger { background: linear-gradient(90deg, #ff5252, #d32f2f); }
.gantt-pending { background: rgba(255,255,255,0.08); }

/* --- LOADING/ERROR --- */
.plan-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 80px 20px;
  color: rgba(255,255,255,0.4);
  font-size: 14px;
}

.plan-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(0,212,255,0.1);
  border-top-color: #00d4ff;
  border-radius: 50%;
  animation: planSpin 0.8s linear infinite;
}

@keyframes planSpin { to { transform: rotate(360deg); } }

.plan-error {
  text-align: center;
  padding: 80px 20px;
  color: #ff5252;
  font-size: 14px;
}

/* --- FAB BUTTON (kept for backward compat) --- */
.planning-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(135deg, #00d4ff 0%, #0066ff 100%);
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,212,255,0.3);
  transition: all 0.3s;
}

.planning-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 30px rgba(0,212,255,0.5);
}

.planning-fab-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #ff5252;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}

/* Old panel elements — keep for backward compat */
#planning-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: 400px;
  height: 100vh;
  background: linear-gradient(180deg, #0a0e1a 0%, #0d1117 50%, #0a0e1a 100%);
  border-left: 1px solid rgba(0,212,255,0.15);
  z-index: 9999;
  overflow-y: auto;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(0,0,0,0.6);
}

#planning-panel.open { right: 0; }

.planning-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0,212,255,0.1);
  position: sticky;
  top: 0;
  background: rgba(10,14,26,0.95);
  backdrop-filter: blur(10px);
  z-index: 10;
}

.planning-header-title {
  font-size: 14px;
  font-weight: 700;
  color: #00d4ff;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.planning-close-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: #888;
  font-size: 18px;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.planning-close-btn:hover {
  color: #ff5252;
  border-color: #ff5252;
}

.planning-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.5);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.planning-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

/* --- RESPONSIVE --- */
@media (max-width: 1200px) {
  .plan-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .plan-top-grid {
    grid-template-columns: 1fr;
  }
  .plan-overview-card {
    display: flex;
    align-items: center;
    gap: 20px;
    text-align: left;
  }
  .plan-ring-wrap {
    margin: 0;
    width: 100px;
    height: 100px;
    flex-shrink: 0;
  }
  .plan-ring-svg { width: 100px; height: 100px; }
  .plan-ring-pct { font-size: 22px; }
}

@media (max-width: 900px) {
  .plan-main-grid {
    grid-template-columns: 1fr;
  }
  .plan-top-grid {
    padding: 12px 16px;
  }
  .plan-main-grid {
    padding: 12px 16px;
  }
  .plan-controls {
    flex-direction: column;
    align-items: stretch;
    padding: 10px 16px;
  }
  .plan-search { max-width: 100%; }
  .plan-filter-row { overflow-x: auto; }
  .plan-header-bar { padding: 12px 16px; }
  .plan-gantt { padding: 12px 16px 20px; }
}

@media (max-width: 768px) {
  .plan-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .plan-metric { padding: 10px; }
  .plan-metric-val { font-size: 16px; }

  .planning-fab {
    bottom: calc(80px + env(safe-area-inset-bottom, 0px) + 12px);
    right: 12px;
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
}
