/* Local Inter Font Declarations */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('fonts/Inter-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('fonts/Inter-Regular.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('fonts/Inter-Medium.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('fonts/Inter-SemiBold.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('fonts/Inter-Bold.woff2') format('woff2');
}

/* Local Outfit Font Declarations */
@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/Outfit-LatinExt.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('fonts/Outfit-Latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Fonts - Defaulting to local Inter */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-size-base: 14px;
  --font-size-header: 16px;
  --font-size-title: 18px;
  --font-weight-title: 600;
  --table-font-family: "Roboto", sans-serif;
  --table-font-size: 12px;
  --table-cell-padding: 4px;
  --table-border-color: #e2e8f0;
  --table-border-radius: 8px;
  
  /* Fixed PI accent */
  --pi-accent-color: #e50046;

  /* Primary Theme Colors */
  --bg-color: #f3f5f8;
  --header-bg: #ffffff;
  --header-text: #2f3542;
  --header-border-color: #e2e8f0;
  --header-border-width: 1px;
  --header-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  --link-color: #272928;
  --link-icon-fill: #81818D;
  --link-hover-color: #313131;
  --navbar-icon-fill: var(--header-text);
  --navbar-icon-hover-color: var(--link-hover-color);
  --panel-bg: #ffffff;
  --panel-text: #2f3542;
  --chart-text-color: #2f3542;
  --panel-border-color: #e2e8f0;
  --settings-tab-bg: #e50046;
  --settings-tab-hover-bg: #f4f6f8;
  --settings-tab-radius: 8px;

  /* Button styles */
  --button-bg: #e50046;
  --button-text: #ffffff;
  --button-radius: 15px;
  --button-shadow: 0 4px 12px rgba(0, 0, 0, 0.16);
  --chart-button-bg: transparent;
  --chart-button-color: #e50046;
  --chart-button-border-color: #f06b94;
  --chart-button-hover-bg: #fce6ed;
  --chart-button-radius: 6px;
  
  /* Layout Dimensions & Spacing */
  --sidebar-width: 340px;
  --dashboard-canvas-min-width: 1420px;
  --dashboard-canvas-min-height: 820px;
  --dashboard-header-height: 50px;
  --dashboard-drawer-preview-width: clamp(230px, 18vw, 280px);
  --grid-gap: 16px;
  --panel-padding: 24px;
  --panel-header-padding-x: 24px;
  --panel-header-padding-top: 24px;
  --panel-radius: 16px;
  --panel-border-width: 0px;
  
  /* Shadow levels: none, soft, medium, strong */
  --panel-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 8px -1px rgba(0, 0, 0, 0.03);

  /* Derived dashboard drawer preview colors (kept in sync with the translator) */
  --drawer-preview-surface-bg: #ffffff;
  --drawer-preview-surface-text: #000000;
  --drawer-preview-soft-bg: #fafbfc;
  --drawer-preview-input-border: #dcdddf;
  --drawer-preview-action-color: #81818d;
  --drawer-preview-action-hover-color: #313131;
  --drawer-preview-link-hover-text: #313131;
  --drawer-preview-disabled-bg: #e5e7eb;
  --drawer-preview-disabled-text: #6b7280;
  --drawer-preview-button-hover-bg: #c6003c;

  /* Theme creator chrome */
  --customizer-accent-color: #e50046;
  --customizer-accent-shadow: rgba(229, 0, 70, 0.3);
  --customizer-font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  
  /* Chart Colors */
  --chart-color-1: #000000;
  --chart-color-2: #4a4a4a;
  --chart-color-3: #e54b3b;
  --chart-color-4: #d8005f;
  --chart-secondary-color-1: #8b5cf6;
  --chart-secondary-color-2: #06b6d4;
  --chart-secondary-color-3: #22c55e;
  --chart-secondary-color-4: #f59e0b;
  --chart-secondary-color-5: #ef4444;
  --chart-secondary-color-6: #64748b;
  --chart-secondary-color-7: #a855f7;
  --chart-secondary-color-8: #14b8a6;

  /* Login Page */
  --login-bg-color: #101010;
  --login-bg-image: none;
  --login-panel-bg: #ffffff;
  --login-panel-text: #2f3542;
  --login-panel-width: 356px;
  --login-panel-radius: 16px;
  --login-panel-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.05), 0 2px 8px -1px rgba(0, 0, 0, 0.03);
  --login-input-bg: #ffffff;
  --login-input-text: #2f3542;
  
  /* Title Alignment: left, center, right */
  --title-alignment: left;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Base SVG styling for self-contained icons */
svg {
  fill: currentColor;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

html {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
body {
  font-family: var(--font-family);
  font-size: 14px;
  background-color: var(--bg-color);
  color: var(--panel-text);
  display: flex;
  height: 100vh;
  overflow: hidden;
  transition: background-color 0.3s ease;
}

/* Sidebar Customizer Styling */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background-color: #1e2530;
  color: #ecf0f1;
  font-family: var(--customizer-font-family);
  font-size: 14px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid #2c3e50;
  flex-shrink: 0;
  z-index: 100;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.25);
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    margin-right 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    margin-bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar button,
.sidebar input,
.sidebar select,
.sidebar textarea {
  font-family: var(--customizer-font-family);
}

.sidebar.hidden {
  transform: translateX(-100%);
  margin-right: calc(-1 * var(--sidebar-width));
}

.floating-sidebar-toggle {
  position: fixed;
  top: 14px;
  left: 14px;
  z-index: 90;
  width: 38px;
  height: 38px;
  border: none;
  border-radius: 8px;
  background-color: var(--customizer-accent-color);
  color: #ffffff;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: var(--customizer-font-family);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  cursor: pointer;
}

.is-login-preview.sidebar-closed .floating-sidebar-toggle {
  display: flex;
}

.sidebar-header {
  padding: 20px;
  border-bottom: 1px solid #2c3e50;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-header h2 i,
.sidebar-header h2 svg {
  color: var(--customizer-accent-color);
}

.sidebar-preview-switcher {
  padding: 14px 20px;
  border-bottom: 1px solid #2c3e50;
  background-color: #1a1f29;
}

.sidebar-preview-switcher .preview-switcher {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border: 1px solid #4a5568;
  border-radius: 8px;
  background-color: #111722;
}

.sidebar-preview-switcher .preview-tab {
  height: 34px;
  color: #e2e8f0;
}

.sidebar-preview-switcher .preview-tab:hover {
  background-color: #2d3748;
  color: #ffffff;
}

.sidebar-preview-switcher .preview-tab.active {
  background-color: var(--customizer-accent-color);
  color: #ffffff;
}

.dashboard-panels-toggle {
  width: 100%;
  min-height: 38px;
  margin-top: 10px;
  padding: 0 10px 0 12px;
  border: 1px solid #4a5568;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.dashboard-panels-toggle:hover {
  background-color: #2d3748;
  border-color: #718096;
  color: #ffffff;
}

.dashboard-panels-toggle-label {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.dashboard-panels-toggle-track {
  position: relative;
  width: 32px;
  height: 18px;
  flex: 0 0 32px;
  border-radius: 9px;
  background: #4a5568;
  transition: background-color 0.2s ease;
}

.dashboard-panels-toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  transition: transform 0.2s ease;
}

.dashboard-panels-toggle[aria-checked="true"] {
  border-color: var(--customizer-accent-color);
  color: #ffffff;
}

.dashboard-panels-toggle[aria-checked="true"] .dashboard-panels-toggle-track {
  background: var(--customizer-accent-color);
}

.dashboard-panels-toggle[aria-checked="true"] .dashboard-panels-toggle-thumb {
  transform: translateX(14px);
}

.dashboard-panels-toggle:disabled {
  border-color: #364152;
  background: transparent;
  color: #718096;
  cursor: not-allowed;
  opacity: 0.62;
}

.dashboard-panels-toggle:disabled:hover {
  border-color: #364152;
  background: transparent;
  color: #718096;
}

.dashboard-panels-toggle:disabled .dashboard-panels-toggle-track {
  background: #364152;
}

.developer-preview-button {
  width: 100%;
  height: 34px;
  margin-top: 10px;
  border: 1px solid #4a5568;
  border-radius: 8px;
  background: transparent;
  color: #cbd5e0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.developer-preview-button:hover {
  background-color: #2d3748;
  border-color: #718096;
  color: #ffffff;
}

.developer-preview-button.active {
  background-color: color-mix(in srgb, var(--customizer-accent-color) 16%, #111722);
  border-color: var(--customizer-accent-color);
  color: #ffffff;
}

.close-sidebar-btn {
  background: none;
  border: none;
  color: #a0aec0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.close-sidebar-btn:hover {
  color: #ffffff;
}

/* Accordion sections */
.sidebar-scroll {
  flex-grow: 1;
  overflow-y: auto;
  padding: 15px;
}

.accordion-item {
  border-bottom: 1px solid #2c3e50;
  margin-bottom: 10px;
}

.accordion-header {
  width: 100%;
  background: none;
  border: none;
  color: #e2e8f0;
  padding: 12px 10px;
  text-align: left;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: color 0.2s, background-color 0.2s;
  border-radius: 6px;
}

.accordion-header:hover {
  background-color: #2d3748;
  color: #ffffff;
}

.accordion-header .chevron {
  transition: transform 0.2s;
}

.accordion-header.active .chevron {
  transform: rotate(180deg);
}

.accordion-content {
  --accordion-open-padding-top: 10px;
  --accordion-open-padding-bottom: 20px;
  max-height: 0;
  overflow: hidden;
  transition:
    max-height 0.25s ease,
    padding-top 0.25s ease,
    padding-bottom 0.25s ease;
  padding: 0 10px;
}

.accordion-content.open {
  max-height: 1000px;
  padding: var(--accordion-open-padding-top) 10px var(--accordion-open-padding-bottom) 10px;
}

/* Customizer Form Elements */
.form-group {
  margin-bottom: 15px;
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 0.82rem;
  color: #a0aec0;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-group.is-disabled-control {
  opacity: 0.48;
}

.form-group.is-disabled-control label,
.form-group.is-disabled-control .color-picker-group {
  cursor: not-allowed;
}

.control-subheading {
  margin: 18px 0 10px;
  padding-top: 14px;
  border-top: 1px solid #2d3748;
  color: #cbd5e0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.input-with-value {
  display: flex;
  align-items: center;
  gap: 12px;
}

.input-with-value input[type="range"] {
  flex-grow: 1;
}

.input-with-value span {
  font-size: 0.8rem;
  color: #e2e8f0;
  min-width: 36px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #4a5568;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--customizer-accent-color);
  cursor: pointer;
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 2px solid #2d3748;
  border-radius: 50%;
}

.color-picker-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.color-hex {
  font-size: 0.85rem;
  font-family: monospace;
  color: #cbd5e0;
}

select {
  width: 100%;
  padding: 8px 12px;
  background-color: #2d3748;
  border: 1px solid #4a5568;
  color: #fff;
  border-radius: 6px;
  outline: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color 0.2s;
}

select:focus {
  border-color: var(--customizer-accent-color);
}

.sidebar input[type="text"],
.sidebar input[type="url"] {
  width: 100%;
  padding: 8px 12px;
  background-color: #2d3748;
  border: 1px solid #4a5568;
  color: #fff;
  border-radius: 6px;
  outline: none;
  font-family: inherit;
  font-size: 0.88rem;
  transition: border-color 0.2s;
}

.sidebar input[type="text"]:focus,
.sidebar input[type="url"]:focus {
  border-color: var(--customizer-accent-color);
}

.sidebar input[type="text"]::placeholder,
.sidebar input[type="url"]::placeholder {
  color: #718096;
}

.is-hidden {
  display: none !important;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}

.checkbox-group input {
  cursor: pointer;
  accent-color: var(--customizer-accent-color);
  width: 16px;
  height: 16px;
}

/* Theme presets panel */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.preset-empty-state {
  grid-column: 1 / -1;
  margin: 0;
  color: #a0aec0;
  font-size: 0.82rem;
  line-height: 1.4;
}

.preset-empty-state-error {
  color: #fca5a5;
}

.preset-btn {
  background-color: #2d3748;
  border: 1px solid #4a5568;
  color: #e2e8f0;
  padding: 10px 8px;
  border-radius: 6px;
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}

.preset-btn:hover {
  border-color: #718096;
  background-color: #3a475a;
}

.preset-btn.active {
  background-color: var(--customizer-accent-color);
  border-color: var(--customizer-accent-color);
  color: #ffffff;
}

/* Sidebar Actions Footer */
.sidebar-footer {
  padding: 20px;
  border-top: 1px solid #2c3e50;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background-color: #1a1f29;
}

.theme-preflight-launch {
  width: 100%;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid #4a5568;
  border-radius: 7px;
  background: #111722;
  color: #e2e8f0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: center;
  gap: 9px;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.theme-preflight-launch:hover {
  background: #242d3b;
  border-color: #718096;
  color: #ffffff;
}

.theme-preflight-launch-icon,
.theme-preflight-launch-count {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #2d3748;
  color: #cbd5e0;
}

.theme-preflight-launch-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.theme-preflight-launch-title {
  color: inherit;
  font-size: 0.82rem;
  font-weight: 750;
}

.theme-preflight-launch-status {
  overflow: hidden;
  color: #a0aec0;
  font-size: 0.7rem;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-preflight-launch-count {
  background: #2d3748;
  font-size: 0.73rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.theme-preflight-launch[data-status="ready"] {
  border-color: #2f6f5b;
}

.theme-preflight-launch[data-status="ready"] .theme-preflight-launch-icon,
.theme-preflight-launch[data-status="ready"] .theme-preflight-launch-count {
  background: #173d32;
  color: #6ee7b7;
}

.theme-preflight-launch[data-status="warning"] {
  border-color: #806522;
}

.theme-preflight-launch[data-status="warning"] .theme-preflight-launch-icon,
.theme-preflight-launch[data-status="warning"] .theme-preflight-launch-count {
  background: #493a16;
  color: #fcd34d;
}

.theme-preflight-launch[data-status="error"] {
  border-color: #8d3e4a;
}

.theme-preflight-launch[data-status="error"] .theme-preflight-launch-icon,
.theme-preflight-launch[data-status="error"] .theme-preflight-launch-count {
  background: #4f2029;
  color: #fda4af;
}

.sidebar-footer-heading {
  color: #ffffff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.save-action-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  width: 100%;
}

.btn-primary {
  background-color: var(--customizer-accent-color);
  color: #ffffff;
  border: none;
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 4px 12px var(--customizer-accent-shadow);
}

.btn-secondary {
  background-color: #2d3748;
  color: #e2e8f0;
  border: 1px solid #4a5568;
}

.btn-secondary:hover {
  background-color: #3a475a;
  color: #ffffff;
}

.file-input-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
  width: 100%;
  cursor: pointer;
}

.file-input-wrapper input[type=file] {
  font-size: 100px;
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.file-input-wrapper input[type=file]::file-selector-button {
  cursor: pointer;
}

.image-upload-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
  gap: 8px;
  align-items: center;
}

.image-upload-btn,
.image-clear-btn {
  height: 36px;
  margin: 0;
}

.image-upload-btn {
  width: 100%;
}

.image-clear-btn {
  width: 40px;
  padding: 0;
}

.image-clear-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.image-file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.image-upload-status {
  display: block;
  margin-top: 7px;
  color: #a0aec0;
  font-size: 0.78rem;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Dashboard Panel Main Wrapper */
.dashboard-wrapper {
  flex-grow: 1;
  min-width: 0;
  height: 100vh;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.dashboard-panels-preview {
  position: absolute;
  inset: var(--dashboard-header-height) 0 0;
  z-index: 9;
  display: none;
  pointer-events: none;
}

.is-dashboard-panels-preview:not(.is-login-preview):not(.is-settings-preview):not(.is-css-preview) .dashboard-panels-preview {
  display: block;
}

.is-dashboard-panels-preview #dashboard-preview.active,
.is-dashboard-panels-preview #dashboard-b-preview.active {
  margin-left: var(--dashboard-drawer-preview-width);
  margin-right: var(--dashboard-drawer-preview-width);
}

.is-dashboard-panels-preview #dashboard-preview.active .dashboard-stage {
  width: 100%;
  min-width: 0;
}

.is-dashboard-panels-preview #dashboard-preview.active .dashboard-grid {
  grid-template-columns: minmax(0, 0.8fr) repeat(2, minmax(0, 1.25fr));
  min-width: 0;
}

.dashboard-drawer-preview {
  position: absolute;
  top: var(--grid-gap);
  bottom: var(--grid-gap);
  width: calc(var(--dashboard-drawer-preview-width) - var(--grid-gap));
  overflow: hidden;
  background: var(--panel-bg);
  color: var(--panel-text);
  border: var(--panel-border-width) solid var(--panel-border-color);
  border-radius: var(--panel-radius);
  box-shadow: var(--panel-shadow);
  box-sizing: border-box;
  pointer-events: auto;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
}

.dashboard-category-drawer-preview {
  left: var(--grid-gap);
  padding: var(--panel-padding);
}

.dashboard-pinned-objects-preview {
  right: var(--grid-gap);
  display: flex;
  flex-direction: column;
}

.dashboard-category-toolbar {
  min-height: 36px;
  padding: 4px 2px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px 28px;
  align-items: center;
  gap: 4px;
  box-sizing: border-box;
}

.dashboard-drawer-search {
  position: relative;
  min-width: 0;
}

.dashboard-drawer-search input {
  width: 100%;
  height: 24px;
  padding: 5px 30px 5px 10px;
  border: 1px solid var(--drawer-preview-input-border);
  border-radius: var(--button-radius);
  outline: none;
  background: var(--drawer-preview-soft-bg);
  color: var(--panel-text);
  box-shadow: none;
  box-sizing: border-box;
  font: inherit;
  font-size: calc(var(--font-size-base) * 0.86);
}

.dashboard-drawer-search input::placeholder {
  color: color-mix(in srgb, var(--panel-text) 62%, transparent);
}

.dashboard-drawer-search > i {
  position: absolute;
  top: 50%;
  right: 10px;
  color: var(--panel-text);
  transform: translateY(-50%);
  pointer-events: none;
}

.dashboard-drawer-icon-button,
.dashboard-pinned-add-button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: var(--button-radius);
  background: transparent;
  color: var(--drawer-preview-action-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  cursor: default;
}

.dashboard-drawer-icon-button:hover,
.dashboard-pinned-add-button:hover {
  background: transparent;
  color: var(--drawer-preview-action-hover-color);
}

.dashboard-category-list {
  padding: 4px 0 12px;
  display: flex;
  flex-direction: column;
}

.dashboard-category-row {
  width: 100%;
  min-height: 34px;
  padding: 6px 14px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--panel-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font: inherit;
  text-align: left;
  cursor: default;
}

.dashboard-category-row.is-child {
  padding-left: 28px;
  justify-content: flex-start;
}

.dashboard-category-row.is-child::before {
  content: "\f105";
  flex: 0 0 12px;
  width: 12px;
  color: currentColor;
  font-family: "Font Awesome 6 Free";
  font-size: 0.82em;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  opacity: 0.62;
  text-align: center;
}

.dashboard-category-row.is-child.is-parent > i {
  margin-left: auto;
}

.dashboard-category-row:hover {
  background: var(--drawer-preview-soft-bg);
  color: var(--drawer-preview-link-hover-text);
}

.dashboard-category-row.is-active {
  font-weight: 700;
}

.dashboard-category-row i {
  flex: 0 0 auto;
  color: currentColor;
  font-size: 0.8em;
}

.dashboard-pinned-header {
  min-height: 48px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--drawer-preview-action-color);
  box-sizing: border-box;
}

.dashboard-pinned-add-button {
  color: var(--button-bg);
  font-size: 1.12rem;
}

.dashboard-pinned-content {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 12px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: auto;
  background: var(--panel-bg);
  color: var(--panel-text);
}

.dashboard-filter-control {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--panel-text);
  font-size: calc(var(--font-size-base) * 0.84);
  font-weight: 600;
}

.dashboard-filter-control > button {
  width: 100%;
  min-height: 24px;
  padding: 5px 10px;
  border: 1px solid var(--drawer-preview-input-border);
  border-radius: var(--button-radius);
  background: var(--drawer-preview-soft-bg);
  color: var(--panel-text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: none;
  font: inherit;
  font-weight: 400;
  cursor: default;
}

.dashboard-pinned-footer {
  min-height: 44px;
  padding: 8px;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: end;
  gap: 36px;
  background: var(--drawer-preview-surface-bg);
}

.dashboard-pinned-footer button {
  min-height: 28px;
  padding: 6px;
  border: none;
  border-radius: var(--button-radius);
  font: inherit;
  font-weight: 700;
}

.dashboard-pinned-cancel-button {
  background: #ffffff;
  color: #000000;
  box-shadow: none;
}

.dashboard-pinned-apply-button {
  background: var(--button-bg);
  color: var(--button-text);
  box-shadow: var(--button-shadow);
}

.dashboard-pinned-footer button:disabled {
  background: var(--drawer-preview-disabled-bg);
  color: var(--drawer-preview-disabled-text);
  box-shadow: none;
  cursor: not-allowed;
}

/* Header styling */
.dashboard-header {
  height: var(--dashboard-header-height);
  min-height: var(--dashboard-header-height);
  max-height: var(--dashboard-header-height);
  flex: 0 0 var(--dashboard-header-height);
  background-color: var(--header-bg);
  border: none;
  border-bottom: var(--header-border-width) solid var(--header-border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px;
  z-index: 10;
  color: var(--header-text);
  box-shadow: var(--header-shadow);
  transition: all 0.3s ease;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
}

.toggle-sidebar-btn {
  background: none;
  border: none;
  color: var(--navbar-icon-fill);
  fill: var(--navbar-icon-fill);
  font-size: 1.25rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.toggle-sidebar-btn i,
.toggle-sidebar-btn svg {
  color: var(--navbar-icon-fill);
  fill: var(--navbar-icon-fill);
}

.toggle-sidebar-btn:hover {
  color: var(--navbar-icon-hover-color);
}

.toggle-sidebar-btn:hover i,
.toggle-sidebar-btn:hover svg {
  color: var(--navbar-icon-hover-color);
  fill: var(--navbar-icon-hover-color);
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.brand-logo-image {
  display: block;
  width: auto;
  max-width: 180px;
  max-height: 30px;
  object-fit: contain;
}

.brand-logo-image[hidden] {
  display: none;
}

.has-brand-logo .brand-logo-bars {
  display: none;
}

/* Red vertical bars matching Panintelligence logo */
.brand-logo-bars {
  display: flex;
  gap: 3px;
  align-items: flex-end;
  height: 20px;
}

.brand-logo-bars .bar {
  width: 4px;
  background-color: var(--pi-accent-color);
  border-radius: 1px;
  transition: background-color 0.3s ease;
}

.brand-logo-bars .bar1 { height: 12px; }
.brand-logo-bars .bar2 { height: 20px; }
.brand-logo-bars .bar3 { height: 16px; }

.header-title {
  font-size: 1.15rem;
  font-weight: 600;
  color: inherit;
}

.preview-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--panel-border-color);
  border-radius: 8px;
  background-color: rgba(0, 0, 0, 0.03);
  flex-shrink: 0;
}

.preview-tab {
  height: 30px;
  border: none;
  border-radius: 6px;
  padding: 0 10px;
  background: transparent;
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
  opacity: 0.72;
}

.preview-tab:hover {
  opacity: 1;
  color: var(--pi-accent-color);
}

.preview-tab.active {
  background-color: var(--pi-accent-color);
  color: #ffffff;
  opacity: 1;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.header-icon-btn {
  background: none;
  border: none;
  color: var(--navbar-icon-fill);
  fill: var(--navbar-icon-fill);
  opacity: 0.7;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.2s, color 0.2s;
  padding: 6px;
  border-radius: 4px;
}

.header-icon-btn i,
.header-icon-btn svg {
  color: var(--navbar-icon-fill);
  fill: var(--navbar-icon-fill);
}

.header-icon-btn:hover {
  opacity: 1;
  color: var(--navbar-icon-hover-color);
  background-color: transparent;
}

.header-icon-btn:hover i,
.header-icon-btn:hover svg {
  color: var(--navbar-icon-hover-color);
  fill: var(--navbar-icon-hover-color);
}

.is-login-preview .dashboard-header,
.is-settings-preview .dashboard-header,
.is-css-preview .dashboard-header {
  display: none;
}

/* Dashboard Scrollable Area */
.dashboard-content {
  flex-grow: 1;
  min-height: 0;
  min-width: 0;
  overflow: auto;
}

.preview-pane {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  display: none;
}

.dashboard-content.preview-pane.active {
  display: block;
}

.login-content.preview-pane.active,
.settings-content.preview-pane.active,
.css-content.preview-pane.active {
  display: flex;
}

.css-content {
  flex-direction: column;
  gap: 12px;
  padding: 18px;
  overflow: hidden;
  background-color: var(--bg-color);
  color: var(--panel-text);
}

.css-preview-toolbar {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.css-copy-btn,
.css-import-btn,
.css-export-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 14px;
  border: none;
  border-radius: 6px;
  background-color: var(--button-bg);
  color: var(--button-text);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--button-shadow);
}

.css-export-btn[data-preflight-status="warning"] {
  outline: 2px solid #f59e0b;
  outline-offset: 2px;
}

.css-export-btn[data-preflight-status="error"] {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

.theme-import-input {
  display: none;
}

.generated-css-output {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  resize: none;
  border: var(--panel-border-width) solid var(--panel-border-color);
  border-radius: min(var(--panel-radius), 8px);
  background-color: #111722;
  color: #e2e8f0;
  box-shadow: var(--panel-shadow);
  padding: 16px;
  font-family: Consolas, "Courier New", monospace;
  font-size: 13px;
  line-height: 1.55;
  outline: none;
  white-space: pre;
  overflow: auto;
}

/* Theme Preflight */
.theme-preflight-scrim {
  display: none;
}

.theme-preflight-drawer {
  position: fixed;
  z-index: 350;
  top: 0;
  right: 0;
  width: min(430px, calc(100vw - 48px));
  height: 100vh;
  border-left: 1px solid #d7dee8;
  background: #f8fafc;
  color: #172033;
  box-shadow: -16px 0 42px rgba(15, 23, 42, 0.18);
  display: flex;
  flex-direction: column;
  font-family: var(--customizer-font-family);
  transform: translateX(105%);
  visibility: hidden;
  transition: transform 0.24s cubic-bezier(0.4, 0, 0.2, 1), visibility 0s linear 0.24s;
}

.theme-preflight-drawer.is-open {
  transform: translateX(0);
  visibility: visible;
  transition-delay: 0s;
}

.theme-preflight-header {
  min-height: 78px;
  padding: 16px 18px;
  border-bottom: 1px solid #dfe5ed;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.theme-preflight-eyebrow {
  display: block;
  margin-bottom: 3px;
  color: #64748b;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.theme-preflight-header h2 {
  margin: 0;
  color: #172033;
  font-size: 1.1rem;
  font-weight: 800;
}

.theme-preflight-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-preflight-icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid #d7dee8;
  border-radius: 6px;
  background: #ffffff;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.theme-preflight-icon-button:hover:not(:disabled) {
  border-color: #94a3b8;
  background: #eef2f6;
  color: #0f172a;
}

.theme-preflight-icon-button:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.theme-preflight-summary {
  min-height: 92px;
  padding: 16px 18px;
  border-bottom: 1px solid #dfe5ed;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  background: #ffffff;
}

.theme-preflight-summary-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #475569;
  font-size: 1rem;
}

.theme-preflight-summary[data-status="ready"] .theme-preflight-summary-icon {
  background: #d1fae5;
  color: #047857;
}

.theme-preflight-summary[data-status="warning"] .theme-preflight-summary-icon {
  background: #fef3c7;
  color: #a16207;
}

.theme-preflight-summary[data-status="error"] .theme-preflight-summary-icon {
  background: #fee2e2;
  color: #b91c1c;
}

.theme-preflight-summary-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.theme-preflight-summary-copy strong {
  color: #172033;
  font-size: 0.92rem;
}

.theme-preflight-summary-copy span {
  color: #64748b;
  font-size: 0.75rem;
  line-height: 1.35;
}

.theme-preflight-score {
  min-width: 42px;
  color: #172033;
  font-size: 1.35rem;
  font-weight: 850;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.theme-preflight-score::after {
  content: "%";
  color: #64748b;
  font-size: 0.64rem;
  font-weight: 700;
}

.theme-preflight-metrics {
  min-height: 44px;
  border-bottom: 1px solid #dfe5ed;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #f8fafc;
}

.theme-preflight-metrics span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #64748b;
  font-size: 0.72rem;
}

.theme-preflight-metrics span + span {
  border-left: 1px solid #dfe5ed;
}

.theme-preflight-metrics strong {
  color: #172033;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.theme-preflight-filters {
  min-height: 44px;
  padding: 0 14px;
  border-bottom: 1px solid #dfe5ed;
  display: flex;
  align-items: flex-end;
  gap: 16px;
  background: #ffffff;
}

.theme-preflight-filter {
  min-height: 43px;
  padding: 0 2px;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #64748b;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 750;
  cursor: pointer;
}

.theme-preflight-filter:hover {
  color: #172033;
}

.theme-preflight-filter.active {
  border-bottom-color: var(--customizer-accent-color);
  color: #172033;
}

.theme-preflight-results {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  background: #ffffff;
}

.theme-preflight-result {
  padding: 15px 18px;
  border-bottom: 1px solid #e2e8f0;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 11px;
}

.theme-preflight-result-status {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #64748b;
  font-size: 0.7rem;
}

.theme-preflight-result[data-severity="error"] .theme-preflight-result-status {
  background: #fee2e2;
  color: #b91c1c;
}

.theme-preflight-result[data-severity="warning"] .theme-preflight-result-status {
  background: #fef3c7;
  color: #a16207;
}

.theme-preflight-result[data-severity="pass"] .theme-preflight-result-status {
  background: #d1fae5;
  color: #047857;
}

.theme-preflight-result-copy {
  min-width: 0;
}

.theme-preflight-result-category {
  display: block;
  margin-bottom: 3px;
  color: #64748b;
  font-size: 0.64rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.theme-preflight-result-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  color: #172033;
  font-size: 0.84rem;
  font-weight: 800;
}

.theme-preflight-result-value {
  flex: 0 0 auto;
  color: #475569;
  font-size: 0.7rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.theme-preflight-result-description {
  margin-top: 5px;
  color: #64748b;
  font-size: 0.74rem;
  line-height: 1.45;
}

.theme-preflight-result-actions {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.theme-preflight-result-action {
  min-height: 29px;
  padding: 0 9px;
  border: 1px solid #cbd5e1;
  border-radius: 5px;
  background: #ffffff;
  color: #334155;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 0.69rem;
  font-weight: 750;
  cursor: pointer;
}

.theme-preflight-result-action:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
  color: #0f172a;
}

.theme-preflight-result-action.is-fix {
  border-color: #9f1239;
  color: #9f1239;
}

.theme-preflight-result-action.is-fix:hover {
  background: #fff1f2;
}

.theme-preflight-empty {
  min-height: 220px;
  padding: 36px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #64748b;
  text-align: center;
}

.theme-preflight-empty i {
  color: #059669;
  font-size: 1.35rem;
}

.theme-preflight-empty strong {
  color: #172033;
  font-size: 0.88rem;
}

.theme-preflight-empty span {
  max-width: 270px;
  font-size: 0.74rem;
  line-height: 1.45;
}

.theme-preflight-footer {
  min-height: 66px;
  padding: 12px 16px;
  border-top: 1px solid #dfe5ed;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 9px;
  background: #f8fafc;
}

.theme-preflight-secondary-action,
.theme-preflight-danger-action {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: pointer;
}

.theme-preflight-secondary-action {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
}

.theme-preflight-secondary-action:hover {
  background: #eef2f6;
}

.theme-preflight-danger-action {
  border: 1px solid #b91c1c;
  background: #b91c1c;
  color: #ffffff;
}

.theme-preflight-danger-action:hover {
  background: #991b1b;
}

.theme-preflight-danger-action[hidden] {
  display: none;
}

.preflight-preview-highlight {
  outline: 3px solid #f59e0b !important;
  outline-offset: 4px;
  animation: preflight-highlight-pulse 1.2s ease-in-out 2;
}

.preflight-control-highlight {
  border-left: 3px solid #f59e0b;
  padding-left: 9px;
  background: rgba(245, 158, 11, 0.08);
  animation: preflight-control-pulse 1.2s ease-in-out 2;
}

@keyframes preflight-highlight-pulse {
  0%, 100% { outline-color: rgba(245, 158, 11, 0.72); }
  50% { outline-color: #f59e0b; }
}

@keyframes preflight-control-pulse {
  0%, 100% { background-color: rgba(245, 158, 11, 0.08); }
  50% { background-color: rgba(245, 158, 11, 0.18); }
}

@media (prefers-reduced-motion: reduce) {
  .theme-preflight-drawer,
  .preflight-preview-highlight,
  .preflight-control-highlight {
    animation: none;
    transition: none;
  }
}

/* Settings Screen Preview */
.settings-content {
  overflow: auto;
  padding: 18px;
  background-color: var(--bg-color);
  color: var(--panel-text);
}

.settings-shell {
  width: 100%;
  min-width: 980px;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-color);
  color: var(--panel-text);
  font-family: var(--font-family);
}

.settings-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 36px;
  padding: 0 8px 10px;
  gap: 16px;
}

.settings-breadcrumbs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: color-mix(in srgb, var(--panel-text) 78%, transparent);
  font-size: 0.86rem;
  font-weight: 600;
}

.settings-breadcrumbs i {
  font-size: 0.62rem;
  opacity: 0.65;
}

.settings-back-button,
.settings-danger-button,
.settings-main-card-header button,
.settings-editor-toolbar button,
.settings-add-tab,
.settings-menu-tab {
  border: 1px solid color-mix(in srgb, var(--panel-border-color) 80%, transparent);
  background: transparent;
  color: var(--link-color);
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
}

.settings-back-button {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 6px;
}

.settings-primary-tabs,
.settings-open-tabs {
  display: flex;
  align-items: flex-end;
  min-height: 36px;
  gap: 5px;
  padding: 4px 6px 0;
  border-bottom: 1px solid var(--panel-border-color);
  background-color: color-mix(in srgb, var(--panel-bg) 94%, var(--bg-color));
  overflow-x: auto;
  overflow-y: hidden;
}

.settings-primary-tab,
.settings-open-tab {
  min-height: 31px;
  border: 1px solid transparent;
  border-bottom-color: transparent;
  border-radius: var(--settings-tab-radius) var(--settings-tab-radius) 0 0;
  padding: 0 14px;
  background: transparent;
  color: color-mix(in srgb, var(--panel-text) 76%, transparent);
  font-family: inherit;
  font-size: 0.84rem;
  font-weight: 700;
  white-space: nowrap;
}

.settings-primary-tab:hover,
.settings-open-tab:hover {
  background: var(--settings-tab-hover-bg);
  color: var(--panel-text);
  border-color: var(--panel-border-color);
  border-bottom-color: transparent;
}

.settings-primary-tab.is-active,
.settings-open-tab.is-active,
.settings-primary-tab.is-active:hover,
.settings-open-tab.is-active:hover {
  background: color-mix(in srgb, var(--panel-bg) 94%, var(--bg-color)) !important;
  color: var(--settings-tab-bg) !important;
  border-color: var(--panel-border-color) !important;
  border-top-color: var(--panel-border-color) !important;
  border-bottom-color: color-mix(in srgb, var(--panel-bg) 94%, var(--bg-color)) !important;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--panel-bg) 94%, var(--bg-color)) !important;
  cursor: default;
}

.settings-workspace {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(230px, 280px) minmax(0, 1fr);
  border: 1px solid var(--panel-border-color);
  border-top: none;
  background: var(--bg-color);
  box-shadow: var(--panel-shadow);
}

.settings-list-panel {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  border: none;
  border-radius: 0;
  box-sizing: border-box;
  background: var(--panel-bg);
  overflow: hidden;
}

.settings-list-title {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid var(--panel-border-color);
  font-weight: 800;
}

.settings-list-item {
  min-height: 34px;
  border: none;
  border-bottom: 1px solid color-mix(in srgb, var(--panel-border-color) 38%, transparent);
  background: transparent;
  color: var(--panel-text);
  padding: 0 12px;
  text-align: left;
  font-family: inherit;
  font-weight: 650;
}

.settings-list-item.is-child {
  padding-left: 26px;
}

.settings-list-item.is-active {
  background: color-mix(in srgb, var(--settings-tab-bg) 14%, var(--panel-bg));
  color: var(--panel-text);
}

.settings-list-footer {
  margin-top: auto;
  padding: 10px;
  border-top: 1px solid var(--panel-border-color);
  background: color-mix(in srgb, var(--panel-bg) 94%, var(--bg-color));
}

.settings-danger-button {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 6px;
  color: var(--link-hover-color);
}

.settings-editor-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel-bg);
}

.settings-open-tabs {
  padding-left: 8px;
}

.settings-add-tab,
.settings-menu-tab,
.settings-editor-toolbar button,
.settings-main-card-header button {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  flex: 0 0 auto;
}
.settings-add-tab:hover,
.settings-menu-tab:hover,
.settings-editor-toolbar button:hover,
.settings-main-card-header button:hover {
  background: transparent;
  color: var(--link-hover-color);
  border-color: var(--link-hover-color);
}

.settings-open-tab {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 190px;
}

.settings-menu-tab {
  margin-left: auto;
}

.settings-editor-toolbar {
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 0 10px;
  border-bottom: 1px solid var(--panel-border-color);
  background: color-mix(in srgb, var(--panel-bg) 96%, var(--bg-color));
}

.settings-editor-body {
  min-height: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr);
}

.settings-details-card,
.settings-main-card {
  min-width: 0;
  padding: 14px;
}

.settings-details-card {
  border-right: 1px solid var(--panel-border-color);
  background: color-mix(in srgb, var(--panel-bg) 96%, var(--bg-color));
}

.settings-details-card h3,
.settings-main-card h3 {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 800;
}

.settings-details-card h3 {
  margin-bottom: 16px;
}

.settings-details-card label {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
  color: color-mix(in srgb, var(--panel-text) 74%, transparent);
  font-size: 0.74rem;
  font-weight: 800;
}

.settings-details-card input,
.settings-details-card select {
  min-height: 32px;
  border: 1px solid var(--panel-border-color);
  border-radius: 6px;
  background: var(--panel-bg);
  color: var(--panel-text);
  padding: 0 9px;
  font-family: inherit;
  font-size: 0.86rem;
}

.settings-main-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.settings-object-grid {
  border: 1px solid var(--panel-border-color);
  border-radius: 8px;
  overflow: hidden;
}

.settings-object-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 110px 80px;
  min-height: 38px;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-bottom: 1px solid color-mix(in srgb, var(--panel-border-color) 70%, transparent);
  font-size: 0.84rem;
}

.settings-object-row:last-child {
  border-bottom: none;
}

.settings-object-row.is-header {
  background: color-mix(in srgb, var(--panel-bg) 90%, var(--bg-color));
  color: color-mix(in srgb, var(--panel-text) 76%, transparent);
  font-weight: 800;
}

@media (max-width: 980px) {
  .settings-shell {
    min-width: 760px;
  }

  .settings-workspace,
  .settings-editor-body {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}
/* Login Page Preview */
.login-content {
  overflow: auto;
  position: relative;
  padding: 0;
  background-color: var(--login-bg-color);
  background-image: var(--login-bg-image);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transition: background-color 0.3s ease;
}

.login-stage {
  position: relative;
  width: 100%;
  min-height: 100%;
  padding: clamp(38px, 7vh, 70px) clamp(24px, 5vw, 80px) 44px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(34px, 5vh, 58px);
  margin: 0;
}

.login-content[data-login-horizontal="left"] .login-stage {
  align-items: flex-start;
}

.login-content[data-login-horizontal="right"] .login-stage {
  align-items: flex-end;
}

.login-content[data-login-vertical="top"] .login-stage {
  justify-content: flex-start;
}

.login-content[data-login-vertical="bottom"] .login-stage {
  justify-content: flex-end;
}

.login-logo {
  width: min(100%, var(--login-panel-width));
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-logo:not(.has-custom-logo) {
  position: absolute;
  top: 18px;
  left: 50%;
  width: min(460px, calc(100% - 48px));
  min-height: 72px;
  transform: translateX(-50%);
}

.login-content[data-login-horizontal="left"] .login-logo:not(.has-custom-logo) {
  left: auto;
  right: 24px;
  width: min(260px, calc(100% - 48px));
  transform: none;
}

.login-content[data-login-horizontal="right"] .login-logo:not(.has-custom-logo) {
  left: 24px;
  right: auto;
  width: min(260px, calc(100% - 48px));
  transform: none;
}

.login-logo-image {
  display: block;
  width: auto;
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.login-logo-image[hidden] {
  display: none;
}

.login-logo-placeholder {
  width: 100%;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  border: 1px dashed rgba(255, 255, 255, 0.48);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
}

.login-logo.has-custom-logo .login-logo-placeholder {
  display: none;
}

.login-card {
  width: min(100%, var(--login-panel-width));
  background-color: var(--login-panel-bg);
  color: var(--login-panel-text);
  border: var(--panel-border-width) solid var(--panel-border-color);
  border-radius: var(--login-panel-radius);
  box-shadow: var(--login-panel-shadow);
  padding: var(--panel-padding);
  display: flex;
  flex-direction: column;
  gap: 18px;
  transition: background-color 0.3s ease, border-radius 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.login-field {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-field label {
  color: var(--login-panel-text);
  font-size: calc(var(--font-size-base) * 0.78);
  font-weight: 500;
}

.login-field input {
  width: 100%;
  height: 28px;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--panel-border-color);
  color: var(--login-input-text);
  font-family: inherit;
  font-size: var(--font-size-base);
  outline: none;
  pointer-events: none;
}

.login-content[data-login-input-style="filled"] .login-field input {
  height: 36px;
  padding: 4px 8px;
  box-sizing: border-box;
  background: var(--login-input-bg);
  border-bottom: none;
  border-radius: 4px;
}

.login-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: -6px;
}

.login-submit {
  border: none;
  border-radius: var(--button-radius);
  background-color: var(--button-bg);
  color: var(--button-text);
  min-height: 30px;
  padding: 0 18px;
  font-family: inherit;
  font-size: calc(var(--font-size-base) * 0.86);
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--button-shadow);
  transition: background-color 0.3s ease, color 0.3s ease, border-radius 0.3s ease, box-shadow 0.3s ease;
}

.login-card-footer {
  border-radius: 12px;
  background: color-mix(in srgb, var(--login-panel-bg) 92%, var(--login-panel-text));
  color: var(--login-panel-text);
  padding: 13px 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login-forgotten {
  color: var(--link-color);
  font-size: calc(var(--font-size-base) * 0.95);
  text-decoration: none;
}

.login-forgotten:hover {
  color: var(--link-hover-color);
}

.login-language-control {
  width: 100%;
  min-height: 28px;
  border: none;
  border-bottom: 1px solid var(--panel-border-color);
  background: transparent;
  color: var(--login-panel-text);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  font-family: inherit;
  font-size: calc(var(--font-size-base) * 0.95);
  cursor: pointer;
  text-align: left;
}

.login-language-control span {
  flex: 1;
}

/* Dashboard Stage */
.dashboard-stage {
  padding: var(--grid-gap);
  width: 100%;
  min-width: 0;
  min-height: max(100%, calc(var(--dashboard-canvas-min-height) + (var(--grid-gap) * 2)));
  box-sizing: border-box;
}
/* Main CSS Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) repeat(2, minmax(0, 1.25fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: var(--grid-gap);
  width: 100%;
  height: max(var(--dashboard-canvas-min-height), calc(100vh - var(--dashboard-header-height) - (var(--grid-gap) * 2)));
  min-width: 0;
  min-height: var(--dashboard-canvas-min-height);
  box-sizing: border-box;
}

.dashboard-grid > * {
  min-width: 0;
}

/* 2x2 Subgrid for KPI cards */
.kpi-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: var(--grid-gap);
  height: 100%;
  min-width: 0;
}

.panel-card {
  background-color: var(--panel-bg);
  border-radius: var(--panel-radius);
  border: var(--panel-border-width) solid var(--panel-border-color);
  box-shadow: var(--panel-shadow);
  padding: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  transition: background-color 0.3s ease, border-radius 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Card toolbar and headers */
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  flex: 0 0 auto;
  padding: var(--panel-header-padding-top) var(--panel-header-padding-x) 0;
  margin-bottom: 0;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.panel-title-wrapper {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--panel-text);
  flex-grow: 1;
  min-width: 0;
  justify-content: flex-start;
}

.panel-title-icon {
  flex: 0 0 auto;
  line-height: 1.15;
  color: var(--link-icon-fill);
  fill: var(--link-icon-fill);
  opacity: 0.6;
}

.panel-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: calc(var(--font-size-title) * 0.82);
  font-weight: var(--font-weight-title);
  line-height: 1.14;
  color: inherit;
  text-align: var(--title-alignment);
  overflow: hidden;
}

.panel-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  opacity: 1;
  transition: opacity 0.2s ease;
}

.panel-card:hover .panel-toolbar {
  opacity: 1;
}

.panel-btn {
  background: none;
  border: none;
  color: var(--link-color);
  fill: var(--link-icon-fill);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.panel-btn i,
.panel-btn svg {
  color: var(--link-icon-fill);
  fill: var(--link-icon-fill);
}

.panel-btn:hover {
  color: var(--link-hover-color);
}

.panel-btn:hover i,
.panel-btn:hover svg {
  color: var(--link-hover-color);
  fill: var(--link-hover-color);
}

.panel-content {
  flex: 1 1 0;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: stretch;
  position: relative;
  overflow: hidden;
}

.panel-card:not(.kpi-card) > .panel-content {
  box-sizing: border-box;
  padding: clamp(8px, calc(var(--panel-padding) * 0.36), 15px) var(--panel-padding) var(--panel-padding);
}

/* KPI Card Specifics */
.kpi-card {
  padding: 16px;
  justify-content: space-between;
  overflow: hidden;
}

.kpi-card .panel-header {
  padding: 0;
  margin-bottom: 0;
}

.kpi-card .panel-content {
  justify-content: center;
}

.kpi-header-left {
  display: flex;
  align-items: center;
  margin-bottom: 2px;
}

.kpi-arrow-down {
  margin-right: 4px;
  color: #e54b3b;
}

.kpi-value-wrapper {
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  max-width: 100%;
  min-width: 0;
  margin: 4px 0;
  overflow: hidden;
}

.kpi-value {
  display: inline-block;
  font-size: calc(var(--font-size-base) * 2.25);
  font-weight: 700;
  line-height: 1;
  color: var(--panel-text);
  white-space: nowrap;
}

.kpi-value.green-value {
  color: #10b981; /* Green color for £ value in dashboard */
}

.kpi-label {
  font-size: calc(var(--font-size-base) * 0.95);
  line-height: 1.18;
  color: var(--panel-text);
  opacity: 0.7;
  font-weight: 500;
}

.kpi-footer-link {
  font-size: calc(var(--font-size-base) * 0.85);
  line-height: 1.18;
  margin-top: 4px;
  color: var(--panel-text);
  opacity: 0.8;
}

.kpi-footer-link a {
  color: var(--link-color);
  text-decoration: underline;
  cursor: pointer;
}

.kpi-footer-link a:hover {
  color: var(--link-hover-color);
}

/* Chart Canvas Wrapper */
.chart-container {
  position: relative;
  width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1 1 0;
  overflow: hidden;
}

.chart-container canvas {
  max-width: 100%;
  max-height: 100%;
}
.live-chart {
  display: none !important;
}

.chart-link-button-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.chart-link-button {
  appearance: none;
  border: 1px solid var(--chart-button-border-color);
  border-radius: var(--chart-button-radius);
  background: var(--chart-button-bg);
  color: var(--chart-button-color);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 26px;
  padding: 3px 10px;
  font-family: var(--font-family);
  font-size: calc(var(--font-size-base) * 0.85);
  font-weight: 700;
  line-height: 18px;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.chart-link-button:hover,
.chart-link-button:focus-visible {
  background: var(--chart-button-hover-bg);
  border-color: var(--chart-button-color);
  color: var(--chart-button-color);
  outline: none;
}

.chart-container-fit {
  flex: 1 1 0;
  height: 100%;
  min-height: 0;
}

.chart-container-large {
  height: 100%;
  min-height: 0;
}

.table-preview-wrapper {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--table-border-color);
  border-radius: var(--table-border-radius);
  background: var(--panel-bg);
}

.preview-data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--panel-text);
  font-family: var(--table-font-family);
  font-size: var(--table-font-size);
  line-height: 1.35;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

.preview-data-table th,
.preview-data-table td {
  padding: var(--table-cell-padding) calc(var(--table-cell-padding) * 2);
  border-bottom: 1px solid color-mix(in srgb, var(--table-border-color) 82%, transparent);
  white-space: nowrap;
  vertical-align: middle;
}

.preview-data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: color-mix(in srgb, var(--panel-bg) 90%, var(--panel-text));
  color: var(--panel-text);
  font-weight: 700;
  text-align: left;
}

.preview-data-table tbody tr:nth-child(even) {
  background: color-mix(in srgb, var(--panel-bg) 97%, var(--panel-text));
}

.preview-data-table tbody tr:hover {
  background: color-mix(in srgb, var(--panel-bg) 91%, var(--panel-text));
}

.preview-data-table th:nth-child(n+3),
.preview-data-table td:nth-child(n+3) {
  text-align: right;
}

.preview-data-table tbody tr:last-child td {
  border-bottom: none;
}


/* Dashboard B: operational dashboard preview */
.dashboard-b-content {
  background-color: var(--bg-color);
  color: var(--panel-text);
}

.dashboard-b-stage {
  padding: var(--grid-gap);
  width: 100%;
  min-width: min(100%, 1120px);
  min-height: max(100%, calc(var(--dashboard-canvas-min-height) + (var(--grid-gap) * 2)));
  box-sizing: border-box;
}

.dashboard-b-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(260px, 1fr);
  gap: var(--grid-gap);
  width: 100%;
  min-width: min(100%, 1120px);
  min-height: var(--dashboard-canvas-min-height);
  height: max(var(--dashboard-canvas-min-height), calc(100vh - var(--dashboard-header-height) - (var(--grid-gap) * 2)));
  box-sizing: border-box;
}

.dashboard-b-grid > * {
  min-width: 0;
}

.dashboard-b-kpi,
.dashboard-b-chart {
  color: var(--panel-text);
}

.dashboard-b-kpi-leads,
.dashboard-b-wide-chart,
.dashboard-b-donut-card,
.dashboard-b-email-chart {
  grid-column: span 4;
}

.dashboard-b-kpi-handovers,
.dashboard-b-small-donut-card,
.dashboard-b-kpi-mql,
.dashboard-b-kpi-sql {
  grid-column: span 3;
}

.dashboard-b-kpi-emails,
.dashboard-b-kpi-recipients {
  grid-column: span 4;
}


.dashboard-b-kpi .dashboard-b-kpi-header {
  align-items: flex-start;
  padding-bottom: 0;
}

.dashboard-b-kpi .panel-toolbar {
  opacity: 1;
}
.dashboard-b-kpi-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2vh, 22px);
  padding: var(--panel-padding);
  text-align: center;
}

.dashboard-b-kpi-icon {
  color: var(--chart-color-1);
  font-size: clamp(54px, 7vw, 104px);
  line-height: 1;
}

.dashboard-b-kpi-label {
  color: var(--chart-color-1);
  font-size: calc(var(--font-size-base) * 1.1);
  font-weight: 800;
  line-height: 1.15;
}

.dashboard-b-kpi-value {
  color: var(--chart-color-1);
  font-size: clamp(38px, 4.3vw, 72px);
  font-weight: 800;
  line-height: 0.95;
  font-variant-numeric: tabular-nums;
}

.dashboard-b-chart .panel-header {
  padding-bottom: 0;
}

.dashboard-b-chart .panel-title {
  font-size: calc(var(--font-size-title) * 0.72);
  white-space: normal;
}

.dashboard-b-chart-content {
  justify-content: center;
}

.dashboard-b-horizontal-chart {
  --dashboard-b-axis-color: color-mix(in srgb, var(--panel-text) 14%, transparent);
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 2px 6px 0;
  box-sizing: border-box;
}

.dashboard-b-bar-row {
  display: grid;
  grid-template-columns: minmax(130px, 38%) minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 0;
  color: var(--panel-text);
  font-size: clamp(8px, calc(var(--font-size-base) * 0.68), 11px);
  line-height: 1.1;
}

.dashboard-b-bar-row > span {
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dashboard-b-bar-row > div {
  position: relative;
  min-width: 0;
  height: 100%;
  min-height: 12px;
  display: flex;
  align-items: center;
  background-image: repeating-linear-gradient(
    to right,
    transparent 0,
    transparent calc(20% - 1px),
    var(--dashboard-b-axis-color) calc(20% - 1px),
    var(--dashboard-b-axis-color) 20%
  );
}

.dashboard-b-bar-row b {
  display: block;
  height: min(100%, 22px);
  min-width: 2px;
  border-radius: 0 3px 3px 0;
  background: var(--chart-color-1);
}

.dashboard-b-bar-width-100 { width: 100%; }
.dashboard-b-bar-width-71 { width: 71%; }
.dashboard-b-bar-width-54 { width: 54%; }
.dashboard-b-bar-width-36 { width: 36%; }
.dashboard-b-bar-width-29 { width: 29%; }
.dashboard-b-bar-width-21 { width: 21%; }
.dashboard-b-bar-width-14 { width: 14%; }
.dashboard-b-bar-width-7 { width: 7%; }
.dashboard-b-bar-width-5 { width: 5%; }
.dashboard-b-bar-width-3 { width: 3%; }
.dashboard-b-bar-width-2 { width: 2%; }
.dashboard-b-bar-width-1 { width: 1%; }

.dashboard-b-wide-chart .dashboard-b-bar-row {
  flex: 1 1 0;
  grid-template-columns: minmax(120px, 42%) minmax(0, 1fr);
}

.dashboard-b-wide-chart .dashboard-b-bar-row b {
  transform-origin: left center;
  transition: filter 160ms ease, transform 160ms ease;
}

.dashboard-b-wide-chart .dashboard-b-bar-row:hover b {
  filter: brightness(0.82);
  transform: scaleY(1.08);
}

.dashboard-b-bar-row em {
  margin-left: 6px;
  color: var(--panel-text);
  font-style: normal;
  font-weight: 800;
  font-size: inherit;
  line-height: 1;
  flex: 0 0 auto;
}

.dashboard-b-bar-axis {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: color-mix(in srgb, var(--panel-text) 76%, transparent);
  font-size: clamp(8px, calc(var(--font-size-base) * 0.66), 10px);
  padding-left: calc(38% + 10px);
}

.dashboard-b-email-bars {
  gap: 5px;
}

.dashboard-b-email-bars .dashboard-b-bar-row {
  flex: 1 1 0;
}

.dashboard-b-email-bars .dashboard-b-bar-row b {
  background: var(--chart-color-1);
}

.dashboard-b-chart-note {
  margin: -2px 0 4px;
  color: color-mix(in srgb, var(--panel-text) 76%, transparent);
  font-size: calc(var(--font-size-base) * 0.68);
  line-height: 1;
  text-align: center;
}

.dashboard-b-donut-layout {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}

.dashboard-b-donut {
  width: min(100%, 300px);
  height: min(100%, 245px);
  min-width: 0;
  min-height: 0;
  position: relative;
  color: var(--panel-text);
}

.dashboard-b-donut canvas {
  width: 100% !important;
  height: 100% !important;
}

.dashboard-b-small-donut-card .dashboard-b-donut-layout {
  padding-top: 0;
}

.dashboard-b-small-donut-card .dashboard-b-donut {
  width: min(100%, 210px);
  height: min(100%, 205px);
}

@media (min-width: 1101px) and (max-width: 1400px) {
  .dashboard-b-kpi-leads {
    grid-column: span 3;
  }

  .dashboard-b-wide-chart {
    grid-column: span 5;
  }
}

@media (max-width: 1100px) {
  .dashboard-b-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .dashboard-b-kpi-leads,
  .dashboard-b-wide-chart,
  .dashboard-b-donut-card,
  .dashboard-b-email-chart,
  .dashboard-b-kpi-emails,
  .dashboard-b-kpi-recipients {
    grid-column: span 6;
  }

  .dashboard-b-kpi-handovers,
  .dashboard-b-small-donut-card,
  .dashboard-b-kpi-mql,
  .dashboard-b-kpi-sql {
    grid-column: span 3;
  }
}
/* Pipeline Funnel SVG styling */
.funnel-wrapper {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  overflow: hidden;
}

.funnel-wrapper svg {
  display: block;
  max-width: 100%;
  max-height: 100%;
}

.funnel-polygon {
  transition: fill 0.3s ease;
  cursor: pointer;
}

.funnel-polygon:hover {
  filter: brightness(1.08);
}

.funnel-text-title {
  font-family: var(--font-family);
  font-size: 12px;
  font-weight: 600;
  pointer-events: none;
}

.funnel-text-percent {
  font-family: var(--font-family);
  font-size: 10px;
  pointer-events: none;
  opacity: 0.85;
}

@media (max-width: 1050px) {
  .dashboard-header .preview-tab span {
    display: none;
  }

  .dashboard-header .preview-tab {
    width: 32px;
    padding: 0;
  }

  .header-right {
    gap: 8px;
  }
}

@media (max-width: 850px) {
  body {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: 50vh;
    border-right: none;
    border-bottom: 1px solid #2c3e50;
  }
  
  .sidebar.hidden {
    transform: translateY(-100%);
    margin-bottom: -50vh;
    margin-right: 0;
  }
  
  .dashboard-wrapper {
    height: 50vh;
  }

  .theme-preflight-scrim {
    position: fixed;
    z-index: 340;
    inset: 0;
    border: none;
    display: block;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  body.preflight-open .theme-preflight-scrim {
    opacity: 1;
    pointer-events: auto;
  }

  .theme-preflight-drawer {
    width: 100%;
    max-width: none;
    border-left: none;
  }

  .theme-preflight-filters {
    gap: 12px;
  }

  .theme-preflight-footer {
    justify-content: stretch;
  }

  .theme-preflight-secondary-action,
  .theme-preflight-danger-action {
    flex: 1 1 auto;
  }
}










