/* ══════════════════════════════════════════════════════════════════
   WorkHub 2.0 — Dashboard (sections, grids, stat cards, CMD+K, pages)
   ══════════════════════════════════════════════════════════════════ */

/* ── Dash sections ────────────────────────────────────────────── */
.dash-section {
  margin-bottom: var(--space-6);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: background-color var(--tr) var(--ease), border-color var(--tr) var(--ease);
}
.dash-section__title {
  font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 400;
  color: var(--text); margin-bottom: var(--space-4);
  display: flex; align-items: center; gap: var(--space-2);
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--border-subtle);
}
.dash-section__title svg { width: 20px; height: 20px; color: var(--accent); }

/* Section accent colors */
.dash-section--business { border-left-color: var(--accent); }
.dash-section--promo { border-left-color: var(--info); }
.dash-section--promo .dash-section__title svg { color: var(--info); }
.dash-section--tech { border-left-color: var(--success); }
.dash-section--tech .dash-section__title svg { color: var(--success); }

/* Sub-section divider */
.dash-subsection-title {
  font-size: var(--text-sm); font-weight: 500; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 0.04em;
  margin-top: var(--space-5); margin-bottom: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-subtle);
}

/* ── Dash grid ────────────────────────────────────────────────── */
.dash-grid { display: grid; gap: var(--space-4); }
.dash-grid--4 { grid-template-columns: repeat(4, 1fr); }
.dash-grid--3 { grid-template-columns: repeat(3, 1fr); }
.dash-grid--2 { grid-template-columns: repeat(2, 1fr); }

@media (max-width: 1200px) {
  .dash-grid--4 { grid-template-columns: repeat(2, 1fr); }
  .dash-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .dash-grid--4, .dash-grid--3, .dash-grid--2 { grid-template-columns: 1fr; }
}

/* ── Stat card ────────────────────────────────────────────────── */
.stat-card {
  background: var(--bg); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); padding: var(--space-4);
  transition: border-color var(--tr) var(--ease), background-color var(--tr) var(--ease);
}
.stat-card:hover { border-color: var(--border); }
.stat-card__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.stat-card__label { font-size: var(--text-sm); font-weight: 500; color: var(--text-secondary); }
.stat-card__icon { width: 36px; height: 36px; border-radius: var(--radius); display: flex; align-items: center; justify-content: center; }
.stat-card__icon svg { width: 20px; height: 20px; }
.stat-card__icon--accent { background: var(--accent-light); color: var(--accent); }
.stat-card__icon--success { background: var(--success-light); color: var(--success); }
.stat-card__icon--warning { background: var(--warning-light); color: var(--warning); }
.stat-card__icon--info { background: var(--info-light); color: var(--info); }
.stat-card__icon--error { background: var(--error-light); color: var(--error); }
.stat-card__value { font-family: var(--font-data); font-size: var(--text-3xl); font-weight: 600; color: var(--text); line-height: 1.2; }
.stat-card__change { display: inline-flex; align-items: center; gap: var(--space-1); font-size: var(--text-xs); font-weight: 500; margin-left: var(--space-2); }
.stat-card__change--up { color: var(--success); }
.stat-card__change--down { color: var(--error); }
.stat-card__sub { font-size: var(--text-xs); color: var(--text-muted); margin-top: var(--space-1); }

/* ── Server status ────────────────────────────────────────────── */
.server-row {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle);
}
.server-row:last-child { border-bottom: none; }
.server-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.server-dot--ok { background: var(--success); }
.server-dot--warn { background: var(--warning); }
.server-dot--error { background: var(--error); }
.server-name { font-size: var(--text-sm); font-weight: 500; flex: 1; }
.server-meta { font-size: var(--text-xs); color: var(--text-muted); font-family: var(--font-data); }

/* ── Activity feed ────────────────────────────────────────────── */
.activity-item {
  display: flex; gap: var(--space-3); padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border-subtle); font-size: var(--text-sm);
}
.activity-item:last-child { border-bottom: none; }
.activity-time { font-family: var(--font-data); font-size: var(--text-xs); color: var(--text-muted); white-space: nowrap; min-width: 50px; }
.activity-text { color: var(--text-secondary); }
.activity-text strong { color: var(--text); font-weight: 500; }

/* ── CMD+K overlay ────────────────────────────────────────────── */
.cmdk-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); backdrop-filter: blur(4px);
  z-index: 100; display: none; align-items: flex-start; justify-content: center; padding-top: 20vh;
}
.cmdk-overlay.open { display: flex; animation: cmdk-fade-in var(--tr-fast) var(--ease-out); }
.cmdk-box {
  width: 520px; max-width: 90vw; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
  animation: cmdk-slide-in var(--tr) var(--ease-out);
}
.cmdk-input {
  width: 100%; padding: 14px var(--space-4); border: none; border-bottom: 1px solid var(--border);
  background: transparent; color: var(--text); font-size: var(--text-lg); outline: none;
}
.cmdk-input::placeholder { color: var(--text-muted); }
.cmdk-list { max-height: 320px; overflow-y: auto; padding: var(--space-2); }
.cmdk-item {
  display: flex; align-items: center; gap: var(--space-3); padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background-color var(--tr-fast) var(--ease);
  font-size: var(--text-sm); color: var(--text-secondary);
}
.cmdk-item:hover, .cmdk-item.selected { background: var(--accent-subtle); color: var(--text); }
.cmdk-item svg { width: 16px; height: 16px; opacity: 0.5; flex-shrink: 0; }
.cmdk-item__label { flex: 1; }
.cmdk-hint { padding: var(--space-2) var(--space-4); font-size: var(--text-xs); color: var(--text-muted); border-top: 1px solid var(--border-subtle); display: flex; gap: var(--space-4); }

@keyframes cmdk-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes cmdk-slide-in { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ── Pages ────────────────────────────────────────────────────── */
.page { display: none; }
.page.active { display: block; }
.page-stub {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  height: 60vh; color: var(--text-muted); gap: var(--space-4);
}
.page-stub svg { width: 48px; height: 48px; opacity: 0.2; }
.page-stub__title { font-family: var(--font-display); font-size: var(--text-3xl); }
.page-stub__text { font-size: var(--text-sm); }
