/* InboxMail — email marketing UI (custom.css) */

:root {
  --em-ink: #122033;
  --em-muted: #5b6b7c;
  --em-line: #d9e1ea;
  --em-bg: #eef2f6;
  --em-panel: #ffffff;
  --em-sidebar: #0c1a2b;
  --em-sidebar-2: #13263d;
  --em-accent: #0f766e;
  --em-accent-2: #115e59;
  --em-accent-soft: #ccfbf1;
  --em-warn: #b45309;
  --em-danger: #b91c1c;
  --em-ok: #047857;
  --em-radius: 14px;
  --em-shadow: 0 10px 28px rgba(12, 26, 43, 0.06);
  --em-font: "Outfit", "Trebuchet MS", sans-serif;
  --em-display: "Source Serif 4", Georgia, serif;
  --sidebar-w: 248px;
}

* { box-sizing: border-box; }

body.app-shell {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  color: var(--em-ink);
  background:
    linear-gradient(180deg, #f5f7fa 0%, var(--em-bg) 100%);
  font-family: var(--em-font);
}

/* ——— Sidebar ——— */
.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background:
    radial-gradient(ellipse 120% 60% at 0% 0%, rgba(15, 118, 110, 0.28), transparent 55%),
    linear-gradient(185deg, var(--em-sidebar) 0%, var(--em-sidebar-2) 100%);
  color: #e8eef5;
  padding: 1.25rem 0.9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  z-index: 40;
}

.sidebar-brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  padding: 0.35rem 0.55rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-mark {
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #14b8a6, #0f766e);
  font-size: 1.05rem;
  box-shadow: 0 6px 16px rgba(15, 118, 110, 0.35);
}

.brand-name {
  font-family: var(--em-display);
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-tag {
  font-size: 0.72rem;
  color: rgba(232, 238, 245, 0.55);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 0.15rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex: 1;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  color: rgba(232, 238, 245, 0.78);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.94rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.side-link:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #fff;
}

.side-link.active {
  background: rgba(20, 184, 166, 0.18);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(45, 212, 191, 0.25);
}

.side-icon {
  width: 1.15rem;
  height: 1.15rem;
  display: inline-flex;
  opacity: 0.9;
}
.side-icon svg { width: 100%; height: 100%; }

.sidebar-foot {
  margin-top: auto;
  padding: 0.85rem;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.78rem;
  color: rgba(232, 238, 245, 0.7);
}
.sidebar-foot p { margin: 0.4rem 0 0; line-height: 1.35; }
.lock-chip {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.2);
  color: #99f6e4;
}

/* ——— Main frame ——— */
.app-frame {
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.app-topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.1rem 1.5rem 0.85rem;
  border-bottom: 1px solid var(--em-line);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.page-title {
  margin: 0;
  font-family: var(--em-display);
  font-size: 1.55rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--em-ink);
  line-height: 1.15;
}

.page-sub {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--em-muted);
}

.topbar-actions { margin-left: auto; }

.sidebar-toggle {
  display: none;
  border: 1px solid var(--em-line);
  background: #fff;
  border-radius: 10px;
  width: 2.4rem;
  height: 2.4rem;
  font-size: 1.1rem;
  cursor: pointer;
}

.app-content {
  padding: 1.35rem 1.5rem 2rem;
  flex: 1;
}

.app-footer {
  padding: 0.9rem 1.5rem 1.25rem;
  color: var(--em-muted);
  font-size: 0.78rem;
  border-top: 1px solid var(--em-line);
}
.app-footer .sep { margin: 0 0.35rem; opacity: 0.5; }

/* ——— Surfaces ——— */
.panel {
  background: var(--em-panel);
  border: 1px solid var(--em-line);
  border-radius: var(--em-radius);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--em-shadow);
}

.hero-dash {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(125deg, rgba(15, 118, 110, 0.09), transparent 45%),
    linear-gradient(180deg, #fff, #f8fafc);
}
.hero-dash h1,
.hero-dash .hero-title {
  font-family: var(--em-display);
  font-size: clamp(1.6rem, 2.5vw, 2.1rem);
  letter-spacing: -0.03em;
  color: var(--em-ink);
  margin: 0 0 0.4rem;
}
.hero-dash p { color: var(--em-muted); max-width: 46rem; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 0.85rem;
}
.stat {
  padding: 1rem 1.05rem;
  border-radius: 12px;
  background: var(--em-panel);
  border: 1px solid var(--em-line);
  box-shadow: var(--em-shadow);
  transition: transform 0.15s ease;
}
.stat:hover { transform: translateY(-2px); }
.stat .label {
  color: var(--em-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.stat .value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--em-ink);
  margin-top: 0.2rem;
  font-variant-numeric: tabular-nums;
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.75rem;
}
.quick-card {
  display: block;
  padding: 1rem;
  border-radius: 12px;
  border: 1px solid var(--em-line);
  background: #fff;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.quick-card:hover {
  border-color: #99f6e4;
  box-shadow: var(--em-shadow);
  color: inherit;
}
.quick-card strong { display: block; margin-bottom: 0.2rem; }
.quick-card span { font-size: 0.82rem; color: var(--em-muted); }

/* ——— Buttons ——— */
.btn-leaf,
.btn-em-primary {
  background: var(--em-accent) !important;
  border-color: var(--em-accent) !important;
  color: #fff !important;
  font-weight: 600;
  border-radius: 10px !important;
  padding: 0.45rem 0.95rem;
}
.btn-leaf:hover,
.btn-em-primary:hover {
  background: var(--em-accent-2) !important;
  border-color: var(--em-accent-2) !important;
  color: #fff !important;
}

.form-control,
.form-select {
  border-radius: 10px !important;
  border-color: var(--em-line) !important;
  padding: 0.55rem 0.75rem;
}
.form-control:focus,
.form-select:focus {
  border-color: #5eead4 !important;
  box-shadow: 0 0 0 0.2rem rgba(15, 118, 110, 0.15) !important;
}
.form-control.fix-applied-flash,
.form-select.fix-applied-flash {
  border-color: #14b8a6 !important;
  box-shadow: 0 0 0 0.2rem rgba(20, 184, 166, 0.25) !important;
}
.form-label {
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--em-ink);
}

.table {
  --bs-table-bg: transparent;
}
.table thead th {
  color: var(--em-muted);
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom-width: 1px;
}
.table > :not(caption) > * > * {
  padding: 0.75rem 0.5rem;
  vertical-align: middle;
}
.table a { color: var(--em-accent); font-weight: 600; text-decoration: none; }
.table a:hover { text-decoration: underline; }

.em-alert {
  border-radius: 12px;
  border: none;
}

.sec-title {
  font-family: var(--em-display);
  font-size: 1.15rem;
  margin: 0;
}

/* ——— Deliverability ——— */
.deliverability-card {
  border-radius: var(--em-radius);
  padding: 1.2rem 1.25rem;
  border: 1px solid var(--em-line);
  background: #fff;
  box-shadow: var(--em-shadow);
}
.deliverability-card .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  color: var(--em-muted);
  font-weight: 700;
}
.deliverability-card .status-title {
  font-family: var(--em-display);
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}
.deliverability-card .status-subtitle { color: var(--em-muted); font-size: 0.92rem; }
.score-pill {
  background: var(--em-bg);
  border: 1px solid var(--em-line);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font-weight: 700;
  font-size: 0.85rem;
}

.deliverability-card.status-perfect {
  border-color: #6ee7b7;
  background: linear-gradient(165deg, #ecfdf5, #fff 55%);
}
.deliverability-card.status-perfect .status-title { color: var(--em-ok); }

.deliverability-card.status-good {
  border-color: #fcd34d;
  background: linear-gradient(165deg, #fffbeb, #fff 55%);
}
.deliverability-card.status-good .status-title { color: var(--em-warn); }

.deliverability-card.status-bad {
  border-color: #fca5a5;
  background: linear-gradient(165deg, #fef2f2, #fff 55%);
}
.deliverability-card.status-bad .status-title { color: var(--em-danger); }

.reason-list { list-style: none; padding: 0; }
.reason {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  padding: 0.7rem 0;
  border-top: 1px solid var(--em-line);
  font-size: 0.9rem;
}
.reason-body { flex: 1; min-width: 0; }
.reason-issue { line-height: 1.4; }
.reason-fix {
  margin-top: 0.45rem;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--em-line);
}
.reason-perfect .reason-fix { display: none; }
.fix-label {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--em-accent);
  margin-bottom: 0.25rem;
}
.fix-text {
  font-size: 0.84rem;
  color: var(--em-ink);
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.btn-apply-fix {
  margin-top: 0.5rem;
  background: #fff !important;
  border: 1px solid var(--em-accent) !important;
  color: var(--em-accent) !important;
  font-weight: 600;
  border-radius: 8px !important;
}
.btn-apply-fix:hover {
  background: var(--em-accent-soft) !important;
  color: var(--em-accent-2) !important;
}
.reason-tag {
  flex: 0 0 auto;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 0.18rem 0.42rem;
  border-radius: 6px;
  margin-top: 0.12rem;
}
.reason-perfect .reason-tag { background: #d1fae5; color: #065f46; }
.reason-good .reason-tag { background: #fef3c7; color: #92400e; }
.reason-bad .reason-tag { background: #fee2e2; color: #991b1b; }

.lock-note {
  font-size: 0.86rem;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.lock-note.ok {
  background: #ecfdf5;
  color: #065f46;
  border-color: #a7f3d0;
}

.badge-status {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.75rem;
  font-weight: 700;
}
.badge-status.status-perfect { background: #d1fae5; color: #065f46; }
.badge-status.status-good { background: #fef3c7; color: #92400e; }
.badge-status.status-bad { background: #fee2e2; color: #991b1b; }
.badge-status.status-unchecked { background: #e5e7eb; color: #374151; }

/* ——— Mail preview ——— */
.mail-status-preview {
  border: 1px solid var(--em-line);
  border-radius: var(--em-radius);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--em-shadow);
}
.mail-chrome {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.85rem;
  background: #f1f5f9;
  border-bottom: 1px solid var(--em-line);
  font-size: 0.72rem;
  color: var(--em-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.mail-chrome-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #cbd5e1;
}
.mail-status-banner {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.85rem 1rem;
  font-size: 0.9rem;
}
.mail-status-banner.status-perfect { background: #ecfdf5; color: #065f46; }
.mail-status-banner.status-good { background: #fffbeb; color: #92400e; }
.mail-status-banner.status-bad { background: #fef2f2; color: #991b1b; }
.mail-meta {
  padding: 0.85rem 1rem;
  border-top: 1px solid var(--em-line);
  font-size: 0.86rem;
}
.mail-meta span {
  display: inline-block;
  min-width: 4.2rem;
  color: var(--em-muted);
  font-weight: 600;
}
.mail-reasons { padding: 0 1rem 1rem; font-size: 0.8rem; }
.mail-reason-line { margin-bottom: 0.45rem; line-height: 1.35; }
.mail-reason-line.reason-bad { color: var(--em-danger); }
.mail-reason-line.reason-good { color: var(--em-warn); }
.mail-reason-line.reason-perfect { color: var(--em-ok); }
.mail-fix-example {
  margin-top: 0.15rem;
  color: var(--em-ink);
  font-weight: 500;
}

/* ——— Editor / crypto card ——— */
.email-editor-wrap .jodit-container:not(.jodit_inline) {
  border-radius: 12px;
  border-color: var(--em-line) !important;
  overflow: hidden;
  background: #fff;
}
.email-editor-wrap .jodit-toolbar__box:not(:empty) {
  border-radius: 12px 12px 0 0;
  border-color: var(--em-line) !important;
  background: #f8faf9;
}
.email-editor-wrap .jodit-workplace {
  min-height: 240px;
}
.email-editor-wrap .jodit-wysiwyg {
  min-height: 220px;
  padding: 1rem 1.1rem;
}
.email-editor-wrap .jodit-source,
.email-editor-wrap .jodit-source__mirror-fake {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace !important;
  font-size: 0.82rem;
  line-height: 1.45;
}

.crypto-card {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  padding: 1rem;
  border-radius: 12px;
  background: linear-gradient(135deg, #f0fdfa, #fff);
  border: 1px solid #99f6e4;
}
.crypto-card .crypto-icon {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 10px;
  background: var(--em-accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.crypto-card h3 {
  font-size: 0.95rem;
  margin: 0 0 0.25rem;
  font-weight: 700;
}
.crypto-card p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--em-muted);
  line-height: 1.4;
}

.status-legend {
  display: grid;
  gap: 0.65rem;
}
.status-legend .item {
  display: grid;
  grid-template-columns: 5.5rem 1fr;
  gap: 0.6rem;
  align-items: start;
  font-size: 0.88rem;
}
.status-legend .item p { margin: 0; color: var(--em-muted); }

/* ——— Mobile ——— */
@media (max-width: 992px) {
  body.app-shell {
    grid-template-columns: 1fr;
  }
  .app-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: min(280px, 86vw);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 12px 0 40px rgba(0, 0, 0, 0.25);
  }
  body.sidebar-open .app-sidebar {
    transform: translateX(0);
  }
  .sidebar-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .app-content { padding: 1rem; }
  .app-topbar { padding: 0.9rem 1rem; }
}

@media (max-width: 576px) {
  .page-title { font-size: 1.25rem; }
  .topbar-actions .btn { font-size: 0.8rem; }
}

/* ——— Live tracker ——— */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  background: #e2e8f0;
  color: #334155;
}
.live-pill.is-live {
  background: #ccfbf1;
  color: #0f766e;
  box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.5);
  animation: livePulse 1.6s ease infinite;
}
.live-pill.is-live::before {
  content: '';
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #14b8a6;
}
.live-pill.is-done { background: #d1fae5; color: #065f46; }
.live-pill.is-paused { background: #fef3c7; color: #92400e; }

@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(20, 184, 166, 0); }
  100% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0); }
}

.next-send-card {
  background:
    linear-gradient(120deg, rgba(15, 118, 110, 0.08), transparent 42%),
    #fff;
}
.next-send-card .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--em-muted);
}
.next-to {
  font-family: var(--em-display);
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-top: 0.2rem;
}
.next-email { color: var(--em-muted); font-size: 0.95rem; }

.countdown-box {
  background: #0c1a2b;
  color: #ecfeff;
  border-radius: 14px;
  padding: 1rem 1.1rem;
  text-align: center;
}
.countdown-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(236, 254, 255, 0.65);
  font-weight: 700;
}
.countdown-value {
  font-variant-numeric: tabular-nums;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  margin: 0.15rem 0;
  font-family: var(--em-font);
}
.countdown-sub {
  font-size: 0.78rem;
  color: rgba(236, 254, 255, 0.7);
}

.live-progress {
  height: 0.55rem;
  border-radius: 999px;
  background: #e2e8f0;
}
.live-progress .progress-bar {
  background: linear-gradient(90deg, #0f766e, #14b8a6);
  border-radius: 999px;
}

.activity-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  max-height: 320px;
  overflow: auto;
}
.activity-list li {
  display: grid;
  gap: 0.1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--em-line);
  font-size: 0.86rem;
}
.activity-list li:last-child { border-bottom: 0; padding-bottom: 0; }
.activity-list strong { color: var(--em-ink); }
.activity-list span {
  font-size: 0.75rem;
  color: var(--em-muted);
}
.activity-list em {
  font-style: normal;
  font-size: 0.78rem;
  color: #475569;
  word-break: break-word;
}

.badge-status.status-sent,
.badge-status.status-perfect { background: #d1fae5; color: #065f46; }
.badge-status.status-failed,
.badge-status.status-bounced,
.badge-status.status-bad { background: #fee2e2; color: #991b1b; }
.badge-status.status-skipped,
.badge-status.status-good { background: #fef3c7; color: #92400e; }

/* Login */
body.login-screen {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  font-family: var(--em-font);
  color: var(--em-ink);
  background:
    radial-gradient(ellipse 80% 50% at 10% 0%, rgba(15, 118, 110, 0.22), transparent 55%),
    linear-gradient(185deg, #0c1a2b 0%, #13263d 55%, #0f766e 160%);
}
.login-card {
  width: min(420px, calc(100% - 2rem));
  background: #fff;
  border-radius: 18px;
  padding: 2rem 1.75rem 1.5rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}
.login-mark {
  width: 3rem;
  height: 3rem;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #14b8a6, #0f766e);
  color: #fff;
  font-size: 1.3rem;
  margin-bottom: 1rem;
}
.login-card h1 {
  font-family: var(--em-display);
  font-size: 1.7rem;
  margin: 0 0 0.25rem;
}
.login-sub { color: var(--em-muted); margin-bottom: 1.25rem; }
.login-hint { font-size: 0.78rem; color: var(--em-muted); margin: 1rem 0 0; }

.cron-cmd {
  background: #0c1a2b;
  color: #d1fae5;
  border-radius: 10px;
  padding: 0.9rem 1rem;
  font-size: 0.8rem;
  white-space: pre-wrap;
  word-break: break-all;
}
.cron-status-card.status-active { border-top: 4px solid #047857; }
.cron-status-card.status-failed { border-top: 4px solid #b91c1c; }
.cron-status-title {
  font-family: var(--em-display);
  font-size: 1.8rem;
  margin: 0.15rem 0 0.4rem;
}
.cron-status-card.status-active .cron-status-title { color: #047857; }
.cron-status-card.status-failed .cron-status-title { color: #b91c1c; }

