/* ═══════════════════════════════════════════════════════════
   BuildOS — Dashboard CSS
═══════════════════════════════════════════════════════════ */

/* ─── KPI Grid ───────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

/* ─── Control Tower (iOS Inset Grouped) ───────────────────── */
.control-tower {
  background: var(--clr-surface);
  border: 0.5px solid var(--clr-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-6);
}

.ct-header {
  background: #007AFF;
  color: white;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ct-header-title {
  font-size: 15px;
  font-weight: 600;
  color: white;
  letter-spacing: -0.01em;
}

.ct-header-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.75);
  margin-top: 1px;
}

.ct-grid-wrapper {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.ct-grid-wrapper::-webkit-scrollbar {
  height: 4px;
}

.ct-grid-wrapper::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 4px;
}

.ct-grid {
  display: grid;
  grid-template-columns: minmax(190px, 2.2fr) minmax(130px, 1.3fr) minmax(90px, 1fr) minmax(105px, 1.1fr) minmax(90px, 1fr) minmax(85px, 0.9fr);
  min-width: 660px;
  width: 100%;
}

.ct-column-header {
  padding: 10px var(--space-4);
  font-size: 11px;
  font-weight: 600;
  color: #8E8E93;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 0.5px solid var(--clr-border);
  background: #F8F8FC;
  white-space: nowrap;
}

.ct-row {
  display: contents;
  cursor: pointer;
}

.ct-cell {
  padding: var(--space-4);
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.08);
  display: flex;
  align-items: center;
  transition: background var(--transition-fast);
}

.ct-row:hover .ct-cell {
  background: rgba(0, 122, 255, 0.04);
}

.ct-project-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: #000000;
}

.ct-project-type {
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
  margin-top: 2px;
}

/* Health indicators */
.health-icon {
  font-size: 20px;
}

/* ─── Dashboard Charts ───────────────────────────────────── */
.chart-card {
  background: var(--clr-surface);
  border: 0.5px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.chart-title {
  font-size: 14.5px;
  font-weight: 600;
  color: #000000;
  letter-spacing: -0.01em;
}

.chart-subtitle {
  font-size: 12px;
  color: var(--clr-text-muted);
  margin-top: 2px;
}

/* Inline SVG charts */
.svg-chart {
  width: 100%;
  overflow: visible;
}

/* Bar chart */
.bar-chart-container {
  width: 100%;
  height: 200px;
}

/* Donut chart */
.donut-chart-container {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.donut-legend {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 3px;
  flex-shrink: 0;
}

.legend-value {
  margin-left: auto;
  font-weight: 600;
  font-size: var(--text-xs);
  color: var(--clr-text-primary);
}

/* ─── Activity Feed (iOS List Style) ─────────────────────── */
.activity-feed {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 10px var(--space-3);
  border-radius: var(--radius-md);
  transition: background var(--transition-fast);
  cursor: pointer;
}

.activity-item:hover {
  background: rgba(0, 122, 255, 0.04);
}

.activity-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
  background: rgba(118, 118, 128, 0.1);
  color: var(--clr-text-secondary);
  border: none;
}

.activity-icon.success { background: rgba(52, 199, 89, 0.14); color: #248A3D; }
.activity-icon.warning { background: rgba(255, 149, 0, 0.14); color: #C97200; }
.activity-icon.danger  { background: rgba(255, 59, 48, 0.14); color: #D70015; }
.activity-icon.info    { background: rgba(0, 122, 255, 0.14); color: #007AFF; }

.activity-text { font-size: 13.5px; color: var(--clr-text-primary); line-height: 1.4; }
.activity-time { font-size: 11.5px; color: var(--clr-text-muted); margin-top: 2px; }

/* ─── Dashboard 2x3 grid ─────────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: var(--space-4);
}

.dashboard-grid-2col {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-4);
}

/* ─── Project Card (iOS Inset Style) ─────────────────────── */
.project-card {
  background: var(--clr-surface);
  border: 0.5px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(0, 122, 255, 0.3);
  transform: translateY(-2px);
}

/* ─── Alert Banner (iOS Tinted Pill) ─────────────────────── */
.alert-banner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 13.5px;
  font-weight: 500;
  border: none;
}

.alert-banner.danger  { background: rgba(255, 59, 48, 0.12); color: #D70015; }
.alert-banner.warning { background: rgba(255, 149, 0, 0.12); color: #C97200; }
.alert-banner.success { background: rgba(52, 199, 89, 0.12); color: #248A3D; }
.alert-banner.info    { background: rgba(0, 122, 255, 0.12); color: #007AFF; }

/* ─── Insights Panel (iOS Inset List) ────────────────────── */
.insights-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.insight-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: 12px 14px;
  background: var(--clr-surface);
  border: 0.5px solid var(--clr-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xs);
  transition: all var(--transition-fast);
}

.insight-item:hover {
  background: rgba(0, 122, 255, 0.04);
}

.insight-icon  { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.insight-title { font-size: 13.5px; font-weight: 600; color: #000000; }
.insight-desc  { font-size: 12px; color: var(--clr-text-secondary); margin-top: 2px; line-height: 1.4; }
