:root {
  color-scheme: light;
  --accent-purple: #635bff;
  --accent-violet: #635bff;
  --accent-blue: #556cd6;
  --accent-cyan: #06b6d4;
  --accent-green: #1ea672;
  --accent-orange: #c57a12;
  --accent-red: #d94841;
  --accent-pink: #ec4899;
  --accent-yellow: #facc15;
  --bg-page: #e7ebf2;
  --bg-sidebar: #e3e7ee;
  --bg-topbar: transparent;
  --bg-card: #ffffff;
  --bg-card-hover: #ffffff;
  --bg-soft: #f4f6fa;
  --bg-input: #ffffff;
  --border-subtle: #dce2ea;
  --border-strong: #c8d0dc;
  --text-primary: #30364a;
  --text-secondary: #566176;
  --text-muted: #8a96aa;
  --shadow-card: 0 1px 2px rgba(29, 36, 52, 0.08), 0 10px 24px rgba(29, 36, 52, 0.05);
  --shadow-pop: 0 12px 32px rgba(29, 36, 52, 0.15);
  --shadow-glow-purple: none;
  --chart-grid: #e3e8f0;
  --radius-card: 6px;
  --radius-control: 5px;
  --sidebar-width: 252px;
  --content-max: 1480px;
  --font-ui: Inter, Geist, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg-page: #060b14;
  --bg-sidebar: rgba(7, 17, 31, 0.92);
  --bg-topbar: rgba(8, 15, 28, 0.84);
  --bg-card: rgba(17, 27, 45, 0.78);
  --bg-card-hover: rgba(25, 39, 63, 0.9);
  --bg-soft: rgba(148, 163, 184, 0.08);
  --bg-input: rgba(8, 15, 28, 0.68);
  --border-subtle: rgba(148, 163, 184, 0.16);
  --border-strong: rgba(148, 163, 184, 0.28);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --shadow-card: 0 18px 48px rgba(0, 0, 0, 0.34);
  --shadow-pop: 0 28px 78px rgba(0, 0, 0, 0.45);
  --shadow-glow-purple: 0 0 32px rgba(124, 58, 237, 0.24);
  --chart-grid: rgba(148, 163, 184, 0.12);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg-page);
  color: var(--text-primary);
  font-family: var(--font-ui);
  font-size: 14px;
  font-weight: 450;
  line-height: 1.5;
  letter-spacing: 0;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

html[data-theme="dark"] body {
  background: linear-gradient(180deg, #07111f 0%, var(--bg-page) 46%, #050914 100%);
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.d-none {
  display: none !important;
}

.d-block {
  display: block !important;
}

.min-w-0 {
  min-width: 0 !important;
}

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

.text-secondary {
  color: var(--text-secondary) !important;
}

.small {
  font-size: 0.82rem !important;
}

.mb-4 {
  margin-bottom: 1.5rem !important;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  scrollbar-gutter: stable;
  -webkit-overflow-scrolling: touch;
}

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(440px, 100%);
  padding: 28px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  box-shadow: var(--shadow-pop), var(--shadow-glow-purple);
  backdrop-filter: blur(22px);
}

.auth-card h1 {
  margin: 0 0 8px;
  font-size: 1.6rem;
  font-weight: 750;
}

.auth-card p {
  margin: 0 0 22px;
  color: var(--text-secondary);
  line-height: 1.55;
}

.auth-actions {
  display: grid;
  gap: 10px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  border-right: 0;
  background: var(--bg-sidebar);
  backdrop-filter: none;
  z-index: 30;
}

.brand-lockup {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.sidebar-brand {
  padding: 22px 20px 18px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  background: #ffffff;
  color: var(--text-secondary);
  font-weight: 850;
  font-size: 1.2rem;
  box-shadow: var(--shadow-card);
}

.brand-title {
  color: var(--text-primary);
  font-size: 1.18rem;
  font-weight: 800;
  line-height: 1.12;
}

.brand-kicker,
.brand-domain {
  display: block;
  margin-top: 4px;
  color: var(--accent-violet);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
  text-decoration: none;
}

.brand-domain {
  color: var(--text-secondary);
  letter-spacing: 0;
  text-transform: none;
}

.side-nav {
  display: grid;
  gap: 8px;
  padding: 18px 14px;
}

.side-nav .nav-link {
  min-height: 48px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-card);
  color: var(--text-primary);
  font-weight: 650;
  text-decoration: none;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.side-nav .nav-link:hover {
  color: var(--accent-blue);
  background: rgba(255, 255, 255, 0.42);
}

.side-nav .nav-link.active {
  color: var(--accent-blue);
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.side-nav i {
  color: #7f8da6;
  font-size: 1.08rem;
}

.side-nav .nav-link.active i {
  color: var(--accent-blue);
}

.nav-badge {
  min-width: 25px;
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-violet) 18%, var(--bg-card));
  color: var(--accent-violet);
  font-size: 0.7rem;
  font-weight: 850;
  text-align: center;
}

.side-nav .active .nav-badge {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
}

.nav-badge.danger {
  color: var(--accent-red);
  background: color-mix(in srgb, var(--accent-red) 14%, var(--bg-card));
}

.sidebar-footer {
  display: grid;
  gap: 14px;
  margin-top: auto;
  padding: 16px;
}

.business-card,
.sidebar-profile,
.panel-card,
.stat-card,
.toast-box,
.dropdown-menu {
  border: 1px solid var(--border-subtle);
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
  backdrop-filter: none;
}

.business-card {
  padding: 16px;
  border-radius: var(--radius-card);
}

.business-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 750;
}

.business-card strong {
  display: block;
  margin-top: 12px;
  font-size: 0.94rem;
}

.business-card p {
  margin: 6px 0 0;
  color: var(--text-secondary);
  font-size: 0.78rem;
  line-height: 1.45;
}

.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent-green);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--accent-green) 15%, transparent);
}

.sidebar-profile {
  width: 100%;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-card);
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.sidebar-user-menu {
  position: relative;
  width: 100%;
}

.sidebar-user-dropdown {
  top: auto;
  right: 0;
  bottom: calc(100% + 10px);
  left: 0;
  width: 100%;
  min-width: 0;
}

.sidebar-profile strong,
.sidebar-profile small {
  display: block;
}

.sidebar-profile small {
  color: var(--text-secondary);
}

.main-stage {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 76px;
  display: grid;
  grid-template-columns: minmax(260px, 560px) minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 22px 28px;
  border-bottom: 0;
  background: var(--bg-topbar);
  backdrop-filter: none;
}

.global-search,
.table-search {
  min-height: 34px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--bg-input);
  color: var(--text-secondary);
  box-shadow: var(--shadow-card);
}

.global-search input,
.table-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text-primary);
}

.global-search input::placeholder,
.table-search input::placeholder {
  color: var(--text-muted);
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:focus,
.nav-link:focus,
.view-tab:focus,
.sidebar-profile:focus,
.date-chip:focus,
.link-button:focus,
input:focus,
select:focus {
  outline: 3px solid color-mix(in srgb, var(--accent-blue) 34%, transparent);
  outline-offset: 2px;
}

.btn-primary-gradient {
  border-color: var(--accent-blue);
  background: var(--accent-blue);
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(85, 108, 214, 0.2);
}

.btn-soft {
  border-color: var(--border-subtle);
  background: #ffffff;
  color: var(--text-primary);
}

.btn-soft:hover,
.btn-soft.active {
  border-color: var(--border-strong);
  background: #ffffff;
  color: var(--accent-blue);
}

.btn-sm {
  min-height: 34px;
  padding: 0 11px;
  font-size: 0.82rem;
}

.btn-icon {
  position: relative;
  width: 42px;
  padding: 0;
  border-color: var(--border-subtle);
  background: var(--bg-soft);
  color: var(--text-primary);
}

.notification-dot {
  position: absolute;
  top: -5px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-violet);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 850;
}

.notification-dot.is-empty {
  display: none;
}

.theme-toggle span {
  min-width: 38px;
}

.dropdown {
  position: relative;
}

.dropdown-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1000;
  display: none;
  min-width: 280px;
  padding: 8px;
  margin: 0;
  list-style: none;
  border-radius: var(--radius-card);
}

.dropdown-menu.show,
.user-menu.is-open .dropdown-menu {
  display: block;
}

.sidebar-user-menu .sidebar-user-dropdown {
  inset: auto 0 calc(100% + 10px) 0;
  width: 100%;
  min-width: 0;
  max-height: min(360px, calc(100vh - 128px));
  overflow-y: auto;
  transform-origin: bottom center;
}

.sidebar-user-menu.is-open .sidebar-profile > i {
  transform: rotate(180deg);
}

.notification-menu,
.message-menu {
  position: relative;
  display: inline-flex;
}

.notification-dropdown,
.message-dropdown {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 1000;
  display: none;
  width: min(430px, calc(100vw - 32px));
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  box-shadow: var(--shadow-pop);
}

.notification-menu.is-open .notification-dropdown,
.message-menu.is-open .message-dropdown {
  display: grid;
}

.notification-dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.notification-dropdown-head strong,
.notification-dropdown-head span {
  display: block;
}

.notification-dropdown-head strong {
  color: var(--text-primary);
  font-size: 0.96rem;
  font-weight: 800;
}

.notification-dropdown-head span {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.notification-list-menu {
  max-height: 420px;
  padding: 10px;
}

.message-list {
  max-height: 420px;
  display: grid;
  gap: 8px;
  overflow-y: auto;
  padding: 10px;
}

.message-item {
  width: 100%;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  padding: 10px;
  border: 0;
  border-radius: var(--radius-card);
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  cursor: pointer;
}

.message-item:hover,
.message-item:focus {
  background: var(--bg-soft);
}

.message-avatar {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-blue) 14%, var(--bg-card));
  color: var(--accent-blue);
  font-size: 0.72rem;
  font-weight: 850;
}

.message-body,
.message-title-line,
.message-preview,
.message-meta {
  min-width: 0;
}

.message-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-title-line strong {
  flex: 1 1 auto;
  color: var(--text-primary);
  font-size: 0.86rem;
  font-weight: 800;
}

.message-preview,
.message-meta {
  display: block;
  margin-top: 3px;
}

.message-preview {
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.message-meta {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.notification-view-all {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-top: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--accent-blue);
  font-weight: 800;
  cursor: pointer;
}

.notification-view-all:hover,
.notification-view-all:focus {
  background: var(--bg-soft);
}

.dropdown-header {
  padding: 8px;
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border-radius: var(--radius-card);
  color: var(--text-primary);
  text-decoration: none;
}

.dropdown-item:hover,
.dropdown-item:focus {
  background: var(--bg-soft);
}

.dropdown-divider {
  height: 0;
  margin: 6px 0;
  border: 0;
  border-top: 1px solid var(--border-subtle);
}

.text-danger {
  color: var(--accent-red) !important;
}

.row-action {
  position: relative;
  display: inline-flex;
}

.row-action-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.row-action-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 10;
  display: none;
  min-width: 172px;
  padding: 7px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  box-shadow: var(--shadow-pop);
  backdrop-filter: blur(18px);
}

.row-action.is-open .row-action-menu {
  display: grid;
  gap: 4px;
}

.row-action-item {
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-card);
  background: transparent;
  color: var(--text-primary);
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.row-action-item:hover,
.row-action-item:focus {
  background: var(--bg-soft);
}

.row-action-item.danger {
  color: var(--accent-red);
}

.dropdown-toggle::after {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  margin-left: auto;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.user-avatar-mini,
.user-avatar-large {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  color: #ffffff;
  background: linear-gradient(135deg, var(--accent-orange), var(--accent-purple));
  font-weight: 850;
}

.user-avatar-mini {
  width: 32px;
  height: 32px;
  border-radius: 999px;
}

.user-avatar-large {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-control);
}

.user-avatar-mini img,
.user-avatar-large img {
  position: absolute;
  inset: 0;
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-avatar-mini.has-image img,
.user-avatar-large.has-image img {
  display: block;
}

.user-avatar-mini.has-image span,
.user-avatar-large.has-image span {
  display: none;
}

.profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
}

.content-wrap {
  width: min(100%, var(--content-max));
  margin: 0 auto;
  padding: 24px 28px 34px;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.page-eyebrow {
  margin-bottom: 6px;
  color: var(--accent-violet);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-heading h1 {
  margin: 0;
  color: var(--text-primary);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.12;
}

.page-heading p {
  margin: 8px 0 0;
  color: var(--text-secondary);
  max-width: 760px;
  font-size: 0.98rem;
  line-height: 1.55;
}

.date-chip {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: #ffffff;
  color: var(--text-primary);
  font-weight: 650;
  box-shadow: var(--shadow-card);
}

.date-range-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.date-select {
  min-height: 34px;
  padding: 0 34px 0 10px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: #ffffff;
  color: var(--text-secondary);
  font-weight: 650;
  box-shadow: var(--shadow-card);
}

.view-tabs {
  display: flex;
  gap: 4px;
  max-width: 100%;
  margin-bottom: 18px;
  padding: 4px;
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: #ffffff;
  box-shadow: var(--shadow-card);
  scrollbar-width: none;
}

.view-tabs::-webkit-scrollbar {
  display: none;
}

.view-tab {
  min-height: 34px;
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 650;
  cursor: pointer;
}

.view-tab:hover,
.view-tab.active {
  color: var(--accent-blue);
  background: var(--bg-soft);
  box-shadow: none;
}

.view-tab i {
  color: #8190aa;
  font-size: 0.95rem;
}

.view-tab.active i {
  color: var(--accent-blue);
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
}

.segmented-control {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--bg-soft);
}

.segment-button {
  min-height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--text-secondary);
  font-weight: 650;
  cursor: pointer;
}

.segment-button:hover,
.segment-button.active {
  background: var(--bg-card);
  color: var(--accent-blue);
  box-shadow: 0 1px 2px rgba(29, 36, 52, 0.06);
}

.api-alerts {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.alert {
  padding: 13px 15px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--accent-orange) 12%, var(--bg-card));
  color: var(--text-primary);
}

.alert strong {
  margin-right: 8px;
  color: var(--accent-orange);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  margin-bottom: 22px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.kpi-grid.wide {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.stat-card {
  min-height: 170px;
  display: grid;
  grid-template-rows: auto minmax(58px, 1fr);
  gap: 12px;
  align-items: stretch;
  padding: 20px 22px;
  border: 0;
  border-right: 1px solid var(--border-subtle);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.stat-card:hover {
  transform: none;
  background: #fbfcfe;
}

.stat-card:last-child {
  border-right: 0;
}

.stat-left {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
}

.stat-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.stat-icon {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: var(--radius-card);
  color: var(--text-secondary);
  box-shadow: none;
  font-size: 0.9rem;
}

.accent-purple {
  background: color-mix(in srgb, var(--accent-purple) 10%, #ffffff);
  color: var(--accent-purple);
}

.accent-blue {
  background: color-mix(in srgb, var(--accent-blue) 10%, #ffffff);
  color: var(--accent-blue);
}

.accent-green {
  background: color-mix(in srgb, var(--accent-green) 12%, #ffffff);
  color: var(--accent-green);
}

.accent-orange {
  background: color-mix(in srgb, var(--accent-orange) 13%, #ffffff);
  color: var(--accent-orange);
}

.accent-red {
  background: color-mix(in srgb, var(--accent-red) 10%, #ffffff);
  color: var(--accent-red);
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 650;
}

.stat-value {
  max-width: 100%;
  margin-top: 6px;
  color: var(--accent-blue);
  font-size: 1.55rem;
  font-weight: 500;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.stat-note {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.trend-up {
  color: #13795b;
  font-weight: 700;
}

.trend-down {
  color: #9f5a00;
  font-weight: 700;
}

.metric-chip {
  min-height: 20px;
  display: inline-flex;
  align-items: center;
  padding: 0 6px;
  border-radius: 4px;
  background: color-mix(in srgb, currentColor 14%, transparent);
  font-size: 0.78rem;
}

.sparkline {
  width: 100%;
  height: 68px;
  min-height: 68px;
  align-self: end;
  color: var(--accent-violet);
}

.sparkline path.area {
  opacity: 0.04;
}

.sparkline path.line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sparkline path.comparison-line,
.line-chart path.comparison-line {
  fill: none;
  stroke: #b7c1cf;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dashboard-grid,
.orders-layout,
.blog-layout,
.customers-layout,
.payments-layout,
.products-layout {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.suite-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 16px;
  margin-top: 16px;
}

.settings-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.span-2 {
  grid-column: span 2;
}

.panel-card {
  min-width: 0;
  border-radius: var(--radius-card);
  overflow: hidden;
}

.panel-header {
  min-height: 62px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-header h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1rem;
  font-weight: 650;
}

.panel-header p {
  margin: 5px 0 0;
  color: var(--text-secondary);
  font-size: 0.82rem;
  line-height: 1.45;
}

.link-button {
  border: 0;
  background: transparent;
  color: var(--accent-violet);
  font-weight: 800;
  cursor: pointer;
}

.chart-shell,
.donut-shell,
.status-list,
.compact-list,
.notification-list,
.timeline-list,
.funnel,
.chart-list,
.gauge-card,
.action-output {
  padding: 16px;
}

.chart-shell {
  min-height: 260px;
  display: grid;
  align-content: stretch;
}

.chart-shell.compact-chart {
  min-height: 250px;
}

.line-chart {
  min-height: 238px;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
}

.line-chart svg {
  width: 100%;
  height: 210px;
  overflow: visible;
}

.stripe-chart svg {
  height: 208px;
}

.grid-line {
  stroke: var(--chart-grid);
  stroke-width: 1;
}

.stripe-chart .grid-line {
  stroke-dasharray: 0;
  opacity: 0.55;
}

.stripe-chart path.line {
  stroke-width: 2.4 !important;
}

.axis-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.axis-labels span,
.axis-labels strong {
  min-width: 0;
  max-width: 34%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.axis-labels strong {
  text-align: center;
}

.axis-labels span:last-child {
  text-align: right;
}

.stripe-chart .axis-labels {
  padding: 0 2px;
  color: var(--text-secondary);
}

.donut-shell {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.donut {
  width: 154px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 999px;
}

.donut-center {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 2px;
  padding: 8px;
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--text-primary);
  text-align: center;
  box-shadow: inset 0 0 0 1px var(--border-subtle);
}

.donut-center strong {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
  line-height: 1.08;
  font-variant-numeric: tabular-nums;
}

.donut-center span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 0.68rem;
}

.donut-legend {
  display: grid;
  gap: 10px;
}

.legend-row,
.status-row,
.compact-row,
.timeline-row,
.progress-row {
  display: grid;
  gap: 10px;
}

.compact-row > .money,
.compact-row > .chip {
  max-width: 120px;
  justify-self: end;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-row {
  grid-template-columns: 10px minmax(0, 1fr) auto;
  align-items: center;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.legend-row strong {
  max-width: 72px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: currentColor;
}

.status-list,
.compact-list,
.notification-list,
.timeline-list,
.chart-list {
  display: grid;
  gap: 10px;
}

.notification-list {
  max-height: 438px;
  overflow: auto;
}

.status-row,
.compact-row,
.timeline-row,
.progress-row {
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--bg-card) 72%, transparent);
}

.status-row {
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
}

.status-icon,
.article-avatar,
.product-avatar,
.customer-avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: 0 0 auto;
  border-radius: var(--radius-card);
  background: var(--bg-soft);
  color: var(--accent-violet);
  font-weight: 850;
}

.status-icon {
  width: 38px;
  height: 38px;
}

.notification-item {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-left-width: 3px;
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--bg-card) 76%, transparent);
}

.notification-item.is-unread {
  border-left-color: var(--accent-violet);
  background: color-mix(in srgb, var(--accent-violet) 5%, var(--bg-card));
}

.notification-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-card);
  font-size: 1rem;
}

.notification-copy {
  display: grid;
  gap: 4px;
}

.notification-copy strong {
  color: var(--text-primary);
  font-weight: 750;
}

.notification-copy span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text-secondary);
  font-size: 0.84rem;
  line-height: 1.42;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notification-copy small {
  color: var(--text-muted);
  font-size: 0.76rem;
}

.notification-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  max-width: 108px;
}

.notification-link {
  color: var(--accent-blue);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
}

.product-avatar {
  width: 52px;
  height: 52px;
  border: 1px solid var(--border-subtle);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-blue) 13%, transparent), color-mix(in srgb, var(--accent-purple) 13%, transparent)),
    var(--bg-soft);
}

.article-avatar {
  width: 52px;
  height: 52px;
  border: 1px solid var(--border-subtle);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-purple) 12%, transparent), color-mix(in srgb, var(--accent-blue) 10%, transparent)),
    var(--bg-soft);
  color: var(--accent-purple);
}

.customer-avatar {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  font-size: 0.76rem;
}

.customer-avatar-large {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-subtle);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-blue) 14%, transparent), color-mix(in srgb, var(--accent-violet) 16%, transparent)),
    var(--bg-soft);
  color: var(--accent-blue);
  font-size: 0.86rem;
}

.product-avatar img,
.article-avatar img,
.customer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-avatar img,
.article-avatar img {
  display: block;
}

.status-row strong,
.compact-row strong,
.timeline-row strong {
  display: block;
  color: var(--text-primary);
}

.status-row small,
.compact-row small,
.timeline-row small {
  display: block;
  margin-top: 3px;
  color: var(--text-secondary);
}

.compact-row {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
}

.compact-row.no-border {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.compact-row.no-media {
  grid-template-columns: minmax(0, 1fr) auto;
}

.timeline-row {
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
}

.timeline-dot {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-blue) 16%, var(--bg-soft));
  color: var(--accent-blue);
}

.empty-state {
  padding: 22px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--bg-card) 64%, transparent);
  color: var(--text-secondary);
  line-height: 1.55;
}

.data-table {
  width: 100%;
  min-width: 760px;
  margin: 0;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text-primary);
}

.data-table th,
.data-table td {
  padding: 13px 15px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  white-space: nowrap;
}

.data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: color-mix(in srgb, var(--bg-card) 88%, var(--bg-page));
  color: var(--text-secondary);
  font-size: 0.74rem;
  font-weight: 800;
  text-align: left;
}

.data-table tbody tr:hover td {
  background: color-mix(in srgb, var(--accent-purple) 8%, transparent);
}

.product-table-row,
.customer-table-row {
  cursor: pointer;
}

.product-table-row:focus td,
.customer-table-row:focus td,
.article-table-row:focus td {
  outline: 2px solid color-mix(in srgb, var(--accent-blue) 32%, transparent);
  outline-offset: -2px;
}

.data-table .sparkline {
  width: 112px;
  height: 46px;
  min-height: 46px;
}

.money {
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.sku {
  color: var(--text-secondary);
  font-size: 0.78rem;
}

.chip {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  min-height: 21px;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.chip-success {
  color: #13795b;
  background: #c9f2d3;
}

.chip-green {
  color: #13795b;
  background: #c9f2d3;
}

.chip-warning {
  color: #9f5a00;
  background: #ffe2a8;
}

.chip-danger {
  color: #a93631;
  background: #ffd7d4;
}

.chip-info {
  color: var(--accent-blue);
  background: #dfe6ff;
}

.chip-purple {
  color: var(--accent-purple);
  background: #e8e5ff;
}

.chip-neutral {
  color: var(--text-secondary);
  background: #edf1f6;
}

.catalog-controls {
  flex: 1 1 460px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.product-header {
  align-items: center;
  flex-wrap: wrap;
}

.table-search {
  width: min(320px, 100%);
}

.filter-select {
  min-height: 42px;
  min-width: 156px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--bg-input);
  color: var(--text-primary);
}

.product-rail {
  display: grid;
  gap: 16px;
}

.suite-control-panel {
  overflow: visible;
}

.module-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  padding: 16px;
}

.module-card {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(118px, 1fr) auto auto;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: #fff;
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.module-card:hover,
.module-card.is-focused {
  border-color: color-mix(in srgb, var(--accent-blue) 36%, var(--border-subtle));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-blue) 12%, transparent), var(--shadow-card);
}

.module-card.is-focused {
  transform: translateY(-2px);
}

.module-card-top,
.module-card-foot,
.module-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.module-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--accent-blue) 9%, #fff);
  color: var(--accent-blue);
}

.module-card-body {
  min-width: 0;
}

.module-group {
  display: block;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 750;
  text-transform: uppercase;
}

.module-card h3 {
  margin: 0 0 8px;
  color: var(--text-primary);
  font-size: 1.04rem;
  font-weight: 650;
}

.module-card p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.5;
}

.module-card-foot {
  align-items: flex-end;
  border-top: 1px solid var(--border-subtle);
  padding-top: 12px;
}

.module-card-foot strong {
  max-width: 42%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--accent-blue);
  font-size: 1.15rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.module-card-foot span {
  min-width: 0;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 0.78rem;
}

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

.product-detail-shell {
  display: grid;
  gap: 16px;
}

.product-detail-hero {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) minmax(180px, 260px);
  gap: 22px;
  align-items: stretch;
  padding: 20px;
}

.product-detail-media {
  min-height: 220px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-blue) 7%, transparent), color-mix(in srgb, var(--accent-purple) 7%, transparent)),
    var(--bg-soft);
  color: var(--accent-blue);
  font-size: 2.4rem;
  font-weight: 700;
}

.product-detail-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-main {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 12px;
}

.product-detail-kicker,
.product-detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.product-detail-main h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: 1.75rem;
  font-weight: 650;
  line-height: 1.16;
}

.product-detail-main p {
  max-width: 760px;
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.58;
}

.product-detail-price {
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 18px;
  border-left: 1px solid var(--border-subtle);
}

.product-detail-price span,
.product-detail-price small {
  color: var(--text-secondary);
}

.product-detail-price strong {
  color: var(--accent-blue);
  font-size: 1.7rem;
  font-weight: 500;
  line-height: 1.1;
}

.product-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.product-detail-panel {
  min-width: 0;
}

.detail-list,
.raw-field-grid {
  display: grid;
  gap: 0;
  padding: 4px 16px 16px;
}

.detail-list-row,
.raw-field-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(0, 1fr);
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.detail-list-row:last-child,
.raw-field-row:last-child {
  border-bottom: 0;
}

.detail-list-row span,
.raw-field-row span {
  color: var(--text-secondary);
}

.detail-list-row strong,
.raw-field-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
  color: var(--text-primary);
  font-weight: 650;
}

.order-pipeline {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.pipeline-step {
  position: relative;
  min-height: 118px;
  display: grid;
  align-content: space-between;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--bg-card) 74%, transparent);
}

.pipeline-step::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 54px;
  height: 2px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent-blue) 42%, transparent);
}

.pipeline-step span {
  color: var(--text-secondary);
  font-weight: 750;
}

.pipeline-step strong {
  color: var(--text-primary);
  font-size: 1.7rem;
  font-weight: 850;
}

.progress-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.progress-track {
  height: 9px;
  margin-top: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-soft);
}

.progress-fill {
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-blue), var(--accent-violet));
}

.funnel {
  display: grid;
  gap: 8px;
}

.funnel-step {
  min-height: 44px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 0 12px;
  border-radius: var(--radius-card);
  color: #ffffff;
  font-weight: 780;
}

.gauge {
  width: 180px;
  aspect-ratio: 2 / 1;
  margin: 4px auto 12px;
  border-radius: 180px 180px 0 0;
  background:
    radial-gradient(circle at 50% 100%, var(--bg-card) 0 52%, transparent 53%),
    conic-gradient(from 180deg, var(--accent-red), var(--accent-orange), var(--accent-green));
}

.gauge-card {
  text-align: center;
}

.gauge-card strong {
  display: block;
  font-size: 2rem;
  font-weight: 850;
}

.gauge-card span {
  color: var(--text-secondary);
}

.action-tabs {
  display: flex;
  gap: 8px;
  padding: 16px 16px 0;
  flex-wrap: wrap;
}

.toast-box {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 1100;
  display: none;
  align-items: center;
  gap: 12px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 12px 14px;
  border-radius: var(--radius-card);
  color: var(--text-primary);
}

.toast-box.show {
  display: flex;
}

.toast-close {
  border: 0;
  background: transparent;
  color: var(--accent-violet);
  font-weight: 850;
  cursor: pointer;
}

.modal-shell {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
  place-items: center;
  padding: 20px;
}

.modal-shell.is-open {
  display: grid;
}

.modal-scrim {
  position: absolute;
  inset: 0;
  background: rgba(2, 6, 23, 0.56);
  backdrop-filter: blur(8px);
}

.modal-panel {
  position: relative;
  width: min(640px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  box-shadow: var(--shadow-pop), var(--shadow-glow-purple);
  backdrop-filter: blur(22px);
}

.modal-panel-wide {
  width: min(860px, 100%);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.modal-header h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 850;
}

.modal-form {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.modal-form label {
  display: grid;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 800;
}

.form-help {
  display: block;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 650;
  line-height: 1.45;
}

.form-help.warning {
  color: var(--accent-orange);
}

.modal-form input,
.modal-form select,
.modal-form textarea {
  min-height: 44px;
  width: 100%;
  padding: 0 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-control);
  background: var(--bg-input);
  color: var(--text-primary);
}

.modal-form textarea {
  min-height: 96px;
  padding: 10px 12px;
  resize: vertical;
  line-height: 1.5;
}

.form-grid-2,
.form-grid-3 {
  display: grid;
  gap: 12px;
}

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

.form-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 8px;
}

.form-check-row {
  min-height: 42px;
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 10px;
  color: var(--text-primary);
}

.form-check-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--accent-blue);
}

.skeleton-text,
.skeleton-row td {
  position: relative;
  overflow: hidden;
  color: transparent !important;
}

.skeleton-text::after,
.skeleton-row td::after {
  content: "";
  position: absolute;
  inset: 28% 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--text-muted) 16%, transparent), transparent);
  background-size: 200% 100%;
  animation: shimmer 1.1s infinite;
}

@keyframes shimmer {
  to {
    background-position-x: -200%;
  }
}

html[data-theme="dark"] .global-search,
html[data-theme="dark"] .table-search,
html[data-theme="dark"] .date-chip,
html[data-theme="dark"] .date-select,
html[data-theme="dark"] .view-tabs,
html[data-theme="dark"] .kpi-grid,
html[data-theme="dark"] .btn-soft,
html[data-theme="dark"] .segmented-control,
html[data-theme="dark"] .segment-button.active,
html[data-theme="dark"] .module-card {
  background: var(--bg-card);
}

html[data-theme="dark"] .stat-card:hover,
html[data-theme="dark"] .view-tab:hover,
html[data-theme="dark"] .view-tab.active {
  background: var(--bg-card-hover);
}

html[data-theme="dark"] .chip-success,
html[data-theme="dark"] .chip-green {
  background: color-mix(in srgb, var(--accent-green) 18%, transparent);
  color: #66d39d;
}

html[data-theme="dark"] .chip-warning {
  background: color-mix(in srgb, var(--accent-orange) 18%, transparent);
  color: #f0b35b;
}

html[data-theme="dark"] .chip-danger {
  background: color-mix(in srgb, var(--accent-red) 18%, transparent);
  color: #ff8580;
}

html[data-theme="dark"] .chip-info,
html[data-theme="dark"] .chip-purple {
  background: color-mix(in srgb, var(--accent-blue) 18%, transparent);
}

@media (max-width: 1280px) {
  .dashboard-grid,
  .orders-layout,
  .products-layout,
  .customers-layout,
  .payments-layout,
  .blog-layout,
  .suite-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .span-2 {
    grid-column: span 2;
  }

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

@media (max-width: 1100px) {
  .topbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .global-search {
    width: 100%;
  }
}

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

  .sidebar {
    position: sticky;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .sidebar-brand {
    padding: 16px 18px 10px;
  }

  .side-nav {
    display: flex;
    gap: 8px;
    padding: 8px 16px 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .side-nav .nav-link {
    min-width: 148px;
    flex: 0 0 auto;
  }

  .sidebar-footer {
    display: none;
  }

  .topbar {
    position: relative;
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: flex-start;
  }

  .content-wrap {
    padding: 20px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .heading-tools,
  .date-chip {
    width: 100%;
  }

  .settings-layout {
    grid-template-columns: 1fr;
  }

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

  .product-detail-hero {
    grid-template-columns: 180px minmax(0, 1fr);
  }

  .product-detail-price {
    grid-column: 1 / -1;
    border-top: 1px solid var(--border-subtle);
    border-left: 0;
  }
}

@media (max-width: 720px) {
  .kpi-grid,
  .kpi-grid.wide,
  .dashboard-grid,
  .orders-layout,
  .products-layout,
  .customers-layout,
  .payments-layout,
  .blog-layout,
  .suite-grid,
  .product-detail-grid {
    grid-template-columns: 1fr;
  }

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

  .stat-card {
    grid-template-columns: minmax(0, 1fr);
    border-right: 0;
    border-bottom: 1px solid var(--border-subtle);
  }

  .stat-card:last-child {
    border-bottom: 0;
  }

  .stat-value {
    font-size: 1.45rem;
  }

  .sparkline {
    min-height: 64px;
  }

  .side-nav .nav-link {
    grid-template-columns: 24px minmax(0, 1fr);
    min-width: 136px;
  }

  .nav-badge {
    display: none;
  }

  .btn span {
    display: none;
  }

  .btn {
    min-width: 42px;
    padding: 0 11px;
  }

  .global-search {
    min-width: 0;
  }

  .topbar {
    min-height: auto;
    padding: 12px 16px;
  }

  .topbar-actions {
    gap: 8px;
  }

  .notification-dropdown,
  .message-dropdown {
    position: fixed;
    top: 68px;
    right: 16px;
    left: 16px;
    width: auto;
  }

  .page-heading h1 {
    font-size: 1.68rem;
  }

  .donut-shell {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .order-pipeline {
    grid-template-columns: 1fr;
  }

  .catalog-controls,
  .table-search,
  .filter-select,
  .segmented-control {
    width: 100%;
  }

  .segmented-control {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .segment-button {
    flex: 1 0 auto;
  }

  .chart-shell {
    min-height: 236px;
  }

  .line-chart,
  .chart-shell.compact-chart {
    min-height: 220px;
  }

  .line-chart svg,
  .stripe-chart svg {
    height: 180px;
  }

  .data-table {
    min-width: 680px;
    font-size: 0.9rem;
  }

  .product-detail-hero {
    grid-template-columns: 1fr;
    padding: 14px;
  }

  .product-detail-media {
    min-height: 260px;
  }

  .detail-list-row,
  .raw-field-row {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .notification-item {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .notification-meta {
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    max-width: 100%;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
  }

  .form-grid-2,
  .form-grid-3 {
    grid-template-columns: 1fr;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions .btn {
    width: 100%;
  }
}

@media (max-width: 520px) {
  body {
    font-size: 14px;
  }

  .auth-gate {
    padding: 14px;
  }

  .auth-card {
    padding: 20px;
  }

  .sidebar-brand {
    padding-inline: 14px;
  }

  .brand-lockup {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px;
  }

  .brand-mark {
    width: 42px;
    height: 42px;
  }

  .side-nav {
    padding-inline: 14px;
  }

  .content-wrap {
    padding: 16px 14px 24px;
  }

  .view-tabs {
    margin-inline: -14px;
    border-right: 0;
    border-left: 0;
    border-radius: 0;
  }

  .panel-header,
  .chart-shell,
  .donut-shell,
  .status-list,
  .compact-list,
  .timeline-list,
  .funnel,
  .chart-list,
  .gauge-card,
  .action-output {
    padding: 12px;
  }

  .module-grid {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .product-avatar {
    width: 44px;
    height: 44px;
  }

  .article-avatar {
    width: 44px;
    height: 44px;
  }

  .product-detail-media {
    min-height: 220px;
  }

  .product-detail-main h2 {
    font-size: 1.45rem;
  }

  .data-table {
    min-width: 640px;
  }

  .modal-shell {
    align-items: end;
    padding: 10px;
  }

  .modal-panel {
    max-height: calc(100vh - 20px);
  }

  .modal-header,
  .modal-form {
    padding: 16px;
  }

  .toast-box {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }
}

.customers-layout {
  grid-template-columns: minmax(0, 2.1fr) minmax(300px, 0.9fr);
  align-items: start;
}

.customers-main-panel {
  grid-column: auto;
}

.customer-list-header {
  align-items: center;
}

.customer-result-meta {
  display: block;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.customer-table {
  min-width: 980px;
}

.customer-table th:first-child,
.customer-table td:first-child {
  min-width: 260px;
}

.customer-cell,
.customer-contact-cell,
.customer-actions-cell {
  max-width: 280px;
}

.customer-identity {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.customer-identity strong,
.customer-card strong,
.customer-profile-copy h2 {
  color: var(--text-primary);
}

.customer-identity small,
.customer-muted,
.customer-card small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.customer-contact-lines {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.customer-contact-lines > span {
  min-width: 0;
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
  color: var(--text-secondary);
  font-size: 0.82rem;
}

.customer-contact-lines i {
  color: var(--text-muted);
}

.customer-contact-empty {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.customer-chip-stack {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.chip i {
  margin-right: 4px;
  font-size: 0.85em;
}

.customer-date {
  display: block;
  color: var(--text-primary);
  font-weight: 700;
}

.customer-clv {
  display: block;
  max-width: 130px;
}

.customer-actions-cell .row-action-inline {
  justify-content: flex-end;
}

.customer-card-list {
  display: none;
  gap: 12px;
  padding: 12px;
}

.customer-card {
  min-width: 0;
  display: grid;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--bg-card);
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.customer-card:hover,
.customer-card:focus {
  border-color: color-mix(in srgb, var(--accent-blue) 36%, var(--border-subtle));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent-blue) 10%, transparent);
  outline: 0;
  transform: translateY(-1px);
}

.customer-card-top {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.customer-card-metrics,
.customer-quick-stats {
  display: grid;
  gap: 10px;
}

.customer-card-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.customer-metric {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 11px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background: var(--bg-soft);
}

.customer-metric i {
  color: var(--accent-blue);
}

.customer-metric span {
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 750;
}

.customer-metric strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.95rem;
  font-weight: 750;
}

.customer-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.customer-detail-shell {
  display: grid;
  gap: 16px;
}

.customer-profile-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.85fr) minmax(190px, 0.55fr);
  gap: 1px;
  padding: 0;
  background: var(--border-subtle);
}

.customer-profile-hero > * {
  min-width: 0;
  background: var(--bg-card);
  padding: 20px;
}

.customer-profile-identity {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
}

.customer-avatar-xl {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-blue) 14%, transparent), color-mix(in srgb, var(--accent-violet) 16%, transparent)),
    var(--bg-soft);
  color: var(--accent-blue);
  font-size: 1.75rem;
  font-weight: 850;
}

.customer-profile-copy {
  min-width: 0;
  display: grid;
  gap: 10px;
}

.customer-profile-kicker,
.customer-profile-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.customer-profile-copy h2 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 1.7rem;
  font-weight: 700;
  line-height: 1.16;
}

.customer-profile-copy p,
.customer-profile-notes p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.55;
}

.customer-profile-notes {
  display: grid;
  align-content: center;
  gap: 12px;
}

.customer-section-label {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
}

.customer-score-panel {
  display: grid;
  align-content: center;
  gap: 7px;
}

.customer-score-panel span,
.customer-score-panel small {
  color: var(--text-secondary);
}

.customer-score-panel strong {
  max-width: 100%;
  overflow: hidden;
  color: var(--accent-blue);
  font-size: 1.65rem;
  font-weight: 700;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-quick-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.customer-quick-stats .customer-metric {
  background: var(--bg-card);
  box-shadow: var(--shadow-card);
}

.customer-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.customer-info-card {
  min-width: 0;
}

.customer-info-header > div {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.customer-info-header p {
  grid-column: 2;
}

.customer-info-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-card);
  background: color-mix(in srgb, var(--accent-blue) 10%, var(--bg-card));
  color: var(--accent-blue);
}

@media (max-width: 1120px) {
  .customers-layout,
  .customer-profile-hero,
  .customer-detail-grid {
    grid-template-columns: 1fr;
  }

  .customer-profile-hero {
    gap: 0;
  }

  .customer-profile-hero > * + * {
    border-top: 1px solid var(--border-subtle);
  }

  .customer-quick-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .customers-table-wrap {
    display: none;
  }

  .customer-card-list {
    display: grid;
  }

  .customer-list-header,
  .catalog-controls {
    align-items: stretch;
  }

  .customer-card-top {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .customer-card-top > .chip {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .customer-profile-identity,
  .customer-quick-stats,
  .customer-card-metrics {
    grid-template-columns: 1fr;
  }

.customer-avatar-xl {
    width: 74px;
    height: 74px;
  }
}

.payments-layout {
  align-items: start;
}

.payment-gateway-panel {
  min-width: 0;
}

.payment-table {
  min-width: 920px;
}

.payment-transaction-table {
  min-width: 780px;
}

.payment-gateway-row {
  cursor: pointer;
}

.payment-gateway-row.is-selected td {
  background: color-mix(in srgb, var(--accent-blue) 9%, transparent);
}

.payment-gateway-identity {
  min-width: 0;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.payment-gateway-identity strong,
.payment-transaction-id strong {
  display: block;
  color: var(--text-primary);
}

.payment-gateway-identity small,
.payment-transaction-id small {
  display: block;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 0.76rem;
}

.gateway-logo {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--accent-blue) 10%, transparent), color-mix(in srgb, var(--accent-purple) 10%, transparent)),
    var(--bg-soft);
  color: var(--accent-blue);
  font-size: 1.05rem;
  font-weight: 850;
}

.gateway-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 7px;
  background: #ffffff;
}

.payment-config-stack {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.payment-rail {
  display: grid;
  gap: 16px;
}

.payment-transaction-id {
  min-width: 0;
  max-width: 260px;
}

html[data-theme="dark"] .gateway-logo img {
  background: #ffffff;
}

@media (max-width: 720px) {
  .payment-table,
  .payment-transaction-table {
    min-width: 720px;
  }
}
