:root {
  --bg: #f4f7fb;
  --bg-strong: #eaf0f7;
  --panel: #ffffff;
  --panel-muted: #f8fafc;
  --panel-accent: #f2f6ff;
  --line: #d9e2ec;
  --line-strong: #c5d0dd;
  --text: #17212d;
  --muted: #5e6b7e;
  --muted-soft: #8290a4;
  --accent: #2d5bff;
  --accent-strong: #2148d8;
  --accent-soft: rgba(45, 91, 255, 0.1);
  --success: #197a57;
  --success-soft: rgba(25, 122, 87, 0.12);
  --warning: #a86e11;
  --warning-soft: rgba(168, 110, 17, 0.12);
  --danger: #b84747;
  --danger-soft: rgba(184, 71, 71, 0.12);
  --shadow: 0 22px 54px rgba(24, 40, 64, 0.08);
  --shadow-soft: 0 10px 24px rgba(24, 40, 64, 0.06);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --space: 24px;
}

* {
  box-sizing: border-box;
}

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

body {
  background:
    radial-gradient(circle at top left, rgba(45, 91, 255, 0.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(13, 148, 136, 0.08), transparent 22%),
    linear-gradient(180deg, #f7f9fc 0%, #eef3f8 100%);
  color: var(--text);
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  overflow-x: hidden;
}

.scene,
.grid-haze {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.scene-top {
  background:
    radial-gradient(circle at 12% 8%, rgba(45, 91, 255, 0.1), transparent 20%),
    radial-gradient(circle at 86% 10%, rgba(14, 116, 144, 0.08), transparent 22%);
}

.scene-bottom {
  background:
    radial-gradient(circle at 14% 88%, rgba(16, 185, 129, 0.08), transparent 18%),
    radial-gradient(circle at 84% 80%, rgba(45, 91, 255, 0.08), transparent 20%);
}

.grid-haze {
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.65) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.65) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.25;
  mask-image: radial-gradient(circle at center, rgba(0, 0, 0, 0.8), transparent 86%);
}

.page {
  position: relative;
  z-index: 1;
  max-width: 1600px;
  margin: 0 auto;
  padding: 28px;
}

.panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(217, 226, 236, 0.95);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.reveal {
  animation: rise-in 0.45s ease both;
}

.hidden {
  display: none !important;
}

.eyebrow,
.section-label {
  margin: 0;
  color: var(--muted-soft);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: "Sora", "IBM Plex Sans", sans-serif;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

p {
  margin: 0;
}

.lead,
.hero-copy,
.workspace-status,
.panel-note,
.inline-message,
.meta-value,
.stack-caption,
.automation-copy {
  color: var(--muted);
}

.auth-view {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(360px, 0.85fr);
  gap: 24px;
  align-items: stretch;
  min-height: calc(100vh - 56px);
}

.auth-copy,
.auth-card {
  padding: 40px;
}

.auth-copy h1 {
  margin-top: 18px;
  max-width: 11ch;
  font-size: clamp(2.8rem, 5vw, 5rem);
}

.lead {
  margin-top: 22px;
  max-width: 58ch;
  font-size: 1.04rem;
  line-height: 1.65;
}

.feature-stack {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.feature-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fbfcff, #f6f8fc);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.feature-card h2 {
  font-size: 1.05rem;
}

.feature-card p {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.55;
}

.feature-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--panel-accent);
  color: var(--accent-strong);
  font-weight: 700;
  border: 1px solid rgba(45, 91, 255, 0.12);
}

.auth-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
}

.auth-header {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 6px rgba(25, 122, 87, 0.12);
}

.form-stack {
  display: grid;
  gap: 18px;
}

.form-tight {
  gap: 16px;
}

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

.field label {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
}

.field-note {
  color: var(--muted-soft);
  font-size: 0.82rem;
  font-weight: 500;
}

input,
textarea,
select,
button {
  font: inherit;
}

input,
textarea,
select {
  width: 100%;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  transition:
    border-color 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease;
}

input::placeholder,
textarea::placeholder {
  color: #98a5b7;
}

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

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: rgba(45, 91, 255, 0.45);
  box-shadow: 0 0 0 4px rgba(45, 91, 255, 0.12);
}

input:disabled,
textarea:disabled,
select:disabled,
button:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.field label input[type="checkbox"],
.automation-switch input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
  accent-color: var(--accent);
}

.primary-button,
.ghost-button,
.icon-button,
.app-card,
.table-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-decoration: none;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

.primary-button {
  padding: 14px 18px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  color: #fff;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(45, 91, 255, 0.2);
}

.ghost-button,
.table-action {
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  box-shadow: var(--shadow-soft);
}

.ghost-button.accent {
  background: var(--panel-accent);
  border-color: rgba(45, 91, 255, 0.18);
  color: var(--accent-strong);
}

.ghost-button.danger {
  background: #fff5f5;
  border-color: rgba(184, 71, 71, 0.16);
  color: var(--danger);
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-muted);
  color: var(--muted);
}

.primary-button:hover,
.ghost-button:hover,
.icon-button:hover,
.table-action:hover,
.app-card:hover {
  transform: translateY(-1px);
}

.inline-message {
  min-height: 1.25rem;
  font-size: 0.9rem;
}

.inline-message.error {
  color: var(--danger);
}

.inline-message.success {
  color: var(--success);
}

.app-view {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 22px;
  padding: 24px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-lockup h2 {
  font-size: 1.45rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(180deg, #2d5bff, #2148d8);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  box-shadow: 0 12px 24px rgba(45, 91, 255, 0.2);
}

.sidebar-block {
  display: grid;
  gap: 14px;
}

.block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pill,
.automation-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(45, 91, 255, 0.12);
  background: var(--panel-accent);
  color: var(--accent-strong);
  font-size: 0.82rem;
  font-weight: 600;
}

.user-chip {
  display: grid;
  gap: 4px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel-muted);
}

.user-chip strong {
  font-size: 0.98rem;
}

.user-chip span {
  color: var(--muted);
  font-size: 0.9rem;
}

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

.sidebar-nav {
  display: grid;
  gap: 8px;
}

.nav-button,
.mobile-nav-button,
.subnav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    color 0.18s ease,
    transform 0.18s ease;
}

.nav-button:hover,
.mobile-nav-button:hover,
.subnav-button:hover {
  transform: translateY(-1px);
}

.nav-button.active,
.mobile-nav-button.active,
.subnav-button.active {
  background: var(--panel-accent);
  border-color: rgba(45, 91, 255, 0.24);
  color: var(--accent-strong);
}

.app-list {
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 320px);
  overflow: auto;
  padding-right: 2px;
}

.app-card {
  display: grid;
  gap: 5px;
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--text);
  text-align: left;
  box-shadow: var(--shadow-soft);
}

.app-card strong {
  font-size: 0.98rem;
}

.app-card span {
  color: var(--muted);
  font-size: 0.86rem;
}

.app-card.active {
  border-color: rgba(45, 91, 255, 0.28);
  background: linear-gradient(180deg, #f7f9ff, #f1f5ff);
  box-shadow: 0 18px 30px rgba(45, 91, 255, 0.12);
}

.workspace {
  display: grid;
  gap: 20px;
}

.workspace-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.workspace-header h1 {
  margin-top: 10px;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.app-icon-small {
  width: 34px;
  height: 34px;
  margin-left: 10px;
  vertical-align: middle;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid var(--line);
  background: #fff;
}

.workspace-status {
  max-width: 30ch;
  font-size: 0.96rem;
  line-height: 1.55;
  text-align: right;
}

.workspace-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.mobile-section-nav {
  display: none;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.section-shell {
  display: grid;
  gap: 18px;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.section-header h2 {
  margin-top: 8px;
  font-size: clamp(1.35rem, 2vw, 1.8rem);
}

.section-description {
  max-width: 58ch;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.section-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.section-subnav {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.workspace-content {
  display: grid;
  gap: 18px;
  min-height: 220px;
}

.page-stack {
  display: grid;
  gap: 18px;
}

.split-layout {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.split-layout-wide {
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

.content-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.summary-stats {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.summary-stat {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfcfe, #f7f9fc);
}

.summary-stat strong {
  display: block;
  margin: 8px 0;
  font-size: 1.4rem;
  color: var(--text);
}

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

.key-value-list {
  display: grid;
  gap: 12px;
}

.key-value-row {
  display: grid;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf2f7;
}

.key-value-row:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.key-value-cell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.key-value-cell strong {
  color: var(--text);
  word-break: break-word;
}

.rule-accordion-list {
  display: grid;
  gap: 12px;
}

.automation-settings-stack {
  display: grid;
  gap: 14px;
}

.automation-setting-card {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfcfe, #f7f9fc);
}

.automation-setting-card-primary {
  border-color: rgba(45, 91, 255, 0.22);
  background: linear-gradient(180deg, #f8faff, #eef3ff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.automation-setting-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.automation-setting-header h4 {
  margin-top: 8px;
  font-size: 1.08rem;
}

.automation-setting-value {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 10px 14px;
  border: 1px solid rgba(45, 91, 255, 0.18);
  border-radius: 999px;
  background: rgba(45, 91, 255, 0.08);
  color: var(--accent-strong);
  font-weight: 700;
}

.rule-accordion {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfcfe, #f7f9fc);
}

.rule-accordion-toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  width: 100%;
  gap: 16px;
  padding: 16px 18px;
  border: 0;
  border-radius: 18px;
  background: transparent;
  color: inherit;
  text-align: left;
}

.rule-accordion-copy h4 {
  margin: 8px 0 6px;
}

.rule-accordion-body {
  display: grid;
  gap: 14px;
  padding: 0 18px 18px;
}

.detail-modal-card {
  width: min(1100px, 100%);
}

.hero-card,
.panel {
  padding: 24px;
}

.hero-card {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) auto;
  gap: 20px;
  align-items: start;
}

.hero-card h2 {
  margin-top: 10px;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
}

.hero-copy {
  margin-top: 14px;
  max-width: 56ch;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.meta-grid,
.metric-grid,
.dashboard-grid,
.two-up,
.detail-grid,
.automation-grid,
.automation-form-row,
.automation-counter-grid,
.automation-kpi-grid {
  display: grid;
  gap: 16px;
}

.meta-grid {
  grid-column: 1 / -1;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

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

.automation-form-row.compact {
  grid-template-columns: minmax(0, 240px);
}

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

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

.meta-card,
.metric-card,
.detail-card,
.automation-kpi,
.automation-counter {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfcfe, #f7f9fc);
}

.meta-card-copyable {
  cursor: pointer;
}

.meta-card-copyable:hover {
  border-color: rgba(45, 91, 255, 0.22);
  background: linear-gradient(180deg, #f7f9ff, #f2f6ff);
}

.meta-label,
.metric-label,
.detail-label {
  color: var(--muted);
  font-size: 0.82rem;
}

.copy-hint {
  color: var(--muted-soft);
  font-size: 0.78rem;
}

.meta-value,
.detail-value {
  margin-top: 10px;
  color: var(--text);
  line-height: 1.55;
  word-break: break-word;
}

.meta-code {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.82rem;
}

.metric-card {
  position: relative;
  overflow: hidden;
}

.metric-card::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent), #3f9cff);
}

.metric-value {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.5;
}

.metric-stat {
  margin-top: 10px;
  color: var(--text);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

.metric-note-compact {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.metric-value strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 2rem;
}

.panel-wide {
  min-height: 340px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.panel-header h3 {
  margin-top: 8px;
  font-size: 1.45rem;
}

.panel-note {
  max-width: 30ch;
  text-align: right;
  line-height: 1.5;
}

.quick-link-button {
  white-space: nowrap;
}

.activity-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-items: flex-end;
  gap: 10px;
  min-height: 220px;
  padding-top: 12px;
  overflow: hidden;
}

.chart-bar {
  display: grid;
  gap: 6px;
  align-items: end;
  min-width: 0;
}

.chart-bar-fill {
  min-height: 12px;
  border-radius: 999px 999px 10px 10px;
  background: linear-gradient(180deg, #5c84ff, #2d5bff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.chart-label,
.chart-value,
.chart-subvalue {
  font-size: 0.8rem;
  text-align: center;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-label {
  color: var(--muted);
}

.chart-value {
  color: var(--text);
  font-weight: 600;
}

.chart-subvalue {
  color: var(--muted-soft);
  font-size: 0.74rem;
}

.stack-list {
  display: grid;
  gap: 12px;
}

.stack-row {
  display: grid;
  gap: 8px;
}

.stack-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.stack-caption {
  font-size: 0.86rem;
  line-height: 1.5;
}

.bar-track {
  width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef5;
}

.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #3f9cff);
}

.table-shell {
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: auto;
  background: #fff;
}

.pagination-bar,
.reports-filter-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pagination-bar {
  margin-top: 16px;
}

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

.pagination-status {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 600;
}

.reports-filter-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.reports-filter-grid-primary {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.reports-inline-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  padding: 14px 12px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--muted-soft);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

tbody tr {
  cursor: pointer;
  transition: background 0.18s ease;
}

tbody tr:hover {
  background: #f7faff;
}

tbody tr.static-row {
  cursor: default;
}

tbody tr.static-row:hover {
  background: transparent;
}

.table-action {
  padding: 8px 12px;
  font-size: 0.88rem;
}

.table-action.small {
  padding: 7px 10px;
  font-size: 0.78rem;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  background: #f0f4f8;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
}

.status-pill::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #94a3b8;
}

.status-pill.sent,
.status-pill.active,
.status-pill.opened {
  background: var(--success-soft);
  color: var(--success);
}

.status-pill.sent::before,
.status-pill.active::before,
.status-pill.opened::before {
  background: var(--success);
}

.status-pill.scheduled,
.status-pill.eligible {
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.scheduled::before,
.status-pill.eligible::before {
  background: var(--warning);
}

.status-pill.cancelled,
.status-pill.failed,
.status-pill.expired,
.status-pill.inactive {
  background: var(--danger-soft);
  color: var(--danger);
}

.status-pill.cancelled::before,
.status-pill.failed::before,
.status-pill.expired::before,
.status-pill.inactive::before {
  background: var(--danger);
}

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

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

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

.detail-list article,
.automation-card,
.automation-rule-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfcfe, #f7f9fc);
}

.automation-shell {
  display: grid;
  gap: 18px;
}

.automation-kpi-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.automation-kpi strong,
.automation-counter strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
}

.automation-kpi strong {
  font-size: 1.5rem;
}

.automation-grid {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
}

.automation-card h4,
.automation-rule-card h4 {
  margin: 10px 0 8px;
  font-size: 1.1rem;
}

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

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

.automation-rule-list,
.automation-rule-meta {
  display: grid;
  gap: 12px;
}

.automation-rule-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.automation-rule-meta {
  grid-auto-flow: column;
  justify-content: start;
  margin-top: 12px;
}

.automation-counter-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 14px;
}

.automation-switch {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
}

.automation-action {
  margin-top: 16px;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  line-height: 1.6;
  background: linear-gradient(180deg, #fbfcfe, #f7f9fc);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 30, 44, 0.42);
  backdrop-filter: blur(7px);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(960px, 100%);
  max-height: calc(100vh - 48px);
  overflow: auto;
  padding: 28px;
}

.addon-modal-card {
  max-width: 680px;
}

.section-divider {
  width: 100%;
  height: 1px;
  margin: 4px 0;
  border: 0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
}

.inline-actions {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.inline-actions-label {
  margin-bottom: 0;
}

.select-addon-button {
  padding: 8px 12px;
  font-size: 0.84rem;
}

.campaign-modal-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  margin-top: 22px;
}

.push-preview-sidebar {
  border-left: 1px solid var(--line);
  padding-left: 28px;
}

.preview-label {
  margin-bottom: 12px;
}

.android-push-preview {
  background: linear-gradient(180deg, #f1f4f8, #e7edf5);
  border: 1px solid #d3dce8;
  border-radius: 20px;
  padding: 16px;
  color: #17212d;
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  user-select: none;
}

.android-push-preview .app-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #5e6b7e;
  font-size: 0.76rem;
}

.android-push-preview .app-info .icon {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

.android-push-preview .app-info .expand-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: #5e6b7e;
}

.android-push-preview.expanded .expand-btn {
  transform: rotate(180deg);
}

.android-push-preview .content {
  display: flex;
  gap: 12px;
}

.android-push-preview .text-content {
  flex: 1;
  min-width: 0;
}

.android-push-preview h4 {
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.95rem;
  margin: 0 0 4px;
}

.android-push-preview p {
  color: #5e6b7e;
  font-size: 0.88rem;
  line-height: 1.45;
}

.android-push-preview.collapsed p {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.android-push-preview.expanded p {
  white-space: normal;
}

.preview-img-collapsed {
  width: 52px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.expanded-image-container {
  margin-top: 12px;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.expanded-image-container img {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  object-fit: cover;
}

.preview-toggle-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.8rem;
  text-align: center;
}

.addon-list-container {
  display: grid;
  gap: 10px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px;
}

.addon-placeholder {
  color: var(--muted);
  text-align: center;
}

.addon-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.addon-thumb {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: var(--panel-muted);
}

.addon-content {
  flex: 1;
  min-width: 0;
}

.addon-content strong {
  display: block;
}

.addon-id {
  color: var(--muted);
  font-size: 0.82rem;
}

.addon-select {
  flex-shrink: 0;
}

.toast-stack {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 20;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 280px;
  max-width: 360px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--text);
  box-shadow: var(--shadow);
}

.toast.error {
  border-color: rgba(184, 71, 71, 0.18);
}

.toast.success {
  border-color: rgba(25, 122, 87, 0.16);
}

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

@media (max-width: 1260px) {
  .auth-view,
  .app-view,
  .dashboard-grid,
  .automation-grid,
  .campaign-modal-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
  }

  .push-preview-sidebar {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding-left: 0;
    padding-top: 24px;
  }

  .metric-grid,
  .detail-grid,
  .automation-kpi-grid,
  .automation-counter-grid,
  .summary-stats,
  .settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .page {
    padding: 18px;
  }

  .auth-copy,
  .auth-card,
  .sidebar,
  .hero-card,
  .panel,
  .modal-card {
    padding: 20px;
  }

  .auth-view {
    min-height: auto;
  }

  .workspace-header,
  .inline-actions,
  .panel-header,
  .section-header,
  .automation-setting-header,
  .pagination-bar,
  .reports-filter-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .workspace-status,
  .panel-note {
    text-align: left;
  }

  .metric-grid,
  .meta-grid,
  .detail-grid,
  .two-up,
  .automation-form-row,
  .automation-form-row.compact,
  .automation-kpi-grid,
  .automation-counter-grid,
  .summary-stats,
  .settings-grid,
  .split-layout,
  .split-layout-wide {
    grid-template-columns: 1fr;
  }

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

  .hero-actions,
  .workspace-actions,
  .section-toolbar {
    justify-content: flex-start;
  }

  .sidebar-nav {
    display: none;
  }

  .mobile-section-nav {
    display: flex;
  }

  .key-value-cell {
    align-items: flex-start;
    flex-direction: column;
  }

  .table-shell {
    border: 0;
    background: transparent;
    overflow: visible;
  }

  table,
  thead,
  tbody,
  tr,
  td {
    display: block;
    width: 100%;
  }

  thead {
    display: none;
  }

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

  tbody tr {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
    background: #fff;
    box-shadow: var(--shadow-soft);
  }

  td {
    padding: 8px 0;
    border-bottom: 1px solid #edf2f7;
  }

  td:last-child {
    border-bottom: 0;
  }

  td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 4px;
    color: var(--muted-soft);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .detail-modal-card {
    width: 100%;
    max-height: calc(100vh - 24px);
  }

  .toast-stack {
    left: 18px;
    right: 18px;
    bottom: 18px;
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}
