@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=JetBrains+Mono:wght@400;500&display=swap');

/* ═══════════════════════════════════════════════════════════════
   MAILBLAST — Premium Multi-Color Design System (Light Theme)
═══════════════════════════════════════════════════════════════ */

:root {
  /* Core Palette — Navy, Sky Blue, Red, White */
  --bg-deep:       #eef2f6;
  --bg-primary:    #ffffff;
  --bg-secondary:  #ffffff;
  --bg-card:       #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-glass:      rgba(255, 255, 255, 0.85);
  --border:        rgba(15, 23, 42, 0.08); /* Dark navy border */
  --border-bright: rgba(15, 23, 42, 0.14);

  /* Accent — Navy & Sky Blue */
  --accent:        #1e3a8a; /* Navy blue */
  --accent-2:      #0ea5e9; /* Sky blue */
  --accent-glow:   rgba(30, 58, 138, 0.25);
  --accent-glow-sm:rgba(30, 58, 138, 0.12);
  --grad-accent:   linear-gradient(135deg, #1e3a8a, #0ea5e9); /* Navy to Sky Blue */

  /* Status Colors */
  --success:       #059669; /* Professional Green */
  --success-glow:  rgba(5, 150, 105, 0.2);
  --warning:       #d97706; /* Professional Amber */
  --warning-glow:  rgba(217, 119, 6, 0.2);
  --danger:        #dc2626; /* Professional Red */
  --danger-glow:   rgba(220, 38, 38, 0.2);
  --info:          #0ea5e9; /* Sky blue */
  --info-glow:     rgba(14, 165, 233, 0.2);

  /* Typography */
  --text-primary:   #0f172a; /* Slate navy */
  --text-secondary: #475569;
  --text-muted:     #94a3b8;

  /* Layout */
  --sidebar-w:  260px;
  --header-h:   64px;
  --radius:     16px;
  --radius-sm:  10px;
  --radius-xs:  6px;
  --shadow-sm:  0 2px 8px rgba(0,0,0,0.04);
  --shadow:     0 8px 32px rgba(30, 58, 138, 0.08); /* Navy shadow */
  --shadow-lg:  0 24px 64px rgba(30, 58, 138, 0.15);
  --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 14px;
  overflow-x: hidden;
}

/* Animated mesh background — Bright SaaS feel */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 60% at 20% -10%, rgba(30,58,138,0.06) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 85% 110%, rgba(220,38,38,0.05) 0%, transparent 60%),
    radial-gradient(ellipse 50% 40% at 50% 50%, rgba(5,150,105,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-2); }

/* ═══════════════════════════════════════════════════════════════
   LAYOUT
═══════════════════════════════════════════════════════════════ */
.app-wrapper { display: flex; min-height: 100vh; position: relative; z-index: 1; }

/* ═══════════════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  z-index: 100;
  box-shadow: 4px 0 24px rgba(0,0,0,0.02);
}

/* Logo */
.sidebar-logo {
  padding: 22px 20px 18px;
  display: flex;
  align-items: center;
  gap: 13px;
  border-bottom: 1px solid var(--border);
  position: relative;
}

.logo-icon {
  width: 40px; height: 40px;
  background: var(--grad-accent);
  border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 4px 14px var(--accent-glow);
}

.logo-text {
  font-size: 19px;
  font-weight: 900;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}
.logo-version {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-top: 1px;
}

/* Nav */
.sidebar-nav { flex: 1; padding: 16px 10px; overflow-y: auto; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--border-bright); border-radius: 2px; }

.nav-section-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1.2px;
  padding: 10px 10px 5px;
  margin-top: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 13.5px;
  transition: all var(--transition);
  margin-bottom: 2px;
  cursor: pointer;
  position: relative;
}
.nav-item:hover {
  background: rgba(30, 58, 138, 0.04);
  color: var(--text-primary);
}
.nav-item.active {
  background: var(--accent-glow-sm);
  color: var(--accent);
  font-weight: 700;
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 18px;
  background: var(--grad-accent);
  border-radius: 0 3px 3px 0;
}
.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
  opacity: 0.9;
}

.sidebar-footer {
  padding: 14px 18px;
  border-top: 1px solid var(--border);
  font-size: 11.5px;
  color: var(--text-muted);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 7px;
}
.status-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 8px var(--success-glow);
  animation: pulse-dot 2.5s infinite;
  flex-shrink: 0;
}
@keyframes pulse-dot {
  0%, 100% { opacity: 1; box-shadow: 0 0 6px rgba(5,150,105,0.4); }
  50%       { opacity: 0.5; box-shadow: 0 0 2px rgba(5,150,105,0.1); }
}

/* ═══════════════════════════════════════════════════════════════
   MAIN CONTENT
═══════════════════════════════════════════════════════════════ */
.main-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ─── Top Header ─────────────────────────────────────────────── */
.top-header {
  height: var(--header-h);
  background: rgba(255,255,255,0.7);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  position: sticky; top: 0; z-index: 50;
}
.header-title {
  font-size: 17px;
  font-weight: 800;
  flex: 1;
  letter-spacing: -0.2px;
}
.header-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  font-weight: 500;
}
.header-actions { display: flex; gap: 8px; align-items: center; }

/* ─── Page Content ───────────────────────────────────────────── */
.page-content { padding: 24px 28px; flex: 1; }
.page-header {
  margin-bottom: 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title { font-size: 24px; font-weight: 800; letter-spacing: -0.5px; }
.page-subtitle { color: var(--text-secondary); font-size: 13.5px; margin-top: 4px; }

/* ═══════════════════════════════════════════════════════════════
   STAT CARDS
═══════════════════════════════════════════════════════════════ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  display: flex;
  align-items: center;
  gap: 18px;
  transition: all var(--transition);
  cursor: default;
  box-shadow: var(--shadow-sm);
}
.stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(30, 58, 138, 0.2);
  box-shadow: var(--shadow);
}
.stat-card:hover .stat-icon { transform: scale(1.08); }

.stat-icon {
  width: 54px; height: 54px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  transition: transform var(--transition);
}
.stat-icon.purple {
  background: rgba(30,58,138,0.08);
  color: var(--accent);
}
.stat-icon.green {
  background: rgba(5,150,105,0.08);
  color: var(--success);
}
.stat-icon.blue {
  background: rgba(14,165,233,0.08);
  color: var(--info);
}
.stat-icon.yellow {
  background: rgba(217,119,6,0.08);
  color: var(--warning);
}
.stat-icon.red {
  background: rgba(220,38,38,0.08);
  color: var(--danger);
}

.stat-value { font-size: 28px; font-weight: 900; line-height: 1; letter-spacing: -0.5px; color: var(--text-primary); }
.stat-label { font-size: 12.5px; color: var(--text-secondary); margin-top: 6px; font-weight: 600; }

/* ═══════════════════════════════════════════════════════════════
   CARDS
═══════════════════════════════════════════════════════════════ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.card-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(0,0,0,0.015);
}
.card-title {
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: -0.1px;
}
.card-body { padding: 22px; }

/* ═══════════════════════════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex;  align-items: center;  gap: 8px;
  padding: 9px 18px;  border-radius: var(--radius-sm);
  font-family: 'Inter', sans-serif;  font-size: 13.5px;  font-weight: 600;
  border: none;  cursor: pointer;  transition: all var(--transition);
  line-height: 1;  white-space: nowrap;  letter-spacing: 0.2px;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }

.btn-primary {
  background: var(--grad-accent);
  color: #fff;
  box-shadow: 0 4px 12px var(--accent-glow);
}
.btn-primary:hover:not(:disabled) { box-shadow: 0 6px 18px rgba(30, 58, 138, 0.4); }

.btn-success { background: linear-gradient(135deg, #059669, #10b981); color: #fff; box-shadow: 0 4px 12px var(--success-glow); }
.btn-danger { background: linear-gradient(135deg, #b91c1c, #dc2626); color: #fff; box-shadow: 0 4px 12px var(--danger-glow); }

.btn-outline {
  background: #fff;
  color: var(--text-primary);
  border: 1px solid var(--border-bright);
  box-shadow: var(--shadow-sm);
}
.btn-outline:hover:not(:disabled) {
  border-color: rgba(0,0,0,0.2);
  background: var(--bg-deep);
}
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}
.btn-ghost:hover:not(:disabled) { color: var(--text-primary); background: rgba(0,0,0,0.04); }
.btn-sm { padding: 7px 14px; font-size: 12.5px; border-radius: var(--radius-xs); }

/* ═══════════════════════════════════════════════════════════════
   FORMS
═══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;  font-size: 12px;  font-weight: 700;
  margin-bottom: 8px;  color: var(--text-secondary);
  text-transform: uppercase;  letter-spacing: 0.6px;
}
.form-control {
  width: 100%;  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  transition: all var(--transition);
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}
.form-control:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow-sm), inset 0 1px 2px rgba(0,0,0,0.02);
}
.form-control::placeholder { color: var(--text-muted); }
.form-control:hover:not(:focus) { border-color: rgba(0,0,0,0.3); }

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%238ca3b8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}
select.form-control option { background: var(--bg-card); color: var(--text-primary); }
textarea.form-control { resize: vertical; min-height: 100px; }
.form-hint { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; font-weight: 500; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ═══════════════════════════════════════════════════════════════
   TABLES
═══════════════════════════════════════════════════════════════ */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  padding: 12px 18px;
  font-size: 11px;  font-weight: 800;
  color: var(--text-muted);
  text-transform: uppercase;  letter-spacing: 1px;
  border-bottom: 1px solid var(--border);
  text-align: left;  white-space: nowrap;
  background: rgba(0,0,0,0.02);
}
tbody tr { border-bottom: 1px solid var(--border); transition: background var(--transition); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(0,0,0,0.015); }
td { padding: 14px 18px; font-size: 13.5px; color: var(--text-secondary); font-weight: 500;}
td .fw-bold { color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════════
   BADGES
═══════════════════════════════════════════════════════════════ */
.badge {
  display: inline-flex;  align-items: center;  gap: 6px;
  padding: 4px 10px;  border-radius: 20px;
  font-size: 11.5px;  font-weight: 700;  letter-spacing: 0.3px;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; }

.badge-success  { background: rgba(5,150,105,0.1); color: var(--success); border: 1px solid rgba(5,150,105,0.2); }
.badge-success::before  { background: var(--success); box-shadow: 0 0 4px var(--success); }

.badge-danger   { background: rgba(220,38,38,0.1);  color: var(--danger);  border: 1px solid rgba(220,38,38,0.2); }
.badge-danger::before   { background: var(--danger); box-shadow: 0 0 4px var(--danger); }

.badge-warning  { background: rgba(217,119,6,0.1); color: var(--warning); border: 1px solid rgba(217,119,6,0.2); }
.badge-warning::before  { background: var(--warning); box-shadow: 0 0 4px var(--warning); }

.badge-info     { background: rgba(14,165,233,0.1); color: var(--info);    border: 1px solid rgba(14,165,233,0.2); }
.badge-info::before     { background: var(--info); box-shadow: 0 0 4px var(--info); }

.badge-secondary{ background: var(--bg-deep); color: var(--text-secondary); border: 1px solid var(--border-bright); }
.badge-secondary::before{ background: var(--text-muted); }

.badge-primary  { background: var(--accent-glow-sm); color: var(--accent); border: 1px solid rgba(30, 58, 138, 0.2); }
.badge-primary::before  { background: var(--accent); box-shadow: 0 0 4px var(--accent); }

/* ═══════════════════════════════════════════════════════════════
   PROGRESS BAR
═══════════════════════════════════════════════════════════════ */
.progress-bar-wrapper {
  background: rgba(0,0,0,0.06);
  border-radius: 20px;
  height: 8px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--grad-accent);
  border-radius: 20px;
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 10px var(--accent-glow);
  position: relative;
  overflow: hidden;
}
.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 2s infinite;
}
@keyframes shimmer { to { left: 100%; } }

/* ═══════════════════════════════════════════════════════════════
   SEND PROGRESS MODAL
═══════════════════════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,0.6); /* dark slate overlay */
  display: none; align-items: center; justify-content: center;
  z-index: 1000;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.modal-overlay.active { display: flex; }
.modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 44px;
  width: 100%; max-width: 520px;
  text-align: center;
  animation: modal-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}
@keyframes modal-in {
  from { transform: scale(0.9) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0); opacity: 1; }
}
.modal-icon { font-size: 56px; margin-bottom: 20px; color: var(--accent); }
.modal-title { font-size: 24px; font-weight: 900; margin-bottom: 8px; letter-spacing: -0.3px; color: var(--text-primary); }
.modal-sub { color: var(--text-secondary); font-size: 14px; margin-bottom: 32px; font-weight: 500; }

.send-stats { display: flex; justify-content: center; gap: 40px; margin: 24px 0; }
.send-stat-item { text-align: center; }
.send-stat-value { font-size: 34px; font-weight: 900; letter-spacing: -1px; color: var(--text-primary); }
.send-stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; }

/* ═══════════════════════════════════════════════════════════════
   QUILL EDITOR
═══════════════════════════════════════════════════════════════ */
.ql-toolbar.ql-snow {
  background: #fdfdfd;
  border: 1px solid var(--border-bright) !important;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.ql-container.ql-snow {
  background: #fff;
  border: 1px solid var(--border-bright) !important;
  border-top: none !important;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  min-height: 300px;
  color: var(--text-primary);
  font-size: 14.5px;
}
.ql-editor { min-height: 300px; font-family: 'Inter', sans-serif; }

/* ═══════════════════════════════════════════════════════════════
   TOASTS
═══════════════════════════════════════════════════════════════ */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 12px; pointer-events: none; }
.toast {
  background: #fff;
  border: 1px solid var(--border-bright);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  display: flex; align-items: center; gap: 14px;
  min-width: 320px; max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
  pointer-events: all;
}
@keyframes toast-in { from { transform: translateX(120%) scale(0.9); opacity: 0; } to { transform: translateX(0) scale(1); opacity: 1; } }
.toast.removing { animation: toast-out 0.3s ease forwards; }
@keyframes toast-out { to { transform: translateX(120%); opacity: 0; } }
.toast-icon { font-size: 20px; }
.toast-success { border-left: 4px solid var(--success); }
.toast-error   { border-left: 4px solid var(--danger); }
.toast-info    { border-left: 4px solid var(--info); }
.toast-message { font-size: 14px; font-weight: 600; flex: 1; color: var(--text-primary); }

/* ═══════════════════════════════════════════════════════════════
   EMPTY STATE
═══════════════════════════════════════════════════════════════ */
.empty-state { text-align: center; padding: 70px 20px; }
.empty-state-icon { font-size: 56px; margin-bottom: 20px; color: var(--text-muted); opacity: 0.5; }
.empty-state-title { font-size: 18px; font-weight: 800; color: var(--text-primary); margin-bottom: 8px; letter-spacing: -0.2px; }
.empty-state-text { font-size: 14px; color: var(--text-secondary); max-width: 320px; margin: 0 auto 24px; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════════
   ALERTS
═══════════════════════════════════════════════════════════════ */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.alert-success { background: rgba(5,150,105,0.08);  border: 1px solid rgba(5,150,105,0.2);  color: #047857; }
.alert-error   { background: rgba(220,38,38,0.08);   border: 1px solid rgba(220,38,38,0.2);   color: #b91c1c; }
.alert-warning { background: rgba(217,119,6,0.08);  border: 1px solid rgba(217,119,6,0.2);  color: #b45309; }

/* ═══════════════════════════════════════════════════════════════
   UTILITIES
═══════════════════════════════════════════════════════════════ */
.divider { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-success   { color: var(--success); }
.text-danger    { color: var(--danger); }
.text-accent    { color: var(--accent); }
.flex           { display: flex; }
.flex-1         { flex: 1; }
.items-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.gap-2          { gap: 8px; }
.gap-3          { gap: 12px; }
.mt-1           { margin-top: 4px; }
.mt-2           { margin-top: 8px; }
.mt-4           { margin-top: 16px; }
.mb-4           { margin-bottom: 16px; }
.fw-bold        { font-weight: 700; }
.fw-black       { font-weight: 900; }
.font-mono      { font-family: 'JetBrains Mono', monospace; font-size: 13px; }

.text-gradient {
  background: var(--grad-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.glow-sep { border: none; height: 1px; background: linear-gradient(90deg, transparent, var(--accent-glow), transparent); margin: 24px 0; }
code { font-family: 'JetBrains Mono', monospace; font-size: 13px; background: rgba(30, 58, 138, 0.08); color: var(--accent); padding: 3px 8px; border-radius: 4px; font-weight: 600;}
