:root {
  --app-bg: #f7f4ee;
  --app-card: #ffffff;
  --app-border: #e7e1d7;
  --app-text: #111827;
  --app-muted: #6b7280;
  --app-sidebar: #fbfaf7;
  --app-sidebar-2: #f4efe7;
  --app-accent: #f59e0b;
  --app-shadow: 0 16px 36px rgba(17, 24, 39, 0.06);
  --app-radius: 22px;
}

html, body {
  min-height: 100%;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--app-text);
  background: linear-gradient(180deg, #fbfaf7 0%, #f6f2ea 100%);
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 272px;
  flex-direction: column;
  background: var(--app-sidebar);
  box-shadow: inset -1px 0 0 rgba(231, 225, 215, 0.95);
  color: var(--app-text);
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 1.1rem .9rem;
  transition: width .25s ease, transform .25s ease;
  border-right: 1px solid rgba(231, 225, 215, 0.95);
}

.sidebar-collapsed .app-sidebar {
  width: 96px;
}

.app-sidebar__brand {
  display: flex;
  align-items: center;
  gap: .9rem;
  padding: .2rem .35rem 1rem;
  margin-bottom: .65rem;
  border-bottom: 1px solid rgba(231, 225, 215, 0.95);
}

.app-sidebar__brand.has-logo {
  justify-content: flex-start;
}

[data-brand-wrap].has-logo {
  gap: 0 !important;
  width: 100%;
}

.app-logo {
  width: 100%;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 1;
  min-width: 0;
}

[data-brand-wrap]:not(.has-logo) .app-logo {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  background: #e2e8f0;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, .18);
  flex-shrink: 0;
}

.app-logo.app-logo--image {
  max-width: 100%;
  height: auto;
  min-height: 46px;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.app-sidebar__brand.has-logo .app-logo.app-logo--image,
.offcanvas-header .app-logo.app-logo--image {
  min-height: 46px;
  height: 46px;
}

.app-sidebar__brand.has-logo .app-logo__image,
.offcanvas-header .app-logo__image {
  width: 100%;
  max-height: 35px;
}

.app-brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.app-brand-text strong {
  font-size: 1rem;
}

.app-brand-text span {
  font-size: .82rem;
  color: var(--app-muted);
}

.sidebar-collapsed .app-brand-text,
.sidebar-collapsed .app-nav__link span,
.sidebar-collapsed .app-sidebar__footer .small,
.sidebar-collapsed .app-sidebar__footer .btn {
  display: none;
}

.app-nav {
  display: flex;
  flex-direction: column;
  gap: .22rem;
}

.app-nav__link {
  display: flex;
  align-items: center;
  gap: .9rem;
  color: var(--app-text);
  text-decoration: none;
  padding: .78rem .9rem;
  border-radius: 12px;
  font-weight: 600;
  font-size: .97rem;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
  border: 1px solid transparent;
}

.app-nav__link i {
  font-size: 1.05rem;
  color: #1f2937;
}

.app-nav__link:hover {
  color: #000;
  background: rgba(255,255,255,0.78);
  border-color: rgba(231, 225, 215, 0.95);
}

.app-nav__link.is-active {
  color: #000;
  background: #fff;
  border-color: rgba(231, 225, 215, 0.98);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.05);
}

.app-sidebar__footer {
  margin-top: auto;
  padding: 1rem .5rem .4rem;
  border-top: 1px solid rgba(231, 225, 215, 0.95);
}

.app-sidebar__footer .small {
  color: var(--app-muted) !important;
}

.app-main {
  flex: 1;
  min-width: 0;
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  backdrop-filter: blur(18px);
  background: rgba(251, 250, 247, 0.88);
  border-bottom: 1px solid rgba(231, 225, 215, 0.78);
}

.app-page {
  padding: 1.25rem;
}

.app-page-title {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -.02em;
}

.app-page-subtitle {
  color: var(--app-muted);
  font-size: .92rem;
}

.app-topbar__right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .5rem;
  flex-wrap: wrap;
}

.app-card,
.card {
  border: 1px solid rgba(231, 225, 215, 0.95);
  border-radius: var(--app-radius);
  box-shadow: var(--app-shadow);
  background: rgba(255,255,255,.92);
}

.card-header {
  background: transparent;
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

.metric-card {
  border-radius: 24px;
  padding: 1.25rem;
  background: linear-gradient(180deg, rgba(255,255,255,0.98), rgba(255,255,255,0.88));
  border: 1px solid rgba(231, 225, 215, 0.95);
  box-shadow: var(--app-shadow);
  height: 100%;
}

.metric-card__eyebrow {
  color: var(--app-muted);
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.metric-card__value {
  font-size: clamp(1.6rem, 2vw, 2.3rem);
  font-weight: 800;
  letter-spacing: -.04em;
  margin-top: .25rem;
}

.metric-card__meta {
  color: var(--app-muted);
  font-size: .9rem;
}

.section-toolbar {
  display: flex;
  justify-content: space-between;
  gap: .75rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.filters-card .accordion-button {
  border-radius: 18px !important;
  background: #fff;
  font-weight: 700;
}

.filters-card .accordion-button:not(.collapsed) {
  box-shadow: none;
  background: #fffaf0;
  color: #92400e;
}

.table-responsive {
  border-radius: 20px;
}

.table {
  margin-bottom: 0;
}

.table thead th {
  white-space: nowrap;
  font-size: .82rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--app-muted);
}

.table td,
.table th {
  vertical-align: middle;
}

.table tbody tr:hover {
  background: rgba(248, 250, 252, 0.9);
}

.data-empty {
  padding: 2rem;
  text-align: center;
  color: var(--app-muted);
}

.js-google-chart {
  width: 100%;
  min-height: 320px;
}

.chart-card .card-body {
  padding: 1rem 1rem .5rem;
}

.app-stat-chip {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .45rem .75rem;
  border-radius: 999px;
  background: #fffaf0;
  color: #92400e;
  font-size: .82rem;
  font-weight: 700;
}

.badge {
  font-weight: 700;
}

.modal-content {
  border-radius: 24px;
}

.form-label {
  font-size: .92rem;
  font-weight: 700;
}

.app-form-body {
  padding: 1.25rem;
}

.module-actions {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.module-actions--topbar {
  justify-content: flex-end;
}

.module-actions--topbar .btn {
  white-space: nowrap;
}

.sticky-module-actions {
  position: static;
  top: auto;
  z-index: auto;
  backdrop-filter: none;
}

#app-module-root.is-loading {
  opacity: .55;
  pointer-events: none;
}

.small-muted {
  color: var(--app-muted);
  font-size: .88rem;
}

.customer-pill {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: .25rem .55rem;
  font-size: .82rem;
  font-weight: 600;
}

@media (max-width: 991.98px) {
  .app-page {
    padding: 1rem;
  }

  .app-topbar {
    padding: .9rem 1rem;
  }

  .js-google-chart {
    min-height: 260px;
  }
}


.app-offcanvas {
  background: #fbfaf7;
  color: var(--app-text);
}

.app-offcanvas .offcanvas-header {
  border-bottom: 1px solid rgba(231, 225, 215, 0.95);
}

.app-offcanvas .app-nav__link {
  color: var(--app-text);
}

.app-offcanvas .app-nav__link:hover,
.app-offcanvas .app-nav__link.is-active {
  color: #000;
  background: #fff;
  border-color: rgba(231, 225, 215, 0.98);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.05);
}

.app-logo__image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: inherit;
  display: block;
}

.app-logo.app-logo--image .app-logo__image {
  width: 100%;
  height: auto;
  max-width: 100%;
}

.login-brand {
  width: 100%;
  max-width: 420px;
}

.login-brand .app-logo {
  width: 100%;
  height: auto;
  min-height: 0;
  margin-inline: auto;
  background: transparent;
  box-shadow: none;
}

.login-brand .app-logo__image {
  width: 100%;
  max-width: 100%;
  max-height: 140px;
  height: auto;
}

.filter-shortcuts {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
}

.filter-shortcuts .btn {
  box-shadow: none;
}

.filter-shortcuts .btn.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #fff;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.settings-preview {
  min-height: 180px;
  border: 1px dashed rgba(148, 163, 184, 0.5);
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(248,250,252,0.9), rgba(255,255,255,0.95));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.settings-preview img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.settings-preview--icon img {
  max-width: 72px;
  max-height: 72px;
}

.settings-preview__empty {
  text-align: center;
  color: var(--app-muted);
}

@media (max-width: 991.98px) {
  .filter-shortcuts {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: .25rem;
  }

  .filter-shortcuts .btn {
    white-space: nowrap;
  }
}
