/* ============================================================
   NexaGrid - UI Components showcase page
   ============================================================ */

/* ================= Page header ================= */
.components-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.components-head .dashboard-title { flex: 1; min-width: 260px; }

.cd-intro {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 560px;
}

/* ================= Anchor chips ================= */
.cd-anchors {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.cd-anchors a {
  height: 34px;
  padding: 0 13px;
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  transition: background 0.15s, color 0.15s;
}

.cd-anchors a:hover {
  color: var(--accent);
  background: var(--accent-soft);
}

.cd-anchors a svg { width: 13px; height: 13px; }

/* ================= Section block ================= */
.cd-block {
  scroll-margin-top: 8px;
}

.cd-sec-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 20px;
}

.cd-sec-num {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cd-sec-head h2 {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
}

.cd-sec-head p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}

/* ================= Demo area ================= */
.cd-demo {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
}

.cd-demo.stack {
  flex-direction: column;
  align-items: flex-start;
}

.cd-demo.column { flex-direction: column; }

.cd-tile {
  display: flex;
  flex-direction: column;
  gap: 9px;
  align-items: flex-start;
  min-width: 0;
}

.cd-tile-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-2);
}

.cd-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.cd-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  width: 100%;
}

.cd-sep {
  width: 100%;
  height: 1px;
  background: var(--surface-inset);
  margin: 4px 0;
}

.cd-code {
  font-size: 11px;
  color: var(--muted);
  background: var(--canvas-1);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  padding: 2px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  white-space: nowrap;
}

/* Form demo */
.cd-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  width: 100%;
}

.cd-form .cd-tile { width: 100%; }

.cd-form input.input-flat,
.cd-form .csel-wrap { width: 100%; }

.cd-check-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cd-switch-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.cd-switch-row > span { font-size: 12.5px; font-weight: 600; color: var(--ink); min-width: 120px; }

/* Table demo */
.cd-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.cd-table-wrap .widget-table { min-width: 560px; }

/* Avatar demo */
.cd-avatars {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* card + kpi demo */
.cd-kpi {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  width: 100%;
}

.cd-kpi .kpi-card {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cd-kpi .kpi-card .top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cd-kpi .kpi-card .top span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cd-kpi .kpi-card b {
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.cd-kpi .kpi-card .stat-track { background: var(--surface-inset); }

.cd-kpi .kpi-card .stat-track span { background: var(--accent); }
.cd-kpi .kpi-card .stat-track span.success { background: var(--success); }
.cd-kpi .kpi-card .stat-track span.warning { background: var(--warning); }

/* tooltip hotspots */
.cd-hotspots {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* toast + modal buttons */
.cd-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

@media (max-width: 720px) {
  .cd-form { grid-template-columns: 1fr; }
  .cd-kpi { grid-template-columns: 1fr; }
}