:root {
  color-scheme: light;
  --bg: #f1f4ed;
  --panel: #ffffff;
  --ink: #1e2520;
  --muted: #68736b;
  --line: #dfe4dc;
  --brand: #1f7a55;
  --brand-ink: #0e3e2c;
  --accent: #b95035;
  --warn: #a66700;
  --danger: #b42318;
  --tone-primary: #0f3d2e;
  --tone-communication: #2f6f91;
  --tone-warning: #b96f16;
  --tone-success: #197a4d;
  --tone-danger: #b84235;
  --tone-neutral: #66736b;
  --tone-soft: #f4f7f3;
  --tone-communication-soft: #e7f1f6;
  --tone-warning-soft: #fff1dc;
  --tone-success-soft: #e8f4ee;
  --tone-danger-soft: #fce7e4;
  --soft: #ecf5ef;
  --shadow: 0 16px 42px rgba(26, 43, 32, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(180deg, #f8faf6 0%, var(--bg) 100%);
  display: grid;
  grid-template-columns: 264px 1fr;
}

.sidebar {
  min-height: 100vh;
  padding: 22px 16px;
  border-right: 1px solid var(--line);
  background: linear-gradient(180deg, #fcfdfb 0%, #f5f8f2 100%);
  box-shadow: inset -1px 0 0 rgba(223, 228, 220, 0.8);
  position: sticky;
  top: 0;
}

.brand {
  display: grid;
  gap: 8px;
  margin-bottom: 28px;
}

.brand-logo,
.login-logo {
  display: block;
  width: 184px;
  max-width: 100%;
  height: auto;
}

.brand-copy small {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
  font-weight: 800;
}

.login-brand {
  display: grid;
  gap: 10px;
  margin-bottom: 18px;
}

.login-brand .eyebrow {
  margin-bottom: 0;
}

.login-brand h2 {
  font-size: 22px;
}

.login-logo {
  width: 188px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: white;
  font-weight: 800;
}

.brand small,
.muted,
small {
  color: var(--muted);
}

.brand small {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 11px;
}

nav {
  display: grid;
  gap: 6px;
}

.nav-button {
  width: 100%;
  border: 0;
  border-radius: 8px;
  padding: 11px 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.nav-button__badge {
  min-width: 22px;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.nav-button.active,
.nav-button:hover {
  background: var(--soft);
  color: var(--brand-ink);
}

main {
  min-width: 0;
  background: linear-gradient(180deg, rgba(248, 250, 246, 0.9) 0%, rgba(241, 244, 237, 1) 100%);
}

.topbar {
  padding: 22px 30px 16px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(241, 244, 237, 0.82);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(223, 228, 220, 0.8);
}

.impersonation-banner {
  margin: 14px 30px 0;
  padding: 12px 14px;
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(31, 122, 85, 0.18);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(236, 245, 239, 0.96) 0%, rgba(247, 251, 248, 0.98) 100%);
  box-shadow: 0 12px 28px rgba(26, 43, 32, 0.08);
}

.impersonation-banner__copy {
  display: grid;
  gap: 3px;
}

.impersonation-banner__copy strong {
  font-size: 14px;
}

.impersonation-banner__copy small {
  color: var(--muted);
}

.impersonation-banner__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.topbar-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  position: relative;
}

.notification-shell {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.icon-button,
.notification-toggle {
  width: 44px;
  height: 44px;
  padding: 0;
  flex: 0 0 auto;
}

.icon-button svg,
.notification-toggle svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.notification-toggle {
  position: relative;
}

.notification-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #c81e1e;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
  box-shadow: 0 4px 12px rgba(200, 30, 30, 0.28);
}

.notification-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(420px, calc(100vw - 24px));
  max-height: min(68vh, 620px);
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 40px rgba(26, 43, 32, 0.16);
  z-index: 38;
  backdrop-filter: blur(12px);
}

.notification-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.notification-panel__header small {
  display: block;
  margin-top: 3px;
}

.notification-panel__state {
  color: var(--muted);
  padding: 8px 2px;
}

.notification-panel__summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0 0 10px;
}

.notification-panel__list {
  display: grid;
  gap: 8px;
}

.notification-item {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  width: 100%;
  padding: 11px 12px;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.notification-item.is-unread {
  background: linear-gradient(180deg, rgba(31, 122, 85, 0.06), rgba(31, 122, 85, 0.02));
  border-color: rgba(31, 122, 85, 0.28);
}

.notification-item.tone-danger {
  box-shadow: inset 3px 0 0 var(--tone-danger), 0 10px 18px rgba(184, 66, 53, 0.06);
}

.notification-item.tone-warning {
  box-shadow: inset 3px 0 0 var(--tone-warning), 0 10px 18px rgba(185, 111, 22, 0.05);
}

.notification-item.tone-communication {
  box-shadow: inset 3px 0 0 var(--tone-communication), 0 10px 18px rgba(47, 111, 145, 0.05);
}

.notification-item.tone-neutral {
  box-shadow: inset 3px 0 0 rgba(216, 226, 217, 1), 0 10px 18px rgba(26, 43, 32, 0.04);
}

.notification-item__title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--brand-ink);
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: center;
}

.notification-item__headline {
  font-weight: 700;
  line-height: 1.35;
}

.notification-item__body {
  color: var(--muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-item__meta {
  color: var(--muted);
  font-size: 12px;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 0;
  flex: 0 0 auto;
}

.menu-toggle__lines {
  width: 18px;
  display: grid;
  gap: 3px;
}

.menu-toggle__lines span {
  display: block;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 18, 13, 0.38);
  z-index: 34;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 28px;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 15px;
}

p {
  margin: 6px 0 0;
}

#app {
  padding: 0 30px 42px;
}

.grid {
  display: grid;
  gap: 16px;
}

.cols-2 {
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.7fr);
}

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.card,
.panel {
  background: linear-gradient(180deg, #ffffff 0%, #fcfdfb 100%);
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.card:focus-within,
.panel:focus-within,
.list-item:focus-within {
  border-color: rgba(31, 122, 85, 0.34);
  box-shadow: 0 16px 38px rgba(31, 122, 85, 0.12);
}

.card {
  padding: 16px;
}

.metric-button {
  display: block;
  width: 100%;
  text-align: left;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, #f9fbf8 100%);
  border: 1px solid rgba(216, 226, 217, 0.95);
  box-shadow: 0 12px 28px rgba(26, 43, 32, 0.08);
  position: relative;
  overflow: hidden;
  min-height: 112px;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 6px;
  transition: transform 140ms ease, box-shadow 140ms ease, border-color 140ms ease;
}

.metric-button[data-tone="primary"],
.metric-button.primary {
  background: linear-gradient(180deg, #143f31 0%, #1a5b43 100%);
  color: #fff;
  border-color: rgba(20, 63, 49, 0.18);
}

.metric-button[data-tone="communication"],
.metric-button.communication {
  background: linear-gradient(180deg, #f2f8fb 0%, #e8f2f7 100%);
  border-color: rgba(47, 111, 145, 0.18);
}

.metric-button[data-tone="warning"],
.metric-button.warning {
  background: linear-gradient(180deg, #fff8ec 0%, #fff1dc 100%);
  border-color: rgba(185, 111, 22, 0.18);
}

.metric-button[data-tone="success"],
.metric-button.success {
  background: linear-gradient(180deg, #eff8f3 0%, #e5f2ea 100%);
  border-color: rgba(25, 122, 77, 0.18);
}

.metric-button[data-tone="danger"],
.metric-button.danger {
  background: linear-gradient(180deg, #fef1ee 0%, #fde7e3 100%);
  border-color: rgba(184, 66, 53, 0.18);
}

.metric-button[data-tone="neutral"],
.metric-button.neutral {
  background: linear-gradient(180deg, #fbfcfa 0%, #f4f7f3 100%);
  border-color: rgba(231, 236, 232, 1);
}

.metric-button:hover {
  border-color: #b8cabc;
  background: linear-gradient(180deg, #ffffff 0%, #f4fbf6 100%);
  box-shadow: 0 16px 34px rgba(26, 43, 32, 0.12);
  transform: translateY(-1px);
}

.metric-button.active {
  border-color: rgba(31, 122, 85, 0.42);
  box-shadow: 0 18px 34px rgba(31, 122, 85, 0.14);
}

.metric-button::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--brand) 0%, #67a889 55%, var(--accent) 100%);
  opacity: 0.9;
}

.metric-button[data-tone="primary"]::before,
.metric-button.primary::before {
  background: linear-gradient(90deg, var(--tone-primary) 0%, #2f6b55 100%);
}

.metric-button[data-tone="communication"]::before,
.metric-button.communication::before {
  background: linear-gradient(90deg, var(--tone-communication) 0%, #72a8c3 100%);
}

.metric-button[data-tone="warning"]::before,
.metric-button.warning::before {
  background: linear-gradient(90deg, var(--tone-warning) 0%, #d79b4f 100%);
}

.metric-button[data-tone="success"]::before,
.metric-button.success::before {
  background: linear-gradient(90deg, var(--tone-success) 0%, #69a77f 100%);
}

.metric-button[data-tone="danger"]::before,
.metric-button.danger::before {
  background: linear-gradient(90deg, var(--tone-danger) 0%, #d4766a 100%);
}

.card strong {
  display: block;
  font-size: 28px;
  line-height: 1;
  margin-top: 8px;
}

.metric-button small {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.panel {
  padding: 18px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.section-title small {
  display: block;
  margin-top: 4px;
}

.section-title--stacked {
  align-items: flex-start;
}

.eyebrow {
  display: block;
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

form {
  display: grid;
  gap: 12px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
}

label {
  display: grid;
  gap: 5px;
  font-size: 13px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 10px 11px;
  font: inherit;
  color: var(--ink);
  background: white;
}

textarea {
  min-height: 84px;
  resize: vertical;
}

button,
.button {
  border: 0;
  border-radius: 7px;
  padding: 10px 13px;
  font: inherit;
  font-weight: 650;
  cursor: pointer;
  background: var(--brand);
  color: white;
  text-decoration: none;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

button.secondary,
.button.secondary {
  background: #edf3ee;
  color: var(--ink);
}

button.secondary.active,
.button.secondary.active,
button.neutral.active,
.button.neutral.active {
  background: var(--soft);
  color: var(--brand-ink);
  border-color: rgba(31, 122, 85, 0.32);
  box-shadow: 0 10px 22px rgba(31, 122, 85, 0.08);
}

button.communication.active,
.button.communication.active {
  background: var(--tone-communication-soft);
  color: var(--tone-communication);
  border-color: rgba(47, 111, 145, 0.32);
}

button.warning.active,
.button.warning.active {
  background: var(--tone-warning-soft);
  color: var(--tone-warning);
  border-color: rgba(185, 111, 22, 0.32);
}

button.success.active,
.button.success.active {
  background: var(--tone-success-soft);
  color: var(--tone-success);
  border-color: rgba(25, 122, 77, 0.32);
}

button.danger.active,
.button.danger.active {
  background: var(--tone-danger-soft);
  color: var(--tone-danger);
  border-color: rgba(184, 66, 53, 0.32);
}

button.primary,
.button.primary {
  background: var(--tone-primary);
  color: #fff;
}

button.communication,
.button.communication {
  background: var(--tone-communication-soft);
  color: var(--tone-communication);
}

button.warning,
.button.warning {
  background: var(--tone-warning-soft);
  color: var(--tone-warning);
}

button.success,
.button.success {
  background: var(--tone-success-soft);
  color: var(--tone-success);
}

button.neutral,
.button.neutral {
  background: var(--tone-soft);
  color: var(--tone-neutral);
}

button.danger {
  background: var(--tone-danger-soft);
  color: var(--tone-danger);
}

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

.actions.wrap {
  align-items: flex-start;
}

.compact-actions {
  gap: 6px;
}

.compact-actions button {
  padding: 7px 9px;
  font-size: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: 10px 8px;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

td {
  overflow-wrap: anywhere;
}

.crm-layout-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px;
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fafcf8 100%);
}

.crm-layout-panel > summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
}

.crm-layout-panel > summary::-webkit-details-marker {
  display: none;
}

.crm-layout-panel > summary::after {
  color: var(--muted);
  content: 'öffnen';
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.crm-layout-panel[open] > summary::after {
  content: 'schließen';
}

.crm-layout-panel summary small {
  display: block;
  margin-top: 3px;
}

.crm-layout-body {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.crm-layout-controls {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.crm-layout-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
}

.crm-layout-toggle input {
  margin: 0;
}

.crm-layout-hint {
  color: var(--muted);
  line-height: 1.45;
}

.crm-pipeline-board {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
}

.crm-pipeline-panel > summary {
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
}

.crm-pipeline-panel > summary::-webkit-details-marker {
  display: none;
}

.crm-pipeline-panel > summary::after {
  color: var(--muted);
  content: 'öffnen';
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.crm-pipeline-panel[open] > summary::after {
  content: 'schließen';
}

.crm-pipeline-panel summary small {
  display: block;
  margin-top: 3px;
}

.crm-pipeline-body {
  display: grid;
  gap: 10px;
  padding-top: 12px;
}

.crm-pipeline-column {
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  background: #f9fbf8;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
}

.crm-pipeline-header {
  align-items: center;
  background: #fff;
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  min-height: 44px;
  padding: 9px 10px;
  text-align: left;
  width: 100%;
}

.crm-pipeline-header span {
  font-size: 13px;
  font-weight: 800;
}

.crm-pipeline-header strong {
  align-items: center;
  background: var(--soft);
  border-radius: 999px;
  color: var(--brand-ink);
  display: inline-flex;
  font-size: 13px;
  justify-content: center;
  min-width: 28px;
  padding: 4px 8px;
}

.crm-pipeline-stack {
  display: grid;
  gap: 7px;
}

.crm-pipeline-card {
  background: #fff;
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 10px;
  text-align: left;
  width: 100%;
}

.crm-pipeline-card strong {
  font-size: 13px;
  line-height: 1.25;
}

.crm-pipeline-card small,
.crm-pipeline-card span,
.crm-pipeline-empty {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.crm-pipeline-empty {
  border: 1px dashed rgba(177, 190, 181, 0.85);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.crm-pipeline-more {
  min-height: 34px;
  padding: 7px 9px;
  width: 100%;
}

.crm-bulk-panel {
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  background: #fbfcfa;
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
  padding: 10px;
}

.crm-bulk-toolbar {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.crm-bulk-toolbar select {
  max-width: 260px;
  min-width: 210px;
}

.crm-bulk-toolbar button {
  min-height: 38px;
  padding: 8px 12px;
}

.crm-bulk-count {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  margin-left: auto;
}

.crm-bulk-details {
  align-items: end;
  display: flex;
  flex: 1 1 260px;
  gap: 8px;
  min-width: 220px;
}

.crm-bulk-details label {
  flex: 1 1 260px;
  margin: 0;
  max-width: 360px;
  min-width: 220px;
}

.crm-bulk-details[hidden],
.crm-bulk-details label[hidden] {
  display: none !important;
}

.crm-table tr.is-selected td {
  background: #f2f8f2;
}

.crm-table tr[data-crm-row-open] {
  cursor: pointer;
}

.crm-table tr[data-crm-row-open]:hover td {
  background: #f7faf6;
}

.crm-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  background: #fff;
}

.merchant-table-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 420px) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.merchant-table-wrap {
  margin-top: 4px;
}

.merchant-table {
  min-width: 1120px;
}

.inbox-html-body {
  color: var(--ink);
  font-size: 14px;
  line-height: 1.5;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.inbox-html-body img,
.inbox-inline-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 10px 0;
  border: 0;
}

.inbox-html-body table {
  max-width: 100%;
}

.inbox-html-body a {
  color: var(--brand);
}

.crm-table {
  table-layout: fixed;
  min-width: 100%;
  width: max-content;
}

.crm-table th,
.crm-table td {
  overflow-wrap: normal;
  word-break: normal;
}

.crm-table th {
  position: relative;
  padding-right: 16px;
}

.crm-th__inner {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
}

.crm-th__sort {
  appearance: none;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.crm-th__sort:hover .crm-th__label,
.crm-th__sort:focus-visible .crm-th__label {
  text-decoration: underline;
}

.crm-th__sort-indicator {
  color: var(--muted);
  font-size: 12px;
  flex: 0 0 auto;
}

.crm-th.is-sorted .crm-th__sort-indicator {
  color: var(--brand);
}

.crm-th.is-filtered {
  background: rgba(31, 122, 85, 0.05);
}

.crm-th__filter-button {
  appearance: none;
  border: 1px solid rgba(223, 228, 220, 0.95);
  background: #fff;
  color: var(--muted);
  width: 28px;
  height: 28px;
  border-radius: 7px;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  flex: 0 0 auto;
  font-size: 14px;
  line-height: 1;
}

.crm-th__filter-button.active {
  background: var(--soft);
  color: var(--brand-ink);
  border-color: rgba(31, 122, 85, 0.22);
}

.crm-column-filter-panel {
  display: grid;
  gap: 12px;
  margin-bottom: 12px;
}

.crm-column-filter-form {
  display: grid;
  gap: 10px;
}

.crm-column-filter-help {
  color: var(--muted);
  font-size: 12px;
}

.crm-column-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.crm-column-filter-chip {
  appearance: none;
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 7px 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.crm-column-filter-chip span {
  color: var(--muted);
  font-size: 12px;
}

.crm-column-filter-chip strong {
  font-size: 13px;
}

.crm-column-filter-chip--clear {
  color: var(--brand-ink);
  background: var(--soft);
}

.crm-th__label {
  display: block;
  padding-right: 10px;
}

.crm-resize-handle {
  position: absolute;
  top: 0;
  right: 0;
  width: 12px;
  height: 100%;
  cursor: col-resize;
  touch-action: none;
}

.crm-resize-handle::before {
  content: '';
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 5px;
  width: 2px;
  border-radius: 999px;
  background: rgba(104, 115, 107, 0.28);
}

.crm-cell {
  line-height: 1.45;
}

.crm-cell-merchant {
  display: grid;
  gap: 6px;
}

.crm-detail-link {
  justify-content: flex-start;
  max-width: 100%;
  white-space: normal;
  text-align: left;
}

.crm-cell small {
  line-height: 1.35;
}

.crm-link {
  display: inline-block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: top;
}

body.crm-table-resizing,
body.crm-table-resizing * {
  cursor: col-resize !important;
  user-select: none !important;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef2ed;
  font-size: 12px;
  font-weight: 700;
}

.status.warn {
  background: #fff1d6;
  color: var(--warn);
}

.status.good {
  background: #e6f4ea;
  color: var(--brand-ink);
}

.status.bad {
  background: #fce8e6;
  color: var(--danger);
}

.status.communication {
  background: var(--tone-communication-soft);
  color: var(--tone-communication);
}

.status.warning {
  background: var(--tone-warning-soft);
  color: var(--tone-warning);
}

.status.success {
  background: var(--tone-success-soft);
  color: var(--tone-success);
}

.status.neutral {
  background: var(--tone-soft);
  color: var(--tone-neutral);
}

.toast {
  margin: 0 30px 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #e9f6ef;
  border: 1px solid #b9dfc8;
  color: var(--brand-ink);
}

.toast.error {
  background: #fce8e6;
  border-color: #f4b8b3;
  color: var(--danger);
}

.action-confirmation {
  align-items: center;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(185, 223, 200, 0.98);
  border-radius: 10px;
  box-shadow: 0 18px 54px rgba(26, 43, 32, 0.2);
  color: var(--brand-ink);
  display: grid;
  gap: 12px;
  grid-template-columns: auto minmax(0, 1fr);
  left: 50%;
  max-width: min(520px, calc(100vw - 28px));
  padding: 14px 16px;
  position: fixed;
  top: 22px;
  transform: translateX(-50%);
  width: max-content;
  z-index: 120;
  animation: action-confirmation-in 180ms ease-out;
}

.action-confirmation.is-hiding {
  opacity: 0;
  transform: translateX(-50%) translateY(-6px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.action-confirmation__icon {
  align-items: center;
  background: #e6f4ea;
  border-radius: 999px;
  color: var(--brand-ink);
  display: inline-flex;
  font-weight: 900;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.action-confirmation strong,
.action-confirmation span {
  display: block;
}

.action-confirmation span {
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

@keyframes action-confirmation-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%);
  }
}

.empty {
  color: var(--muted);
  padding: 22px 0;
}

.split-list {
  display: grid;
  gap: 10px;
}

.list-item {
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  padding: 13px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfa 100%);
  box-shadow: 0 10px 22px rgba(26, 43, 32, 0.05);
}

.list-item:hover {
  border-color: #c9d6cb;
}

.consignment-create-panel,
.consignment-list-panel {
  width: 100%;
}

.consignment-create-form {
  display: grid;
  gap: 14px;
}

.consignment-create-grid,
.consignment-product-grid {
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.consignment-product-panel {
  padding: 16px;
  background: linear-gradient(180deg, #fafcf8 0%, #f6faf3 100%);
}

.consignment-card {
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfa 100%);
  box-shadow: 0 10px 22px rgba(26, 43, 32, 0.05);
  overflow: clip;
}

.consignment-card summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 15px;
}

.consignment-card summary::-webkit-details-marker {
  display: none;
}

.consignment-card.is-active {
  border-color: rgba(31, 122, 85, 0.38);
  box-shadow: 0 16px 34px rgba(31, 122, 85, 0.12);
}

.consignment-card__summary {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.consignment-card__summary-main strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}

.consignment-card__summary-main small {
  display: block;
  margin-top: 4px;
}

.consignment-card__summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
  align-items: center;
}

.consignment-card__body {
  border-top: 1px solid rgba(223, 228, 220, 0.95);
  padding: 14px 15px 15px;
  display: grid;
  gap: 12px;
}

.consignment-card__table {
  overflow: auto;
}

.consignment-card__table table {
  min-width: 740px;
}

.consignment-card__actions {
  justify-content: flex-end;
}

.consignment-empty {
  padding: 24px 4px;
}

.consignment-drawer {
  position: fixed;
  inset: 0;
  z-index: 41;
  display: flex;
  justify-content: flex-end;
}

.consignment-drawer__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(10, 18, 13, 0.38);
  appearance: none;
  cursor: pointer;
}

.consignment-drawer__panel {
  position: relative;
  width: min(100vw, 560px);
  height: 100%;
  overflow: auto;
  border-radius: 0;
  box-shadow: -24px 0 48px rgba(26, 43, 32, 0.2);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfa 100%);
}

.consignment-drawer__preview {
  border: 1px solid rgba(216, 226, 217, 0.95);
  border-radius: 8px;
  padding: 10px 12px;
  background: #f5faf6;
  color: var(--muted);
  font-size: 13px;
}

.consignment-drawer__context {
  display: grid;
  gap: 4px;
}

.consignment-drawer__actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.detail {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.inbox-shell {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
}

.inbox-kpis {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.inbox-kpi {
  min-height: 108px;
}

.inbox-kpi span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.inbox-kpi.active,
.inbox-kpi.is-selected {
  border-color: rgba(31, 122, 85, 0.36);
  box-shadow: 0 18px 34px rgba(31, 122, 85, 0.14);
}

.inbox-searchbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 2px;
}

.inbox-grid {
  display: grid;
  grid-template-columns: minmax(320px, 420px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.inbox-list-pane,
.inbox-detail-pane {
  min-width: 0;
  max-width: 100%;
}

.inbox-list {
  gap: 10px;
}

.inbox-item {
  display: grid;
  gap: 10px;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfa 100%);
  box-shadow: 0 10px 22px rgba(26, 43, 32, 0.05);
}

.inbox-item:hover {
  border-color: #c8d5ca;
  box-shadow: 0 14px 28px rgba(26, 43, 32, 0.09);
}

.inbox-item.is-selected {
  border-color: rgba(31, 122, 85, 0.42);
  box-shadow: 0 16px 32px rgba(31, 122, 85, 0.12);
}

.inbox-item__head,
.inbox-thread-card__head,
.inbox-detail__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
  flex-wrap: wrap;
}

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

.tasks-kpi-groups {
  display: grid;
  gap: 14px;
}

.tasks-kpi-group {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fafcf8 100%);
}

.tasks-kpi-group__head h3 {
  margin: 0;
  font-size: 15px;
}

.tasks-kpi-group__head small {
  display: block;
  margin-top: 3px;
}

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

.task-kpi {
  min-height: 116px;
}

.task-kpi span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.task-kpi.active,
.task-kpi.is-selected {
  border-color: rgba(31, 122, 85, 0.36);
  box-shadow: 0 18px 34px rgba(31, 122, 85, 0.14);
}

.task-kpi[data-tone="danger"],
.task-kpi[data-tone="warning"],
.task-kpi[data-tone="communication"],
.task-kpi[data-tone="success"] {
  min-height: 118px;
}

.tasks-scope-panel .actions.wrap {
  gap: 8px;
}

.tasks-scope-panel .actions.wrap button {
  border-radius: 999px;
  padding-inline: 12px;
  min-height: 34px;
}

.tasks-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.92fr) minmax(0, 1.08fr);
  gap: 16px;
  align-items: start;
  width: 100%;
  min-width: 0;
}

.tasks-list-pane,
.tasks-detail-pane {
  min-width: 0;
  max-width: 100%;
}

.tasks-list {
  gap: 10px;
}

.task-card,
.task-detail-panel {
  width: 100%;
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfa 100%);
  box-shadow: 0 10px 22px rgba(26, 43, 32, 0.05);
}

.task-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  text-align: left;
  cursor: pointer;
  border-left-width: 5px;
  border-left-style: solid;
}

.task-card:hover {
  border-color: #c8d5ca;
  box-shadow: 0 14px 28px rgba(26, 43, 32, 0.09);
}

.task-card.is-selected {
  border-color: rgba(31, 122, 85, 0.42);
  box-shadow: 0 16px 32px rgba(31, 122, 85, 0.12);
}

.task-card.tone-danger {
  border-left-color: var(--tone-danger);
}

.task-card.tone-warning {
  border-left-color: var(--tone-warning);
}

.task-card.tone-communication {
  border-left-color: var(--tone-communication);
}

.task-card.tone-success {
  border-left-color: var(--tone-success);
}

.task-card.tone-neutral {
  border-left-color: rgba(216, 226, 217, 1);
}

.task-card__head,
.task-detail-panel__header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
  flex-wrap: wrap;
}

.task-card__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.task-card__meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.task-card__badges,
.task-detail-panel__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.task-card__body {
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
}

.task-card__footer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.task-detail-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  position: sticky;
  top: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfa 100%);
  box-shadow: 0 14px 30px rgba(26, 43, 32, 0.06);
}

.task-next-action {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(185, 223, 200, 0.95);
  background: linear-gradient(180deg, #f4fbf6 0%, #eef8f1 100%);
}

.task-next-action small {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 11px;
  font-weight: 800;
}

.task-next-action strong {
  font-size: 14px;
  line-height: 1.4;
}

.task-detail-panel .actions.wrap {
  gap: 8px;
}

.task-detail-panel__header h3 {
  margin: 2px 0 0;
  font-size: 22px;
  line-height: 1.2;
}

.task-detail-panel__header small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

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

.task-detail-summary > div,
.task-detail-notes {
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  padding: 12px 14px;
  background: #fff;
}

.task-detail-summary small,
.task-detail-notes small {
  display: block;
  color: var(--muted);
  margin-bottom: 4px;
}

.task-detail-summary strong {
  display: block;
  font-size: 15px;
  line-height: 1.35;
}

.task-detail-notes p {
  margin: 0;
  color: var(--text);
  white-space: pre-wrap;
  line-height: 1.55;
}

.task-inline-form {
  display: grid;
  gap: 12px;
}

.tasks-composer {
  display: grid;
  gap: 14px;
}

.inbox-item__titlewrap {
  display: grid;
  gap: 4px;
}

.inbox-item__titlewrap strong {
  font-size: 15px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.inbox-item__titlewrap span,
.inbox-thread-card__meta {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.inbox-item__badges,
.inbox-detail__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-start;
}

.inbox-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
  overflow-wrap: anywhere;
  word-break: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
}

.inbox-item__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inbox-detail {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.inbox-detail__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 16px;
  min-width: 0;
}

.inbox-detail__stack,
.inbox-detail__side {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.inbox-detail-card {
  display: grid;
  gap: 12px;
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  padding: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfa 100%);
  box-shadow: 0 12px 24px rgba(26, 43, 32, 0.05);
  min-width: 0;
}

.inbox-assignment {
  display: grid;
  gap: 12px;
}

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

.inbox-assignment--form {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  align-items: end;
}

.inbox-assignment__note {
  min-height: 46px;
  display: flex;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.inbox-step-form {
  display: grid;
  gap: 12px;
}

.inbox-message-body,
.inbox-thread-card__body,
.inbox-thread-card__quote-body {
  display: grid;
  gap: 10px;
  line-height: 1.55;
  max-width: 78ch;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: pre-wrap;
}

.inbox-message-body p,
.inbox-thread-card__body p,
.inbox-thread-card__quote-body p {
  margin: 0;
  white-space: normal;
}

.inbox-thread-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  padding: 14px;
  background: #fdfdfb;
  min-width: 0;
}

.inbox-thread-card.is-current {
  border-color: rgba(31, 122, 85, 0.34);
  background: #fff;
}

.inbox-thread-card__quote {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.inbox-thread-card__quote summary {
  cursor: pointer;
  color: var(--brand-ink);
  font-weight: 700;
  font-size: 13px;
}

.inbox-thread-card__quote-body {
  margin-top: 10px;
}

.inbox-composer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 28, 21, 0.4);
  z-index: 70;
}

.inbox-composer {
  position: fixed;
  top: 24px;
  right: 24px;
  bottom: 24px;
  width: min(740px, calc(100vw - 48px));
  z-index: 71;
  overflow: auto;
  display: grid;
  gap: 14px;
  max-width: calc(100vw - 48px);
}

.inbox-composer blockquote,
.email-editor blockquote {
  margin: 0;
  padding: 12px 14px;
  border-left: 3px solid rgba(31, 122, 85, 0.28);
  background: #f7faf7;
  color: var(--muted);
  border-radius: 0 8px 8px 0;
}

.inbox-composer__summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.inbox-composer__summary-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #f9fbf8;
}

.inbox-composer__summary-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.inbox-composer__summary-item strong {
  display: block;
  margin-top: 4px;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.global-palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(18, 28, 21, 0.4);
  z-index: 90;
}

.global-palette {
  position: fixed;
  top: 72px;
  right: 24px;
  width: min(920px, calc(100vw - 48px));
  max-height: calc(100vh - 96px);
  overflow: auto;
  z-index: 91;
  display: grid;
  gap: 14px;
}

.global-palette-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.global-palette-results {
  display: grid;
  gap: 12px;
}

.global-palette-group {
  display: grid;
  gap: 10px;
}

.global-palette-group__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.global-palette-group__list {
  display: grid;
  gap: 10px;
}

.global-palette-result {
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: left;
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  padding: 14px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfa 100%);
  box-shadow: 0 10px 22px rgba(26, 43, 32, 0.05);
}

.global-palette-result:hover {
  border-color: #c8d5ca;
  box-shadow: 0 14px 28px rgba(26, 43, 32, 0.09);
}

.global-palette-result__title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
}

.global-palette-result__subtitle {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.global-palette-result__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.global-palette__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.global-palette-hint {
  border: 1px dashed rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  padding: 14px;
  color: var(--muted);
  background: #f9fbf8;
}

.merchant-section-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 2px;
}

.merchant-section-nav button {
  min-height: 36px;
  padding: 8px 12px;
  font-size: 13px;
}

.merchant-crm-shell {
  display: grid;
  gap: 12px;
}

.merchant-crm-title {
  display: grid;
  gap: 6px;
}

.merchant-crm-subtitle {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.merchant-crm-head-actions {
  align-items: flex-start;
}

.merchant-crm-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
  gap: 12px;
  align-items: start;
  margin-top: 4px;
}

.merchant-crm-column {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.merchant-core-panel {
  display: grid;
  gap: 12px;
}

.merchant-core-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.merchant-core-block {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  background: #fafcf9;
  min-width: 0;
}

.merchant-core-block strong {
  font-size: 13px;
}

.merchant-core-block span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.merchant-core-mini {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.merchant-timeline-panel {
  display: grid;
  gap: 12px;
}

.merchant-detail-toolbar {
  display: grid;
  gap: 10px;
}

.merchant-detail-toolbar__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  justify-content: space-between;
}

.merchant-detail-toolbar__search {
  flex: 1 1 360px;
  display: grid;
  gap: 6px;
}

.merchant-detail-toolbar__search span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 600;
}

.merchant-detail-toolbar__search input {
  width: 100%;
}

.merchant-detail-toolbar__actions {
  align-items: flex-end;
}

.merchant-detail-toolbar__hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.merchant-activity-summary {
  display: grid;
  gap: 12px;
}

.merchant-activity-summary__grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.merchant-activity-summary__card,
.audit-entry {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfa 100%);
  box-shadow: 0 10px 22px rgba(26, 43, 32, 0.05);
  min-width: 0;
}

.merchant-activity-summary__card small,
.audit-entry__meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.merchant-activity-summary__card strong,
.audit-entry strong {
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.merchant-activity-summary__hint,
.audit-entry__summary,
.audit-entry__note {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.merchant-activity-summary__actions {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.merchant-activity-summary .status.warn {
  align-self: flex-start;
}

.merchant-timeline-filters {
  margin-top: -2px;
}

.merchant-timeline-list {
  display: grid;
  gap: 10px;
}

.merchant-timeline-entry {
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfa 100%);
  box-shadow: 0 10px 22px rgba(26, 43, 32, 0.05);
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}

.merchant-timeline-entry__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.merchant-timeline-entry__head strong {
  font-size: 14px;
}

.merchant-timeline-entry__meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.merchant-timeline-entry__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.merchant-timeline-entry__chips .status {
  font-size: 11px;
  padding: 4px 8px;
}

.merchant-timeline-entry__summary,
.merchant-timeline-entry__result {
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink);
}

.merchant-timeline-entry__details {
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.merchant-timeline-entry--activity {
  border-left: 4px solid rgba(171, 121, 54, 0.42);
}

.merchant-timeline-entry--task {
  border-left: 4px solid rgba(92, 151, 77, 0.46);
}

.merchant-timeline-entry--communication {
  border-left: 4px solid rgba(68, 111, 173, 0.42);
}

.merchant-timeline-entry--good {
  background: linear-gradient(180deg, #ffffff 0%, #f9fcf7 100%);
}

.merchant-timeline-entry--warn {
  background: linear-gradient(180deg, #ffffff 0%, #fffdf5 100%);
}

.merchant-timeline-entry--muted {
  background: linear-gradient(180deg, #ffffff 0%, #fcfcfb 100%);
}

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

.audit-entry__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  min-width: 0;
  flex-wrap: wrap;
}

.audit-entry__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.audit-entry__chips .status {
  font-size: 11px;
  padding: 4px 8px;
}

.merchant-section-group {
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #fafcf8 100%);
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(26, 43, 32, 0.05);
}

.merchant-section-group > summary {
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 800;
  color: var(--brand-ink);
  background: linear-gradient(180deg, #fff 0%, #f8fbf7 100%);
  border-bottom: 1px solid rgba(223, 228, 220, 0.85);
}

.merchant-section-group > summary::-webkit-details-marker {
  display: none;
}

.merchant-section-group > summary::after {
  content: '▾';
  float: right;
  color: var(--muted);
  font-weight: 700;
}

.merchant-section-group[open] > summary::after {
  content: '▴';
}

.merchant-section-body {
  display: grid;
  gap: 12px;
  padding: 12px;
}

.merchant-section-body .panel {
  margin-top: 0;
}

.merchant-contact-highlight {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(92, 151, 77, 0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(243, 250, 240, 0.96) 0%, rgba(255, 255, 255, 0.96) 100%);
  color: var(--brand-ink);
}

.merchant-contact-highlight strong {
  font-size: 13px;
}

.merchant-contact-list {
  display: grid;
  gap: 10px;
}

.merchant-contact-card {
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbf8 100%);
  overflow: hidden;
}

.merchant-contact-card > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
  position: relative;
}

.merchant-contact-card > summary::-webkit-details-marker {
  display: none;
}

.merchant-contact-card > summary::after {
  content: '▾';
  position: absolute;
  right: 14px;
  top: 14px;
  color: var(--muted);
  font-weight: 700;
}

.merchant-contact-card[open] > summary::after {
  content: '▴';
}

.merchant-contact-card__summary {
  display: grid;
  gap: 6px;
  padding-right: 24px;
}

.merchant-contact-card__title-row,
.merchant-contact-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.merchant-contact-card__title-row strong {
  font-size: 14px;
}

.merchant-contact-pill-row {
  gap: 6px;
}

.merchant-contact-card__meta {
  font-size: 12px;
  color: var(--muted);
  justify-content: flex-start;
}

.merchant-contact-card__body {
  border-top: 1px solid rgba(223, 228, 220, 0.85);
  padding: 12px 14px 14px;
  display: grid;
  gap: 12px;
}

.merchant-contact-card--primary {
  box-shadow: 0 10px 20px rgba(26, 43, 32, 0.07);
}

.merchant-contact-note {
  padding: 10px 12px;
  border-radius: 8px;
  background: #f6f9f4;
  border: 1px solid rgba(223, 228, 220, 0.95);
  color: var(--ink);
  line-height: 1.45;
}

#merchant-next-input,
#merchant-task-input,
#merchant-templates,
#merchant-merge,
#merchant-workflow,
#merchant-masterdata,
#merchant-relations,
#merchant-history,
#merchant-contacts,
#merchant-locations,
#merchant-terms,
#merchant-lead-score,
#crm-worklists,
#crm-list,
#csv-preview,
#csv-history {
  scroll-margin-top: 96px;
}

#merchant-next-input:focus {
  outline: 2px solid rgba(92, 151, 77, 0.35);
  outline-offset: 2px;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.danger-text {
  color: var(--danger);
}

.user-box {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.user-box small {
  display: block;
}

.push-panel {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.64);
}

.push-panel .actions {
  gap: 6px;
}

.merchant-quick-actions {
  margin-top: 12px;
}

.quick-action-grid,
.template-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.quick-action-grid > *,
.template-actions > * {
  width: 100%;
}

.template-card {
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbf8 100%);
  padding: 14px;
  display: grid;
  gap: 8px;
}

.template-card strong {
  font-size: 14px;
}

.template-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

.email-editor-shell {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  margin: 10px 0 14px;
}

.email-editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 9px;
  border-bottom: 1px solid var(--line);
  background: #f7faf6;
}

.email-editor-toolbar button {
  min-height: 34px;
  padding: 7px 10px;
}

.email-editor-divider {
  width: 1px;
  height: 28px;
  background: var(--line);
  margin: 0 3px;
}

.email-editor {
  min-height: 220px;
  padding: 16px;
  outline: 0;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.email-editor:focus {
  box-shadow: inset 0 0 0 2px rgba(36, 128, 85, 0.2);
}

.email-editor p {
  margin: 0 0 12px;
}

.email-editor ul {
  margin: 0 0 12px 20px;
}

.email-preview-panel {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
}

.email-preview-body {
  max-height: 240px;
  overflow: auto;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.email-preview-body .empty {
  padding: 8px 0;
}

.button.disabled,
button.secondary.disabled,
button:disabled {
  opacity: 0.58;
  pointer-events: none;
}

.push-panel button {
  width: 100%;
  padding: 8px 10px;
  font-size: 13px;
}

.push-panel--settings {
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf7 100%);
  max-width: 560px;
}

.push-panel--settings .actions {
  display: flex;
}

.push-panel--settings button {
  width: auto;
}

.push-device-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.push-device-item {
  align-items: flex-start;
  background: #fff;
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 10px 12px;
}

.push-device-item small {
  color: var(--muted);
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.login-panel {
  max-width: 420px;
}

.dashboard-layout {
  gap: 18px;
}

.dashboard-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.95fr);
  gap: 20px;
  padding: 24px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbf7 42%, #eef6ef 100%);
  border-color: rgba(206, 219, 208, 0.95);
}

.dashboard-hero-copy {
  display: grid;
  gap: 10px;
  align-content: start;
}

.dashboard-hero h2 {
  font-size: 30px;
  line-height: 1.12;
  max-width: 15ch;
}

.dashboard-hero p {
  max-width: 60ch;
  line-height: 1.55;
}

.dashboard-hero-actions {
  margin-top: 18px;
}

.dashboard-hero-aside {
  display: grid;
  gap: 12px;
}

.hero-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  display: grid;
  gap: 10px;
}

.hero-summary-item,
.hero-note {
  border-radius: 8px;
  border: 1px solid rgba(223, 228, 220, 0.95);
  background: linear-gradient(180deg, #ffffff 0%, #f8fbf7 100%);
  box-shadow: 0 12px 24px rgba(26, 43, 32, 0.06);
  padding: 14px;
}

.hero-summary-item {
  display: grid;
  gap: 5px;
  min-height: 88px;
}

.hero-summary-item small,
.hero-note small {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 11px;
  font-weight: 800;
}

.hero-summary-item strong {
  font-size: 26px;
  line-height: 1;
}

.hero-summary-item span,
.hero-note span {
  color: var(--muted);
  font-size: 13px;
}

.hero-note {
  display: grid;
  gap: 5px;
}

.dashboard-band {
  display: grid;
  gap: 12px;
}

.dashboard-band .section-title h2 {
  font-size: 18px;
}

.dashboard-band .metric-button {
  min-height: 108px;
}

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

.dashboard-kpi-groups {
  display: grid;
  gap: 14px;
}

.dashboard-kpi-groups .tasks-kpi-group__cards {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.dashboard-kpis--three {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.dashboard-kpis--four {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.dashboard-workbench {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 14px;
  align-items: start;
  margin-top: 2px;
}

.dashboard-column {
  display: grid;
  gap: 12px;
  align-content: start;
  min-width: 0;
}

.dashboard-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.report-dashboard-panel {
  display: grid;
  gap: 14px;
}

.report-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: end;
}

.report-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.report-filter-chip {
  appearance: none;
  border: 1px solid rgba(223, 228, 220, 0.95);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  padding: 8px 12px;
  min-height: 36px;
  cursor: pointer;
  font-weight: 650;
}

.report-filter-chip.active {
  background: var(--soft);
  color: var(--brand-ink);
  border-color: rgba(31, 122, 85, 0.34);
  box-shadow: 0 10px 22px rgba(31, 122, 85, 0.08);
}

.report-assignee-select {
  display: grid;
  gap: 5px;
  min-width: 220px;
  color: var(--muted);
  font-size: 13px;
}

.report-assignee-select span {
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}

.report-grid {
  display: grid;
  gap: 14px;
}

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

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

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

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

.report-trend,
.report-table-panel,
.report-list-panel {
  display: grid;
  gap: 12px;
}

.report-trend__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.report-trend__head h3 {
  margin: 0;
  font-size: 16px;
}

.report-trend__head small {
  display: block;
  margin-top: 4px;
}

.report-trend__rows {
  display: grid;
  gap: 10px;
}

.report-trend__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(120px, 1.6fr) auto;
  gap: 10px;
  align-items: center;
}

.report-trend__meta {
  display: grid;
  gap: 2px;
}

.report-trend__meta strong {
  font-size: 14px;
  line-height: 1.25;
}

.report-trend__meta small {
  font-size: 12px;
}

.report-trend__bar {
  height: 10px;
  border-radius: 999px;
  background: rgba(223, 228, 220, 0.75);
  overflow: hidden;
  position: relative;
}

.report-trend__bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--tone-neutral) 0%, #7c8a81 100%);
}

.report-trend--communication .report-trend__bar span {
  background: linear-gradient(90deg, var(--tone-communication) 0%, #6fabc6 100%);
}

.report-trend--warning .report-trend__bar span {
  background: linear-gradient(90deg, var(--tone-warning) 0%, #d89d50 100%);
}

.report-trend--success .report-trend__bar span {
  background: linear-gradient(90deg, var(--tone-success) 0%, #71ad84 100%);
}

.report-trend--danger .report-trend__bar span {
  background: linear-gradient(90deg, var(--tone-danger) 0%, #d57a70 100%);
}

.report-trend__value {
  min-width: 34px;
  text-align: right;
  font-weight: 800;
  color: var(--ink);
}

.report-kpi {
  position: relative;
  overflow: hidden;
}

.report-kpi::before {
  content: '';
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--tone-neutral) 0%, #8a988f 100%);
}

.report-kpi--communication::before {
  background: linear-gradient(90deg, var(--tone-communication) 0%, #6fabc6 100%);
}

.report-kpi--warning::before {
  background: linear-gradient(90deg, var(--tone-warning) 0%, #d89d50 100%);
}

.report-kpi--success::before {
  background: linear-gradient(90deg, var(--tone-success) 0%, #71ad84 100%);
}

.report-kpi--danger::before {
  background: linear-gradient(90deg, var(--tone-danger) 0%, #d57a70 100%);
}

.report-kpi strong {
  font-size: 24px;
  line-height: 1;
}

.report-kpi span {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--muted);
}

.report-table {
  width: 100%;
  border-collapse: collapse;
}

.report-table th,
.report-table td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(223, 228, 220, 0.8);
  text-align: left;
  vertical-align: top;
}

.report-table th {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.report-table td {
  font-size: 13px;
}

.report-table tbody tr:hover {
  background: rgba(244, 247, 243, 0.8);
}

.report-table-panel .empty,
.report-list-panel .empty {
  margin-top: 2px;
}

.dashboard-task-panel--compact {
  padding: 16px;
}

.dashboard-task-panel--compact .section-title {
  margin-bottom: 10px;
}

.dashboard-task-panel--compact .split-list {
  gap: 8px;
}

.dashboard-task-panel--compact .list-item {
  padding: 11px;
  box-shadow: 0 8px 18px rgba(26, 43, 32, 0.04);
}

.dashboard-task-panel--compact .list-item small {
  display: block;
  margin-top: 4px;
  line-height: 1.35;
}

.dashboard-task-panel--compact .list-item__title {
  font-weight: 700;
  line-height: 1.3;
}

.dashboard-task-panel--compact .list-item__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  margin-top: 6px;
}

.dashboard-task-panel--compact .list-item__actions button,
.dashboard-task-panel--compact .list-item__actions .button {
  min-height: 34px;
  width: auto;
  flex: 0 0 auto;
}

.empty--slim {
  padding: 14px 0;
}

.duplicate-preview-box {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: #fafdf8;
}

.duplicate-preview-box .section-title {
  margin-bottom: 0;
}

.dashboard-load-more-row {
  display: flex;
  justify-content: center;
  padding-top: 10px;
}

.dashboard-mobile-shell {
  display: grid;
  gap: 12px;
}

.dashboard-mobile-header {
  display: grid;
  gap: 6px;
}

.dashboard-mobile-header h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.15;
}

.dashboard-mobile-header small {
  display: block;
  line-height: 1.45;
}

.dashboard-mobile-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dashboard-mobile-focus {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.dashboard-mobile-focus .section-title {
  margin-bottom: 0;
}

.dashboard-band--mobile {
  margin-bottom: 0;
}

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

.dashboard-mobile-worklist {
  display: grid;
  gap: 12px;
}

.dashboard-mobile-filters {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  position: sticky;
  top: 72px;
  z-index: 2;
  padding: 8px 0;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 246, 0.96));
  backdrop-filter: blur(10px);
}

.dashboard-mobile-filters .secondary.active {
  background: var(--soft);
  color: var(--brand-ink);
  border-color: rgba(31, 122, 85, 0.32);
}

.dashboard-mobile-list {
  display: grid;
  gap: 10px;
}

.dashboard-mobile-card {
  display: grid;
  gap: 8px;
  padding: 13px;
}

.dashboard-mobile-card__head {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.dashboard-mobile-card__title {
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

.dashboard-mobile-card__meta,
.dashboard-mobile-card__body {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.dashboard-mobile-card__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dashboard-mobile-card__actions .button,
.dashboard-mobile-card__actions button,
.dashboard-mobile-card__actions a {
  width: 100%;
}

.link-button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--brand);
  font: inherit;
  font-weight: 700;
  padding: 6px 8px;
  cursor: pointer;
}

.link-button:hover {
  text-decoration: underline;
}

.link-button:disabled {
  color: var(--muted);
  cursor: wait;
  text-decoration: none;
}

.messe-frame-panel {
  padding: 0;
  overflow: hidden;
}

.messe-frame {
  width: 100%;
  min-height: calc(100svh - 220px);
  border: 0;
  display: block;
  background: #f6faf5;
}

.messe-capture-shell {
  display: grid;
  gap: 16px;
}

.messe-capture-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 16px;
  align-items: start;
}

.messe-capture-form,
.messe-capture-side {
  min-width: 0;
}

.messe-capture-form {
  display: grid;
  gap: 14px;
}

.messe-capture-side {
  display: grid;
  gap: 16px;
}

.messe-capture-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.messe-choices {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  background: #fafcf8;
}

.messe-choices legend {
  margin-bottom: 2px;
}

.messe-note-card {
  padding: 16px;
}

.success-state {
  border: 1px solid rgba(31, 122, 85, 0.2);
  background: linear-gradient(180deg, #f7fbf6 0%, #eef8f1 100%);
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(26, 43, 32, 0.08);
  padding: 18px;
  display: grid;
  gap: 12px;
}

.success-state strong {
  font-size: 18px;
}

.pwa-install-overlay {
  align-items: center;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(205, 219, 208, 0.96);
  border-radius: 10px;
  bottom: 22px;
  box-shadow: 0 22px 70px rgba(26, 43, 32, 0.22);
  display: grid;
  gap: 14px;
  grid-template-columns: 78px minmax(0, 1fr) auto;
  left: 286px;
  padding: 16px;
  position: fixed;
  right: 22px;
  z-index: 80;
}

.pwa-install-logo {
  align-items: center;
  background: #0d120f;
  border-radius: 8px;
  display: flex;
  justify-content: center;
  min-height: 74px;
  padding: 8px;
}

.pwa-install-logo img {
  display: block;
  max-height: 56px;
  max-width: 100%;
}

.pwa-install-copy {
  display: grid;
  gap: 5px;
}

.pwa-install-copy small {
  color: var(--brand);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.pwa-install-copy h2 {
  font-size: 19px;
}

.pwa-install-copy p {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.pwa-install-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 5px;
}

.pwa-install-steps span {
  background: #edf3ee;
  border-radius: 999px;
  color: var(--brand-ink);
  font-size: 12px;
  font-weight: 750;
  padding: 6px 9px;
}

.pwa-install-actions {
  justify-content: flex-end;
}

@media (max-width: 900px) {
  body.nav-open {
    overflow: hidden;
  }

  body {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(84vw, 320px);
    min-height: 100svh;
    height: 100svh;
    transform: translateX(-102%);
    transition: transform 180ms ease;
    z-index: 35;
    border-right: 1px solid var(--line);
    border-bottom: 0;
    box-shadow: 18px 0 48px rgba(26, 43, 32, 0.16);
    overflow: auto;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  nav {
    grid-template-columns: 1fr;
  }

  .topbar,
  #app {
    padding-left: 16px;
    padding-right: 16px;
  }

  .pwa-install-overlay {
    left: 16px;
    right: 16px;
  }

  .topbar,
  .cols-2 {
    grid-template-columns: 1fr;
    display: grid;
  }

  .dashboard-workbench {
    grid-template-columns: 1fr;
  }

  .dashboard-hero {
    grid-template-columns: 1fr;
  }

  .dashboard-hero h2 {
    max-width: none;
  }

  .dashboard-mini-grid {
    grid-template-columns: 1fr;
  }

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

  .report-grid--trends,
  .report-grid--team,
  .report-grid--lists,
  .report-grid--lists-2 {
    grid-template-columns: 1fr;
  }

  .dashboard-task-panel--compact {
    padding: 14px;
  }

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

  .task-detail-panel {
    position: static;
  }

  .messe-frame {
    min-height: calc(100svh - 180px);
  }

  .menu-toggle {
    display: inline-flex;
  }
}

@media (max-width: 720px) {
  html {
    -webkit-text-size-adjust: 100%;
  }

  body {
    display: block;
    min-height: 100svh;
  }

  .sidebar {
    padding: 10px 12px 8px;
    background: rgba(252, 253, 251, 0.96);
    backdrop-filter: blur(18px);
  }

  .brand {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
  }

  .brand-logo {
    width: 118px;
  }

  .brand-copy small {
    font-size: 10px;
  }

  nav {
    display: grid;
    gap: 8px;
    overflow: visible;
    padding: 0;
  }

  .nav-button {
    border: 1px solid rgba(223, 228, 220, 0.95);
    min-height: 42px;
    padding: 10px 12px;
    white-space: normal;
    width: 100%;
  }

  .user-box {
    background: #ffffff;
    border: 1px solid rgba(223, 228, 220, 0.95);
    border-radius: 8px;
    display: grid;
    gap: 7px;
    margin: 8px 0 0;
    padding: 10px;
  }

  .push-panel {
    padding: 8px;
  }

  .push-panel button,
  .user-box > button {
    min-height: 40px;
  }

  .push-panel--settings {
    max-width: none;
  }

  .push-panel--settings .actions,
  .push-panel--settings button {
    width: 100%;
  }

  .report-filter-row {
    overflow-x: visible;
    padding-bottom: 0;
    flex-wrap: wrap;
  }

  .report-filter-chip {
    flex: 1 1 120px;
  }

  .report-assignee-select {
    min-width: 0;
  }

  .report-trend__row {
    grid-template-columns: 1fr;
  }

  .report-trend__value {
    text-align: left;
  }

  .push-device-item {
    display: grid;
  }

  main {
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }

  .topbar {
    align-items: stretch;
    display: grid;
    gap: 10px;
    padding: 14px 14px 12px;
    position: static;
  }

  .impersonation-banner {
    margin: 0 12px 10px;
    flex-direction: column;
    align-items: flex-start;
  }

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

  h1 {
    font-size: 23px;
    line-height: 1.15;
  }

  h2 {
    font-size: 17px;
    line-height: 1.25;
  }

  p {
    line-height: 1.5;
  }

  #app {
    padding: 0 12px 28px;
  }

  .menu-toggle {
    width: 42px;
    height: 42px;
  }

  .notification-popover {
    max-width: calc(100vw - 20px);
    left: auto;
    right: 0;
  }

  .toast {
    margin: 0 12px 12px;
  }

  .panel {
    padding: 14px;
  }

  .crm-layout-panel {
    padding: 12px;
  }

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

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

  .crm-pipeline-column {
    padding: 9px;
  }

  .crm-bulk-toolbar {
    align-items: stretch;
    display: grid;
  }

  .crm-bulk-toolbar select {
    max-width: none;
    min-width: 0;
  }

  .crm-bulk-details {
    display: grid;
    min-width: 0;
  }

  .crm-bulk-details label {
    max-width: none;
    min-width: 0;
  }

  .crm-bulk-count {
    margin-left: 0;
  }

  .card {
    padding: 14px;
  }

  .cards,
  .dashboard-kpis,
  .dashboard-kpis--three,
  .dashboard-kpis--four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .metric-button {
    min-height: 96px;
  }

  .card strong {
    font-size: 24px;
  }

  .dashboard-layout,
  .grid {
    gap: 12px;
  }

  .hero-summary {
    grid-template-columns: 1fr;
  }

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

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

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

  .inbox-searchbar {
    grid-template-columns: 1fr;
  }

  .inbox-grid,
  .inbox-detail__layout,
  .inbox-assignment--matched,
  .inbox-assignment--form {
    grid-template-columns: 1fr;
  }

  .inbox-composer {
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

  .global-palette {
    top: 12px;
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
    max-height: none;
  }

  .global-palette-search {
    grid-template-columns: 1fr;
  }

  .global-palette__quick {
    display: grid;
  }

  .inbox-composer__summary {
    grid-template-columns: 1fr;
  }

  .merchant-core-grid {
    grid-template-columns: 1fr;
  }

  .email-editor-toolbar {
    gap: 5px;
  }

  .email-editor-toolbar button {
    flex: 1 1 auto;
  }

  .email-editor {
    min-height: 190px;
    padding: 14px;
  }

  .email-preview-panel {
    padding: 10px;
  }

  .email-preview-body {
    max-height: 220px;
    padding: 12px;
  }

  .dashboard-hero {
    gap: 14px;
    padding: 16px;
  }

  .dashboard-hero h2 {
    font-size: 24px;
    line-height: 1.15;
  }

  .dashboard-mobile-header h2 {
    font-size: 22px;
  }

  .dashboard-mobile-quick-actions,
  .dashboard-mobile-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .dashboard-mobile-kpis .metric-button {
    min-height: 92px;
  }

  .tasks-hero .hero-summary {
    grid-template-columns: 1fr;
  }

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

  .task-detail-summary {
    grid-template-columns: 1fr;
  }

  .task-card__footer {
    flex-direction: column;
  }

  .messe-frame {
    min-height: calc(100svh - 158px);
  }

  .pwa-install-overlay {
    border-radius: 10px 10px 0 0;
    bottom: 0;
    grid-template-columns: 58px minmax(0, 1fr);
    left: 0;
    padding: 14px;
    right: 0;
  }

  .pwa-install-logo {
    min-height: 58px;
  }

  .pwa-install-logo img {
    max-height: 44px;
  }

  .pwa-install-copy h2 {
    font-size: 17px;
  }

  .pwa-install-actions {
    grid-column: 1 / -1;
  }

  .dashboard-hero-actions,
  .actions {
    align-items: stretch;
    display: grid;
    grid-template-columns: 1fr;
  }

  .actions button,
  .actions .button,
  .actions a {
    min-height: 44px;
    width: 100%;
  }

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

  .merchant-section-nav {
    gap: 6px;
  }

  .merchant-section-nav button {
    min-height: 40px;
    padding: 8px 10px;
  }

  .section-title {
    align-items: flex-start;
    display: grid;
  }

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

  label {
    font-size: 14px;
  }

input,
select,
textarea,
button,
.button {
  border-radius: 8px;
  font-size: 16px;
  min-height: 46px;
}

input[readonly] {
  background: #f4f6f2;
  color: var(--muted);
}

input.is-computed {
  background: #eef4ed;
  border-color: rgba(49, 124, 86, 0.28);
}

  input,
  select,
  textarea {
    padding: 12px;
  }

  textarea {
    min-height: 106px;
  }

  .split-list {
    gap: 9px;
  }

  .list-item {
    padding: 12px;
  }

  .crm-table-wrap {
    max-width: 100%;
    overflow-x: hidden;
  }

  .crm-table {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    table-layout: auto;
  }

  .crm-table th,
  .crm-table td {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .crm-cell .actions,
  .crm-cell .actions.wrap,
  .crm-cell .actions.compact-actions {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .crm-cell .actions button {
    width: 100%;
  }

  .consignment-card__summary {
    display: grid;
  }

  .consignment-card__summary-meta {
    justify-content: flex-start;
  }

  .consignment-drawer__panel {
    width: 100%;
  }

  table[data-mobile-table='true'] {
    border-collapse: separate;
    display: grid;
    font-size: 14px;
    gap: 10px;
    max-width: 100%;
    min-width: 0;
    width: 100%;
  }

  .crm-table[data-mobile-table='true'] {
    width: 100%;
    max-width: 100%;
  }

  table[data-mobile-table='true'] thead {
    display: none;
  }

  table[data-mobile-table='true'] tbody {
    display: grid;
    gap: 10px;
  }

  table[data-mobile-table='true'] tr {
    background: #ffffff;
    border: 1px solid rgba(223, 228, 220, 0.95);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    padding: 11px;
  }

  table[data-mobile-table='true'] td {
    align-items: start;
    border-bottom: 0;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(88px, 34%) minmax(0, 1fr);
    padding: 0;
    min-width: 0;
  }

  table[data-mobile-table='true'] td::before {
    color: var(--muted);
    content: attr(data-label);
    font-size: 12px;
    font-weight: 800;
    line-height: 1.35;
  }

  table[data-mobile-table='true'] td:empty {
    display: none;
  }

  table[data-mobile-table='true'] td button,
  table[data-mobile-table='true'] td a {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
  }

  .status {
    white-space: nowrap;
  }

  .tasks-mobile-shell {
    display: grid;
    gap: 12px;
  }

  .tasks-mobile-hero {
    display: grid;
    gap: 12px;
  }

  .tasks-mobile-hero__head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
  }

  .tasks-mobile-hero__head h2 {
    font-size: 22px;
    margin: 3px 0 4px;
  }

  .tasks-mobile-hero__head p {
    margin: 0;
    color: var(--muted);
    font-size: 13px;
  }

  .tasks-mobile-hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .tasks-mobile-kpis__grid {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tasks-mobile-filters .tasks-mobile-chip-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x proximity;
  }

  .tasks-mobile-chip-row button {
    flex: 0 0 auto;
    scroll-snap-align: start;
    white-space: nowrap;
  }

  .tasks-mobile-list__items {
    display: grid;
    gap: 10px;
  }

  .dashboard-mobile-card--task {
    gap: 10px;
    padding: 13px;
  }

  .dashboard-mobile-card__head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
  }

  .dashboard-mobile-card__title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
  }

  .dashboard-mobile-card__meta,
  .dashboard-mobile-card__body {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .dashboard-mobile-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .task-mobile-focus {
    display: grid;
    gap: 10px;
  }

  .task-mobile-focus__title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
  }

  .task-mobile-focus__meta,
  .task-mobile-focus__body {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
  }

  .tasks-sheet {
    position: fixed;
    inset: 0;
    z-index: 80;
  }

  .tasks-sheet__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(13, 23, 18, 0.42);
  }

  .tasks-sheet__panel {
    position: absolute;
    inset: auto 0 0;
    max-height: 92svh;
    overflow: auto;
    background: #fff;
    border-radius: 18px 18px 0 0;
    padding: 14px;
    box-shadow: 0 -18px 42px rgba(13, 23, 18, 0.18);
  }

  .tasks-sheet__panel--composer {
    background: transparent;
    box-shadow: none;
    padding: 0;
  }

  .tasks-sheet__header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .tasks-sheet__header h3 {
    margin: 4px 0 0;
    font-size: 18px;
    line-height: 1.25;
  }

  .tasks-sheet__header small,
  .tasks-sheet__header span {
    display: block;
    color: var(--muted);
    line-height: 1.4;
  }

  .tasks-sheet__quick-actions {
    margin-bottom: 12px;
  }

  .tasks-sheet__content .task-detail-panel,
  .tasks-sheet__content .tasks-composer {
    position: static;
    box-shadow: none;
    padding: 0;
  }

  .tasks-sheet__content .task-detail-summary {
    grid-template-columns: 1fr;
  }

  .tasks-sheet__content .task-inline-form {
    margin-top: 12px;
  }

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

@media (max-width: 420px) {
  .cards,
  .dashboard-kpis,
  .dashboard-kpis--three,
  .dashboard-kpis--four {
    grid-template-columns: 1fr;
  }

  .merchant-activity-summary__grid {
    grid-template-columns: 1fr;
  }

  .dashboard-hero h2 {
    font-size: 22px;
  }

  .hero-summary {
    grid-template-columns: 1fr;
  }
}
