/* InboxTeam 2.0 design tokens and cross-module normalization. */
:root {
  --font-sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-size-caption: 11px;
  --font-size-small: 12px;
  --font-size-body: 14px;
  --font-size-section: 17px;
  --font-size-page: 28px;
  --line-height-tight: 1.25;
  --line-height-body: 1.5;
  --control-height: 40px;
  --radius-control: 8px;
  --space-page-x: 36px;
  --space-page-y: 30px;
}

html { font-size: 16px; }
body { font-family: var(--font-sans); font-size: var(--font-size-body); line-height: var(--line-height-body); }
button, input, select, textarea { font-family: inherit; }

/* Page hierarchy */
.page-title h1,
.operations-heading h1,
.campaign-detail-head h1,
.search-heading h1,
.contacts-heading h1,
.contact-profile h1,
.config-landing > header h1,
.status-settings-head h1,
.automation-heading h1,
.macro-heading h1,
.agent-profile-heading h1,
.queue-header h1 {
  font-size: var(--font-size-page);
  line-height: var(--line-height-tight);
  letter-spacing: -.55px;
}

.eyebrow,
.config-breadcrumb {
  font-size: var(--font-size-caption);
  line-height: 1.35;
  letter-spacing: .85px;
}

.page-title p,
.operations-heading > div > p:last-child,
.campaign-detail-head p,
.search-heading > div > p:last-child,
.contacts-heading > div > p:last-child,
.status-settings-head > div > p:last-child,
.automation-heading > div > p:last-child,
.macro-heading p:not(.eyebrow),
.agent-profile-heading p:not(.eyebrow),
.config-landing > header p:last-child {
  font-size: var(--font-size-small);
  line-height: var(--line-height-body);
}

.panel-header h2,
.campaign-list h2,
.campaign-tools h2,
.campaign-review h2,
.integration-card h2,
.agent-report h2,
.quality-report h2,
.group-card h2,
.operation-settings h2,
.system-heading h2,
.go-live-panel h2,
.agent-setting-section h2,
.default-views-panel h2,
.custom-views-panel h2,
.view-builder h2,
.macro-builder h2,
.config-card-grid h2 {
  font-size: var(--font-size-section);
  line-height: 1.35;
}

.automation-list > header h2,
.automation-activity h2,
.automation-studio h2 {
  font-size: var(--font-size-section);
  line-height: 1.35;
}

/* Shared body and helper text */
.panel-header p,
.group-card header p,
.operation-settings p,
.system-heading p,
.agent-setting-section header p,
.default-views-panel header p,
.custom-views-panel header p,
.view-builder > p:not(.eyebrow),
.macro-builder > p:not(.eyebrow),
.config-card-grid header p,
.config-featured small {
  font-size: var(--font-size-small);
  line-height: var(--line-height-body);
}

.data-row strong,
.audit-row > div strong,
.system-checks strong,
.ticket-row strong,
.search-result strong,
.contact-row strong,
.macro-row strong,
.custom-views-panel article,
.campaign-review main > article,
.agent-report > article {
  font-size: var(--font-size-body);
}

.data-row small,
.audit-row > div small,
.system-checks small,
.system-checks span,
.ticket-row small,
.ticket-row em,
.ticket-row time,
.search-result small,
.search-result em,
.search-result time,
.contact-row small,
.contact-row time,
.macro-row small,
.criteria-summary,
.custom-views-panel article small {
  font-size: var(--font-size-caption);
  line-height: 1.4;
}

/* Forms use one readable density. */
.stack-form label,
.provider-card label,
.campaign-tools label,
.integration-form label,
.report-heading form label,
.template-settings label,
.audience-builder label,
.campaign-source-card form > label,
.view-builder form > label,
.macro-builder form > label,
.status-edit-form label,
.status-dialog label,
.automation-builder label,
.agent-field-row label {
  font-size: var(--font-size-caption);
  line-height: 1.35;
}

.stack-form input,
.stack-form select,
.stack-form textarea,
.provider-card input,
.provider-card select,
.campaign-tools input,
.campaign-tools select,
.campaign-tools textarea,
.integration-form input,
.integration-form select,
.integration-form textarea,
.search-filters input,
.search-filters select,
.queue-filter select,
.view-builder input:not([type="checkbox"]),
.view-builder select,
.macro-builder input:not([type="checkbox"]),
.macro-builder select,
.macro-builder textarea,
.status-edit-form input,
.status-edit-form select,
.status-dialog input,
.status-dialog select {
  min-height: var(--control-height);
  border-radius: var(--radius-control);
  font-size: var(--font-size-small);
  line-height: 1.4;
}

/* One action language across configuration, profiles and operational tools. */
.primary-button,
.secondary-button,
.secondary-action,
.use-ai-button,
.danger-button,
.danger-quiet,
.oauth-install-button,
.search-filters button,
.macro-search button,
.report-heading form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--control-height);
  margin: 0;
  border-radius: var(--radius-control);
  padding: 0 14px;
  font-size: var(--font-size-small);
  font-weight: 750;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.primary-button,
.use-ai-button {
  border: 1px solid var(--green);
  background: var(--green);
  color: #fff;
}

.primary-button:hover,
.use-ai-button:hover { background: var(--green-dark); border-color: var(--green-dark); }

.secondary-button,
.secondary-action {
  border: 1px solid #c7d3cd;
  background: #fff;
  color: var(--green-dark);
}

.secondary-button:hover,
.secondary-action:hover { border-color: #8eb9a0; background: #f5faf7; }

.danger-button,
.danger-quiet {
  border: 1px solid #e8c1bd;
  background: #fff7f6;
  color: #a13f36;
}

.danger-button:hover,
.danger-quiet:hover { border-color: #d9948d; background: #fff0ee; }

.oauth-install-button { min-height: var(--control-height); }

:is(.primary-button, .secondary-button, .secondary-action, .use-ai-button, .danger-button, .danger-quiet, .oauth-install-button):active {
  transform: translateY(1px);
}

:is(.primary-button, .secondary-button, .secondary-action, .use-ai-button, .danger-button, .danger-quiet, .oauth-install-button):disabled,
:is(.primary-button, .secondary-button, .secondary-action, .use-ai-button, .danger-button, .danger-quiet, .oauth-install-button)[aria-disabled="true"] {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}

:is(a, button, input, select, textarea, summary):focus-visible {
  outline: 3px solid rgba(15, 122, 79, .22);
  outline-offset: 2px;
}

/* Required fields are revealed together after the first submit attempt. */
.required-field-marker {
  margin-inline-start: 4px;
  color: var(--danger);
  font-size: 1em;
  font-weight: 800;
  line-height: 1;
}

form.validation-attempted :is(input, select, textarea)[aria-invalid="true"] {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(161, 63, 54, .1);
}

/* Tables and status metadata */
.queue-columns,
.search-table-head,
.contacts-table-head,
.recipient-head,
.agent-head,
.macro-table-head,
.view-table-head,
.status-table > header {
  font-size: var(--font-size-caption);
  letter-spacing: .45px;
}

.status-badge,
.sla-badge,
.status-pill,
.campaign-status,
.recipient-status,
.macro-state,
.view-active,
.status-category,
.agent-role-label,
.tag {
  font-size: var(--font-size-caption);
  line-height: 1.2;
}

/* Administration center */
.config-title small { font-size: var(--font-size-caption); }
.config-title strong { font-size: var(--font-size-small); }
.config-search input { font-size: var(--font-size-small); }
.config-center-nav .config-home,
.config-center-nav section a { font-size: var(--font-size-small); }
.config-center-nav section > p { font-size: var(--font-size-caption); }
.config-featured strong,
.config-card-grid h2 { font-size: var(--font-size-body); }
.config-featured small,
.config-card-grid header p,
.config-card-grid section > a { font-size: var(--font-size-small); }

/* SLA, audit and system pages were using separate scales. */
.operation-summary span,
.system-summary span,
.system-summary small,
.audit-row time,
.audit-row code { font-size: var(--font-size-caption); }
.operation-summary strong,
.system-summary strong { font-size: 20px; line-height: 1.25; }
.audit-row { font-size: var(--font-size-small); }
.audit-row pre { font-size: var(--font-size-caption); line-height: 1.5; }
.system-checks article { font-size: var(--font-size-small); }

/* Automation Studio and advanced tools */
.automation-studio,
.automations-page,
.macro-page,
.views-page { font-size: var(--font-size-body); }
.automation-kpis span,
.automation-card small,
.automation-node small,
.condition-row small,
.action-row small { font-size: var(--font-size-caption); }
.automation-card strong,
.automation-node strong,
.condition-row strong,
.action-row strong { font-size: var(--font-size-small); }
.integration-icon.openai { background: var(--green-soft); color: var(--green); }
.integration-form > .integration-help { color: var(--muted); font-size: var(--font-size-caption); line-height: 1.5; }

@media (max-width: 760px) {
  :root {
    --font-size-page: 24px;
    --space-page-x: 18px;
    --space-page-y: 22px;
  }
}
