:root {
  --bg: #f4efe6;
  --bg-alt: #fffaf0;
  --ink: #1f2933;
  --muted: #52606d;
  --line: rgba(31, 41, 51, 0.12);
  --panel: rgba(255, 250, 240, 0.88);
  --primary: #f7b500;
  --secondary: #44bba4;
  --accent: #ff6b35;
  --shadow: 0 24px 60px rgba(31, 41, 51, 0.12);
}

html {
  font-size: 16px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(247, 181, 0, 0.2), transparent 25%),
    radial-gradient(circle at right 20%, rgba(68, 187, 164, 0.18), transparent 22%),
    linear-gradient(180deg, #fbf6ed 0%, #f4efe6 100%);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
}

h1, h2, h3, .brand-mark {
  font-family: Georgia, "Times New Roman", serif;
}

a {
  color: inherit;
}

.app-shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
}

.app-shell-fluid {
  width: calc(100% - 2rem);
  margin: 0 auto;
}

.app-navbar {
  padding: 1rem 0;
  background: transparent;
}

.brand-mark {
  font-size: 1.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.nav-link {
  color: var(--muted) !important;
  font-weight: 600;
}

.hero-panel,
.panel-card,
.stat-card {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-panel {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 1.5rem;
  padding: 2rem;
  margin: 1rem 0 1.5rem;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 250, 240, 0.96), rgba(255, 243, 214, 0.94));
}

.hero-panel h1 {
  margin: 0.5rem 0 1rem;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.hero-copy,
.muted-copy {
  color: var(--muted);
}

.hero-highlight {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 1.5rem;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(31, 41, 51, 0.96), rgba(60, 72, 88, 0.96));
  color: #fffaf0;
}

.hero-highlight-label,
.eyebrow {
  display: inline-block;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.75rem;
  font-weight: 700;
}

.workspace-grid,
.stats-grid,
.charts-grid {
  display: grid;
  gap: 1.5rem;
}

.workspace-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1.5rem;
}

.stats-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 1.5rem;
}

.charts-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 1.5rem;
}

.chart-panel-wide {
  grid-column: 1 / -1;
}

.panel-card,
.stat-card {
  padding: 1.5rem;
  border-radius: 24px;
  background: var(--panel);
}

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

.panel-head h2,
.stat-card strong {
  margin: 0.3rem 0 0;
}

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

.field-label {
  display: inline-block;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-weight: 700;
}

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

.filter-actions {
  display: flex;
  align-items: end;
  gap: 0.75rem;
}

.filter-help-text {
  grid-column: 1 / -1;
  margin: -0.25rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.filter-checklist-group {
  min-width: 0;
}

.filter-checklist {
  display: grid;
  gap: 0.45rem;
  max-height: 10.25rem;
  overflow: auto;
  padding: 0.55rem;
  border: 1px solid rgba(123, 107, 232, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.filter-check-option {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.15rem;
  padding: 0.4rem 0.55rem;
  border-radius: 13px;
  color: var(--text);
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.filter-check-option:hover {
  background: rgba(123, 107, 232, 0.09);
  transform: translateX(2px);
}

.filter-check-option input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--primary);
}

.filter-check-option span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filter-check-option-all {
  background: rgba(123, 107, 232, 0.1);
  color: var(--primary-dark);
  font-weight: 800;
}

.dashboard-filter-config {
  padding: 1rem;
  border: 1px solid rgba(123, 107, 232, 0.16);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.dashboard-filter-config .muted-copy {
  margin-bottom: 0.85rem;
}

.dashboard-filter-config-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.55rem;
}

.dashboard-filter-config-head h2 {
  margin: 0.2rem 0 0;
  font-size: 1.15rem;
}

.dashboard-filter-config-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.75rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  color: var(--primary-dark);
  background: rgba(123, 107, 232, 0.12);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.dashboard-list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.dashboard-list-card a:not(.btn) {
  color: inherit;
  text-decoration: none;
}

.dashboard-list-card a:not(.btn):hover {
  color: var(--primary);
}

body.embed-mode {
  min-height: 100vh;
  background: #f7f5fb;
}

.embed-content {
  min-height: 100vh;
  padding: 1rem;
}

body.embed-mode .builder-shell {
  margin: 0;
}

body.embed-mode .builder-canvas {
  min-height: calc(100vh - 2rem);
}

.dashboard-filter-accordion .accordion-item {
  border: 0;
  background: transparent;
}

.dashboard-filter-accordion .accordion-button {
  padding: 0;
  color: var(--text);
  background: transparent;
  box-shadow: none;
}

.dashboard-filter-accordion .accordion-button span {
  display: grid;
  gap: 0.2rem;
}

.dashboard-filter-accordion .accordion-button strong {
  font-size: 1.35rem;
}

.dashboard-filter-accordion .accordion-button::after {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 50%;
  background-color: rgba(123, 107, 232, 0.12);
  background-position: center;
}

.dashboard-filter-accordion .accordion-body {
  padding: 1.15rem 0 0;
}

.filter-span-2 {
  grid-column: 1 / -1;
}

.stat-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(255, 248, 231, 0.92));
}

.stat-label {
  display: block;
  color: var(--muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.chart-panel {
  min-height: 360px;
}

.chart-surface {
  width: 100% !important;
  height: 280px !important;
}

.ranking-table {
  border-radius: 18px;
  overflow: hidden;
}

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

.option-card {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  border: 1px solid var(--line);
}

.option-card p,
.dashboard-list-card p {
  margin: 0.4rem 0 0;
  color: var(--muted);
}

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

.dashboard-list-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 1.2rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.56);
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-list-card:hover,
.dashboard-list-card.is-active {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(31, 41, 51, 0.12);
}

.dashboard-builder-grid {
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
}

.dashboard-builder-main {
  display: grid;
  gap: 1.5rem;
}

.dashboard-hero {
  margin-top: 0;
}

.sidebar-card {
  position: sticky;
  top: 1rem;
}

.dashboard-list-compact .dashboard-list-card {
  justify-content: flex-start;
}

.dynamic-widget-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-widget-canvas {
  width: 100% !important;
  height: 280px !important;
}

.bi-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 360px;
  gap: 1.25rem;
  align-items: start;
  margin: 1rem 0 2rem;
}

.bi-leftbar,
.bi-rightbar,
.bi-stage {
  min-width: 0;
}

.bi-brand-card,
.bi-section-card,
.bi-toolbar,
.bi-canvas,
.bi-widget-card {
  border: 1px solid rgba(39, 57, 75, 0.12);
  border-radius: 24px;
  background: rgba(255, 252, 245, 0.94);
  box-shadow: 0 18px 45px rgba(31, 41, 51, 0.09);
}

.bi-brand-card,
.bi-section-card,
.bi-toolbar,
.bi-canvas {
  padding: 1.25rem;
}

.bi-brand-card {
  background: linear-gradient(160deg, #203040 0%, #32485e 100%);
  color: #f8f2e8;
  margin-bottom: 1rem;
}

.bi-brand-card h1,
.bi-toolbar h2,
.bi-canvas-head h3,
.bi-widget-head h3,
.bi-section-head h3 {
  margin: 0.4rem 0 0;
}

.bi-brand-card p,
.bi-section-head p,
.bi-canvas-head p,
.bi-widget-option small,
.bi-nav-item span,
.bi-inline-value {
  color: var(--muted);
}

.bi-brand-card p {
  color: rgba(248, 242, 232, 0.78);
  margin: 0.7rem 0 0;
}

.bi-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.bi-section-head-stack {
  display: block;
}

.mini-link {
  font-size: 0.88rem;
  color: #385170;
  text-decoration: none;
}

.bi-nav-list {
  display: grid;
  gap: 0.7rem;
}

.bi-nav-item {
  display: block;
  padding: 0.95rem 1rem;
  border-radius: 18px;
  text-decoration: none;
  border: 1px solid rgba(39, 57, 75, 0.09);
  background: #fffdf8;
  transition: all 0.18s ease;
}

.bi-nav-item strong,
.bi-nav-item span {
  display: block;
}

.bi-nav-item span {
  margin-top: 0.35rem;
  font-size: 0.88rem;
}

.bi-nav-item:hover,
.bi-nav-item.is-active {
  border-color: rgba(56, 81, 112, 0.35);
  background: linear-gradient(180deg, #fff8e6 0%, #fffef9 100%);
  transform: translateY(-1px);
}

.bi-stage {
  display: grid;
  gap: 1rem;
}

.bi-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.bi-toolbar-meta {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.bi-kpi-pill {
  min-width: 110px;
  padding: 0.7rem 0.9rem;
  border-radius: 16px;
  background: #fffef9;
  border: 1px solid rgba(39, 57, 75, 0.08);
}

.bi-kpi-pill span,
.bi-kpi-pill strong {
  display: block;
}

.bi-kpi-pill span {
  color: var(--muted);
  font-size: 0.78rem;
}

.bi-canvas {
  min-height: 72vh;
  background:
    linear-gradient(rgba(208, 219, 230, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(208, 219, 230, 0.35) 1px, transparent 1px),
    linear-gradient(180deg, #f7f5ef 0%, #fdfcf8 100%);
  background-size: 24px 24px, 24px 24px, 100% 100%;
}

.bi-canvas-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
}

.bi-canvas-head p {
  max-width: 360px;
  margin: 0;
  text-align: right;
}

.bi-empty-canvas {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--muted);
}

.bi-empty-illustration {
  display: grid;
  grid-template-columns: repeat(3, 52px);
  gap: 0.8rem;
  margin-bottom: 1.25rem;
}

.bi-empty-illustration span {
  height: 92px;
  border-radius: 20px;
  background: linear-gradient(180deg, #dce7f0, #f2c078);
  opacity: 0.75;
}

.bi-widget-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.bi-widget-card {
  padding: 1rem 1rem 0.85rem;
  min-height: 360px;
  background: rgba(255, 255, 255, 0.95);
}

.bi-widget-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.bi-widget-meta {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  align-items: end;
}

.bi-widget-meta span {
  font-size: 0.82rem;
  padding: 0.35rem 0.55rem;
  border-radius: 999px;
  background: #f3f6f9;
  color: #385170;
}

.bi-form-card {
  position: sticky;
  top: 1rem;
}

.bi-widget-library {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  margin-bottom: 1rem;
}

.bi-widget-option {
  display: grid;
  gap: 0.45rem;
  text-align: left;
  padding: 0.95rem;
  border-radius: 18px;
  border: 1px solid rgba(39, 57, 75, 0.1);
  background: #fffef9;
  transition: all 0.18s ease;
}

.bi-widget-option strong,
.bi-widget-option small {
  display: block;
}

.bi-widget-option small {
  line-height: 1.35;
}

.bi-widget-option:hover,
.bi-widget-option.is-active {
  border-color: rgba(56, 81, 112, 0.45);
  background: linear-gradient(180deg, #f8fbff 0%, #fffaf0 100%);
  box-shadow: 0 14px 30px rgba(31, 41, 51, 0.09);
}

.bi-widget-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(180deg, #d9e8f5, #f3be69);
  position: relative;
  overflow: hidden;
}

.bi-widget-icon::before,
.bi-widget-icon::after {
  content: "";
  position: absolute;
}

.bi-widget-icon-bar::before {
  left: 6px;
  bottom: 6px;
  width: 5px;
  height: 12px;
  background: #274054;
  box-shadow: 8px -5px 0 #274054, 16px -10px 0 #274054;
}

.bi-widget-icon-line::before {
  left: 5px;
  top: 18px;
  width: 22px;
  height: 2px;
  background: #274054;
  transform: rotate(-20deg);
}

.bi-widget-icon-line::after {
  left: 6px;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #274054;
  box-shadow: 9px 2px 0 #274054, 18px -4px 0 #274054;
}

.bi-widget-icon-pie::before,
.bi-widget-icon-doughnut::before,
.bi-widget-icon-polarArea::before,
.bi-widget-icon-radar::before {
  inset: 5px;
  border-radius: 50%;
  background: conic-gradient(#274054 0 90deg, #f3be69 90deg 220deg, #87a8c4 220deg 360deg);
}

.bi-widget-icon-doughnut::after {
  inset: 11px;
  border-radius: 50%;
  background: #fffef9;
}

.bi-widget-icon-radar::after {
  left: 8px;
  top: 8px;
  width: 18px;
  height: 18px;
  background: rgba(39, 64, 84, 0.3);
  clip-path: polygon(50% 0%, 100% 35%, 82% 100%, 18% 100%, 0% 35%);
}

.bi-widget-icon-scatter::before,
.bi-widget-icon-bubble::before {
  left: 6px;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #274054;
  box-shadow: 10px 6px 0 #274054, 17px 0 0 #274054;
}

.bi-widget-icon-bubble::after {
  left: 5px;
  bottom: 6px;
  width: 22px;
  height: 12px;
  border-radius: 999px;
  background: rgba(39, 64, 84, 0.22);
}

.bi-form-group {
  margin-bottom: 1rem;
}

.bi-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.9rem;
}

.bi-hidden-select {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bi-inline-value {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(39, 57, 75, 0.1);
  background: #fffef9;
  font-weight: 600;
  color: #274054;
}

.quick-link-panel {
  margin-bottom: 1.5rem;
}

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

.widget-picker-card {
  text-align: left;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.65);
  border-radius: 18px;
  padding: 1rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.widget-picker-card strong,
.widget-picker-card span {
  display: block;
}

.widget-picker-card span {
  margin-top: 0.45rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.widget-picker-card:hover,
.widget-picker-card.is-active {
  transform: translateY(-2px);
  border-color: rgba(247, 181, 0, 0.9);
  box-shadow: 0 16px 30px rgba(31, 41, 51, 0.12);
}

.widget-picker-select {
  background-color: #fff9ee;
}

.footer {
  padding: 1.4rem 0 2rem;
  color: var(--muted) !important;
}

body.dashboard-mode {
  background: linear-gradient(180deg, #d9d7d7 0%, #d1d1d1 100%);
}

body.dashboard-mode .app-navbar,
body.dashboard-mode .footer {
  display: none;
}

body.dashboard-mode .app-shell-fluid {
  width: 100%;
  margin: 0;
}

.inspire-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 0;
  padding: 3rem 2.75rem;
}

.inspire-rail {
  margin: auto 0;
  min-height: 78vh;
  border-radius: 34px 0 0 34px;
  background: linear-gradient(180deg, #7667e8 0%, #6b5fd7 100%);
  box-shadow: 0 22px 48px rgba(84, 76, 150, 0.24);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  padding: 2rem 0;
}

.inspire-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: linear-gradient(180deg, #f5d9ce, #fff);
  color: #6c5ed5;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.inspire-rail-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  position: relative;
}

.inspire-rail-icon::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 12px;
  border: 2px solid rgba(255, 255, 255, 0.85);
}

.inspire-rail-icon.is-active,
.inspire-rail-icon:hover {
  background: rgba(255, 255, 255, 0.35);
}

.inspire-board {
  min-height: 78vh;
  margin: auto 0;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 0 36px 36px 0;
  box-shadow: 0 24px 55px rgba(88, 88, 88, 0.18);
  padding: 2.2rem 2.4rem 2.1rem;
}

.inspire-topbar {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1.5rem;
  margin-bottom: 1.6rem;
}

.inspire-topbar h1 {
  margin: 0.35rem 0 0;
  font-size: clamp(2rem, 3vw, 3rem);
  color: #6f6d72;
}

.inspire-top-actions {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.inspire-ghost-btn,
.inspire-primary-btn,
.inspire-filter-btn,
.inspire-filter-btn-outline {
  border-radius: 999px;
  padding: 0.7rem 1.25rem;
  border-width: 0;
}

.inspire-primary-btn {
  background: linear-gradient(180deg, #7a6be8, #6b5fd7);
  box-shadow: 0 10px 24px rgba(108, 96, 215, 0.28);
}

.inspire-ghost-btn {
  background: #f1eefb;
  color: #6a5fd3;
}

.inspire-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) 360px;
  gap: 1.4rem;
}

.inspire-main-column,
.inspire-side-column {
  display: grid;
  gap: 1.4rem;
}

.inspire-card {
  border-radius: 26px;
  background: #ffffff;
  border: 1px solid rgba(111, 110, 114, 0.08);
  box-shadow: 0 12px 28px rgba(123, 123, 123, 0.12);
  padding: 1.35rem 1.45rem;
}

.inspire-card-large {
  min-height: 72vh;
}

.inspire-accent-card {
  background: linear-gradient(180deg, #7c6dea 0%, #6c60d6 100%);
  color: #fff;
}

.inspire-accent-card .field-label,
.inspire-accent-card .eyebrow,
.inspire-accent-card h2,
.inspire-accent-card .form-select,
.inspire-accent-card .form-control {
  color: #fff;
}

.inspire-accent-card .form-select,
.inspire-accent-card .form-control {
  background-color: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
}

.inspire-accent-card .form-select option {
  color: #2f2d3a;
}

.inspire-card-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.inspire-card-head h2 {
  margin: 0.35rem 0 0;
  color: #7b7981;
  font-size: 1.35rem;
}

.inspire-dots {
  color: #a2a0a8;
  font-weight: 700;
  letter-spacing: 0.2rem;
}

.inspire-empty-state {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #8f8c95;
}

.inspire-empty-state h3 {
  margin-bottom: 0.7rem;
}

.inspire-widget-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.inspire-widget-card {
  border-radius: 22px;
  background: #fcfcff;
  border: 1px solid rgba(115, 103, 240, 0.08);
  padding: 1rem;
  min-height: 330px;
}

.inspire-widget-meta h3 {
  margin: 0.3rem 0 0.2rem;
  color: #6f6d72;
}

.inspire-widget-meta p {
  margin: 0;
  color: #a19dad;
}

.inspire-filter-form,
.inspire-widget-form {
  display: grid;
  gap: 0.9rem;
}

.inspire-filter-dates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.inspire-filter-actions {
  display: flex;
  gap: 0.75rem;
}

.inspire-filter-btn {
  background: #fff;
  color: #6c60d6;
}

.inspire-filter-btn-outline {
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
}

.inspire-widget-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.inspire-widget-option {
  border: 1px solid rgba(115, 103, 240, 0.12);
  background: #faf9ff;
  color: #69657a;
  border-radius: 18px;
  padding: 0.8rem 0.65rem;
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  text-align: center;
}

.inspire-widget-option:hover,
.inspire-widget-option.is-active {
  border-color: rgba(115, 103, 240, 0.4);
  background: linear-gradient(180deg, #f1efff, #ffffff);
  box-shadow: 0 10px 22px rgba(115, 103, 240, 0.12);
}

.inspire-widget-icon {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  position: relative;
  background: linear-gradient(180deg, #dcd7ff, #a499ff);
}

.inspire-widget-icon::before,
.inspire-widget-icon::after {
  content: "";
  position: absolute;
}

.inspire-widget-icon-bar::before,
.inspire-widget-icon-horizontalBar::before,
.inspire-widget-icon-stackedBar::before,
.inspire-widget-icon-pictorialBar::before {
  left: 5px;
  bottom: 5px;
  width: 4px;
  height: 9px;
  background: #6b5fd7;
  box-shadow: 7px -4px 0 #6b5fd7, 14px -7px 0 #6b5fd7;
}

.inspire-widget-icon-horizontalBar::before {
  left: 5px;
  top: 7px;
  width: 17px;
  height: 4px;
  box-shadow: 0 7px 0 #6b5fd7, 0 14px 0 #6b5fd7;
}

.inspire-widget-icon-stackedBar::after {
  left: 10px;
  bottom: 5px;
  width: 4px;
  height: 12px;
  background: #cfc8ff;
  box-shadow: 7px -4px 0 #cfc8ff, 14px -7px 0 #cfc8ff;
}

.inspire-widget-icon-pictorialBar::before {
  border-radius: 999px;
}

.inspire-widget-icon-line::before,
.inspire-widget-icon-smoothLine::before,
.inspire-widget-icon-stepLine::before,
.inspire-widget-icon-bump::before,
.inspire-widget-icon-stackedArea::after {
  left: 4px;
  top: 15px;
  width: 18px;
  height: 2px;
  background: #6b5fd7;
  transform: rotate(-25deg);
}

.inspire-widget-icon-stepLine::before {
  top: 10px;
  height: 12px;
  background: transparent;
  border-left: 2px solid #6b5fd7;
  border-bottom: 2px solid #6b5fd7;
  border-right: 2px solid #6b5fd7;
  transform: none;
}

.inspire-widget-icon-bump::before {
  top: 7px;
  height: 16px;
  background: transparent;
  border-top: 2px solid #6b5fd7;
  border-bottom: 2px solid #8f82ef;
  transform: skewY(-22deg);
}

.inspire-widget-icon-bump::after {
  left: 5px;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6b5fd7;
  box-shadow: 9px 8px 0 #8f82ef, 17px 1px 0 #cfc8ff;
}

.inspire-widget-icon-pie::before,
.inspire-widget-icon-doughnut::before,
.inspire-widget-icon-radar::before,
.inspire-widget-icon-rose::before,
.inspire-widget-icon-sunburst::before {
  inset: 4px;
  border-radius: 50%;
  background: conic-gradient(#6b5fd7 0 120deg, #cfc8ff 120deg 240deg, #8f82ef 240deg 360deg);
}

.inspire-widget-icon-doughnut::after {
  inset: 10px;
  border-radius: 50%;
  background: #faf9ff;
}

.inspire-widget-icon-sunburst::after {
  inset: 10px;
  border-radius: 50%;
  border: 2px solid #faf9ff;
}

.inspire-widget-icon-scatter::before,
.inspire-widget-icon-bubble::before,
.inspire-widget-icon-effectScatter::before {
  left: 5px;
  top: 6px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6b5fd7;
  box-shadow: 8px 5px 0 #6b5fd7, 14px 0 0 #6b5fd7;
}

.inspire-widget-icon-bubble::after,
.inspire-widget-icon-effectScatter::after {
  left: 5px;
  bottom: 5px;
  width: 16px;
  height: 8px;
  border-radius: 999px;
  background: rgba(107, 95, 215, 0.2);
}

.inspire-widget-icon-effectScatter::after {
  inset: 4px;
  width: auto;
  height: auto;
  border: 2px solid rgba(107, 95, 215, 0.24);
  border-radius: 50%;
  background: transparent;
}

.inspire-widget-icon-area::before,
.inspire-widget-icon-stackedArea::before {
  left: 4px;
  right: 4px;
  bottom: 5px;
  top: 9px;
  background: linear-gradient(180deg, rgba(107, 95, 215, 0.12), rgba(107, 95, 215, 0.45));
  clip-path: polygon(0 100%, 0 72%, 26% 48%, 46% 60%, 72% 28%, 100% 0, 100% 100%);
}

.inspire-widget-icon-area::after,
.inspire-widget-icon-funnel::before,
.inspire-widget-icon-gauge::before,
.inspire-widget-icon-treemap::before,
.inspire-widget-icon-heatmap::before,
.inspire-widget-icon-geo::before,
.inspire-widget-icon-candlestick::before,
.inspire-widget-icon-boxplot::before,
.inspire-widget-icon-parallel::before,
.inspire-widget-icon-graph::before {
  content: "";
  position: absolute;
}

.inspire-widget-icon-area::after {
  left: 4px;
  right: 4px;
  top: 9px;
  height: 2px;
  background: #6b5fd7;
  transform: rotate(-18deg);
  transform-origin: left center;
}

.inspire-widget-icon-funnel::before {
  left: 5px;
  right: 5px;
  top: 5px;
  bottom: 5px;
  background: linear-gradient(180deg, #cfc8ff 0%, #8f82ef 40%, #6b5fd7 100%);
  clip-path: polygon(0 0, 100% 0, 72% 35%, 62% 58%, 62% 100%, 38% 100%, 38% 58%, 28% 35%);
}

.inspire-widget-icon-gauge::before {
  left: 4px;
  right: 4px;
  top: 4px;
  height: 20px;
  border-radius: 20px 20px 0 0;
  border: 3px solid #6b5fd7;
  border-bottom: 0;
}

.inspire-widget-icon-gauge::after {
  left: 13px;
  top: 13px;
  width: 2px;
  height: 8px;
  background: #6b5fd7;
  transform: rotate(35deg);
  transform-origin: bottom center;
}

.inspire-widget-icon-treemap::before {
  inset: 5px;
  background:
    linear-gradient(90deg, transparent 56%, #faf9ff 56%, #faf9ff 60%, transparent 60%),
    linear-gradient(180deg, transparent 48%, #faf9ff 48%, #faf9ff 52%, transparent 52%),
    linear-gradient(180deg, #dcd7ff, #a499ff);
  border-radius: 6px;
}

.inspire-widget-icon-heatmap::before {
  inset: 5px;
  border-radius: 5px;
  background:
    linear-gradient(90deg, transparent 30%, #faf9ff 30%, #faf9ff 34%, transparent 34%, transparent 64%, #faf9ff 64%, #faf9ff 68%, transparent 68%),
    linear-gradient(180deg, transparent 30%, #faf9ff 30%, #faf9ff 34%, transparent 34%, transparent 64%, #faf9ff 64%, #faf9ff 68%, transparent 68%),
    linear-gradient(135deg, #f1efff, #8f82ef);
}

.inspire-widget-icon-geo::before {
  inset: 5px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 62% 34%, #faf9ff 0 12%, transparent 13%),
    radial-gradient(circle at 35% 58%, #faf9ff 0 10%, transparent 11%),
    conic-gradient(#6b5fd7 0 120deg, #8f82ef 120deg 230deg, #cfc8ff 230deg 360deg);
}

.inspire-widget-icon-geo::after {
  left: 13px;
  top: 4px;
  width: 2px;
  height: 20px;
  background: rgba(250, 249, 255, 0.8);
  box-shadow: -6px 6px 0 -1px rgba(250, 249, 255, 0.8), 6px 6px 0 -1px rgba(250, 249, 255, 0.8);
}

.inspire-widget-icon-candlestick::before,
.inspire-widget-icon-boxplot::before {
  left: 7px;
  top: 5px;
  width: 4px;
  height: 18px;
  background: #6b5fd7;
  box-shadow: 7px 3px 0 #cfc8ff, 14px -2px 0 #6b5fd7;
}

.inspire-widget-icon-boxplot::before {
  width: 12px;
  height: 8px;
  top: 10px;
  background: transparent;
  border: 2px solid #6b5fd7;
  box-shadow: 8px 0 0 -1px #cfc8ff;
}

.inspire-widget-icon-parallel::before {
  inset: 5px;
  background:
    linear-gradient(90deg, #6b5fd7 0 2px, transparent 2px 8px, #6b5fd7 8px 10px, transparent 10px 16px, #6b5fd7 16px 18px),
    linear-gradient(25deg, transparent 35%, #8f82ef 35%, #8f82ef 42%, transparent 42%);
}

.inspire-widget-icon-graph::before {
  left: 5px;
  top: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6b5fd7;
  box-shadow: 13px 4px 0 #8f82ef, 5px 15px 0 #cfc8ff;
}

.inspire-widget-icon-graph::after {
  left: 8px;
  top: 10px;
  width: 14px;
  height: 10px;
  border-top: 2px solid rgba(107, 95, 215, 0.45);
  border-left: 2px solid rgba(107, 95, 215, 0.45);
  transform: rotate(18deg);
}

.hub-hero,
.create-dashboard-shell,
.builder-shell {
  margin: 1rem 0 2rem;
}

.hub-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 280px;
  gap: 1.5rem;
  padding: 2rem;
  border-radius: 30px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255, 249, 238, 0.96), rgba(240, 246, 252, 0.94));
  box-shadow: var(--shadow);
}

.hub-hero h1,
.create-dashboard-card h1,
.builder-brand-card h1 {
  margin: 0.35rem 0 0.9rem;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.hub-hero-actions,
.builder-topbar-actions,
.builder-action-row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.hub-kicker {
  color: var(--muted);
  max-width: 260px;
}

.hub-hero-side {
  display: grid;
  gap: 1rem;
}

.hub-mini-stat,
.builder-brand-card {
  padding: 1.25rem;
  border-radius: 24px;
  color: #fffaf0;
  background: linear-gradient(160deg, #203040 0%, #32485e 100%);
  box-shadow: 0 16px 38px rgba(31, 41, 51, 0.16);
}

.hub-mini-stat strong {
  display: block;
  font-size: 2.4rem;
}

.dashboard-hub-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.9fr);
  gap: 1.5rem;
  align-items: start;
}

.dashboard-list-rich .dashboard-list-card {
  padding: 1.1rem 1.2rem;
}

.hub-empty-state,
.builder-empty-state {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.9rem;
  color: var(--muted);
}

.create-dashboard-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 220px);
}

.create-dashboard-card {
  width: min(720px, 100%);
  padding: 2rem;
}

.create-dashboard-form {
  margin-top: 1.4rem;
}

.dashboard-toast {
  margin: 1rem;
}

.builder-shell {
  display: grid;
  grid-template-columns: minmax(300px, 340px) minmax(0, 1fr);
  gap: 1.25rem;
  padding: 1.25rem;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.builder-shell-full {
  grid-template-columns: minmax(0, 1fr);
  padding: 0;
}

.builder-sidebar,
.builder-main {
  display: grid;
  gap: 1rem;
  align-content: start;
  min-width: 0;
}

.builder-sidebar {
  width: 100%;
  max-width: 340px;
}

.builder-main {
  width: 100%;
}

.builder-topbar,
.builder-canvas {
  width: 100%;
  min-width: 0;
}

.builder-filter-panel {
  width: 100%;
  min-width: 0;
}

.builder-side-card {
  padding: 1.25rem;
}

.builder-date-grid,
.builder-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.builder-filter-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1rem;
  align-items: end;
}

.builder-filter-actions {
  display: flex;
  gap: 0.75rem;
  align-items: end;
}

.builder-widget-picker {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.builder-widget-option {
  border: 1px solid rgba(115, 103, 240, 0.12);
  background: #faf9ff;
  color: #69657a;
  border-radius: 18px;
  padding: 0.8rem 0.65rem;
  display: grid;
  justify-items: center;
  gap: 0.4rem;
  text-align: center;
}

.builder-widget-option:hover,
.builder-widget-option.is-active {
  border-color: rgba(115, 103, 240, 0.4);
  background: linear-gradient(180deg, #f1efff, #ffffff);
  box-shadow: 0 10px 22px rgba(115, 103, 240, 0.12);
}

.builder-topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: end;
  padding: 1.4rem 1.6rem;
  border-radius: 26px;
  background: rgba(255, 252, 245, 0.94);
  border: 1px solid rgba(39, 57, 75, 0.12);
  box-shadow: 0 18px 45px rgba(31, 41, 51, 0.09);
}

.builder-topbar h2,
.builder-canvas-head h3 {
  margin: 0.35rem 0 0;
}

.builder-canvas {
  padding: 1.4rem;
  border-radius: 28px;
  background:
    linear-gradient(rgba(208, 219, 230, 0.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(208, 219, 230, 0.35) 1px, transparent 1px),
    linear-gradient(180deg, #f7f5ef 0%, #fdfcf8 100%);
  background-size: 24px 24px, 24px 24px, 100% 100%;
  border: 1px solid rgba(39, 57, 75, 0.12);
  box-shadow: 0 18px 45px rgba(31, 41, 51, 0.09);
}

.builder-canvas-head {
  margin-bottom: 1rem;
}

.builder-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 1rem;
  align-items: start;
}

.builder-widget-card {
  min-width: 0;
  padding: 1rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(115, 103, 240, 0.12);
  box-shadow: 0 14px 34px rgba(80, 79, 108, 0.12);
  cursor: grab;
}

.builder-widget-card.is-dragging {
  opacity: 0.45;
}

.builder-widget-toolbar,
.builder-widget-actions {
  display: flex;
  gap: 0.75rem;
}

.builder-widget-toolbar {
  justify-content: space-between;
  align-items: start;
  margin-bottom: 1rem;
}

.builder-widget-heading h3 {
  margin: 0.3rem 0 0.3rem;
}

.builder-widget-heading p,
.widget-config-panel summary,
.builder-brand-card p {
  color: var(--muted);
}

.builder-widget-actions {
  align-items: center;
}

.widget-span-select {
  min-width: 112px;
}

.drag-handle {
  cursor: grab;
}

.widget-config-panel {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(39, 57, 75, 0.08);
}

.widget-config-panel summary {
  cursor: pointer;
  font-weight: 700;
  margin-bottom: 0.9rem;
}

.builder-delete-form {
  margin-top: 0.9rem;
}

@media (max-width: 1279.98px) {
  .builder-shell {
    grid-template-columns: 1fr;
  }

  .builder-sidebar {
    max-width: none;
  }
}

@media (max-width: 991.98px) {
  .hero-panel,
  .workspace-grid,
  .stats-grid,
  .charts-grid,
  .filter-grid,
  .option-grid,
  .dynamic-widget-grid,
  .dashboard-builder-grid,
  .widget-picker-grid,
  .bi-shell,
  .bi-widget-grid,
  .bi-form-grid,
  .bi-widget-library,
  .inspire-grid,
  .inspire-filter-dates,
  .inspire-widget-grid,
  .inspire-widget-picker,
  .hub-hero,
  .dashboard-hub-grid,
  .builder-shell,
  .builder-date-grid,
  .builder-editor-grid,
  .builder-widget-picker,
  .builder-filter-grid {
    grid-template-columns: 1fr;
  }

  .chart-panel-wide {
    grid-column: auto;
  }

  .sidebar-card,
  .bi-form-card {
    position: static;
  }

  .bi-toolbar,
  .bi-canvas-head,
  .bi-widget-head {
    flex-direction: column;
    align-items: stretch;
  }

  .bi-canvas-head p,
  .bi-widget-meta {
    text-align: left;
    align-items: flex-start;
  }

  .inspire-shell {
    grid-template-columns: 1fr;
    padding: 1rem;
  }

  .inspire-rail {
    min-height: auto;
    border-radius: 24px;
    flex-direction: row;
    justify-content: center;
    padding: 1rem;
  }

  .inspire-board {
    border-radius: 28px;
    padding: 1.25rem;
  }

  .inspire-topbar,
  .inspire-filter-actions,
  .hub-hero-actions,
  .builder-topbar,
  .builder-topbar-actions,
  .builder-widget-toolbar,
  .builder-widget-actions,
  .builder-action-row,
  .builder-filter-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .builder-grid {
    grid-template-columns: 1fr;
  }

  .builder-widget-card {
    grid-column: auto !important;
  }
}

:root {
  --bg: #efeff2;
  --bg-alt: #f7f7fb;
  --ink: #6f6d76;
  --muted: #a3a0ad;
  --line: rgba(122, 107, 232, 0.12);
  --panel: #ffffff;
  --panel-strong: #7768e4;
  --panel-soft: #f5f3ff;
  --primary: #7568e4;
  --secondary: #8ce7b8;
  --accent: #f2dd7f;
  --danger: #ef8ca8;
  --shadow: 0 18px 40px rgba(125, 121, 147, 0.16);
}

body {
  background:
    radial-gradient(circle at top left, rgba(117, 104, 228, 0.07), transparent 24%),
    radial-gradient(circle at bottom right, rgba(140, 231, 184, 0.08), transparent 20%),
    linear-gradient(180deg, #ececef 0%, #f3f3f6 100%);
  color: var(--ink);
  font-family: "Segoe UI", Tahoma, sans-serif;
}

h1, h2, h3, .brand-mark {
  font-family: "Segoe UI", Tahoma, sans-serif;
  font-weight: 700;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  transition: grid-template-columns 0.2s ease;
}

.admin-sidebar {
    background: linear-gradient(180deg, #2d217d 0%, #000000 100%);
    border-right: 0;
    padding: 1.5rem 1.1rem;
    display: grid;
    align-content: start;
    gap: 1.4rem;
    position: sticky;
    top: 0;
    height: 100vh;
    box-shadow: 20px 0 40px rgba(128, 119, 186, 0.12);
    transition: padding 0.2s ease;
    overflow-x: hidden;
}

.admin-sidebar-top {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex: 1 1 auto;
  min-width: 0;
  padding: 0.9rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.admin-brand-copy {
  min-width: 0;
}

.admin-brand strong,
.admin-brand small {
  display: block;
}

.admin-brand small,
.admin-sidebar-label,
.admin-sidebar-card p {
  color: rgba(255, 255, 255, 0.72);
}

.admin-brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(241, 238, 251, 0.92));
  color: #6d61d8;
  font-weight: 800;
  overflow: hidden;
  padding: 0.35rem;
}

.admin-brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.admin-sidebar-toggle {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.admin-sidebar-toggle:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.admin-sidebar-toggle svg,
.admin-nav-icon svg,
.dashboard-tree-toggle-icon svg,
.dashboard-tree-node-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.admin-sidebar-section {
  display: grid;
  gap: 0.7rem;
}

.admin-sidebar-label {
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0 0.6rem;
}

.admin-nav {
  display: grid;
  gap: 0.4rem;
}

.admin-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.8rem 1rem;
  border-radius: 16px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.9);
  border: 1px solid transparent;
  transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.admin-nav-link:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.22);
  transform: translateX(2px);
}

.admin-nav-icon {
  flex: 0 0 auto;
  display: inline-flex;
  color: rgba(255, 255, 255, 0.82);
}

.admin-nav-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-sidebar-tree-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.admin-tree-add-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 1.1rem;
  line-height: 1;
}

.dashboard-tree {
  min-width: 0;
}

.dashboard-tree-list {
  list-style: none;
  margin: 0;
  padding: 0 0 0 0.45rem;
  display: grid;
  gap: 0.25rem;
}

.dashboard-tree-item {
  min-width: 0;
}

.dashboard-tree-folder summary,
.dashboard-tree-link {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 38px;
  padding: 0.5rem 0.75rem;
  border-radius: 14px;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.92);
  cursor: pointer;
  user-select: none;
}

.dashboard-tree-folder summary {
  list-style: none;
}

.dashboard-tree-folder summary::-webkit-details-marker {
  display: none;
}

.dashboard-tree-folder[open] > summary .dashboard-tree-toggle-icon {
  transform: rotate(90deg);
}

.dashboard-tree-toggle-icon,
.dashboard-tree-toggle-spacer {
  flex: 0 0 auto;
  width: 14px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease;
}

.dashboard-tree-node-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.dashboard-tree-folder-icon {
  color: #f2dd7f;
  background: rgba(242, 221, 127, 0.16);
}

.dashboard-tree-dashboard-icon {
  color: #dcd8ff;
  background: rgba(255, 255, 255, 0.13);
}

.dashboard-tree-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-tree-folder summary:hover,
.dashboard-tree-link:hover,
.dashboard-tree-link.is-active {
  background: rgba(255, 255, 255, 0.16);
}

.dashboard-tree-empty {
  padding: 0.45rem 0.75rem;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

.dashboard-tree-empty-child {
  padding-left: 2rem;
}

.dashboard-tree-menu {
  position: absolute;
  z-index: 1060;
  display: none;
  min-width: 220px;
  padding: 0.45rem;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(122, 107, 232, 0.12);
  box-shadow: 0 18px 45px rgba(125, 121, 147, 0.18);
}

.dashboard-tree-menu.is-open {
  display: grid;
}

.dashboard-tree-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  color: #6f6d76;
  text-align: left;
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
}

.dashboard-tree-menu button:hover {
  background: #f3f0ff;
  color: #6d61d8;
}

.global-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(239, 239, 242, 0.72);
  backdrop-filter: blur(4px);
}

.global-loading-overlay.is-visible {
  display: flex;
}

.global-loading-card {
  min-width: 260px;
  max-width: min(360px, calc(100vw - 2rem));
  padding: 1.35rem 1.5rem;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(122, 107, 232, 0.14);
  box-shadow: 0 18px 45px rgba(125, 121, 147, 0.22);
  color: var(--ink);
  display: grid;
  justify-items: center;
  gap: 0.55rem;
  text-align: center;
}

.global-loading-card strong {
  color: #6f6d76;
}

.global-loading-card span {
  color: var(--muted);
  font-size: 0.92rem;
}

.global-loading-spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 4px solid #eeeafd;
  border-top-color: #7568e4;
  animation: global-loading-spin 0.8s linear infinite;
}

@keyframes global-loading-spin {
  to {
    transform: rotate(360deg);
  }
}

.admin-sidebar-card {
  margin-top: auto;
  padding: 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.admin-sidebar-card strong {
  display: block;
  margin: 0.35rem 0 0.5rem;
  color: #ffffff;
}

.admin-shell.sidebar-collapsed {
  grid-template-columns: 92px minmax(0, 1fr);
}

.admin-shell.sidebar-collapsed .admin-sidebar {
  padding-inline: 0.85rem;
}

.admin-shell.sidebar-collapsed .admin-sidebar-top {
  display: grid;
  justify-items: center;
}

.admin-shell.sidebar-collapsed .admin-brand {
  justify-content: center;
  padding: 0.75rem;
}

.admin-shell.sidebar-collapsed .admin-brand-copy,
.admin-shell.sidebar-collapsed .admin-sidebar-label,
.admin-shell.sidebar-collapsed .admin-nav-text,
.admin-shell.sidebar-collapsed .dashboard-tree-name,
.admin-shell.sidebar-collapsed .dashboard-tree-empty,
.admin-shell.sidebar-collapsed .admin-sidebar-card {
  display: none;
}

.admin-shell.sidebar-collapsed .admin-nav-link,
.admin-shell.sidebar-collapsed .dashboard-tree-folder summary,
.admin-shell.sidebar-collapsed .dashboard-tree-link {
  justify-content: center;
  padding-inline: 0.5rem;
}

.admin-shell.sidebar-collapsed .admin-sidebar-tree-head {
  justify-content: center;
}

.admin-shell.sidebar-collapsed .dashboard-tree-list {
  padding-left: 0;
}

.admin-shell.sidebar-collapsed .dashboard-tree-toggle-icon,
.admin-shell.sidebar-collapsed .dashboard-tree-toggle-spacer {
  display: none;
}

.admin-shell.sidebar-collapsed .dashboard-tree-node-icon {
  width: 34px;
  height: 34px;
}

.admin-main {
  min-width: 0;
  padding: 1.25rem;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.1rem;
  padding: 1.1rem 1.25rem;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.admin-header h1 {
  margin: 0.25rem 0 0;
  font-size: clamp(1.6rem, 2vw, 2.3rem);
}

.admin-header-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.admin-user-chip {
  display: grid;
  gap: 0.15rem;
  min-width: 180px;
  padding: 0.6rem 0.85rem;
  border-radius: 16px;
  background: #ffffff;
  border: 1px solid rgba(122, 107, 232, 0.14);
}

.admin-user-chip strong,
.admin-user-chip span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user-chip span {
  color: var(--muted);
  font-size: 0.86rem;
}

.admin-logout-form {
  margin: 0;
}

.admin-content {
  min-width: 0;
}

.admin-content-fluid {
  width: 100%;
}

.panel-card,
.stat-card,
.hero-panel,
.hub-hero,
.builder-topbar,
.builder-canvas,
.admin-header {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.panel-card,
.stat-card,
.dashboard-list-card,
.option-card,
.widget-picker-card,
.builder-widget-card,
.hub-mini-stat,
.builder-brand-card,
.dashboard-list-card,
.admin-page-grid article {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(252, 251, 255, 0.98));
}

.hero-panel,
.hub-hero,
.builder-canvas,
.builder-topbar,
.create-dashboard-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 249, 255, 0.98));
}

.panel-card,
.stat-card,
.option-card,
.dashboard-list-card,
.widget-picker-card,
.builder-widget-card,
.form-control,
.form-select,
.btn,
.table {
  color: var(--ink);
}

.form-control,
.form-select {
  background-color: #fcfbff;
  border-color: rgba(122, 107, 232, 0.14);
  color: var(--ink);
}

.form-control:focus,
.form-select:focus {
  background-color: #ffffff;
  color: var(--ink);
  border-color: rgba(117, 104, 228, 0.4);
  box-shadow: 0 0 0 0.2rem rgba(117, 104, 228, 0.12);
}

.form-select option {
  color: #6f6d76;
}

.btn-primary,
.inspire-primary-btn {
  background: linear-gradient(135deg, #7b6be8, #6d61d8);
  border-color: transparent;
  box-shadow: 0 10px 24px rgba(117, 104, 228, 0.2);
}

.btn-outline-dark,
.btn-light,
.btn-outline-secondary,
.inspire-ghost-btn,
.inspire-filter-btn,
.inspire-filter-btn-outline {
  background: #ffffff;
  border-color: rgba(122, 107, 232, 0.16);
  color: #7b6be8;
}

.btn-outline-danger {
  border-color: rgba(239, 140, 168, 0.45);
  color: #d96b93;
}

.table-dark {
  --bs-table-bg: #ffffff;
  --bs-table-striped-bg: #faf8ff;
  --bs-table-hover-bg: #f2eeff;
  --bs-table-color: #6f6d76;
  --bs-table-border-color: rgba(122, 107, 232, 0.1);
}

.eyebrow,
.stat-label {
  color: #9c97aa;
}

.hero-copy,
.muted-copy,
.option-card p,
.dashboard-list-card p,
.hub-kicker,
.builder-widget-heading p,
.widget-config-panel summary,
.builder-brand-card p,
.field-label,
.footer,
.admin-sidebar-card p {
  color: var(--muted) !important;
}

.dashboard-list-card:hover,
.dashboard-list-card.is-active,
.builder-widget-card:hover {
  border-color: rgba(117, 104, 228, 0.2);
  box-shadow: 0 16px 30px rgba(145, 140, 170, 0.18);
}

.builder-canvas {
  background:
    linear-gradient(rgba(202, 196, 233, 0.3) 1px, transparent 1px),
    linear-gradient(90deg, rgba(202, 196, 233, 0.3) 1px, transparent 1px),
    linear-gradient(180deg, #f8f7fc 0%, #ffffff 100%);
  background-size: 24px 24px, 24px 24px, 100% 100%;
}

.dashboard-toast {
  margin: 0 0 1rem;
}

.admin-page-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin: 1rem 0 2rem;
}

.auth-body {
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 20%, rgba(123, 107, 232, 0.18), transparent 26%),
    radial-gradient(circle at 80% 15%, rgba(140, 231, 184, 0.18), transparent 22%),
    linear-gradient(180deg, #ececef 0%, #f8f7fc 100%);
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 2rem;
}

.auth-card {
  width: min(520px, 100%);
  padding: 2rem;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(122, 107, 232, 0.14);
  box-shadow: 0 28px 70px rgba(125, 121, 147, 0.22);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.auth-brand img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  border-radius: 22px;
  background: #f6f3ff;
  padding: 0.6rem;
}

.auth-brand h1 {
  margin: 0.35rem 0 0;
}

.auth-help {
  margin: 1rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.access-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.75fr) minmax(0, 1.25fr);
  gap: 1rem;
  align-items: start;
}

.access-user-select {
  margin-bottom: 1rem;
}

.access-section {
  display: grid;
  gap: 0.65rem;
}

.access-section h3 {
  margin: 0;
  font-size: 1.05rem;
}

.access-option-list {
  max-height: 330px;
  overflow: auto;
  display: grid;
  gap: 0.45rem;
  padding-right: 0.25rem;
}

.access-option {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.7rem 0.85rem;
  border-radius: 14px;
  border: 1px solid rgba(122, 107, 232, 0.12);
  background: #fcfbff;
}

.access-option input {
  width: 18px;
  height: 18px;
  accent-color: #7568e4;
}

body.dashboard-mode .admin-sidebar {
  display: none;
}

body.dashboard-mode .admin-shell {
  grid-template-columns: 1fr;
}

body.dashboard-mode .admin-main {
  padding: 0;
}

body.dashboard-mode .admin-header,
body.dashboard-mode .footer {
  display: none;
}

body.dashboard-mode .admin-content {
  padding: 0;
}

@media (max-width: 991.98px) {
  .admin-shell,
  .admin-page-grid,
  .access-grid {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
    height: auto;
  }

  .admin-header,
  .admin-header-actions {
    flex-direction: column;
    align-items: stretch;
  }
}

.builder-grid {
  grid-auto-flow: row dense;
  align-items: stretch;
}

.builder-widget-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 460px;
  overflow: hidden;
}

.builder-widget-toolbar {
  align-items: flex-start;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.builder-widget-heading {
  min-width: 0;
  flex: 1 1 auto;
}

.builder-widget-heading h3 {
  line-height: 1.25;
  word-break: break-word;
}

.builder-widget-heading p {
  margin: 0;
  line-height: 1.4;
}

.builder-widget-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.drag-handle,
.widget-span-select {
  height: 38px;
}

.widget-span-select {
  width: 132px;
}

.dashboard-widget-canvas {
  display: block;
  flex: 1 1 auto;
  min-height: 280px;
  margin-top: 1rem;
}

.widget-config-panel {
  margin-top: 1rem;
}

.widget-config-panel[open] {
  margin-top: 1.25rem;
}

.widget-config-panel summary {
  list-style: none;
}

.widget-config-panel summary::-webkit-details-marker {
  display: none;
}

.builder-widget-card .builder-editor-grid,
.builder-widget-card .builder-widget-picker {
  align-items: start;
}

body.is-exporting-dashboard .builder-widget-actions {
  display: none !important;
}

body.is-exporting-dashboard .builder-canvas-head {
  display: none;
}

body.is-exporting-dashboard .builder-widget-card {
  cursor: default;
  break-inside: avoid;
}

body.is-exporting-dashboard .builder-canvas {
  box-shadow: none;
}

.builder-gear-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.widget-settings-trigger {
  width: 38px;
  padding: 0;
}

.builder-modal-content {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.99), rgba(250, 249, 255, 0.99));
  border: 1px solid rgba(122, 107, 232, 0.14);
  box-shadow: 0 24px 60px rgba(145, 140, 170, 0.2);
  color: var(--ink);
}

.builder-modal-header {
  align-items: start;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.builder-modal-header h2 {
  margin: 0.35rem 0 0;
}

.builder-modal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.builder-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.25rem;
}

.builder-modal-actions-end {
  justify-content: flex-end;
}

.builder-inline-delete-form {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

@media (max-width: 991.98px) {
  .builder-widget-card {
    min-height: auto;
  }

  .builder-modal-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-widget-canvas {
    min-height: 250px;
  }

  .widget-span-select {
    width: 100%;
  }
}
