.sidebar-shell {
  flex: 1 1 0;
  min-height: 0;
  height: 100%;
  background: var(--sidebar-bg, var(--bg-dark));
  border-radius: var(--radius-lg);
  padding: var(--space-2) var(--space-1);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  justify-items: stretch;
  align-content: start;
}

.sidebar-brand,
.sidebar-exit,
.sidebar-expand {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
  color: var(--white);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  margin: 0 auto;
}

.sidebar-expand {
  margin-top: var(--space-1);
}

.sidebar-exit {
  margin-top: var(--space-4);
}

.sidebar-brand-text {
  display: none;
}

.sidebar-brand-label,
.sidebar-toggle-label,
.nav-label {
  display: none;
}

.sidebar-brand-tagline {
  display: none;
}

.sidebar-nav {
  margin-top: var(--space-2);
  display: grid;
  align-content: start;
  gap: var(--space-1);
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: var(--space-4);
}

.nav-group {
  display: grid;
  gap: var(--space-1);
}

.nav-group:last-of-type {
  margin-bottom: var(--space-2);
}

.nav-group-label {
  display: none;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.45);
  padding: 0 12px 2px;
}

.nav-group-items {
  display: grid;
  gap: var(--space-1);
}

.sidebar-shell.is-expanded .nav-group-label {
  display: block;
}

.nav-group.has-active .nav-group-label {
  color: rgba(255, 255, 255, 0.7);
}

.nav-btn {
  width: 52px;
  height: 52px;
  border-radius: var(--radius);
  color: var(--nav-icon);
  background: transparent;
  border: 1px solid transparent;
  display: grid;
  place-items: center;
  text-decoration: none;
  margin: 0 auto;
}

.nav-btn.is-active {
  background: var(--primary);
  color: var(--white);
  border-color: var(--primary);
}

.nav-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
}

.nav-btn.is-active:hover {
  background: var(--primary);
  color: var(--white);
}

.nav-subtree {
  display: grid;
  gap: 4px;
  position: relative;
}

.nav-sub-toggle {
  justify-content: space-between;
  position: relative;
  z-index: 0;
}

.nav-sub-main {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.nav-sub-chevron {
  display: none;
  width: 14px;
  height: 14px;
  opacity: 0.75;
  transition: transform 180ms ease;
}

.nav-sub-items {
  display: grid;
  gap: 4px;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transform: translateY(-4px);
  transition: max-height 240ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease, transform 180ms ease;
  position: relative;
  z-index: 1;
}

.nav-subtree.is-open .nav-sub-items {
  max-height: 400px;
  opacity: 1;
  transform: translateY(0);
}

.nav-subtree.is-open .nav-sub-chevron {
  transform: rotate(180deg);
}

.nav-subtree.is-open > .nav-sub-toggle {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.2);
}

.nav-subtree.has-active-child > .nav-sub-toggle {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-shell.is-expanded .nav-subtree.is-open > .nav-sub-toggle {
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.2);
}

.sidebar-shell.is-expanded .nav-subtree.has-active-child > .nav-sub-toggle {
  background: var(--primary);
  color: var(--white);
  border-color: transparent;
}

.nav-sub-item {
  opacity: 0.92;
  position: relative;
  z-index: 2;
}

.sidebar-shell.is-expanded .nav-sub-item {
  height: 38px;
  padding-left: 54px;
}

.sidebar-shell.is-expanded .nav-sub-item.is-active {
  background: var(--accent-cyan-soft);
  color: var(--white);
  border-color: rgba(138, 243, 255, 0.35);
  font-weight: 700;
  position: relative;
}

.sidebar-shell.is-expanded .nav-sub-item.is-active::before {
  content: "";
  position: absolute;
  left: 12px;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 999px;
  background: var(--accent-cyan);
}

.sidebar-shell.is-expanded .nav-sub-chevron {
  display: inline-block;
}

.sidebar-shell.is-expanded .nav-sub-items {
  margin-left: 14px;
  padding-left: 10px;
}

.sidebar-shell:not(.is-expanded) .nav-sub-items {
  display: none !important;
}

/* Flyout when collapsed: show submenu to the right on toggle */
.sidebar-shell:not(.is-expanded) .nav-subtree.is-open .nav-sub-items {
  display: grid !important;
  position: absolute;
  left: 100%;
  top: 0;
  margin-left: 8px;
  min-width: 200px;
  padding: 8px;
  background: var(--bg-dark, #1a1c22);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
  max-height: 320px;
  opacity: 1;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-shell:not(.is-expanded) .nav-subtree.is-open .nav-sub-item {
  height: 38px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.sidebar-shell:not(.is-expanded) .nav-subtree.is-open .nav-sub-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sidebar-shell.is-expanded {
  padding: var(--space-2) 10px;
}

.sidebar-shell.is-expanded .sidebar-brand {
  width: 100%;
  height: auto;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 8px 12px;
  gap: 10px;
}

.sidebar-shell.is-expanded .sidebar-brand-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-shell.is-expanded .sidebar-brand-tagline {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.2;
}

.sidebar-shell.is-expanded .sidebar-expand,
.sidebar-shell.is-expanded .sidebar-exit,
.sidebar-shell.is-expanded .nav-btn {
  width: 100%;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 0 12px;
  gap: 10px;
}

/* Circular unread badge on Email nav (overrides global .badge pill padding) */
.sidebar-shell .nav-btn .sidebar-email-badge {
  flex-shrink: 0;
  margin-left: auto;
  box-sizing: border-box;
  min-width: 1.25rem;
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border-radius: 50%;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  text-transform: none;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--white, #fff);
  color: var(--primary, #3b82f6);
}

.sidebar-shell .nav-btn .sidebar-email-badge[data-digits="2"] {
  width: 1.375rem;
  min-width: 1.375rem;
  height: 1.375rem;
  font-size: 0.6rem;
}

.sidebar-shell .nav-btn .sidebar-email-badge[data-digits="3"] {
  width: auto;
  min-width: 1.5rem;
  height: 1.25rem;
  padding: 0 4px;
  border-radius: 999px;
  font-size: 0.55rem;
}

.sidebar-shell.is-expanded .sidebar-brand i,
.sidebar-shell.is-expanded .sidebar-expand i,
.sidebar-shell.is-expanded .sidebar-exit i,
.sidebar-shell.is-expanded .nav-btn i {
  flex-shrink: 0;
}

.sidebar-shell.is-expanded .sidebar-brand-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
}

.sidebar-shell.is-expanded .sidebar-toggle-label,
.sidebar-shell.is-expanded .nav-label {
  display: inline;
  font-size: 12px;
  font-weight: 600;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px 14px 2px;
  min-height: 24px;
  font-size: 12px;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
}

.breadcrumbs a:hover {
  color: var(--primary);
}

.breadcrumbs .breadcrumb-current {
  color: var(--text-strong);
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
}

.breadcrumbs .breadcrumb-sep {
  color: var(--line);
  user-select: none;
  display: inline-flex;
  align-items: center;
}

.breadcrumbs .breadcrumb-sep svg,
.breadcrumbs .breadcrumb-icon svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.breadcrumbs .breadcrumb-sep svg {
  opacity: 0.6;
}

.breadcrumbs .breadcrumb-icon {
  display: inline-flex;
  align-items: center;
}

.header-main {
  margin: 4px 10px 0;
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 1px 6px rgba(20, 24, 34, 0.05);
  min-width: 0;
  max-width: 100%;
}

.header-main > .mobile-sidebar-toggle {
  flex: 0 0 auto;
}

.app-shell.is-layout-classic .header-main {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 8px 12px 6px;
  background: transparent;
}

.app-shell.is-layout-classic .breadcrumbs {
  padding: 0 12px 4px;
  min-height: 20px;
}

.breadcrumbs-classic-wrap {
  padding: var(--space-2) var(--app-padding) 0;
}

.breadcrumbs-classic-wrap .breadcrumbs {
  padding: 0 0 8px;
  min-height: 24px;
}

.header-title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-strong);
  flex: 1 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  min-width: 0;
}

.search-box {
  width: 260px;
  height: var(--control-height);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
}

.period-toggle {
  background: var(--toggle-track);
  border-radius: 12px;
  padding: 4px;
  display: inline-flex;
  gap: 4px;
}

.period-toggle button {
  border: 0;
  background: transparent;
  height: 28px;
  min-width: 88px;
  padding: 0 14px;
  border-radius: 10px;
  color: var(--toggle-text);
  cursor: pointer;
}

.period-toggle .is-active {
  background: var(--secondary);
  color: var(--white);
}

.mobile-sidebar-toggle {
  display: none;
  width: var(--control-height);
  height: var(--control-height);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  align-items: center;
  justify-content: center;
}

.topbar-toolgroup,
.topbar-usergroup {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex-shrink: 0;
}

.topbar-usergroup {
  gap: 8px;
  margin-left: 4px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}

.topbar-adminnav {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin-left: 2px;
  padding-left: 8px;
  border-left: 1px solid var(--line);
  flex-shrink: 0;
}

.topbar-admin-menu {
  position: relative;
}

.topbar-admin-link {
  list-style: none;
  height: 36px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

.topbar-admin-link::-webkit-details-marker {
  display: none;
}

.topbar-admin-link svg {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.topbar-admin-link svg.topbar-admin-caret {
  width: 12px;
  height: 12px;
  opacity: 0.55;
}

.topbar-admin-link:hover,
.topbar-admin-menu[open] > .topbar-admin-link {
  background: var(--surface-muted);
  color: var(--text-strong);
}

.topbar-admin-link.is-active,
.topbar-admin-menu.is-active > .topbar-admin-link {
  color: var(--primary);
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
}

.topbar-profile-dropdown.topbar-admin-dropdown {
  width: 292px;
  max-height: min(70vh, 480px);
  overflow-y: auto;
}

.topbar-profile-dropdown.topbar-admin-dropdown a.has-note {
  align-items: flex-start;
  padding-top: 10px;
  padding-bottom: 10px;
}

.topbar-profile-dropdown.topbar-admin-dropdown a.has-note svg {
  margin-top: 2px;
}

.topbar-admin-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  min-width: 0;
}

.topbar-admin-copy strong {
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
}

.topbar-admin-copy small {
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--text-muted);
  white-space: normal;
}

.topbar-profile-dropdown.topbar-admin-dropdown a.is-active .topbar-admin-copy small {
  color: color-mix(in srgb, var(--primary) 70%, var(--text-muted));
}

.topbar-profile-dropdown.topbar-admin-dropdown a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-profile-dropdown.topbar-admin-dropdown a svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.topbar-profile-dropdown.topbar-admin-dropdown a.is-active {
  background: color-mix(in srgb, var(--primary) 8%, var(--surface));
  color: var(--primary);
}

.topbar-profile-dropdown.topbar-admin-dropdown a.is-active svg {
  color: var(--primary);
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  flex-shrink: 0;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}

.topbar-icon-btn svg {
  width: 16px;
  height: 16px;
  display: block;
}

.topbar-icon-btn:hover {
  background: var(--surface-muted);
  color: var(--text-strong);
}

.topbar-icon-btn[aria-pressed="true"] {
  background: var(--secondary);
  border-color: var(--secondary);
  color: var(--white);
}

.topbar-chip-btn {
  position: relative;
  height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-chip-btn svg {
  width: 15px;
  height: 15px;
  display: block;
  flex-shrink: 0;
}

.topbar-chip-btn:hover {
  background: var(--surface-muted);
  color: var(--text-strong);
}

.topbar-chip-btn.is-active,
.topbar-chip-btn[aria-current="page"] {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 22%, var(--line));
  background: color-mix(in srgb, var(--primary) 5%, var(--surface));
}

.topbar-chip-btn.has-unread-changelog {
  color: var(--primary);
  border-color: color-mix(in srgb, var(--primary) 34%, var(--line));
  background: color-mix(in srgb, var(--primary) 7%, var(--surface));
}

.topbar-chip-btn--analytics {
  border-color: color-mix(in srgb, #3e6cff 30%, var(--line));
  background: linear-gradient(
    135deg,
    color-mix(in srgb, #3e6cff 9%, var(--surface)) 0%,
    color-mix(in srgb, #6f8dff 7%, var(--surface)) 100%
  );
  color: #3e6cff;
}

.topbar-chip-btn--analytics:hover {
  border-color: color-mix(in srgb, #3e6cff 42%, var(--line));
  background: linear-gradient(
    135deg,
    color-mix(in srgb, #3e6cff 15%, var(--surface)) 0%,
    color-mix(in srgb, #6f8dff 12%, var(--surface)) 100%
  );
  color: #2d5ae0;
}

.topbar-chip-btn--analytics.is-active,
.topbar-chip-btn--analytics[aria-current="page"] {
  color: #fff;
  border-color: #3e6cff;
  background: linear-gradient(135deg, #3e6cff 0%, #6f8dff 100%);
  box-shadow: 0 2px 8px color-mix(in srgb, #3e6cff 28%, transparent);
}

.topbar-chip-btn .topbar-changelog-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 17px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e8622c;
  color: #fff;
  box-shadow: 0 0 0 2px var(--surface);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  pointer-events: none;
}

.topbar-changelog-badge[hidden] {
  display: none !important;
}

.topbar-changelog-badge--menu {
  position: static;
  margin-left: auto;
  min-width: 30px;
  height: 17px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e8622c;
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  pointer-events: none;
}

.topbar-profile-menu {
  position: relative;
}

.topbar-profile-trigger {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 4px 10px 4px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  user-select: none;
}

.topbar-profile-trigger::-webkit-details-marker {
  display: none;
}

.topbar-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #3e6cff 0%, #6f8dff 100%);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
}

.topbar-profile-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.topbar-profile-text strong {
  font-size: 12px;
  color: var(--text-strong);
}

.topbar-profile-text small {
  font-size: 10px;
  color: var(--text-muted);
}

@media (max-width: 1100px) {
  .topbar-profile-text small {
    display: none;
  }
}

@media (max-width: 900px) {
  .topbar-admin-link span,
  .topbar-admin-caret {
    display: none;
  }

  .topbar-admin-link {
    width: 36px;
    padding: 0;
    justify-content: center;
  }

  .topbar-chip-btn .topbar-chip-btn-label {
    display: none;
  }

  .topbar-chip-btn {
    width: 36px;
    padding: 0;
  }

  .topbar-chip-btn .topbar-changelog-badge {
    top: -4px;
    right: -4px;
    min-width: 10px;
    width: 10px;
    height: 10px;
    padding: 0;
    font-size: 0;
    border-radius: 50%;
  }
}

@media (max-width: 1024px) {
  .header-main {
    flex-wrap: nowrap;
    gap: 8px;
    padding-right: 8px;
  }

  .header-controls {
    flex: 1 1 auto;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 6px;
    min-width: 0;
  }

  .topbar-toolgroup,
  .topbar-usergroup {
    flex-wrap: wrap;
  }

  .topbar-icon-btn--desktop,
  #layoutModeToggle {
    display: none !important;
  }

  .topbar-profile-text,
  .topbar-profile-trigger > [data-lucide="chevron-down"],
  .topbar-profile-trigger > svg.lucide-chevron-down {
    display: none;
  }

  .topbar-usergroup {
    margin-left: 0;
    padding-left: 0;
    border-left: 0;
  }

  .topbar-chip-btn--analytics {
    display: none !important;
  }
}

@media (max-width: 480px) {
  #themeSwitcherBtn {
    display: none !important;
  }
}

.topbar-profile-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 180px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(20, 24, 34, 0.12);
  padding: 6px;
  z-index: 45;
}

.topbar-profile-dropdown a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-strong);
}

.topbar-profile-dropdown a:hover {
  background: var(--surface-muted);
  color: var(--text-strong);
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--space-2);
  overflow-x: auto;
  overflow-y: visible;
  min-width: 0;
  max-width: 100%;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-1);
}

.card-head h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
}

.chart-card .card-head h2 {
  font-size: 20px;
}

.legend-inline {
  display: inline-flex;
  gap: 14px;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--legend-text);
  font-size: 12px;
  font-weight: 600;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.dot-success {
  background: var(--success);
}

.dot-danger {
  background: var(--danger);
}

.chart-card {
  min-width: 0;
  overflow: hidden;
  display: grid;
  align-content: start;
  gap: var(--space-1);
}

.chart-container {
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.chart-lg {
  height: clamp(220px, 24vh, 300px);
}

.chart-md {
  height: clamp(160px, 14vh, 240px);
}

#categoryChart.chart-container {
  height: 280px;
}

#serviceStatusSunburst.chart-container {
  height: 332px;
  padding-bottom: 10px;
  box-sizing: border-box;
}

.recovery-card {
  align-self: stretch;
  display: grid;
  align-content: start;
  gap: var(--space-1);
}

.recovery-card #savingsChart.chart-container {
  height: 180px;
}

.recovery-breakdown {
  display: grid;
  gap: 8px;
}

.recovery-row .budget-labels {
  margin-bottom: 6px;
  font-size: 12px;
}

.chart-insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-1);
}

.chart-insight-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: var(--surface-muted);
}

.chart-insight-item strong {
  display: block;
  margin: 2px 0 8px;
  font-size: 16px;
}

@media (max-width: 768px) {
  .chart-insights {
    grid-template-columns: 1fr;
  }
}

.stat-widget {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--space-2);
  min-height: 0;
}

.widget-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: var(--bg-dark);
  color: var(--white);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.widget-icon svg {
  width: 20px;
  height: 20px;
}

.widget-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.widget-body h3 {
  margin: 4px 0;
  font-size: 28px;
  line-height: 1.1;
}

.widget-note {
  margin: 0;
  color: var(--note-text-success);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--control-height-sm);
  min-width: 62px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  padding: 0 12px;
  line-height: 1;
}

.badge-success {
  color: var(--badge-success-text);
  background: var(--badge-success-bg);
}

.badge-danger {
  color: var(--badge-danger-text);
  background: var(--badge-danger-bg);
}

.badge-warning {
  color: var(--badge-warning-text);
  background: var(--badge-warning-bg);
}

.budget-status {
  display: grid;
  gap: var(--space-2);
}

.budget-labels {
  margin-bottom: var(--space-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1);
}

.progress {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: var(--progress-track);
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: var(--value, 0%);
  border-radius: inherit;
  background: var(--bg-dark);
}

.muted {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.savings-meta {
  margin-bottom: var(--space-1);
  display: flex;
  justify-content: space-between;
  gap: var(--space-2);
}

.savings-meta h3 {
  margin: 4px 0 0;
  font-size: 28px;
  line-height: 1.1;
}

.head-actions {
  display: flex;
  gap: var(--space-1);
}

.icon-btn {
  width: var(--control-height);
  height: var(--control-height);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  display: grid;
  place-items: center;
}

.cover-art {
  margin-top: var(--space-1);
  height: 94px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  background:
    linear-gradient(135deg, #27355f 0%, #3d57a8 46%, #89a8ff 100%),
    radial-gradient(circle at 85% 20%, rgba(255, 255, 255, 0.35) 0%, rgba(255, 255, 255, 0.02) 48%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.avatar-wrap {
  display: grid;
  place-items: center;
  margin-top: -22px;
}

.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--avatar-bg);
  border: 3px solid var(--white);
  color: var(--avatar-text);
  font-weight: 700;
  display: grid;
  place-items: center;
}

.profile-name {
  margin: var(--space-1) 0 2px;
  text-align: center;
  font-size: 18px;
}

.profile-balance {
  margin: 0;
  text-align: center;
  font-size: 36px;
  font-weight: 800;
}

.monthly-progress {
  margin-top: var(--space-2);
}

.monthly-progress .labels {
  margin-bottom: var(--space-1);
  display: flex;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 12px;
}

.subheading {
  margin: var(--space-2) 0 var(--space-1);
  font-size: 16px;
  font-weight: 700;
}

.category-list {
  display: grid;
  gap: var(--space-1);
}

.category-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
}

.category-item span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--category-text);
}

.activity-card {
  background: var(--bg-dark);
  color: var(--white);
}

.activity-card .card-head h2 {
  font-size: 18px;
  color: var(--white);
}

.fuel-cost-card {
  display: grid;
  gap: var(--space-2);
  padding-bottom: calc(var(--space-2) + 8px);
}

.fuel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.fuel-card-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.fuel-card-title h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
}

.fuel-card-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-muted);
  color: var(--text-muted);
}

.fuel-period-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.fuel-cost-value {
  margin: 0;
  font-size: 44px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.fuel-cost-delta {
  margin: -2px 0 0;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 20px;
}

.fuel-delta-chip {
  background: #dff5ef;
  color: #1e9c80;
  border-radius: 8px;
  padding: 2px 10px;
  font-size: 18px;
  font-weight: 700;
}

.fuel-mini-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  padding-top: 2px;
  padding-bottom: 10px;
}

.fuel-bar-wrap {
  display: grid;
  justify-items: center;
  gap: 8px;
}

.fuel-bar {
  width: 100%;
  max-width: 36px;
  border-radius: 10px;
  background: #dce1e9;
  height: var(--bar-height, 44px);
  transform: scaleY(0.15);
  transform-origin: bottom;
  transition: transform 680ms cubic-bezier(0.22, 1, 0.36, 1), background-color 180ms ease;
}

.fuel-bar-wrap.is-active .fuel-bar {
  background: linear-gradient(180deg, #5e57c8 0%, #7266e7 100%);
}

.fuel-bar-wrap small {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.fuel-bar-wrap.is-active small {
  color: var(--text-strong);
}

.fuel-sparkline #fuelSparklineChart {
  cursor: crosshair;
}

.fuel-cost-card.is-live .fuel-bar {
  transform: scaleY(1);
}

.fuel-sparkline {
  height: 58px;
  margin-top: -4px;
}

.fuel-sparkline #fuelSparklineChart {
  width: 100%;
  height: 100%;
}

.activity-table {
  width: 100%;
  border-collapse: collapse;
}

.activity-table th,
.activity-table td {
  padding: 12px 10px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 13px;
  overflow-wrap: break-word;
  word-break: break-word;
}

.activity-table th {
  color: rgba(255, 255, 255, 0.7);
}

.footer-main {
  padding: var(--space-1) var(--space-2) var(--space-2);
  color: var(--footer-text);
}

/* ── Stat-widget cards (sw- prefix) ─────────────────────── */

.sw-row {
  display: flex;
  gap: 20px;
  margin-bottom: var(--space-3, 24px);
  flex-wrap: wrap;
}

.sw-card {
  background: var(--surface, #fff);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
  flex: 1 1 0;
  min-width: min(220px, 100%);
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
  box-sizing: border-box;
}

.sw-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.sw-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}

.sw-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.sw-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-strong, #111827);
  line-height: 1.2;
}

.sw-subtitle {
  font-size: 12px;
  color: var(--text-muted, #9ca3af);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sw-body {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.sw-metric {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sw-metric-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sw-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-strong, #111827);
  letter-spacing: -0.5px;
  line-height: 1;
}

.sw-trend {
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sw-trend--up { color: #22c55e; }
.sw-trend--down { color: #ef4444; }
.sw-trend--flat { color: var(--text-muted, #9ca3af); }

.sw-label {
  font-size: 13px;
  color: var(--text-muted, #9ca3af);
  font-weight: 500;
}

.sw-engagement {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.sw-ring-badge {
  background: var(--surface-muted, #f9fafb);
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sw-ring {
  position: relative;
  width: 18px;
  height: 18px;
}

.sw-ring svg {
  width: 18px;
  height: 18px;
  transform: rotate(-90deg);
}

.sw-ring circle {
  fill: none;
  stroke-width: 2.5;
  cx: 9;
  cy: 9;
  r: 7;
}

.sw-ring-bg { stroke: var(--line, #e5e7eb); }
.sw-ring-val {
  stroke-linecap: round;
}

.sw-ring-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-strong, #4b5563);
}

@media (max-width: 1100px) {
  .sw-row { gap: 16px; }
  .sw-card { min-width: 200px; }
}

@media (max-width: 768px) {
  .sw-row {
    gap: 12px;
    max-width: 100%;
  }
  .sw-card {
    min-width: 100%;
    flex: 1 1 100%;
    padding: 18px;
    gap: 20px;
  }
  .sw-value { font-size: 22px; }
  .sw-body {
    flex-wrap: wrap;
    gap: 12px;
  }
}

@media (max-width: 480px) {
  .sw-card {
    min-width: 100%;
    flex: 1 1 100%;
    padding: 16px;
  }
}
