/**
 * App-wide light theme: page background + shared dashboard header.
 * Add class "app-theme" to <body> and include partials/_dashboard_header.html after app-bg layers.
 */
@import url("https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700&display=swap");
@import url("dash-header.css");
@import url("https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css");

body.app-theme {
  min-height: 100vh;
  margin: 0;
  font-family: "DM Sans", "Segoe UI", system-ui, sans-serif;
  color: #1e293b;
  background: transparent !important;
  position: relative;
}

.app-bg-mesh {
  position: fixed;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 100% 75% at 0% -10%, rgba(91, 124, 250, 0.11), transparent 52%),
    radial-gradient(ellipse 80% 55% at 100% 0%, rgba(13, 159, 126, 0.09), transparent 48%),
    radial-gradient(ellipse 70% 45% at 50% 100%, rgba(186, 230, 253, 0.35), transparent 55%),
    linear-gradient(165deg, #f8fafc 0%, #eef2f7 48%, #f5f7fb 100%);
  pointer-events: none;
}

.app-bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.45;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.12) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

body.app-theme .container-scroller,
body.app-theme #content {
  position: relative;
  z-index: 1;
}

/* vertical-layout theme uses overflow:hidden here; user menu dropdown must extend below the header */
body.app-theme .container-scroller {
  overflow: visible;
}

/* ---- Global premium baseline for all app-theme pages ---- */
body.app-theme {
  --app-prem-surface: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(246, 250, 255, 0.93));
  --app-prem-border: rgba(116, 147, 191, 0.2);
  --app-prem-shadow-soft: 0 3px 10px rgba(41, 72, 117, 0.08);
  --app-prem-text: #284167;
  --app-prem-muted: #6c7e9b;
}

body.app-theme .main-panel,
body.app-theme .content-wrapper {
  background: transparent;
}

body.app-theme .card:not(.app-user-menu__panel):not(#theme-settings):not(.settings-panel) {
  border: 1px solid var(--app-prem-border);
  border-radius: 14px;
  background: var(--app-prem-surface);
  box-shadow: var(--app-prem-shadow-soft);
}

body.app-theme .card .card-header {
  border-bottom-color: rgba(116, 147, 191, 0.18);
}

body.app-theme .table {
  border-color: rgba(116, 147, 191, 0.2);
}

body.app-theme .table thead th {
  background: linear-gradient(180deg, rgba(229, 240, 255, 0.95), rgba(216, 229, 248, 0.9));
  color: var(--app-prem-text);
  border-bottom-color: rgba(116, 147, 191, 0.2);
}

body.app-theme .table td {
  background: rgba(255, 255, 255, 0.94);
  border-top-color: rgba(116, 147, 191, 0.16);
}

body.app-theme .form-control,
body.app-theme .form-select {
  border-radius: 10px;
  border-color: rgba(116, 147, 191, 0.35);
  color: #1f3960;
  background: rgba(255, 255, 255, 0.95);
}

body.app-theme .form-control:focus,
body.app-theme .form-select:focus {
  border-color: rgba(77, 119, 195, 0.55);
  box-shadow: 0 0 0 0.18rem rgba(77, 119, 195, 0.14);
}

body.app-theme .nav-tabs {
  border-bottom-color: rgba(116, 147, 191, 0.28);
}

body.app-theme .nav-tabs .nav-link {
  border: 1px solid transparent;
  border-radius: 10px 10px 0 0;
  color: var(--app-prem-muted);
  transition: all 0.18s ease;
}

body.app-theme .nav-tabs .nav-link:hover {
  color: var(--app-prem-text);
  border-color: rgba(116, 147, 191, 0.2) rgba(116, 147, 191, 0.2) transparent;
  background: rgba(239, 246, 255, 0.9);
}

body.app-theme .nav-tabs .nav-link.active {
  color: var(--app-prem-text);
  background: linear-gradient(180deg, rgba(244, 249, 255, 0.98), rgba(234, 243, 255, 0.95));
  border-color: rgba(116, 147, 191, 0.26) rgba(116, 147, 191, 0.26) transparent;
  font-weight: 600;
}

body.app-theme .btn-primary,
body.app-theme .btn-success {
  border: none;
  border-radius: 10px;
  box-shadow: 0 3px 10px rgba(57, 97, 168, 0.2);
}

body.app-theme .shadow-sm {
  box-shadow: var(--app-prem-shadow-soft) !important;
}

body.app-theme .badge.bg-secondary {
  background: linear-gradient(135deg, #6d80a6, #8093b7) !important;
}

/* ---- Gradient header (full width) ---- */
.app-topbar {
  width: 100%;
  position: relative;
  z-index: 20;
  overflow: visible;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: linear-gradient(90deg, #4d5152 0%, #6a6a7a 28%, #7d7d8e 52%, #9a9aac 78%, #b8b8c7 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.app-topbar-inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0.3rem 0.85rem;
  max-width: 100%;
  overflow: visible;
}

.app-topbar-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
  flex: 1 1 0%;
  padding-left: 0.1rem;
  padding-right: 0.2rem;
}

.app-topbar-brand-mark {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(22, 24, 28, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
}

.app-topbar-brand-logo {
  display: block;
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.app-topbar-brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.1rem;
  min-width: 0;
}

.app-topbar-brand-title {
  font-size: clamp(0.78rem, 1.25vw, 1rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.18;
  letter-spacing: 0.012em;
}

.app-topbar-brand-title--long {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.28;
  max-height: calc(1.28em * 2);
  text-wrap: balance;
}

.app-topbar-brand-tagline {
  font-size: 0.52rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.85);
  line-height: 1.2;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.12);
}

.app-topbar-nav {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.35rem;
  margin-left: clamp(0.4rem, 1.2vw, 0.95rem);
  padding: 0;
}

.app-topbar-nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  width: auto;
  min-height: 34px;
  padding: 0 0.45rem;
  box-sizing: border-box;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 6px;
  transition: background 0.2s;
}

.app-topbar-nav a + a {
  border-left: none;
  padding-left: 0.45rem;
}

.app-topbar-nav a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff !important;
}

.app-topbar-nav a.active {
  background: rgba(255, 255, 255, 0.16);
}

.app-topbar-nav a .menu-icon {
  font-size: 1.15rem;
}

.app-topbar-divider {
  flex-shrink: 0;
  width: 1px;
  align-self: stretch;
  min-height: 22px;
  margin: auto 0.2rem auto 0.15rem;
  background: rgba(255, 255, 255, 0.24);
}

.app-topbar-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  position: relative;
  overflow: visible;
}

.mspl-price-source {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.mspl-price-source__label {
  opacity: 0.9;
}

.mspl-price-source__select {
  min-height: 32px;
  max-width: min(220px, 42vw);
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
}

.mspl-price-source__select option {
  color: #111;
}

.mspl-price-source-badge {
  display: inline-flex;
  align-items: center;
  max-width: min(180px, 30vw);
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(16, 185, 129, 0.22);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- Topbar user menu (SaaS-style profile dropdown) ---- */
.app-user-menu {
  position: relative;
  flex-shrink: 0;
}

.app-user-menu__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 38px;
  max-width: min(320px, 46vw);
  padding: 0.2rem 0.55rem 0.2rem 0.35rem;
  margin: 0;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
  font: inherit;
  text-align: left;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.app-user-menu__trigger:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.app-user-menu__trigger:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.55);
  outline-offset: 2px;
}

.app-user-menu.is-open .app-user-menu__trigger {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.38);
}

.app-user-menu__avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(145deg, rgba(28, 30, 36, 0.65), rgba(55, 60, 72, 0.55));
  border: 1px solid rgba(255, 255, 255, 0.38);
  color: #fff;
}

.app-user-menu__text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.06rem;
  min-width: 0;
  flex: 1 1 auto;
}

.app-user-menu__name {
  font-weight: 700;
  font-size: 0.8125rem;
  line-height: 1.2;
  color: #fff;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-user-menu__role {
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.2;
  color: rgba(255, 255, 255, 0.72);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-user-menu__chev {
  flex-shrink: 0;
  font-size: 0.8rem;
  opacity: 0.88;
  transition: transform 0.22s ease;
}

.app-user-menu.is-open .app-user-menu__chev {
  transform: rotate(180deg);
}

.app-user-menu__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 228px;
  max-width: min(300px, calc(100vw - 1.5rem));
  padding: 0.4rem 0;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.14),
    0 2px 10px rgba(0, 0, 0, 0.06);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s;
}

.app-user-menu__panel[hidden] {
  display: none !important;
}

.app-user-menu__panel.is-open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.app-user-menu__panel-head {
  padding: 0.55rem 1rem 0.45rem;
}

.app-user-menu__panel-name {
  display: block;
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.25;
  color: #1a1d21;
}

.app-user-menu__panel-email {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #5c6370;
  word-break: break-word;
}

.app-user-menu__sep {
  height: 1px;
  margin: 0.35rem 0;
  background: rgba(0, 0, 0, 0.07);
  border: none;
  padding: 0;
}

a.app-user-menu__item,
button.app-user-menu__item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 1rem;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 0.8125rem;
  color: #2c3138;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.15s ease,
    color 0.15s ease;
}

a.app-user-menu__item .typcn,
button.app-user-menu__item .typcn {
  font-size: 1.12rem;
  opacity: 0.78;
  flex-shrink: 0;
}

a.app-user-menu__item:hover,
button.app-user-menu__item:hover {
  background: rgba(0, 0, 0, 0.045);
  color: #111;
}

a.app-user-menu__item--danger,
button.app-user-menu__item--danger {
  color: #c62828;
}

a.app-user-menu__item--danger:hover,
button.app-user-menu__item--danger:hover {
  background: rgba(198, 40, 40, 0.08);
  color: #b71c1c;
}

button.app-user-menu__item--placeholder {
  opacity: 0.65;
  cursor: not-allowed;
}

button.app-user-menu__item--placeholder:hover {
  background: transparent;
  color: #2c3138;
}

button.app-user-menu__item--placeholder:disabled {
  color: #2c3138;
  opacity: 0.65;
}

@media (max-width: 1199px) {
  .app-topbar-nav {
    margin-left: clamp(0.35rem, 1vw, 0.75rem);
    gap: 0.3rem;
  }

  .app-user-menu__trigger {
    max-width: min(280px, 50vw);
  }
}

@media (max-width: 767px) {
  .app-topbar-inner {
    min-height: 56px;
    gap: 0.5rem;
    padding: 0.45rem 0.75rem;
  }

  .app-topbar-brand-title--long {
    -webkit-line-clamp: 2;
    font-size: 0.7rem;
    line-height: 1.28;
    max-height: calc(1.28em * 2);
  }

  .app-topbar-brand-tagline {
    font-size: 0.5rem;
  }

  .app-topbar-nav {
    margin-left: 0.35rem;
    padding: 2px;
  }

  .app-topbar-nav {
    gap: 0.2rem;
  }

  .app-topbar-nav a {
    min-width: 36px;
    min-height: 32px;
    padding: 0 0.35rem;
  }

  .app-topbar-nav a + a {
    padding-left: 0.35rem;
  }

  .app-user-menu__trigger {
    max-width: min(240px, 72vw);
    padding: 0.18rem 0.45rem 0.18rem 0.28rem;
    gap: 0.4rem;
    min-height: 36px;
  }

  .app-user-menu__name {
    font-size: 0.74rem;
  }

  .app-user-menu__role {
    font-size: 0.65rem;
  }

  .app-user-menu__avatar {
    width: 28px;
    height: 28px;
    font-size: 0.65rem;
  }

  .app-user-menu__panel {
    right: 0;
    left: auto;
    max-width: calc(100vw - 1.25rem);
  }
}

@media (max-width: 420px) {
  .app-user-menu__role {
    display: none;
  }

  .app-user-menu__trigger {
    max-width: min(200px, 78vw);
  }

  .app-user-menu__chev {
    display: none;
  }
}

/* ---- Premium mild dashboard look (advanced dashboards only) ---- */
body.app-theme.dashboard-premium {
  --dash-bg-grad-1: #f6f9ff;
  --dash-bg-grad-2: #edf3ff;
  --dash-bg-grad-3: #e7eefc;
  --dash-card-bg: rgba(255, 255, 255, 0.78);
  --dash-card-border: rgba(89, 122, 172, 0.18);
  --dash-soft-shadow: 0 8px 26px rgba(41, 72, 117, 0.11);
  --dash-subtle-shadow: 0 4px 14px rgba(41, 72, 117, 0.08);
  --dash-title: #273c66;
  --dash-text: #2f456f;
  --dash-muted: #6b7b98;
  --dash-accent: #4d77c3;
}

body.app-theme.dashboard-premium .app-bg-mesh {
  background:
    radial-gradient(ellipse 110% 80% at 0% -15%, rgba(102, 147, 255, 0.15), transparent 55%),
    radial-gradient(ellipse 85% 65% at 100% 0%, rgba(114, 166, 255, 0.12), transparent 52%),
    radial-gradient(ellipse 80% 60% at 45% 100%, rgba(193, 220, 255, 0.35), transparent 58%),
    linear-gradient(168deg, var(--dash-bg-grad-1) 0%, var(--dash-bg-grad-2) 50%, var(--dash-bg-grad-3) 100%);
}

body.app-theme.dashboard-premium .app-bg-grid {
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(136, 166, 210, 0.2) 1px, transparent 1px),
    linear-gradient(90deg, rgba(136, 166, 210, 0.2) 1px, transparent 1px);
}

body.app-theme.dashboard-premium .app-topbar-inner {
  min-height: 44px;
  padding-top: 0.2rem;
  padding-bottom: 0.2rem;
}

body.app-theme.dashboard-premium .app-topbar-brand-mark {
  width: 32px;
  height: 32px;
}

body.app-theme.dashboard-premium .app-topbar-brand-title {
  font-size: clamp(0.75rem, 1.08vw, 0.93rem);
}

body.app-theme.dashboard-premium .app-topbar-nav a {
  min-height: 32px;
  min-width: 34px;
}

body.app-theme.dashboard-premium .page-body-wrapper {
  background: transparent;
  padding-top: 1rem;
}

body.app-theme.dashboard-premium .premium-content-wrapper {
  padding: 0.9rem 1rem 1.1rem !important;
}

body.app-theme.dashboard-premium .premium-page-title {
  margin: 0.15rem 0 0.9rem;
  color: var(--dash-title) !important;
  letter-spacing: 0.01em;
  font-weight: 700;
}

body.app-theme.dashboard-premium .premium-main-card {
  border: 1px solid var(--dash-card-border);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.82), rgba(247, 251, 255, 0.86));
  box-shadow: var(--dash-soft-shadow);
}

body.app-theme.dashboard-premium .premium-main-card > .card-body {
  padding: 0.95rem 1rem 1.15rem;
}

body.app-theme.dashboard-premium #forecastTabs.premium-tabs {
  margin-top: 0 !important;
  margin-bottom: 0.8rem;
  padding: 0.25rem;
  border: 1px solid var(--dash-card-border);
  border-radius: 12px;
  background: rgba(240, 246, 255, 0.9);
  gap: 0.35rem;
}

body.app-theme.dashboard-premium #forecastTabs.premium-tabs .nav-item {
  margin: 0 !important;
}

body.app-theme.dashboard-premium #forecastTabs.premium-tabs .nav-link {
  border: none;
  border-radius: 9px;
  color: var(--dash-text);
  font-weight: 600;
  font-size: 0.84rem;
  padding: 0.43rem 0.78rem;
  transition: all 0.18s ease;
}

body.app-theme.dashboard-premium #forecastTabs.premium-tabs .nav-link:hover {
  background: rgba(77, 119, 195, 0.09);
}

body.app-theme.dashboard-premium #forecastTabs.premium-tabs .nav-link.active {
  color: #fff;
  background: linear-gradient(135deg, #4d77c3, #5f8ddb);
  box-shadow: 0 3px 9px rgba(77, 119, 195, 0.28);
}

body.app-theme.dashboard-premium #forecastTabContent.premium-tab-content {
  border-radius: 14px;
}

body.app-theme.dashboard-premium .premium-forecast-card {
  border-radius: 14px;
}

body.app-theme.dashboard-premium .premium-calculator {
  margin: 0.25rem auto 1rem !important;
  padding: 1.15rem !important;
  max-width: 100%;
  border: 1px solid var(--dash-card-border);
  border-radius: 14px !important;
  background: linear-gradient(160deg, rgba(249, 252, 255, 0.92), rgba(239, 246, 255, 0.86)) !important;
  box-shadow: var(--dash-subtle-shadow) !important;
}

body.app-theme.dashboard-premium .premium-control-card {
  border-color: rgba(103, 140, 194, 0.24) !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, rgba(252, 254, 255, 0.96), rgba(236, 244, 255, 0.94)) !important;
  box-shadow: 0 6px 18px rgba(36, 63, 104, 0.08) !important;
}

body.app-theme.dashboard-premium .premium-control-strip {
  border: 1px solid rgba(104, 138, 189, 0.32) !important;
  border-radius: 12px !important;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(235, 244, 255, 0.93)) !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75), 0 4px 12px rgba(36, 63, 104, 0.08) !important;
  padding: 0.6rem 0.7rem !important;
  gap: 0.65rem !important;
}

body.app-theme.dashboard-premium .premium-control-strip .form-label {
  margin-bottom: 0 !important;
  color: #355482 !important;
  font-size: 0.76rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.01em;
}

body.app-theme.dashboard-premium .premium-control-strip .form-select,
body.app-theme.dashboard-premium .premium-control-strip .form-control {
  height: 34px !important;
  border-radius: 9px !important;
  border: 1px solid rgba(116, 147, 191, 0.42) !important;
  background: #fff !important;
  box-shadow: 0 1px 3px rgba(32, 58, 98, 0.07) !important;
  font-size: 0.82rem !important;
  color: #23416a !important;
}

body.app-theme.dashboard-premium .premium-control-strip .form-select:focus,
body.app-theme.dashboard-premium .premium-control-strip .form-control:focus {
  border-color: rgba(66, 109, 180, 0.68) !important;
  box-shadow: 0 0 0 0.16rem rgba(77, 119, 195, 0.18) !important;
}

body.app-theme.dashboard-premium .premium-control-strip .btn {
  height: 34px !important;
  border-radius: 9px !important;
  border-color: rgba(112, 144, 191, 0.45) !important;
  color: #2b4b79 !important;
  background: linear-gradient(135deg, #ffffff, #edf4ff) !important;
  font-weight: 600;
  box-shadow: 0 2px 7px rgba(33, 60, 101, 0.08);
}

body.app-theme.dashboard-premium .premium-control-strip .btn:hover {
  color: #17375f !important;
  border-color: rgba(82, 125, 192, 0.58) !important;
  background: linear-gradient(135deg, #ffffff, #e2edff) !important;
}

body.app-theme.dashboard-premium .premium-control-strip + hr {
  margin: 0.7rem 0 !important;
  border-color: rgba(116, 147, 191, 0.24);
}

body.app-theme.dashboard-premium .form-control,
body.app-theme.dashboard-premium .form-select {
  border-color: rgba(119, 148, 192, 0.35);
  color: #21395f;
}

body.app-theme.dashboard-premium .form-control:focus,
body.app-theme.dashboard-premium .form-select:focus {
  border-color: rgba(77, 119, 195, 0.55);
  box-shadow: 0 0 0 0.18rem rgba(77, 119, 195, 0.14);
}

body.app-theme.dashboard-premium .cost-table,
body.app-theme.dashboard-premium .cost-table-header,
body.app-theme.dashboard-premium .cost-table-header1,
body.app-theme.dashboard-premium table.table-variance {
  border-radius: 12px;
  overflow: hidden;
  border-color: rgba(114, 145, 190, 0.25) !important;
  box-shadow: 0 4px 14px rgba(38, 66, 109, 0.08) !important;
}

body.app-theme.dashboard-premium .cost-table th,
body.app-theme.dashboard-premium .cost-table-header thead th,
body.app-theme.dashboard-premium .cost-table-header1 thead th,
body.app-theme.dashboard-premium table.table-variance thead tr {
  background: linear-gradient(180deg, rgba(230, 240, 255, 0.98), rgba(216, 229, 248, 0.94)) !important;
  color: #284268 !important;
}

body.app-theme.dashboard-premium .cost-table td,
body.app-theme.dashboard-premium .cost-table-header td,
body.app-theme.dashboard-premium .cost-table-header1 td,
body.app-theme.dashboard-premium table.table-variance td {
  background: rgba(255, 255, 255, 0.96) !important;
}

body.app-theme.dashboard-premium #competitorContainer .row,
body.app-theme.dashboard-premium #datewisePelletSummary {
  border: 1px solid rgba(114, 145, 190, 0.22) !important;
  border-radius: 12px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  box-shadow: 0 4px 12px rgba(38, 66, 109, 0.07) !important;
}

body.app-theme.dashboard-premium #datewisePelletSummary > .card-header,
body.app-theme.dashboard-premium .premium-calculator .card.border-0.shadow-sm.mb-4 > .card-header {
  border: none !important;
  border-radius: 12px 12px 0 0 !important;
  color: #fff !important;
  font-size: 0.86rem;
  letter-spacing: 0.01em;
  background: linear-gradient(135deg, #3d69b4, #5a84cc) !important;
}

body.app-theme.dashboard-premium #datewisePelletSummary > .card-body,
body.app-theme.dashboard-premium .premium-calculator .card.border-0.shadow-sm.mb-4 > .card-body {
  padding: 0.65rem !important;
  gap: 0.55rem !important;
  background: linear-gradient(180deg, rgba(250, 253, 255, 0.95), rgba(241, 247, 255, 0.92)) !important;
}

body.app-theme.dashboard-premium #datewisePelletSummary > .card-body > .p-2,
body.app-theme.dashboard-premium .premium-calculator .card.border-0.shadow-sm.mb-4 > .card-body > .p-2,
body.app-theme.dashboard-premium #costTab > span .p-2 {
  min-width: 180px !important;
  padding: 0.5rem 0.62rem !important;
  border-radius: 12px !important;
  border: 1px solid rgba(116, 147, 191, 0.34) !important;
  box-shadow: 0 4px 10px rgba(36, 63, 104, 0.09) !important;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.98), rgba(232, 242, 255, 0.9)) !important;
}

body.app-theme.dashboard-premium #datewisePelletSummary > .card-body > .p-2 .text-muted,
body.app-theme.dashboard-premium .premium-calculator .card.border-0.shadow-sm.mb-4 > .card-body > .p-2 .text-muted,
body.app-theme.dashboard-premium #costTab > span .p-2 .text-muted {
  color: #5c6f90 !important;
}

body.app-theme.dashboard-premium #datewisePelletSummary > .card-body > .p-2 .fw-bold,
body.app-theme.dashboard-premium .premium-calculator .card.border-0.shadow-sm.mb-4 > .card-body > .p-2 .fw-bold,
body.app-theme.dashboard-premium #costTab > span .p-2 .fw-bold {
  color: #1f4b8e !important;
}

body.app-theme.dashboard-premium #datewisePelletSummary > .card-body > .p-2:nth-child(2),
body.app-theme.dashboard-premium .premium-calculator .card.border-0.shadow-sm.mb-4 > .card-body > .p-2:nth-child(2),
body.app-theme.dashboard-premium #costTab > span .p-2 {
  border-color: rgba(189, 145, 56, 0.48) !important;
  background: linear-gradient(155deg, rgba(255, 247, 211, 0.98), rgba(255, 236, 160, 0.93)) !important;
}

body.app-theme.dashboard-premium .premium-calculator .overflow-hidden.rounded-2.mb-1 {
  border: 1px solid rgba(114, 145, 190, 0.28) !important;
  border-left: 3px solid #4f7ccc !important;
  border-radius: 14px !important;
  background: linear-gradient(180deg, rgba(246, 251, 255, 0.98), rgba(236, 244, 255, 0.92)) !important;
  box-shadow: 0 4px 12px rgba(38, 66, 109, 0.07) !important;
}

body.app-theme.dashboard-premium .premium-calculator .card.shadow-sm.mb-3.border-warning {
  border: 1px solid rgba(189, 145, 56, 0.36) !important;
  border-radius: 12px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 252, 255, 0.94));
}

body.app-theme.dashboard-premium .premium-calculator .card.shadow-sm.mb-3.border-warning .card-title {
  color: #b3892e !important;
  font-size: 1rem;
}

body.app-theme.dashboard-premium .premium-calculator .row.row-cols-6.g-1 > .col > .border.rounded.p-1.bg-light.h-100.small {
  border: 1px solid rgba(116, 147, 191, 0.24) !important;
  border-radius: 10px !important;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(243, 248, 255, 0.94)) !important;
  box-shadow: 0 2px 8px rgba(36, 63, 104, 0.06);
}

body.app-theme.dashboard-premium #costTab {
  margin-top: 0.35rem;
  margin-bottom: 0.9rem !important;
  padding: 0.45rem;
  border-radius: 12px;
  border: 1px solid rgba(114, 145, 190, 0.26);
  background: linear-gradient(180deg, rgba(69, 86, 176, 0.94), rgba(76, 87, 174, 0.9));
}

body.app-theme.dashboard-premium #costTab .nav-link {
  border: none;
  border-radius: 999px;
  color: #1f3d67;
  font-weight: 600;
  font-size: 0.83rem;
  padding: 0.42rem 0.8rem;
  background: linear-gradient(135deg, #f5f8ff, #e3edff);
  transition: background 0.18s ease;
}

body.app-theme.dashboard-premium #costTab .nav-link:hover {
  color: #16345c;
  background: linear-gradient(135deg, #ffffff, #eaf1ff);
}

body.app-theme.dashboard-premium #costTab .nav-link.active,
body.app-theme.dashboard-premium #costTab .nav-link[aria-selected="true"] {
  color: #27416a;
  background: linear-gradient(135deg, #f4f8ff, #dbe9ff);
  box-shadow: 0 2px 8px rgba(11, 33, 65, 0.2);
}

@media (max-width: 991px) {
  body.app-theme.dashboard-premium .premium-content-wrapper {
    padding: 0.7rem 0.7rem 0.95rem !important;
  }

  body.app-theme.dashboard-premium .premium-main-card > .card-body {
    padding: 0.75rem 0.7rem 0.9rem;
  }

  body.app-theme.dashboard-premium .premium-calculator {
    padding: 0.85rem !important;
  }

  body.app-theme.dashboard-premium .premium-control-strip {
    justify-content: flex-start !important;
  }

  body.app-theme.dashboard-premium #datewisePelletSummary > .card-body > .p-2,
  body.app-theme.dashboard-premium .premium-calculator .card.border-0.shadow-sm.mb-4 > .card-body > .p-2,
  body.app-theme.dashboard-premium #costTab > span .p-2 {
    min-width: 155px !important;
  }

  body.app-theme.dashboard-premium .premium-calculator .row.row-cols-6.g-1 > .col {
    flex: 0 0 33.3333%;
    max-width: 33.3333%;
  }
}

@media (max-width: 767px) {
  body.app-theme.dashboard-premium .app-topbar-inner {
    min-height: 48px;
  }

  body.app-theme.dashboard-premium .premium-page-title {
    font-size: 0.95rem;
    margin-bottom: 0.65rem;
  }

  body.app-theme.dashboard-premium #forecastTabs.premium-tabs .nav-link {
    font-size: 0.78rem;
    padding: 0.35rem 0.55rem;
  }

  body.app-theme.dashboard-premium .premium-control-strip {
    padding: 0.5rem !important;
    gap: 0.5rem !important;
  }

  body.app-theme.dashboard-premium .premium-control-strip .form-select,
  body.app-theme.dashboard-premium .premium-control-strip .form-control,
  body.app-theme.dashboard-premium .premium-control-strip .btn {
    height: 32px !important;
    font-size: 0.78rem !important;
  }

  body.app-theme.dashboard-premium #datewisePelletSummary > .card-body > .p-2,
  body.app-theme.dashboard-premium .premium-calculator .card.border-0.shadow-sm.mb-4 > .card-body > .p-2,
  body.app-theme.dashboard-premium #costTab > span .p-2 {
    min-width: 145px !important;
  }

  body.app-theme.dashboard-premium .premium-calculator .row.row-cols-6.g-1 > .col {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* ---- Profile page (/profile) ---- */
.app-profile-wrap {
  max-width: 520px;
  margin: 1.75rem auto 2.5rem;
  padding: 0 1rem;
}

.app-profile-card {
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 12px;
  padding: 1.35rem 1.5rem 1.5rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

.app-profile-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #1a1d21;
}

.app-profile-card__hint {
  margin: 0 0 1.25rem;
  font-size: 0.8125rem;
  color: #64748b;
}

.app-profile-card__list {
  margin: 0;
}

.app-profile-card__row {
  display: grid;
  grid-template-columns: 7.5rem 1fr;
  gap: 0.75rem 1rem;
  align-items: baseline;
  padding: 0.65rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.app-profile-card__row:first-of-type {
  border-top: none;
  padding-top: 0;
}

.app-profile-card__row dt {
  margin: 0;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #94a3b8;
}

.app-profile-card__row dd {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #1e293b;
  word-break: break-word;
}

@media (max-width: 480px) {
  .app-profile-card__row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* Hide legacy breadcrumb bar when both exist during migration */
nav.navbar-breadcrumb.app-topbar-replaced {
  display: none !important;
}

/* Hide legacy Bootstrap fixed-top bar when the shared gradient header is used (same DOM, no duplicate strip) */
body.app-theme .container-scroller > nav.navbar.fixed-top.d-flex.flex-row {
  display: none !important;
}
