/*
 * Gragg Advanced Analytics — Component Styles
 * Design: V2 Executive Report
 */

/* ── Typography ───────────────────────────────────────── */
.font-heading { font-family: "Figtree", sans-serif; }
.font-body { font-family: "Bricolage Grotesque", serif; }
.font-mono { font-family: "IBM Plex Mono", monospace; }
.font-mono-tabular { font-family: "IBM Plex Mono", monospace; font-variant-numeric: tabular-nums; }

/* ── Surface utilities ────────────────────────────────── */
.glass-surface { background: #f4f5f8; }
.glass-surface-subtle { background: #f9fafb; }
.border-glass { border: 1px solid #e2e4ea; }
.border-glass-subtle { border-bottom: 1px solid #edf0f4; }
.border-glass-strong { border: 1px solid #c1c8d4; }

/* ── Accent bar ───────────────────────────────────────── */
.accent-bar { margin-left: -1.5rem; margin-right: -1.5rem; margin-top: -1.5rem; }

/* ── Filter toolbar ───────────────────────────────────── */
.filter-toolbar {
  background: #ffffff;
  border: 1px solid #e2e4ea;
  border-radius: 10px;
  padding: 0.75rem 1rem;
}

/* ── Section divider ──────────────────────────────────── */
.section-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.section-divider::before,
.section-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #edf0f4;
}
.section-divider-label {
  font-family: 'Figtree', sans-serif;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #94a3b8;
}

/* ── Sidebar logo (legacy) ───────────────────────────── */
.logo-glow {
  box-shadow: 0 2px 8px rgba(220, 34, 39, 0.2);
}

/* ── Gragg red button ─────────────────────────────────── */
.btn-gragg {
  background: #DC2227;
  font-family: "Figtree", sans-serif;
  box-shadow: 0 2px 8px rgba(220, 34, 39, 0.2);
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.btn-gragg:hover {
  box-shadow: 0 4px 14px rgba(220, 34, 39, 0.3);
  transform: translateY(-1px);
}

/* ── Mobile-specific fixes ────────────────────────────── */
@media (max-width: 767px) {
  .brand-header {
    padding: 0 12px;
    height: 40px;
  }
  .brand-header-tagline,
  .brand-header-sep,
  .brand-header-user,
  .brand-header-signout {
    display: none;
  }
  .sidebar {
    height: 100vh !important;
    top: 0 !important;
  }

  /* Filter toolbar: scroll horizontally on mobile */
  .filter-toolbar .flex-wrap {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .filter-toolbar .flex-wrap::-webkit-scrollbar {
    display: none;
  }

  .filter-toolbar .flex.items-center.gap-2 {
    flex-shrink: 0;
  }

  /* KPI cards: ensure readable sizing */
  .glass-card p[class*="text-3xl"],
  .card p[class*="text-3xl"] {
    font-size: 1.5rem;
  }

  /* Tables: force minimum readable width */
  .overflow-x-auto {
    -webkit-overflow-scrolling: touch;
  }

  main {
    max-width: 100vw;
    overflow-x: hidden;
  }
}

/* ── Staggered card entrance ──────────────────────────── */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

[data-dashboard-content] .glass-card,
[data-dashboard-content] .card {
  animation: cardIn 0.4s ease-out both;
}
[data-dashboard-content] > .grid > :nth-child(1) { animation-delay: 0s; }
[data-dashboard-content] > .grid > :nth-child(2) { animation-delay: 0.05s; }
[data-dashboard-content] > .grid > :nth-child(3) { animation-delay: 0.1s; }
[data-dashboard-content] > .grid > :nth-child(4) { animation-delay: 0.15s; }
[data-dashboard-content] > .grid > :nth-child(5) { animation-delay: 0.2s; }

/* Visible scrollbars for data tables */
.overflow-x-auto::-webkit-scrollbar,
.overflow-y-auto::-webkit-scrollbar {
  height: 8px;
  width: 8px;
}
.overflow-x-auto::-webkit-scrollbar-track,
.overflow-y-auto::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 4px;
}
.overflow-x-auto::-webkit-scrollbar-thumb,
.overflow-y-auto::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}
.overflow-x-auto::-webkit-scrollbar-thumb:hover,
.overflow-y-auto::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}
/* Firefox */
.overflow-x-auto,
.overflow-y-auto {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.12) rgba(0, 0, 0, 0.02);
}

/* Visible scrollbar on main page body */
body::-webkit-scrollbar {
  width: 10px;
}
body::-webkit-scrollbar-track {
  background: #f4f5f8;
}
body::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 5px;
}
body::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}
body {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.12) #f4f5f8;
}

/* Briefly highlight a card after scroll-to-jump (see scroll_to_target_controller) */
.flash-ring {
  box-shadow: 0 0 0 2px rgba(220, 34, 39, 0.55), 0 0 0 6px rgba(220, 34, 39, 0.15);
  transition: box-shadow 0.4s ease-out;
}
