/* Brand variables (adjust freely) */
:root {
  --brand-start: #1856c9;
  --brand-mid: #0ea5e9;
  --brand-end: #1856c9;
  --text-on-hero: #ffffff;
}

/* Base typography */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
}

/* Optional utility when you want Libre Baskerville somewhere */
.libre-baskerville-regular {
  font-family: "Libre Baskerville", serif;
  font-weight: 400;
  font-style: normal;
}

/* Hero area */
.gradient-background {
  background: linear-gradient(
    300deg,
    var(--brand-start),
    var(--brand-mid),
    var(--brand-end)
  );
  background-size: 180% 180%;
  animation: gradient-animation 10s ease infinite;
  color: var(--text-on-hero);
  min-height: 220px; /* ensures some height on small screens */
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#main-title {
  /* clamp(min, preferred, max) scales smoothly across screens */
  font-size: clamp(2.25rem, 6vw, 6rem);
  color: var(--text-on-hero);
  margin: 0.5rem 0 0.75rem;
  line-height: 1.1;
  text-wrap: balance; /* nicer wrapping when it breaks */
}

/* Smaller variant for long test names on question routes */
#main-title.hero-title-compact {
  font-size: clamp(1.7rem, 4.4vw, 3.4rem);
  line-height: 1.2;
  max-width: 92vw;
  margin-left: auto;
  margin-right: auto;
}

/* Respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  .gradient-background {
    animation: none;
    background-size: cover;
  }
}

@keyframes gradient-animation {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* Horizontal category scroller in your header */
.nav-scroller {
  position: relative;
  z-index: 1;
  height: 2.75rem;
  overflow-y: hidden;
}

.nav-scroller .nav {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  gap: 0.5rem;
}

/* Optional: improve focus states a bit */
a:focus,
button:focus,
.form-control:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(24, 86, 201, 0.25);
}

/* Optional: make outline buttons a tad thicker on mobile taps */
.btn {
  touch-action: manipulation;
}

/* Media queries (keep only what you need) */

@media (max-width: 600px) {
  #main-title {
    font-size: 3rem;
  }
  #main-title.hero-title-compact {
    font-size: clamp(1.35rem, 6vw, 2rem);
  }
  .gradient-background {
    min-height: 96px;
  }
  .gradient-background.py-5 {
    padding-top: 1.5rem !important;
    padding-bottom: 1.5rem !important;
  }
}

@media (min-width: 601px) {
  #main-title {
    font-size: 5rem;
  }
}

.program-card-img {
  width: 100%;
  height: 200px; /* ose 180/200 sipas shijes */
  object-fit: cover; /* prerje e pastër pa deformim */
}

/* Underline the nav-underline links on hover/focus (same style as Bootstrap's active underline) */
.nav-scroller .nav-underline .nav-link {
  border-bottom: 0.125rem solid transparent; /* ensure base line exists */
  transition: border-color 0.15s ease, color 0.15s ease;
}

.nav-scroller .nav-underline .nav-link {
  text-decoration: none;
}
.nav-scroller .nav-underline .nav-link:hover,
.nav-scroller .nav-underline .nav-link:focus {
  text-decoration: underline;
  text-underline-offset: 0.5em; /* nicer gap from text */
  text-decoration-thickness: 0.12em;
}

/* Same visual width for result badges */
.badge-ans {
  display: inline-flex; /* centers text nicely */
  align-items: center;
  justify-content: center;
  min-width: 84px; /* tweak 72–96px to taste */
  text-align: center;
  white-space: nowrap; /* prevent line breaks */
  font-weight: 600;
}

/* Improve contrast on warning if you ever use it here */
.badge-ans.bg-warning {
  color: #212529;
}
@media (max-width: 576px) {
  .badge-ans {
    min-width: 72px;
  } /* a bit tighter on small screens */
}

/* ===== App Navbar ===== */
.app-navbar {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: saturate(140%) blur(10px);
}

.app-navbar-inner {
  margin: 0 auto;
  gap: 0.5rem;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px;
  color: #0f172a;
  font-weight: 800;
}

.app-brand img {
  flex: 0 0 auto;
}

.app-navbar-collapse {
  gap: 1rem;
}

.app-primary-nav,
.app-action-nav {
  align-items: center;
  gap: 0.25rem;
}

.app-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 40px;
  padding: 0.45rem 0.7rem !important;
  border-radius: 8px;
  color: #334155;
  font-weight: 700;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.app-nav-link i {
  color: #64748b;
  font-size: 1rem;
}

.app-nav-link:hover,
.app-nav-link:focus,
.app-nav-link.active {
  color: #0d6efd;
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px rgba(13, 110, 253, 0.14);
}

.app-nav-link:hover i,
.app-nav-link:focus i,
.app-nav-link.active i {
  color: #0d6efd;
}

.app-action-nav {
  gap: 0.5rem;
}

.app-wallet-chip,
.app-admin-chip,
.app-icon-btn,
.app-user-toggle {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 8px;
  background: #fff;
}

.app-wallet-chip,
.app-admin-chip,
.app-user-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #0f172a;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.app-wallet-chip {
  gap: 0.55rem;
  padding: 0.35rem 0.65rem;
}

.app-wallet-coin {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-variant-numeric: tabular-nums;
}

.app-admin-chip {
  gap: 0.4rem;
  padding: 0.45rem 0.7rem;
  color: #7f1d1d;
  background: #fff7ed;
  border-color: rgba(234, 88, 12, 0.22);
}

.app-wallet-chip:hover,
.app-wallet-chip:focus,
.app-wallet-chip.active,
.app-admin-chip:hover,
.app-admin-chip:focus,
.app-admin-chip.active,
.app-user-toggle:hover,
.app-user-toggle:focus,
.app-user-toggle.show {
  color: #0d6efd;
  border-color: rgba(13, 110, 253, 0.28);
  background: #eff6ff;
}

.app-icon-btn {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #334155;
}

.app-icon-btn:hover,
.app-icon-btn:focus,
.app-icon-btn.show {
  color: #0d6efd;
  border-color: rgba(13, 110, 253, 0.28);
  background: #eff6ff;
}

.app-user-toggle {
  gap: 0.45rem;
  padding: 0.3rem 0.65rem 0.3rem 0.35rem !important;
}

.app-user-avatar {
  width: 32px;
  height: 32px;
  font-size: 0.84rem;
}

.app-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  border-radius: 8px;
  font-weight: 800;
  white-space: nowrap;
}

.app-dropdown {
  min-width: 230px;
  padding: 0.45rem;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.12) !important;
}

.app-dropdown .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 38px;
  border-radius: 6px;
  color: #334155;
  font-weight: 700;
}

.app-dropdown .dropdown-item i {
  color: #64748b;
}

.app-dropdown .dropdown-item:hover,
.app-dropdown .dropdown-item:focus,
.app-dropdown .dropdown-item.active,
.app-dropdown .dropdown-item:active {
  color: #0d6efd;
  background: #eff6ff;
}

.app-dropdown .dropdown-item:hover i,
.app-dropdown .dropdown-item:focus i,
.app-dropdown .dropdown-item.active i,
.app-dropdown .dropdown-item:active i {
  color: #0d6efd;
}

.app-resource-menu {
  max-height: min(520px, 72vh);
  overflow-y: auto;
}

.app-admin-bell-menu {
  width: min(380px, calc(100vw - 2rem));
}

.app-logout-item {
  width: 100%;
  border: 0;
  background: transparent;
}

@media (max-width: 991.98px) {
  .app-navbar-collapse {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(15, 23, 42, 0.1);
  }

  .app-primary-nav,
  .app-action-nav {
    align-items: stretch;
  }

  .app-action-nav {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
  }

  .app-nav-link,
  .app-wallet-chip,
  .app-admin-chip,
  .app-user-toggle,
  .app-auth-btn {
    justify-content: flex-start;
    width: 100%;
  }

  .app-icon-btn {
    width: 44px;
    height: 44px;
  }
}

/* Allow long equations to scroll horizontally */
.mjx-container {
  overflow-x: auto;
  overflow-y: hidden;
}

/* Container-scoped so it won't affect other buttons */
#num-nav .num-btn {
  width: 2.6rem; /* fixed width → all equal; bump to 3rem if you may reach 100+ */
  display: inline-grid; /* easy centering */
  place-items: center; /* center the number perfectly */
  font-variant-numeric: tabular-nums; /* uniform digit widths */
  padding: 0.25rem 0; /* keep a tidy height for .btn-sm */
  /* Optional: make them perfect squares */
  /* aspect-ratio: 1; padding: 0; */
}

/* ===== LAYOUT & CENTERING ===== */
.slider-wrap {
  position: relative;
  --gap: 16px;
  /* CHANGED: ensure 1 card per view on small screens (no peeking) */
  --card-w: 100%;
  --side: calc(
    (100% - var(--card-w)) / 2
  ); /* virtual side padding so first card is fully visible */
}

/* horizontally scrollable row */
.slider-wrap .program-slider {
  display: flex;
  gap: var(--gap);
  overflow-x: auto;
  scroll-behavior: smooth;
  padding-bottom: 0;
  scrollbar-width: none; /* Firefox: hide scrollbar, keep scroll */
  -ms-overflow-style: none; /* IE/Edge legacy: hide scrollbar */
  /* Keep overflow anchored from the start so odd card counts don't clip the left edge. */
  justify-content: flex-start;
  scroll-padding-inline: var(--side);
  scroll-snap-type: x proximity;
}

/* invisible spacers before/after to center first/last card */
.slider-wrap .program-slider::before,
.slider-wrap .program-slider::after {
  content: "";
  flex: 0 0 var(--side);
}

.slider-wrap .program-slider::-webkit-scrollbar {
  display: none; /* WebKit: hide scrollbar, keep scroll */
}

.slider-wrap .program-card {
  flex: 0 0 var(--card-w);
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  scroll-snap-align: center;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.slider-wrap .program-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.1);
}

/* arrows */
.slider-wrap .slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 5;
  height: 40px;
  width: 40px;
  border-radius: 999px;
  background: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}
.slider-wrap .slider-arrow.left {
  left: 0;
}
.slider-wrap .slider-arrow.right {
  right: 0;
}

/* ===== SHARED THUMB LOOK ===== */
.thumb {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #f8fafc;
}
.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* chips */
.chip {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
  border: 1px solid transparent;
}
.chip-test {
  color: #0b5ed7;
  background: rgba(13, 110, 253, 0.12);
  border-color: rgba(13, 110, 253, 0.25);
}
.chip-bank {
  color: #198754;
  background: rgba(25, 135, 84, 0.12);
  border-color: rgba(25, 135, 84, 0.25);
}
.chip-flashcards {
  color: #7c3aed;
  background: rgba(124, 58, 237, 0.12);
  border-color: rgba(124, 58, 237, 0.24);
}

/* text */
.title {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.3;
}
.sub {
  color: #6c757d;
  font-size: 0.9rem;
  margin-top: 2px;
}

/* buttons */
.btn-test-primary {
  background: linear-gradient(135deg, #0d6efd, #198754);
  border: none;
  color: #fff;
}
.btn-test-primary:hover {
  filter: brightness(1.05);
}

.btn-bank-primary {
  background: linear-gradient(135deg, #0d6efd, #6f42c1);
  border: none;
  color: #fff;
}
.btn-bank-primary:hover {
  filter: brightness(1.05);
}

.btn-flashcards-primary {
  background: linear-gradient(135deg, #0ea5e9, #7c3aed);
  border: none;
  color: #fff;
}
.btn-flashcards-primary:hover {
  filter: brightness(1.05);
}

/* arrow styling per kind */
.slider-tests .slider-arrow {
  border: 1px solid rgba(13, 110, 253, 0.25);
  color: #0d6efd;
}
.slider-bank .slider-arrow {
  border: 1px solid rgba(0, 0, 0, 0.12);
  color: #212529;
}
.slider-flashcards .slider-arrow {
  border: 1px solid rgba(124, 58, 237, 0.22);
  color: #7c3aed;
}

/* ===== RESPONSIVE WIDTHS ===== */
/* UPDATED: from md and up → show exactly 2 cards per view */
@media (min-width: 768px) {
  .slider-wrap {
    --card-w: calc((100% - var(--gap)) / 2);
  }
}

/* Keep 2-up at lg+ as well (explicitly repeat for clarity; matches your original intent) */
@media (min-width: 992px) {
  .slider-wrap {
    --card-w: calc((100% - var(--gap)) / 2);
  }
}

/* if you ever want 3-up on very wide screens, uncomment:
@media (min-width: 1400px) {
  .slider-wrap { --card-w: calc((100% - 2 * var(--gap)) / 3); }
}
*/
/* --- MOBILE FIX: show exactly 1 full card, no half/peeking --- */
@media (max-width: 767.98px) {
  .slider-wrap {
    --card-w: 100%; /* 1 card per view */
    --side: 0; /* no spacer padding on the ends */
  }

  /* Start items at the left edge; no leading space */
  .slider-wrap .program-slider {
    justify-content: flex-start; /* was center */
    scroll-snap-type: x mandatory; /* clean snap on touch */
    padding-left: 0;
    padding-right: 0;
  }

  /* Remove the virtual spacers entirely on mobile */
  .slider-wrap .program-slider::before,
  .slider-wrap .program-slider::after {
    flex: 0 0 0 !important;
  }

  /* Snap from the left edge so the first card lands flush */
  .slider-wrap .program-card {
    scroll-snap-align: start; /* was center */
  }

  /* Optional: hide arrows on very small screens (uncomment if you like)
  .slider-wrap .slider-arrow { display: none; }
  */
}

/* ===== Result page (scoped) ===== */
.result-page .chart-wrap {
  height: 220px; /* comfortable on phones */
}
@media (min-width: 576px) {
  .result-page .chart-wrap {
    height: 260px;
  }
}
@media (min-width: 768px) {
  .result-page .chart-wrap {
    height: 300px;
  }
}

/* Tighter paddings in stat tiles on small screens */
@media (max-width: 575.98px) {
  .result-page .card .row.text-center.g-2 > [class^="col-"],
  .result-page .card .row.text-center.g-2 > [class*=" col-"] {
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
  }
}

/* Make list-group items breathe on mobile */
.result-page .list-group-item {
  /* keep Bootstrap defaults, just ensure wrap */
  word-break: break-word;
}

/* Siguro që badge + butonat të rrinë gjithmonë në të njëjtin rresht */
.subject-page .action-bar {
  white-space: nowrap; /* mos e thy rreshtin */
  overflow-x: auto; /* lejo rrëshqitje horizontale në telefona shumë të ngushtë */
}
.subject-page .action-bar .btn,
.subject-page .action-bar .badge {
  flex: 0 0 auto; /* mos u shtrij; ruaj gjerësinë natyrale */
}

/* Avatar Initials */
.avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--avatar-bg, var(--brand-mid));
  color: var(--avatar-fg, #fff);
  font-weight: 600;
  border-radius: 50%;
  user-select: none;
  text-transform: uppercase;
}

/* Avatar picker */
.avatar-swatch {
  width: 36px;
  height: 36px;
  font-size: 0.85rem;
}

/* ===== Settings ===== */
.settings-page {
  min-height: calc(100vh - 220px);
  background: #f8fafc;
  color: #0f172a;
}

.settings-titlebar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1080px;
  margin: 0 auto 1rem;
}

.settings-title {
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  font-weight: 800;
  line-height: 1.15;
}

.settings-eyebrow {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-alert,
.settings-status-grid,
.settings-stack {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

.settings-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.settings-status-grid > div {
  min-width: 0;
}

.settings-status-card,
.settings-panel {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.settings-status-card {
  height: 100%;
  min-height: 124px;
  padding: 1rem;
}

.settings-status-icon,
.settings-section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex: 0 0 auto;
}

.settings-status-icon {
  width: 36px;
  height: 36px;
  margin-bottom: 0.75rem;
  background: #e0f2fe;
  color: #0369a1;
}

.settings-status-icon.is-wallet {
  background: #dcfce7;
  color: #15803d;
}

.settings-status-icon.is-calendar {
  background: #fef3c7;
  color: #b45309;
}

.settings-status-icon.is-login {
  background: #ede9fe;
  color: #6d28d9;
}

.settings-stack {
  display: grid;
  gap: 1rem;
}

.settings-panel {
  margin: 0;
  padding: 1.25rem;
}

.settings-panel.row {
  margin-left: 0;
  margin-right: 0;
}

.settings-section-heading {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.35rem;
}

.settings-section-icon {
  width: 44px;
  height: 44px;
  background: #e0f2fe;
  color: #0369a1;
  font-size: 1.2rem;
}

.settings-section-icon.is-profile {
  background: #dcfce7;
  color: #15803d;
}

.settings-section-icon.is-security {
  background: #ede9fe;
  color: #6d28d9;
}

.settings-section-icon.is-danger {
  background: #fee2e2;
  color: #b91c1c;
}

.settings-section-title {
  font-size: 1.15rem;
  font-weight: 800;
}

.settings-subsection {
  margin-top: 0.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.settings-subsection-title {
  font-size: 1rem;
  font-weight: 800;
}

.settings-avatar-preview-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 210px;
  padding: 1rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #f8fafc;
}

.settings-avatar-preview {
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.18) !important;
}

.settings-avatar-option {
  min-height: 52px;
  justify-content: flex-start;
  border-color: rgba(15, 23, 42, 0.14);
  background: #fff;
}

.btn-check:checked + .settings-avatar-option {
  border-color: #1856c9;
  background: #eff6ff;
  color: #0f172a;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 0.25rem;
}

.settings-danger-panel {
  border-color: rgba(220, 38, 38, 0.24);
}

.settings-page .form-control,
.settings-page .form-select {
  border-color: rgba(15, 23, 42, 0.16);
}

.settings-page .form-control:disabled {
  background: #f8fafc;
  color: #64748b;
}

@media (max-width: 991.98px) {
  .settings-status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 575.98px) {
  .settings-titlebar,
  .settings-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-status-grid {
    grid-template-columns: 1fr;
  }

  .settings-panel {
    padding: 1rem;
  }

  .settings-section-heading {
    align-items: flex-start;
  }
}

/* ===== User Dashboard ===== */
.dashboard-page {
  background: #f8fafc;
  color: #0f172a;
}

.dashboard-header,
.dashboard-panel,
.dashboard-kpi,
.dashboard-empty {
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
}

.dashboard-header-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.dashboard-eyebrow {
  color: #2563eb;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dashboard-empty {
  max-width: 720px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4rem);
  text-align: center;
}

.dashboard-empty-icon {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 1rem;
  border-radius: 50%;
  color: #2563eb;
  background: rgba(37, 99, 235, 0.12);
  font-size: 1.75rem;
}

.dashboard-empty p {
  max-width: 560px;
  margin: 0 auto 1.5rem;
  color: #64748b;
}

.dashboard-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.dashboard-kpi {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  min-width: 0;
  padding: 1rem;
}

.dashboard-kpi-icon {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  font-size: 1.2rem;
}

.dashboard-kpi-icon.is-blue {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.12);
}

.dashboard-kpi-icon.is-green {
  color: #15803d;
  background: rgba(22, 163, 74, 0.12);
}

.dashboard-kpi-icon.is-amber {
  color: #b45309;
  background: rgba(245, 158, 11, 0.16);
}

.dashboard-kpi-icon.is-red {
  color: #b91c1c;
  background: rgba(220, 38, 38, 0.11);
}

.dashboard-kpi-label,
.dashboard-kpi-note {
  color: #64748b;
  font-size: 0.85rem;
}

.dashboard-kpi-value {
  color: #0f172a;
  font-size: clamp(1.45rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.1;
}

.dashboard-insight-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 1rem;
}

.dashboard-panel {
  padding: 1rem;
}

.dashboard-panel-primary {
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #0f766e);
  border-color: transparent;
}

.dashboard-panel-primary .dashboard-eyebrow,
.dashboard-panel-primary .text-secondary {
  color: rgba(255, 255, 255, 0.78) !important;
}

.dashboard-panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.dashboard-result-pill,
.dashboard-trend-pill,
.dashboard-subtle-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.dashboard-result-pill.is-strong {
  color: #166534;
  background: #dcfce7;
}

.dashboard-result-pill.is-steady {
  color: #1d4ed8;
  background: #dbeafe;
}

.dashboard-result-pill.is-risk {
  color: #991b1b;
  background: #fee2e2;
}

.dashboard-panel-primary .dashboard-result-pill {
  color: #0f172a;
  background: #fff;
}

.dashboard-trend-pill.is-up {
  color: #166534;
  background: #dcfce7;
}

.dashboard-trend-pill.is-down {
  color: #991b1b;
  background: #fee2e2;
}

.dashboard-trend-pill.is-neutral,
.dashboard-subtle-pill {
  color: #475569;
  background: #f1f5f9;
}

.dashboard-focus-list {
  display: grid;
  gap: 0.8rem;
}

.dashboard-focus-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(90px, 34%);
  align-items: center;
  gap: 0.75rem;
}

.dashboard-focus-meter,
.dashboard-table-progress {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
}

.dashboard-focus-meter span,
.dashboard-table-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb, #16a34a);
}

.dashboard-mini-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.dashboard-mini-stats > div {
  min-width: 0;
  padding: 0.75rem;
  border-radius: 8px;
  background: #f8fafc;
}

.dashboard-mini-stats span {
  display: block;
  color: #64748b;
  font-size: 0.78rem;
}

.dashboard-mini-stats strong {
  display: block;
  color: #0f172a;
  font-size: 1.05rem;
}

.dashboard-chart-wrap {
  position: relative;
  width: 100%;
  height: 300px;
}

.dashboard-chart-wrap.is-compact {
  height: 260px;
}

.dashboard-chart-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 1rem;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #64748b;
  text-align: center;
  background: #f8fafc;
}

.dashboard-table {
  --bs-table-bg: transparent;
}

.dashboard-table thead th {
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom-color: #e2e8f0;
}

.dashboard-table td,
.dashboard-table th {
  white-space: nowrap;
}

.dashboard-table-progress {
  width: min(150px, 22vw);
  margin-bottom: 0.25rem;
}

@media (max-width: 991.98px) {
  .dashboard-kpi-grid,
  .dashboard-insight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-insight-grid .dashboard-panel-primary {
    grid-column: 1 / -1;
  }
}

@media (max-width: 767.98px) {
  .dashboard-header {
    align-items: stretch;
    flex-direction: column;
  }

  .dashboard-header-actions {
    justify-content: flex-start;
  }

  .dashboard-kpi-grid,
  .dashboard-insight-grid,
  .dashboard-mini-stats {
    grid-template-columns: 1fr;
  }

  .dashboard-focus-item {
    grid-template-columns: 1fr;
  }

  .dashboard-chart-wrap,
  .dashboard-chart-wrap.is-compact {
    height: 280px;
  }
}

@media (max-width: 575.98px) {
  .dashboard-kpi {
    padding: 0.9rem;
  }

  .dashboard-panel-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.5rem;
  }
}
