@font-face {
  font-family: "Nunito";
  src: url("/assets/nunito-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
}

:root {
  --background: #f6f7f9;
  --foreground: #17191c;
  --surface-1: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #eef1f4;
  --surface-hover: #f2f4f6;
  --surface-selected: #edf3fe;
  --muted-foreground: #66707b;
  --subtle-foreground: #8a939e;
  --border: rgba(17, 25, 28, 0.12);
  --border-strong: rgba(17, 25, 28, 0.22);
  --input: #ffffff;
  --overlay: rgba(17, 25, 28, 0.32);
  --shadow-color: rgba(16, 24, 40, 0.09);
  --glass-background: rgba(255, 255, 255, 0.82);
  --glass-border: rgba(15, 23, 42, 0.1);
  --brand-blue: #4285f4;
  --brand-red: #ea4335;
  --brand-yellow: #fbbc05;
  --brand-green: #34a853;
  --brand-purple: #a142f4;
  --focus-ring: rgba(23, 25, 28, 0.16);
  color-scheme: light;
}

html[data-theme="dark"] {
  --background: #030303;
  --foreground: #f4f4f5;
  --surface-1: #0d0f10;
  --surface-2: #151719;
  --surface-3: #202326;
  --surface-hover: #191c1e;
  --surface-selected: #17243a;
  --muted-foreground: #a1a1aa;
  --subtle-foreground: #71717a;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.24);
  --input: #151719;
  --overlay: rgba(0, 0, 0, 0.62);
  --shadow-color: rgba(0, 0, 0, 0.38);
  --glass-background: rgba(8, 10, 12, 0.78);
  --glass-border: rgba(255, 255, 255, 0.1);
  --focus-ring: rgba(244, 244, 245, 0.18);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
}

body,
button,
input,
select,
textarea {
  font-family: "Nunito", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-size: 14px;
  line-height: 1.45;
}

body.is-locked {
  overflow: hidden;
}

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

.auth-panel {
  width: min(420px, 100%);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-1);
  box-shadow: 0 18px 50px var(--shadow-color);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.auth-brand img {
  width: 34px;
  height: 34px;
}

.auth-brand strong {
  font-size: 17px;
}

.auth-brand span {
  margin-left: auto;
  color: var(--subtle-foreground);
  font-size: 12px;
}

.auth-heading {
  padding: 24px 0 18px;
}

.auth-heading h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.3;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-form label {
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
}

.auth-form label input {
  margin-top: 6px;
}

.auth-form .button {
  width: 100%;
  min-height: 42px;
  margin-top: 3px;
}

.form-error {
  margin: -2px 0 0;
  color: var(--brand-red);
  font-size: 12px;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus-ring);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--input);
  color: var(--foreground);
  font-size: 14px;
  transition: border-color 160ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

input,
select {
  height: 38px;
  padding: 0 11px;
}

textarea {
  min-height: 88px;
  padding: 10px 11px;
  line-height: 1.55;
  resize: vertical;
}

input:hover,
select:hover,
textarea:hover {
  border-color: var(--border-strong);
}

input::placeholder,
textarea::placeholder {
  color: var(--subtle-foreground);
}

input[type="checkbox"] {
  width: 16px;
  height: 16px;
  padding: 0;
  accent-color: var(--foreground);
}

.is-hidden,
[hidden] {
  display: none !important;
}

.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;
}

.product-header {
  position: sticky;
  z-index: 40;
  top: 0;
  height: 64px;
  border-bottom: 1px solid var(--glass-border);
  background: var(--glass-background);
  backdrop-filter: blur(40px) saturate(1.25);
  -webkit-backdrop-filter: blur(40px) saturate(1.25);
}

.product-header-inner {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto auto minmax(220px, 1fr);
  align-items: center;
  gap: 20px;
  width: min(100%, 1600px);
  height: 64px;
  margin: 0 auto;
  padding: 0 28px;
}

.workspace-switcher,
.mobile-workspace-switcher {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-1);
  color: var(--muted-foreground);
}

.workspace-switcher svg,
.mobile-workspace-switcher svg {
  width: 15px;
  height: 15px;
  flex: 0 0 auto;
}

.workspace-switcher select,
.mobile-workspace-switcher select {
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 700;
  outline: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  min-width: 0;
  height: 44px;
  color: var(--foreground);
  text-decoration: none;
}

.brand-logo-wrap {
  position: relative;
  width: 31px;
  height: 31px;
  flex: 0 0 31px;
}

.brand-logo {
  width: 31px;
  height: 31px;
  object-fit: contain;
}

.brand-logo-wrap .brand-logo {
  position: absolute;
  inset: 0;
}

.brand-logo-dark {
  display: none;
}

html[data-theme="dark"] .brand-logo-dark {
  display: block;
}

html[data-theme="dark"] .brand-logo-light {
  display: none;
}

.brand-wordmark {
  margin-left: 10px;
  font-size: 16px;
  font-weight: 700;
}

.brand-divider {
  width: 1px;
  height: 18px;
  margin: 0 10px;
  background: var(--border);
}

.brand-product {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
}

.product-nav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: color 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.product-nav-item:hover,
.product-nav-item.is-active {
  color: var(--foreground);
}

.nav-dot {
  position: absolute;
  bottom: 1px;
  left: 50%;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand-blue);
  transform: translateX(-50%);
}

.header-actions {
  display: flex;
  align-items: center;
  justify-self: end;
  gap: 6px;
  min-width: 0;
}

.sync-summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 180px;
  height: 40px;
  margin-right: 4px;
  color: var(--muted-foreground);
  font-size: 12px;
  white-space: nowrap;
}

.sync-summary span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-foreground);
  transition: color 160ms cubic-bezier(0.16, 1, 0.3, 1), background 160ms cubic-bezier(0.16, 1, 0.3, 1), border-color 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.icon-button:hover {
  border-color: var(--border);
  background: var(--surface-hover);
  color: var(--foreground);
}

.icon-button svg,
.button svg,
.search-field svg,
.rule-summary svg,
.mobile-nav svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.8;
}

.account-button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 3px 0 10px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 13px;
  font-weight: 600;
}

.account-button:hover {
  border-color: var(--border);
  background: var(--surface-hover);
  color: var(--foreground);
}

.account-popover {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-1);
  box-shadow: 0 18px 44px var(--shadow-color);
}

.account-summary {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0 3px 6px;
  padding: 9px 8px 11px;
  border-bottom: 1px solid var(--border);
}

.account-summary strong {
  color: var(--foreground);
  font-size: 13px;
}

.account-summary small {
  color: var(--subtle-foreground);
  font-size: 10px;
}

.account-popover button {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  padding: 0 9px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
  text-align: left;
}

.account-popover button:hover {
  background: var(--surface-hover);
  color: var(--foreground);
}

.account-popover svg {
  width: 16px;
  height: 16px;
}

.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--foreground);
  color: var(--background);
  font-size: 13px;
  font-weight: 700;
}

.popover-anchor {
  position: relative;
}

.theme-popover {
  position: absolute;
  z-index: 60;
  top: calc(100% + 8px);
  right: 0;
  width: 174px;
  padding: 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-1);
  box-shadow: 0 18px 44px var(--shadow-color);
}

.popover-label {
  padding: 6px 9px 5px;
  color: var(--subtle-foreground);
  font-size: 11px;
  font-weight: 600;
}

.theme-popover button {
  display: grid;
  grid-template-columns: 18px 1fr 16px;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 36px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-foreground);
  text-align: left;
}

.theme-popover button:hover,
.theme-popover button.is-active {
  background: var(--surface-hover);
  color: var(--foreground);
}

.theme-popover svg {
  width: 15px;
  height: 15px;
}

.theme-popover .theme-check {
  visibility: hidden;
}

.theme-popover button.is-active .theme-check {
  visibility: visible;
}

.mobile-menu-button {
  display: none;
}

.mobile-menu {
  position: fixed;
  z-index: 70;
  inset: 0;
  overflow-y: auto;
  padding: 16px;
  background: var(--background);
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
}

.mobile-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
}

.mobile-brand .brand-logo {
  width: 31px;
  height: 31px;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-top: 28px;
}

.mobile-nav-label {
  padding: 20px 12px 8px;
  color: var(--subtle-foreground);
  font-size: 12px;
  font-weight: 600;
}

.mobile-nav button,
.mobile-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--foreground);
  font-size: 17px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
}

.mobile-nav button:hover,
.mobile-nav a:hover {
  background: var(--surface-hover);
}

.mobile-nav .mobile-theme-control {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 0 12px;
}

.mobile-nav .mobile-theme-control button {
  display: flex;
  min-width: 0;
  min-height: 44px;
  justify-content: center;
  gap: 7px;
  padding: 0 8px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--muted-foreground);
  font-size: 12px;
}

.mobile-nav .mobile-theme-control button.is-active {
  border-color: var(--border-strong);
  background: var(--surface-selected);
  color: var(--foreground);
}

.mobile-workspace-switcher {
  width: calc(100% - 24px);
  height: 44px;
  margin: 0 12px;
  padding: 0 12px;
}

.mobile-workspace-switcher select {
  width: 100%;
  font-size: 15px;
}

.app-shell {
  width: min(100%, 1600px);
  margin: 0 auto;
  padding: 0 28px 40px;
}

.context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 82px;
  gap: 24px;
  border-bottom: 1px solid var(--border);
}

.context-copy {
  min-width: 0;
}

.context-eyebrow {
  margin: 0 0 2px;
  color: var(--brand-blue);
  font-size: 11px;
  font-weight: 700;
}

.context-copy h1,
.drawer-header h2,
.modal-header h2 {
  margin: 0;
  color: var(--foreground);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

.context-copy > p:last-child,
.drawer-header > div > p:last-child,
.modal-header > div > p:last-child {
  margin: 3px 0 0;
  color: var(--muted-foreground);
  font-size: 12px;
}

.context-actions,
.drawer-actions,
.modal-footer,
.selection-bar > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  gap: 8px;
  padding: 0 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: color 160ms cubic-bezier(0.16, 1, 0.3, 1), background 160ms cubic-bezier(0.16, 1, 0.3, 1), border-color 160ms cubic-bezier(0.16, 1, 0.3, 1), box-shadow 160ms cubic-bezier(0.16, 1, 0.3, 1);
}

.button-primary {
  background: var(--foreground);
  color: var(--background);
}

.button-primary:hover {
  box-shadow: 0 6px 16px var(--shadow-color);
}

.button-secondary {
  border-color: var(--border);
  background: var(--surface-1);
  color: var(--foreground);
}

.button-secondary:hover,
.button-quiet:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.button-quiet {
  min-height: 34px;
  padding: 0 10px;
  border-color: transparent;
  background: transparent;
  color: var(--foreground);
}

.text-button {
  min-height: 32px;
  padding: 0 4px;
  border: 0;
  background: transparent;
  color: var(--brand-blue);
  font-size: 12px;
  font-weight: 700;
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 110px;
  border-bottom: 1px solid var(--border);
}

.stat-item {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 16px 22px;
  border-right: 1px solid var(--border);
}

.stat-item:first-child {
  padding-left: 0;
}

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

.stat-label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
}

.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--subtle-foreground);
}

.status-dot-blue { background: var(--brand-blue); }
.status-dot-green { background: var(--brand-green); }
.status-dot-yellow { background: var(--brand-yellow); }
.status-dot-red { background: var(--brand-red); }
.status-dot-muted { background: var(--subtle-foreground); }

.stat-value {
  margin-top: 5px;
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.stat-note {
  overflow: hidden;
  margin-top: 3px;
  color: var(--subtle-foreground);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.marketing-area {
  padding-bottom: 40px;
}

.marketing-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  gap: 16px;
  border-bottom: 1px solid var(--border);
}

.marketing-toolbar > div:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.marketing-toolbar strong {
  color: var(--foreground);
  font-size: 13px;
}

.marketing-toolbar span {
  overflow: hidden;
  color: var(--subtle-foreground);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
}

.money-overview > div {
  min-width: 0;
  padding: 16px 20px;
  border-right: 1px solid var(--border);
}

.money-overview > div:first-child {
  padding-left: 0;
}

.money-overview > div:last-child {
  border-right: 0;
}

.money-overview span,
.money-overview strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-overview span {
  color: var(--subtle-foreground);
  font-size: 10px;
  font-weight: 600;
}

.money-overview strong {
  margin-top: 5px;
  color: var(--foreground);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.money-overview-filtered {
  margin-bottom: 14px;
  border-top: 1px solid var(--border);
}

.sync-health {
  display: grid;
  gap: 10px;
  padding: 15px 0;
  border-bottom: 1px solid var(--border);
}

.sync-health-heading,
.sync-health-heading > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sync-health-heading strong {
  font-size: 13px;
}

.sync-health-summary {
  color: var(--muted-foreground);
  font-size: 11px;
}

.sync-history-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--border);
}

.sync-history-item {
  min-width: 0;
  padding: 10px 12px 0;
  border-right: 1px solid var(--border);
}

.sync-history-item:first-child {
  padding-left: 0;
}

.sync-history-item:last-child {
  border-right: 0;
}

.sync-history-item strong,
.sync-history-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-history-item strong {
  color: var(--foreground);
  font-size: 11px;
}

.sync-history-item.is-failed strong {
  color: var(--brand-red);
}

.sync-history-item span {
  margin-top: 3px;
  color: var(--subtle-foreground);
  font-size: 9px;
}

.audit-activity {
  display: grid;
  gap: 7px;
  padding-top: 4px;
}

.audit-activity > strong {
  font-size: 11px;
}

.audit-list {
  display: grid;
  gap: 5px;
}

.audit-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted-foreground);
  font-size: 10px;
}

.audit-item time {
  flex: 0 0 auto;
  color: var(--subtle-foreground);
}

.date-navigator {
  display: flex;
  align-items: center;
  gap: 3px;
}

.date-navigator input {
  width: 144px;
}

.marketing-panels {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.85fr);
  border-bottom: 1px solid var(--border);
}

.marketing-panel {
  min-width: 0;
  min-height: 310px;
  padding: 22px 24px 24px 0;
  border-right: 1px solid var(--border);
}

.marketing-panel + .marketing-panel {
  padding-right: 0;
  padding-left: 24px;
  border-right: 0;
}

.marketing-panel .section-heading,
.daily-snapshot-section .section-heading {
  align-items: flex-start;
}

.section-heading > div {
  min-width: 0;
}

.section-heading h2 {
  margin: 0;
  color: var(--foreground);
  font-size: 14px;
  font-weight: 700;
}

.section-heading > div > span {
  display: block;
  margin-top: 2px;
  color: var(--subtle-foreground);
  font-size: 10px;
}

.marketing-panel .section-heading > strong {
  color: var(--foreground);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

.spend-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(38px, 1fr));
  align-items: stretch;
  height: 218px;
  margin-top: 18px;
  gap: 10px;
}

.spend-chart > .timeline-empty {
  grid-column: 1 / -1;
  align-self: center;
  text-align: center;
}

.trend-column {
  display: grid;
  grid-template-rows: 1fr 18px 18px;
  align-items: end;
  min-width: 0;
  text-align: center;
}

.trend-track {
  display: flex;
  width: 100%;
  height: 100%;
  align-items: flex-end;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}

.trend-bar {
  width: min(34px, 60%);
  min-height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--brand-blue);
  transition: height 220ms cubic-bezier(0.16, 1, 0.3, 1);
}

.trend-value,
.trend-date {
  overflow: hidden;
  color: var(--muted-foreground);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trend-date {
  color: var(--subtle-foreground);
}

.pipeline-summary {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 23px;
}

.pipeline-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
}

.pipeline-row > span,
.pipeline-row > strong {
  color: var(--muted-foreground);
  font-size: 11px;
}

.pipeline-row > strong {
  color: var(--foreground);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pipeline-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-3);
}

.pipeline-fill {
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
  background: var(--brand-blue);
}

.pipeline-fill.pipeline-interested { background: var(--brand-purple); }
.pipeline-fill.pipeline-proposal { background: var(--brand-yellow); }
.pipeline-fill.pipeline-won { background: var(--brand-green); }
.pipeline-fill.pipeline-paused { background: var(--subtle-foreground); }

.daily-snapshot-section {
  padding-top: 22px;
}

.daily-table-wrap {
  margin-top: 15px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-1);
}

.daily-table {
  width: 100%;
  min-width: 1200px;
  border-collapse: collapse;
}

.daily-table th,
.daily-table td {
  height: 43px;
  padding: 0 13px;
  border-bottom: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 11px;
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.daily-table th {
  background: var(--surface-2);
  color: var(--subtle-foreground);
  font-size: 10px;
  font-weight: 700;
}

.daily-table th:first-child,
.daily-table td:first-child {
  color: var(--foreground);
  text-align: left;
}

.daily-table tbody tr:last-child td {
  border-bottom: 0;
}

.daily-table tbody tr.is-selected {
  background: var(--surface-selected);
}

.priority-area {
  padding-top: 20px;
}

.priority-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(140px, 180px) minmax(180px, 220px) auto;
  align-items: end;
  gap: 10px;
}

.priority-search-field {
  width: 100%;
  max-width: 460px;
}

.priority-owner-field,
.priority-sort-field {
  width: 100%;
  min-width: 0;
}

.priority-mine-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-1);
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.priority-mine-toggle:hover {
  border-color: var(--border-strong);
  color: var(--foreground);
}

.priority-queue-tabs {
  display: flex;
  align-items: stretch;
  gap: 22px;
  min-height: 52px;
  margin-top: 14px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.priority-queue-tabs::-webkit-scrollbar {
  display: none;
}

.priority-queue-tabs button {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.priority-queue-tabs button:hover,
.priority-queue-tabs button.is-active {
  color: var(--foreground);
}

.priority-queue-tabs button.is-active::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--brand-blue);
  content: "";
}

.priority-queue-tabs strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--subtle-foreground);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.priority-queue-tabs button.is-active strong {
  background: var(--surface-selected);
  color: var(--brand-blue);
}

.priority-rule-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  gap: 16px;
  color: var(--muted-foreground);
  font-size: 12px;
}

.priority-rule-summary > div {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.priority-rule-summary svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  color: var(--brand-blue);
}

.priority-rule-summary strong {
  flex: 0 0 auto;
  color: var(--foreground);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.priority-table-surface {
  position: relative;
  min-height: 260px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-1);
}

.priority-table {
  width: 100%;
  min-width: 1220px;
  border-collapse: collapse;
  table-layout: fixed;
}

.priority-table th,
.priority-table td {
  overflow: hidden;
  padding: 0 13px;
  border-bottom: 1px solid var(--border);
  color: var(--muted-foreground);
  font-size: 11px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-table th {
  height: 42px;
  background: var(--surface-2);
  color: var(--subtle-foreground);
  font-size: 10px;
  font-weight: 700;
}

.priority-table td {
  height: 72px;
  font-variant-numeric: tabular-nums;
}

.priority-table tbody tr {
  cursor: pointer;
  transition: background 140ms cubic-bezier(0.16, 1, 0.3, 1);
}

.priority-table tbody tr:hover {
  background: var(--surface-hover);
}

.priority-table tbody tr:last-child td {
  border-bottom: 0;
}

.priority-table th:nth-child(1) { width: 178px; }
.priority-table th:nth-child(2) { width: 226px; }
.priority-table th:nth-child(3) { width: 300px; }
.priority-table th:nth-child(4) { width: 132px; }
.priority-table th:nth-child(5) { width: 132px; }
.priority-table th:nth-child(6) { width: 100px; }
.priority-table th:nth-child(7) { width: 106px; }
.priority-table th:nth-child(8) { width: 84px; }

.priority-customer-cell,
.priority-mobile-header > div {
  min-width: 0;
}

.priority-customer-cell strong,
.priority-customer-cell span,
.priority-mobile-header strong,
.priority-mobile-header span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-customer-cell strong,
.priority-mobile-header strong {
  color: var(--foreground);
  font-size: 13px;
}

.priority-customer-cell span,
.priority-mobile-header span {
  margin-top: 4px;
  color: var(--subtle-foreground);
  font-size: 10px;
}

.opportunity-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  white-space: normal;
}

.opportunity-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted-foreground);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.opportunity-red { border-color: rgba(234, 67, 53, 0.28); color: var(--brand-red); }
.opportunity-yellow { border-color: rgba(251, 188, 4, 0.34); color: var(--brand-yellow); }
.opportunity-green { border-color: rgba(52, 168, 83, 0.3); color: var(--brand-green); }
.opportunity-blue { border-color: rgba(66, 133, 244, 0.3); color: var(--brand-blue); }
.opportunity-purple { border-color: rgba(142, 68, 173, 0.3); color: var(--brand-purple); }

.priority-value-cell {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.priority-value-cell span {
  min-width: 0;
}

.priority-value-cell small,
.priority-mobile-values span {
  display: block;
  color: var(--subtle-foreground);
  font-size: 9px;
}

.priority-value-cell strong,
.priority-mobile-values strong {
  display: block;
  overflow: hidden;
  margin-top: 3px;
  color: var(--foreground);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-business-cell {
  display: flex;
  align-items: center;
  gap: 9px;
}

.priority-row-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
}

.priority-mobile-list {
  display: none;
}

.work-area {
  padding-top: 20px;
}

.filter-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 1.6fr) auto minmax(150px, 0.7fr) minmax(190px, 0.9fr) auto auto;
  align-items: flex-end;
  gap: 10px;
  width: 100%;
  min-height: 52px;
}

.advanced-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  align-items: end;
  gap: 10px;
  margin-top: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.advanced-filters[hidden] {
  display: none;
}

.customer-number-field input {
  font-variant-numeric: tabular-nums;
}

.recharge-threshold-field {
  min-width: 150px;
}

.priority-threshold-field {
  min-width: 150px;
}

.filter-toggle-button {
  height: 38px;
  padding: 0 12px;
  white-space: nowrap;
}

.filter-toggle-button.is-active {
  border-color: rgba(66, 133, 244, 0.38);
  background: var(--surface-selected);
  color: var(--foreground);
}

.filter-toggle-button small {
  display: inline-grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--brand-blue);
  color: white;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.filter-toggle-button small[hidden] {
  display: none;
}

.search-field {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.search-field svg {
  position: absolute;
  z-index: 1;
  top: 11px;
  left: 11px;
  color: var(--subtle-foreground);
}

.search-field input {
  padding-left: 36px;
}

.scope-control {
  display: inline-grid;
  grid-template-columns: repeat(3, auto);
  height: 38px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-2);
}

.scope-control button {
  min-width: 56px;
  padding: 0 10px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.scope-control button:hover {
  color: var(--foreground);
}

.scope-control button.is-active {
  background: var(--surface-1);
  color: var(--foreground);
  box-shadow: 0 1px 4px var(--shadow-color);
}

.filter-field,
.threshold-field {
  display: flex;
  flex-direction: column;
  flex: 0 1 145px;
  gap: 4px;
  min-width: 110px;
}

.filter-field > span,
.threshold-field > span:first-child {
  color: var(--subtle-foreground);
  font-size: 10px;
  font-weight: 600;
}

.filter-field select {
  min-width: 110px;
}

.threshold-field {
  flex-basis: 132px;
}

.threshold-input {
  display: grid;
  grid-template-columns: 24px 1fr 38px;
  align-items: center;
  height: 38px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--input);
  color: var(--subtle-foreground);
  font-size: 11px;
}

.threshold-input > span {
  text-align: center;
}

.threshold-input input {
  height: 36px;
  padding: 0 4px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.threshold-input input:focus-visible {
  box-shadow: none;
}

.reset-button {
  margin-left: auto;
}

.rule-summary {
  display: flex;
  align-items: center;
  min-height: 46px;
  gap: 8px;
  color: var(--muted-foreground);
  font-size: 12px;
}

.rule-summary svg {
  width: 15px;
  height: 15px;
}

.result-count {
  margin-left: auto;
  color: var(--foreground);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.selection-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
  margin-bottom: 8px;
  padding: 5px 8px 5px 14px;
  border: 1px solid rgba(66, 133, 244, 0.28);
  border-radius: 7px;
  background: var(--surface-selected);
  color: var(--foreground);
  font-size: 12px;
}

.table-surface {
  position: relative;
  min-height: 260px;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-1);
}

.pagination {
  display: flex;
  align-items: center;
  min-height: 58px;
  gap: 16px;
  color: var(--muted-foreground);
  font-size: 12px;
}

.pagination[hidden] {
  display: none;
}

.pagination-summary {
  margin-right: auto;
  font-variant-numeric: tabular-nums;
}

.page-size-field,
.pagination-controls,
.pagination-pages {
  display: inline-flex;
  align-items: center;
}

.page-size-field {
  gap: 8px;
  white-space: nowrap;
}

.page-size-field select {
  width: 78px;
  min-width: 78px;
}

.pagination-controls {
  gap: 5px;
}

.pagination-pages {
  gap: 3px;
}

.page-number {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: var(--muted-foreground);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.page-number:hover {
  border-color: var(--border);
  background: var(--surface-hover);
  color: var(--foreground);
}

.page-number.is-active {
  border-color: var(--border-strong);
  background: var(--surface-2);
  color: var(--foreground);
  font-weight: 700;
}

.pagination-ellipsis {
  width: 22px;
  text-align: center;
}

.customer-table {
  width: 100%;
  min-width: 1580px;
  border-collapse: collapse;
  table-layout: fixed;
}

.customer-table th,
.customer-table td {
  overflow: hidden;
  padding: 0 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.customer-table th {
  height: 42px;
  background: var(--surface-2);
  color: var(--subtle-foreground);
  font-size: 10px;
  font-weight: 700;
}

.customer-table td {
  height: 64px;
  color: var(--muted-foreground);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.customer-table tbody tr {
  cursor: pointer;
  transition: background 140ms cubic-bezier(0.16, 1, 0.3, 1);
}

.customer-table tbody tr:hover {
  background: var(--surface-hover);
}

.customer-table tbody tr:last-child td {
  border-bottom: 0;
}

.customer-table th:nth-child(1) { width: 42px; }
.customer-table th:nth-child(2) { width: 66px; }
.customer-table th:nth-child(3) { width: 154px; }
.customer-table th:nth-child(4) { width: 110px; }
.customer-table th:nth-child(5) { width: 104px; }
.customer-table th:nth-child(6) { width: 100px; }
.customer-table th:nth-child(7) { width: 112px; }
.customer-table th:nth-child(8) { width: 100px; }
.customer-table th:nth-child(9) { width: 96px; }
.customer-table th:nth-child(10) { width: 96px; }
.customer-table th:nth-child(11) { width: 104px; }
.customer-table th:nth-child(12) { width: 78px; }
.customer-table th:nth-child(13) { width: 94px; }
.customer-table th:nth-child(14) { width: 88px; }
.customer-table th:nth-child(15) { width: 96px; }
.customer-table th:nth-child(16) { width: 46px; }

.check-column,
.action-column {
  text-align: center !important;
}

.check-column input {
  vertical-align: middle;
}

.numeric-column {
  text-align: right !important;
}

.customer-table td.numeric-column {
  color: var(--foreground);
  font-weight: 700;
}

.customer-name-cell {
  min-width: 0;
}

.customer-name {
  overflow: hidden;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
}

.customer-company {
  overflow: hidden;
  margin-top: 3px;
  color: var(--subtle-foreground);
  font-size: 11px;
  text-overflow: ellipsis;
}

.contact-cell span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.contact-cell span + span {
  margin-top: 3px;
  color: var(--subtle-foreground);
  font-size: 10px;
}

.usage-cell {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
}

.usage-meta {
  color: var(--subtle-foreground);
  font-size: 10px;
}

.status-label,
.stage-label,
.rating-label,
.hit-label {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.status-label::before,
.stage-label::before {
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--subtle-foreground);
  content: "";
}

.status-active::before,
.stage-won::before { background: var(--brand-green); }
.status-low::before,
.stage-pending::before { background: var(--brand-yellow); }
.status-inactive::before,
.stage-paused::before { background: var(--brand-red); }
.status-new::before,
.stage-uncontacted::before { background: var(--subtle-foreground); }
.stage-contacted::before { background: var(--brand-blue); }
.stage-interested::before { background: var(--brand-purple); }
.stage-proposal::before { background: var(--brand-yellow); }

.rating-label {
  justify-content: center;
  min-width: 34px;
  height: 24px;
  padding: 0 7px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted-foreground);
}

.rating-A { border-color: rgba(234, 67, 53, 0.28); color: var(--brand-red); }
.rating-B { border-color: rgba(66, 133, 244, 0.28); color: var(--brand-blue); }
.rating-C { color: var(--muted-foreground); }
.rating-D { color: var(--subtle-foreground); }

.table-action {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 6px;
}

.positive-value {
  color: var(--brand-green) !important;
}

.warning-value {
  color: var(--brand-red) !important;
}

.mobile-customer-list {
  display: none;
}

.loading-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 280px;
  gap: 8px;
  color: var(--muted-foreground);
}

.loading-state {
  position: absolute;
  z-index: 2;
  inset: 0;
  background: var(--surface-1);
}

.empty-state svg {
  width: 28px;
  height: 28px;
  margin-bottom: 4px;
  color: var(--subtle-foreground);
}

.empty-state strong {
  color: var(--foreground);
  font-size: 14px;
}

.empty-state span {
  color: var(--subtle-foreground);
  font-size: 12px;
}

.empty-state .button {
  margin-top: 8px;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border);
  border-top-color: var(--foreground);
  border-radius: 50%;
  animation: spin 800ms linear infinite;
}

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

.drawer-backdrop {
  position: fixed;
  z-index: 79;
  inset: 0;
  background: var(--overlay);
}

.customer-drawer {
  position: fixed;
  z-index: 80;
  top: 0;
  right: 0;
  width: min(470px, 100vw);
  height: 100vh;
  overflow: hidden;
  border-left: 1px solid var(--border);
  background: var(--surface-1);
  box-shadow: -24px 0 60px var(--shadow-color);
  transform: translateX(101%);
  transition: transform 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.customer-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  min-height: 96px;
  padding: 22px 22px 17px;
  border-bottom: 1px solid var(--border);
}

.drawer-body {
  height: calc(100vh - 96px);
  overflow-y: auto;
  padding: 18px 22px 40px;
}

.drawer-actions .button {
  flex: 1;
}

.drawer-section {
  padding: 20px 0;
  border-bottom: 1px solid var(--border);
}

.drawer-section:last-child {
  border-bottom: 0;
}

.drawer-section h3,
.section-heading h3 {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
  gap: 15px 20px;
}

.detail-grid div {
  min-width: 0;
}

.detail-grid dt {
  margin-bottom: 3px;
  color: var(--subtle-foreground);
  font-size: 10px;
  font-weight: 600;
}

.detail-grid dd {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--foreground);
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.drawer-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.drawer-form-grid label,
.form-grid > label {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 5px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 600;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-heading h3 {
  margin: 0;
}

.section-heading > span {
  color: var(--subtle-foreground);
  font-size: 11px;
}

.timeline {
  margin-top: 14px;
}

.timeline-empty {
  padding: 18px 0;
  color: var(--subtle-foreground);
  font-size: 12px;
  text-align: center;
}

.timeline-item {
  position: relative;
  padding: 0 0 18px 22px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  position: absolute;
  top: 7px;
  bottom: -7px;
  left: 5px;
  width: 1px;
  background: var(--border);
  content: "";
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-item::after {
  position: absolute;
  top: 5px;
  left: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-blue);
  content: "";
}

.timeline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--subtle-foreground);
  font-size: 10px;
}

.timeline-item p {
  margin: 5px 0 0;
  color: var(--foreground);
  font-size: 12px;
  line-height: 1.6;
}

.timeline-next {
  margin-top: 5px;
  color: var(--muted-foreground);
  font-size: 10px;
}

.modal {
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 40px));
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-1);
  color: var(--foreground);
  box-shadow: 0 24px 80px var(--shadow-color);
}

.modal::backdrop {
  background: var(--overlay);
  backdrop-filter: blur(4px);
}

.modal-compact {
  width: min(620px, calc(100vw - 32px));
}

.modal form,
.modal-frame {
  display: flex;
  max-height: inherit;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex: 0 0 auto;
  min-height: 88px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-body {
  overflow-y: auto;
  padding: 20px 22px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 16px;
}

.field-wide {
  grid-column: 1 / -1;
}

.required {
  margin-left: 3px;
  color: var(--brand-red);
}

.checkbox-field {
  display: grid !important;
  grid-template-columns: 18px 1fr;
  align-items: flex-start;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
}

.checkbox-field input {
  margin-top: 2px;
}

.checkbox-field span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.checkbox-field strong {
  color: var(--foreground);
  font-size: 12px;
}

.checkbox-field small {
  color: var(--subtle-foreground);
  font-size: 10px;
  font-weight: 400;
}

.workspace-permissions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.workspace-permissions legend {
  margin-bottom: 7px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 600;
}

.workspace-permissions label {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px;
  padding: 10px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
}

.workspace-permissions label:has(input:checked) {
  border-color: var(--brand-blue);
  background: var(--surface-selected);
}

.workspace-permissions input {
  margin-top: 2px;
}

.workspace-permissions span {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.workspace-permissions strong {
  color: var(--foreground);
  font-size: 12px;
}

.workspace-permissions small {
  color: var(--subtle-foreground);
  font-size: 10px;
  font-weight: 400;
}

.connection-status {
  display: grid;
  grid-template-columns: 9px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-2);
}

.connection-status > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.connection-status strong,
.connection-status small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.connection-status strong {
  color: var(--foreground);
  font-size: 12px;
}

.connection-status small {
  color: var(--subtle-foreground);
  font-size: 10px;
}

.secret-input {
  position: relative;
  display: block;
}

.secret-input input {
  padding-right: 46px;
}

.secret-input .icon-button {
  position: absolute;
  top: 0;
  right: 0;
  width: 38px;
  height: 38px;
  border: 0;
}

.modal-footer {
  justify-content: flex-end;
  flex: 0 0 auto;
  min-height: 66px;
  padding: 12px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface-2);
}

.user-management-body {
  min-height: 360px;
}

.user-management-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.user-management-toolbar > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.user-management-toolbar strong {
  font-size: 13px;
}

.user-management-toolbar span {
  color: var(--subtle-foreground);
  font-size: 10px;
}

.user-list {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-1);
}

.user-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 74px 58px 36px;
  align-items: center;
  min-height: 64px;
  gap: 12px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
}

.user-row:last-child {
  border-bottom: 0;
}

.user-row .avatar {
  width: 32px;
  height: 32px;
}

.user-identity {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

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

.user-identity strong {
  color: var(--foreground);
  font-size: 12px;
}

.user-identity span,
.user-last-login {
  color: var(--subtle-foreground);
  font-size: 10px;
}

.role-badge,
.account-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 7px;
  border-radius: 5px;
  background: var(--surface-3);
  color: var(--muted-foreground);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.role-admin {
  background: var(--surface-selected);
  color: var(--brand-blue);
}

.account-status.is-inactive {
  color: var(--brand-red);
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: flex;
  width: min(360px, calc(100vw - 36px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 18px 1fr;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-1);
  color: var(--foreground);
  box-shadow: 0 12px 36px var(--shadow-color);
  font-size: 12px;
  pointer-events: auto;
  animation: toast-in 240ms cubic-bezier(0.16, 1, 0.3, 1);
}

.toast svg {
  width: 17px;
  height: 17px;
  color: var(--brand-green);
}

.toast.is-error svg {
  color: var(--brand-red);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 1240px) {
  .product-header-inner {
    grid-template-columns: minmax(240px, 1fr) auto minmax(220px, auto);
  }

  .product-nav {
    display: none;
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .filter-toolbar {
    grid-template-columns: minmax(240px, 1.4fr) auto minmax(140px, 0.7fr) minmax(180px, 1fr) auto auto;
  }

  .reset-button {
    margin-left: 0;
  }

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

  .priority-toolbar {
    grid-template-columns: minmax(260px, 1fr) minmax(140px, 180px) minmax(180px, 220px) auto;
  }
}

@media (max-width: 940px) {
  .marketing-panels {
    grid-template-columns: 1fr;
  }

  .marketing-panel,
  .marketing-panel + .marketing-panel {
    min-height: 290px;
    padding: 20px 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .marketing-panel + .marketing-panel {
    border-bottom: 0;
  }

}

@media (max-width: 767px) {
  .auth-screen {
    padding: 16px;
  }

  .auth-panel {
    padding: 22px;
  }

  .product-header,
  .product-header-inner {
    height: 60px;
  }

  .product-header-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 0 16px;
  }

  .brand-wordmark,
  .brand-divider,
  .brand-product,
  .sync-summary,
  .sync-button,
  .connection-button,
  .account-button,
  #themeButton {
    display: none;
  }

  .workspace-switcher {
    display: none;
  }

  .app-shell {
    padding: 0 16px 28px;
  }

  .context-bar {
    align-items: flex-end;
    min-height: 94px;
    padding: 14px 0;
  }

  .context-copy h1 {
    font-size: 18px;
  }

  .context-copy > p:last-child {
    display: none;
  }

  .context-actions .button {
    width: 40px;
    padding: 0;
  }

  .context-actions .button span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
  }

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

  .stat-item {
    min-height: 94px;
    padding: 14px 14px;
    border-bottom: 1px solid var(--border);
  }

  .stat-item:first-child {
    padding-left: 0;
  }

  .stat-item:nth-child(2) {
    border-right: 0;
  }

  .stat-item:nth-child(3) {
    padding-left: 0;
    border-bottom: 0;
  }

  .stat-item:nth-child(4) {
    border-bottom: 0;
  }

  .stat-value {
    font-size: 22px;
  }

  .work-area {
    padding-top: 16px;
  }

  .priority-area {
    padding-top: 16px;
  }

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

  .priority-search-field {
    max-width: none;
    grid-column: 1 / -1;
  }

  .priority-mine-toggle {
    width: 100%;
  }

  .priority-queue-tabs {
    gap: 18px;
    margin-right: -16px;
    padding-right: 16px;
  }

  .priority-rule-summary {
    align-items: flex-start;
    min-height: 58px;
    padding: 10px 0;
  }

  .priority-rule-summary > div {
    line-height: 1.45;
  }

  .priority-table {
    display: none;
  }

  .priority-mobile-list {
    display: block;
  }

  .priority-mobile-card {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-1);
    cursor: pointer;
  }

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

  .priority-mobile-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: 10px;
  }

  .priority-mobile-header strong {
    font-size: 14px;
  }

  .priority-mobile-card > .opportunity-tags {
    margin-top: 12px;
  }

  .priority-mobile-values {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px 14px;
    margin-top: 14px;
  }

  .priority-mobile-values strong {
    font-size: 12px;
  }

  .priority-mobile-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }

  .priority-mobile-footer > div {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 12px;
  }

  .priority-mobile-footer > div > span:last-child {
    overflow: hidden;
    color: var(--muted-foreground);
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .marketing-toolbar {
    min-height: 68px;
  }

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

  .money-overview > div {
    padding: 13px 12px;
    border-bottom: 1px solid var(--border);
  }

  .money-overview > div:first-child,
  .money-overview > div:nth-child(3) {
    padding-left: 0;
  }

  .money-overview > div:nth-child(2),
  .money-overview > div:nth-child(4) {
    border-right: 0;
  }

  .money-overview > div:nth-child(3),
  .money-overview > div:nth-child(4) {
    border-bottom: 1px solid var(--border);
  }

  .money-overview > div:last-child {
    grid-column: 1 / -1;
    padding-left: 0;
    border-bottom: 0;
  }

  .sync-history-list {
    grid-template-columns: 1fr;
  }

  .sync-history-item,
  .sync-history-item:first-child {
    padding: 8px 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sync-history-item:last-child {
    border-bottom: 0;
  }

  .money-overview strong {
    font-size: 15px;
  }

  .spend-chart {
    grid-template-columns: repeat(7, minmax(30px, 1fr));
    gap: 5px;
  }

  .filter-toolbar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

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

  .sort-field {
    grid-column: auto;
  }

  .search-field,
  .scope-control {
    width: 100%;
    grid-column: 1 / -1;
  }

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

  .filter-toggle-button {
    width: 100%;
    grid-column: 1 / -1;
  }

  .filter-field,
  .threshold-field {
    width: 100%;
    min-width: 0;
  }

  .filter-field select {
    min-width: 0;
  }

  .reset-button {
    display: none;
  }

  .pagination {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px 0;
  }

  .pagination-controls {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .rule-summary {
    align-items: flex-start;
    min-height: 54px;
    padding: 10px 0;
  }

  .rule-summary span:not(.result-count) {
    line-height: 1.45;
  }

  .result-count {
    flex: 0 0 auto;
  }

  .selection-bar {
    align-items: flex-start;
    gap: 8px;
    padding-left: 10px;
  }

  .selection-bar .button span {
    display: none;
  }

  .customer-table {
    display: none;
  }

  .mobile-customer-list {
    display: block;
  }

  .mobile-customer-card {
    padding: 15px;
    border-bottom: 1px solid var(--border);
    background: var(--surface-1);
  }

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

  .mobile-card-header {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr) auto;
    align-items: flex-start;
    gap: 10px;
  }

  .mobile-card-header input {
    margin-top: 2px;
  }

  .mobile-card-title {
    min-width: 0;
  }

  .mobile-card-title strong,
  .mobile-card-title span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-card-title strong {
    color: var(--foreground);
    font-size: 14px;
  }

  .mobile-card-title span {
    margin-top: 2px;
    color: var(--subtle-foreground);
    font-size: 11px;
  }

  .mobile-card-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin: 14px 0 12px 28px;
  }

  .mobile-card-metrics span {
    display: block;
    color: var(--subtle-foreground);
    font-size: 9px;
  }

  .mobile-card-metrics strong {
    display: block;
    overflow: hidden;
    margin-top: 2px;
    color: var(--foreground);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-left: 28px;
  }

  .mobile-card-footer > div {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
  }

  .drawer-header {
    min-height: 88px;
    padding: 18px 16px 14px;
  }

  .drawer-body {
    height: calc(100vh - 88px);
    padding: 16px 16px 32px;
  }

  .modal {
    width: 100vw;
    max-width: none;
    max-height: calc(100vh - 16px);
    margin: auto 0 0;
    border-right: 0;
    border-bottom: 0;
    border-left: 0;
    border-radius: 10px 10px 0 0;
  }

  .modal-header,
  .modal-body,
  .modal-footer {
    padding-right: 16px;
    padding-left: 16px;
  }

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

  .field-wide {
    grid-column: 1;
  }

  .workspace-permissions {
    grid-template-columns: 1fr;
  }

  .user-management-toolbar .button span {
    display: none;
  }

  .user-management-toolbar .button {
    width: 40px;
    padding: 0;
  }

  .user-row {
    grid-template-columns: 32px minmax(0, 1fr) 36px;
    gap: 9px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .user-row > .role-badge,
  .user-row > .account-status {
    display: none;
  }
}

@media (max-width: 380px) {
  .filter-toolbar {
    grid-template-columns: 1fr;
  }

  .search-field,
  .scope-control {
    grid-column: 1;
  }

  .context-bar {
    gap: 12px;
  }

  .priority-toolbar {
    grid-template-columns: 1fr;
  }

  .priority-search-field {
    grid-column: 1;
  }

  .stat-item {
    padding-right: 8px;
  }

  .drawer-actions {
    flex-direction: column;
  }

  .drawer-actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
