:root {
  --customer-success: #4c894d;
  --customer-primary: #5955D1;
  --customer-secondary: #827fe1;
  --customer-accent: #000000;
  --customer-white: #ffffff;
  --customer-bg: #f7f7fb;
  --customer-surface: #ffffff;
  --customer-surface-alt: #fbfbfe;
  --customer-border: #e7e8f0;
  --customer-border-strong: #d7d9e6;
  --customer-text: #16181d;
  --customer-muted: #6b7280;
  --customer-sidebar: 216px;
  --customer-topbar: 56px;
  --customer-radius: 14px;
  --customer-radius-sm: 10px;
  --customer-shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.04);
  --bs-primary: #5955D1;
  --bs-primary-rgb: 89, 85, 209;
  --bs-success: #4c894d;
  --bs-success-rgb: 76, 137, 77;
}

html, body { height: 100%; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: var(--customer-text);
  background: linear-gradient(180deg, #fbfbfe 0%, #f5f6fb 100%);
}

a { color: var(--customer-primary); text-decoration: none; }
a:hover { color: #4d49c1; }

.customer-shell { min-height: 100vh; }
.customer-app { min-height: 100vh; }
.customer-content {
  min-width: 0;
  margin-left: 0;
}
.customer-page {
  padding: 18px 20px 24px;
}
.customer-page > .container,
.customer-page > .container-fluid {
  max-width: none;
  padding-left: 0;
  padding-right: 0;
}
.customer-topbar {
  height: var(--customer-topbar);
  background: rgba(255,255,255,0.86);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--customer-border);
}
.customer-topbar .topbar-search {
  width: min(320px, 100%);
}
.topbar-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1100;
  background: #fff;
  border: 1px solid var(--customer-border);
  border-radius: 12px;
  box-shadow: var(--customer-shadow);
  max-height: 320px;
  overflow-y: auto;
}
.topbar-search-result-item {
  display: block;
  padding: 10px 12px;
  border-bottom: 1px solid #f1f2f8;
  color: inherit;
}
.topbar-search-result-item:last-child { border-bottom: 0; }
.topbar-search-result-item:hover { background: #f8f9ff; }
.topbar-search-result-title { font-weight: 600; color: var(--customer-text); }
.topbar-search-result-desc { font-size: 12px; color: var(--customer-muted); margin-top: 2px; }
.customer-sidebar {
  width: var(--customer-sidebar);
  background: rgba(255,255,255,0.92);
  border-right: 1px solid var(--customer-border);
  padding: 16px 14px;
}
.customer-sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--customer-text);
  margin-bottom: 18px;
}
.customer-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--customer-primary), var(--customer-secondary));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.customer-nav-section {
  margin-bottom: 14px;
}
.customer-nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #8a90a2;
  padding: 0 10px 6px;
}
.customer-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  color: #3e4558;
  font-weight: 500;
  margin-bottom: 2px;
}
.customer-nav-link:hover {
  background: #f5f6fd;
  color: var(--customer-text);
}
.customer-nav-link.active {
  background: rgba(89, 85, 209, 0.10);
  color: var(--customer-primary);
  font-weight: 700;
}
.customer-nav-link i {
  font-size: 14px;
  width: 16px;
  text-align: center;
}
.customer-sidebar-foot {
  margin-top: auto;
  padding-top: 12px;
}
.customer-tenant-chip {
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f7f7fd 100%);
  border: 1px solid var(--customer-border);
}
.customer-quick-link {
  font-size: 11px;
  color: var(--customer-muted);
  background: #f7f8fd;
  border: 1px solid var(--customer-border);
  border-radius: 8px;
  padding: 3px 8px;
  display: inline-flex;
  width: fit-content;
}
.customer-quick-link:hover {
  color: var(--customer-primary);
  background: #eef0ff;
}
.customer-panel,
.customer-sidecard,
.customer-mini-card,
.card {
  background: var(--customer-surface);
  border: 1px solid var(--customer-border);
  border-radius: var(--customer-radius) !important;
  box-shadow: none !important;
}
.customer-panel,
.customer-sidecard { padding: 16px; }
.customer-mini-card { padding: 14px; }
.customer-stat-number,
.display-6,
.display-5 {
  font-size: 26px !important;
  line-height: 1.1;
  letter-spacing: -0.03em;
  font-weight: 700 !important;
}
.customer-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(89, 85, 209, 0.08);
  color: var(--customer-primary);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.customer-kpi-grid .customer-panel,
.customer-kpi-grid .customer-sidecard {
  padding: 14px;
}
.customer-kpi-grid .small { font-size: 12px; }
.timezone-callout {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f5f6fd;
  border: 1px solid var(--customer-border);
  color: #4b5563;
}

h1, .h1 { font-size: 26px; letter-spacing: -0.03em; }
h2, .h2 { font-size: 20px; letter-spacing: -0.02em; }
h3, .h3 { font-size: 18px; }
h4, .h4 { font-size: 16px; }
h5, .h5 { font-size: 15px; }
h6, .h6 { font-size: 14px; }
.lead { font-size: 15px; }
.small, small, .form-text { font-size: 12px !important; color: var(--customer-muted) !important; }
.text-secondary { color: var(--customer-muted) !important; }
.text-muted { color: var(--customer-muted) !important; }

.btn {
  --bs-btn-padding-y: .42rem;
  --bs-btn-padding-x: .85rem;
  --bs-btn-font-size: 13px;
  --bs-btn-border-radius: 10px;
  --bs-btn-font-weight: 600;
  box-shadow: none !important;
}
.btn-sm {
  --bs-btn-padding-y: .34rem;
  --bs-btn-padding-x: .7rem;
  --bs-btn-font-size: 12px;
  --bs-btn-border-radius: 9px;
}
.btn-customer-primary,
.btn-primary {
  color: #fff !important;
  background: var(--customer-primary) !important;
  border-color: var(--customer-primary) !important;
}
.btn-customer-primary:hover,
.btn-primary:hover {
  background: #4d49c1 !important;
  border-color: #4d49c1 !important;
}
.btn-customer-soft,
.btn-light {
  color: var(--customer-text) !important;
  background: #fff !important;
  border: 1px solid var(--customer-border) !important;
}
.btn-customer-soft:hover,
.btn-light:hover {
  background: #f8f9ff !important;
  border-color: var(--customer-border-strong) !important;
}

.form-control,
.form-select,
textarea.form-control {
  min-height: 36px;
  border-radius: 10px;
  border-color: var(--customer-border-strong);
  font-size: 13px;
  padding: .48rem .72rem;
  box-shadow: none !important;
}
textarea.form-control { min-height: 88px; }
.form-control-sm,
.form-select-sm {
  min-height: 30px;
  border-radius: 8px;
  font-size: 12px;
}
.form-control:focus,
.form-select:focus {
  border-color: rgba(89,85,209,.5);
  box-shadow: 0 0 0 3px rgba(89,85,209,.08) !important;
}
.form-label { font-size: 12px; font-weight: 600; margin-bottom: 6px; }

.table {
  --bs-table-bg: transparent;
  --bs-table-striped-bg: #fafbff;
  --bs-table-hover-bg: #f8f9fe;
  margin-bottom: 0;
}
.table > :not(caption) > * > * {
  padding: .68rem .72rem;
  border-bottom-color: var(--customer-border);
  font-size: 13px;
}
.table thead th {
  font-size: 11px;
  color: #7a8194;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: #fbfbfe;
}
.table-responsive {
  border: 1px solid var(--customer-border);
  border-radius: 12px;
  overflow: hidden;
}

.alert {
  border-radius: 12px;
  border-width: 1px;
  font-size: 13px;
}
.badge {
  border-radius: 999px;
  padding: .42em .6em;
  font-size: 11px;
}
code {
  font-size: 12px;
  color: #4338ca;
  background: #f5f6fd;
  padding: 2px 6px;
  border-radius: 8px;
}
hr { border-color: var(--customer-border); opacity: 1; }

.customer-auth-shell {
  max-width: 440px;
  margin: 48px auto;
}
.customer-auth-shell .customer-panel { padding: 24px; }
.customer-auth-topbar {
  padding: 16px 18px 0;
}
.customer-footer {
  padding: 10px 20px 18px;
  color: var(--customer-muted);
}

.customer-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.customer-summary-card {
  border: 1px solid var(--customer-border);
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #fcfcff 100%);
  padding: 14px;
}
.customer-summary-card .value {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.customer-chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-height: 120px;
}
.customer-chart-bars span {
  flex: 1;
  border-radius: 8px 8px 4px 4px;
  background: linear-gradient(180deg, rgba(130,127,225,.85), rgba(89,85,209,.95));
}
.customer-progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: #eeeff7;
  overflow: hidden;
}
.customer-progress-track > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--customer-secondary), var(--customer-primary));
}
.customer-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.customer-ads-sidebar .card {
  position: sticky;
  top: 72px;
}
.customer-ads-sidebar .nav-link {
  border-radius: 10px;
  padding: 7px 10px;
  color: #485066;
  font-size: 13px;
}
.customer-ads-sidebar .nav-link.active {
  background: rgba(89,85,209,.08);
  color: var(--customer-primary);
  font-weight: 700;
}
.customer-ads-thumb {
  width: 64px;
  height: 40px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--customer-border);
}

@media (min-width: 992px) {
  .customer-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 1030;
    display: flex;
    flex-direction: column;
  }
  .customer-content {
    margin-left: var(--customer-sidebar);
  }
  .customer-topbar {
    position: sticky;
    top: 0;
    z-index: 1020;
  }
}

@media (max-width: 991.98px) {
  .customer-page { padding: 14px 14px 22px; }
  .customer-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 575.98px) {
  .customer-summary-grid { grid-template-columns: 1fr; }
  .customer-panel,
  .customer-sidecard,
  .customer-mini-card { padding: 14px; }
  h1, .h1 { font-size: 22px; }
}
