/* ── Table scroll (wide tables on mobile) ─────────────────── */
.table-scroll { overflow-x: auto; }
.table-meta {
  font-size: 0.8rem;
  color: var(--gray-400);
  margin-bottom: 0.5rem;
}
.td-actions { white-space: nowrap; }

/* ── Pagination ───────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1rem;
  justify-content: center;
}
.page-info {
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* ── Sidebar footer links ─────────────────────────────────── */
.sidebar-footer-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
}
.footer-link {
  font-size: 0.82rem;
  color: var(--gray-400);
  text-decoration: none;
}
.footer-link:hover { color: var(--accent); }
.footer-link-btn {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.footer-link-btn:hover { color: var(--danger); }

/* ── Topbar right ─────────────────────────────────────────── */
.topbar-right {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--gray-400);
}

/* ── Timeline edit button ─────────────────────────────────── */
.timeline-edit-btn {
  font-size: 0.75rem;
  color: var(--gray-400);
  text-decoration: none;
  margin-left: auto;
  padding: 0 0.25rem;
}
.timeline-edit-btn:hover { color: var(--accent); }

/* ── Charts ───────────────────────────────────────────────── */
.chart-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.chart-body {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 220px;
}

.chart-wrap-donut {
  width: 180px;
  flex-shrink: 0;
}

.chart-legend {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--gray-600);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Period buttons ───────────────────────────────────────── */
.period-btns {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.period-btn {
  padding: 0.3rem 0.75rem;
  border-radius: 99px;
  border: 1px solid var(--gray-200);
  background: var(--white);
  font-size: 0.8rem;
  color: var(--gray-600);
  cursor: pointer;
  transition: all 0.15s;
}

.period-btn:hover { background: var(--gray-100); }

.period-btn.active {
  background: var(--accent);
  color: var(--white);
  border-color: var(--accent);
}

/* ── Timeline badge ───────────────────────────────────────── */
.timeline-badge {
  display: inline-block;
  background: var(--accent);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
  border-radius: 99px;
  margin-left: 0.5rem;
  letter-spacing: 0.04em;
}

/* ── Stat card uppercase labels ───────────────────────────── */
.stat-label {
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.07em !important;
  text-transform: uppercase !important;
}

@media (max-width: 768px) {
  .chart-grid { grid-template-columns: 1fr; }
  .chart-body { flex-direction: column; align-items: flex-start; }
  .chart-wrap-donut { width: 140px; }
}

/* ── Mobile improvements ──────────────────────────────────── */
@media (max-width: 768px) {
  /* Larger tap targets */
  .nav-item { padding: 0.85rem 1.25rem; font-size: 1rem; }
  .btn { padding: 0.65rem 1rem; font-size: 0.9rem; }
  .btn-sm { padding: 0.5rem 0.85rem; font-size: 0.85rem; }

  /* Full width buttons on mobile */
  .page-actions { flex-direction: column; }
  .page-actions .btn { width: 100%; justify-content: center; }

  /* Stat cards 2 columns on mobile */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 0.75rem; }

  /* Bigger stat values on mobile */
  .stat-value { font-size: 1.75rem; }

  /* Filter form stacks vertically */
  .filter-form { flex-direction: column; }
  .filter-form input,
  .filter-form select { width: 100%; }

  /* Topbar */
  .topbar { padding: 0 1rem; }
  .page-title { font-size: 0.95rem; }
  .topbar-right { display: none; }

  /* Content padding */
  .content { padding: 0.75rem; }

  /* Timeline dates smaller */
  .timeline-date { font-size: 0.7rem; }

  /* Period buttons wrap better */
  .period-btns { gap: 0.25rem; }
  .period-btn { padding: 0.25rem 0.5rem; font-size: 0.75rem; }

  /* Form card full width */
  .form-card { max-width: 100%; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .dashboard-panels { grid-template-columns: 1fr; }
}

/* ── Sidebar active indicator polish ──────────────────────── */
.nav-item {
  border-radius: 0 8px 8px 0;
  margin-right: 0.75rem;
  transition: all 0.15s;
}
.nav-item.active {
  font-weight: 600;
}

/* ── Card hover effect ────────────────────────────────────── */
.stat-card {
  transition: box-shadow 0.15s, transform 0.15s;
}
.stat-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

/* ── Table row hover stronger ─────────────────────────────── */
.table tbody tr:hover {
  background: var(--accent-light) !important;
}
