:root {
  --bloom-sidebar: #1a2332;
  --bloom-sidebar-hover: #243044;
  --bloom-accent: #0d6efd;
  --bloom-bg: #f4f6f9;
  --bloom-border: #e3e8ef;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background: var(--bloom-bg);
  min-height: 100vh;
}

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 240px;
  background: var(--bloom-sidebar);
  color: #c9d4e3;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  z-index: 1030;
}

.sidebar .brand {
  display: block;
  padding: 1.25rem 1.25rem 1rem;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  text-decoration: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar .nav-link {
  color: #aeb9c9;
  padding: 0.5rem 1.25rem;
  line-height: 1.25;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  border-radius: 0;
  font-size: 0.925rem;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
  background: var(--bloom-sidebar-hover);
  color: #fff;
}

.sidebar .nav-link i {
  font-size: 1.1rem;
  width: 1.25rem;
  text-align: center;
}

.main-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: #fff;
  border-bottom: 1px solid var(--bloom-border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.page-content {
  padding: 1.5rem;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--bloom-border);
  border-radius: 0.5rem;
  padding: 1rem 1.15rem;
  height: 100%;
}

.stat-card .stat-label {
  font-size: 0.8rem;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.35rem;
}

.stat-card .stat-value {
  font-size: 1.65rem;
  font-weight: 700;
  color: #1a2332;
  line-height: 1.2;
}

.card-panel {
  background: #fff;
  border: 1px solid var(--bloom-border);
  border-radius: 0.5rem;
  margin-bottom: 1.25rem;
}

.card-panel .card-panel-header {
  padding: 0.9rem 1.15rem;
  border-bottom: 1px solid var(--bloom-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.card-panel .card-panel-body {
  padding: 1.15rem;
}

.badge-status {
  font-weight: 500;
  cursor: help;
}

.badge-subscribed,
.badge-submitted,
.badge-completed {
  background: #d1e7dd;
  color: #0f5132;
}

.badge-unsubscribed,
.badge-cancelled,
.badge-skipped {
  background: #e2e3e5;
  color: #41464b;
}

.badge-bounced,
.badge-failed,
.badge-complained,
.badge-manual,
.badge-suppressed {
  background: #f8d7da;
  color: #842029;
}

.badge-draft {
  background: #e7f1ff;
  color: #084298;
}

.badge-scheduled,
.badge-queued,
.badge-pending,
.badge-retry {
  background: #fff3cd;
  color: #664d03;
}

.badge-sending,
.badge-processing,
.badge-paused {
  background: #cff4fc;
  color: #055160;
}

.empty-state {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #6c757d;
}

.empty-state i {
  font-size: 2.5rem;
  opacity: 0.45;
  display: block;
  margin-bottom: 0.75rem;
}

.table-actions .btn {
  padding: 0.15rem 0.45rem;
}

.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #1a2332 0%, #2c3e50 50%, #1a2332 100%);
  padding: 1.5rem;
}

.auth-card {
  background: #fff;
  border-radius: 0.75rem;
  padding: 2rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.auth-card .brand {
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 0.25rem;
  color: #1a2332;
}

.wizard-steps {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.wizard-steps .step {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 0.5rem;
  border-radius: 0.375rem;
  background: #e9ecef;
  font-size: 0.85rem;
  color: #6c757d;
}

.wizard-steps .step.active {
  background: var(--bloom-accent);
  color: #fff;
}

.wizard-steps .step.done {
  background: #d1e7dd;
  color: #0f5132;
}

/* ---- Friendly UI components ---- */

.sidebar .nav-section {
  padding: 1rem 1.25rem 0.35rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6f7f95;
}

.sidebar .sidebar-cta {
  margin: 1rem 1rem 0.25rem;
}

.sidebar .nav-link small {
  display: block;
  font-size: 0.72rem;
  color: #7d8aa0;
  line-height: 1.2;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
}

.status-pill .dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.success { background: #d1e7dd; color: #0f5132; }
.status-pill.warning { background: #fff3cd; color: #664d03; }
.status-pill.danger  { background: #f8d7da; color: #842029; }

.page-intro {
  color: #5b6778;
  margin: -0.25rem 0 1.25rem;
  font-size: 0.95rem;
  max-width: 900px;
}

.help-box {
  background: #f1f6ff;
  border: 1px solid #cfe0ff;
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
  color: #1e3a6b;
}

.help-box i {
  margin-right: 0.35rem;
}

.setup-steps {
  list-style: none;
  padding: 0;
  margin: 0;
}

.setup-steps li {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.85rem 1.15rem;
  border-top: 1px solid var(--bloom-border);
}

.setup-steps li:first-child {
  border-top: 0;
}

.setup-steps .step-icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  background: #e9ecef;
  color: #495057;
}

.setup-steps li.done .step-icon {
  background: #d1e7dd;
  color: #0f5132;
}

.setup-steps li.done .step-title {
  color: #6c757d;
  text-decoration: line-through;
}

.setup-steps .step-title {
  font-weight: 600;
  color: #1a2332;
}

.setup-steps .step-text {
  font-size: 0.875rem;
  color: #6c757d;
}

.stat-card .stat-icon {
  float: right;
  font-size: 1.4rem;
  opacity: 0.35;
}

.stat-card .stat-help {
  font-size: 0.78rem;
  color: #8a94a3;
  margin-top: 0.2rem;
}

.speed-option {
  display: block;
  border: 2px solid var(--bloom-border);
  border-radius: 0.5rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  height: 100%;
  background: #fff;
}

.speed-option:hover {
  border-color: #9ec5fe;
}

.btn-check:checked + .speed-option {
  border-color: var(--bloom-accent);
  background: #f1f6ff;
}

.speed-option .speed-title {
  font-weight: 600;
  color: #1a2332;
}

.speed-option .speed-text {
  font-size: 0.82rem;
  color: #6c757d;
}

.wizard-steps .step small {
  display: block;
  font-size: 0.72rem;
  opacity: 0.85;
}

.traffic-light {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  border-radius: 0.5rem;
  padding: 1.15rem 1.25rem;
  margin-bottom: 1.25rem;
}

.traffic-light i {
  font-size: 2rem;
  line-height: 1;
}

.traffic-light.success { background: #d1e7dd; color: #0f5132; }
.traffic-light.warning { background: #fff3cd; color: #664d03; }
.traffic-light.danger  { background: #f8d7da; color: #842029; }

.empty-state .btn {
  margin: 0.25rem;
}

.empty-state h3 {
  font-size: 1.1rem;
  color: #1a2332;
  margin-bottom: 0.35rem;
}

@media (max-width: 991.98px) {
  .sidebar {
    position: fixed;
    left: -260px;
    transition: left 0.2s ease;
  }

  .sidebar.show {
    left: 0;
  }

  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1025;
  }

  .sidebar-backdrop.show {
    display: block;
  }
}
