.dashboard {
  padding: 1rem;
  max-width: 1200px;
}

.loading, .error, .empty {
  padding: 2rem;
  text-align: center;
  color: var(--text-secondary, #666);
}

.error {
  color: var(--error-color, #dc2626);
}

.kpiGrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.kpiCard {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 12px;
  padding: 1.25rem;
  text-align: center;
}

.kpiValue {
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary-color, #F25843);
  line-height: 1.2;
}

.kpiLabel {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary, #333);
  margin-top: 0.25rem;
}

.kpiSub {
  font-size: 0.75rem;
  color: var(--text-secondary, #888);
  margin-top: 0.25rem;
}

.section {
  margin-bottom: 2rem;
}

.sectionTitle {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--text-primary, #333);
}

.contextGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
}

.contextCard {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 10px;
  padding: 1rem;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.contextCard:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.contextTitle {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

.contextMeta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.8rem;
  color: var(--text-secondary, #666);
}

.contextCategory {
  background: var(--bg-tag, #e3f2fd);
  color: var(--primary-color, #F25843);
  padding: 0.1rem 0.5rem;
  border-radius: 4px;
  font-size: 0.75rem;
}

.contextLast {
  font-size: 0.75rem;
  color: var(--text-secondary, #888);
  margin-top: 0.5rem;
}

.emptyState {
  text-align: center;
  padding: 2rem;
  color: var(--text-secondary, #666);
  background: var(--bg-card, #fff);
  border: 1px dashed var(--border-color, #ccc);
  border-radius: 10px;
}

.badgeGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.badgeCard {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 20px;
  font-size: 0.85rem;
}

.badgeIcon {
  font-size: 1.1rem;
}

.badgeLabel {
  font-weight: 500;
  color: var(--text-primary, #333);
}

.tipCard {
  background: var(--bg-card, #fff);
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 10px;
  padding: 1.25rem;
  color: var(--text-primary, #333);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ============================================================ */
/* MOBILE RESPONSIVE */
/* ============================================================ */
@media (max-width: 768px) {
  .dashboard {
    padding: 0.75rem;
  }
  .kpiGrid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  .kpiCard {
    padding: 0.85rem;
  }
  .kpiValue {
    font-size: 1.5rem;
  }
  .contextGrid {
    grid-template-columns: 1fr;
  }
  .badgeGrid {
    gap: 0.5rem;
  }
  .badgeCard {
    padding: 0.4rem 0.7rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 400px) {
  .kpiGrid {
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }
  .kpiCard {
    padding: 0.65rem;
    border-radius: 8px;
  }
  .kpiValue {
    font-size: 1.25rem;
  }
  .kpiLabel {
    font-size: 0.75rem;
  }
}

.newTopicBtn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 1.25rem;
  background: var(--primary-color, #F25843);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.85rem;
  font-weight: 500;
}

.newTopicBtn:hover { filter: brightness(1.08); }

@media (max-width: 768px) {
  .dashboard { padding: 0.75rem; }

  .kpiGrid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.65rem;
  }

  .kpiCard { padding: 0.9rem; }
  .kpiValue { font-size: 1.5rem; }
  .kpiLabel { font-size: 0.78rem; }
  .kpiSub { font-size: 0.7rem; }

  .contextGrid {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .badgeGrid { gap: 0.5rem; }
  .badgeCard { padding: 0.4rem 0.65rem; font-size: 0.8rem; }

  .sectionTitle { font-size: 1rem; }
  .tipCard { padding: 0.9rem; font-size: 0.85rem; }
}
