:root {
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --sidebar-bg: #1e1b3a;
  --bg: #f5f6fb;
  --card-shadow: 0 2px 12px rgba(0,0,0,.07);
}

body { background: var(--bg); font-family: "Segoe UI", Roboto, Arial, sans-serif; }

/* ── Navbar ── */
.app-navbar {
  background: linear-gradient(90deg, var(--primary), #7c3aed);
  height: 60px; position: sticky; top: 0; z-index: 1030;
}

/* ── Sidebar ── */
.app-sidebar {
  width: 230px; min-height: calc(100vh - 60px);
  background: var(--sidebar-bg); padding-top: .75rem;
  position: sticky; top: 60px; align-self: flex-start; height: calc(100vh - 60px);
  overflow-y: auto;
}
.app-sidebar .nav-link {
  color: #bbb6e0; padding: .6rem 1.2rem;
  border-left: 3px solid transparent; font-size: .875rem;
  transition: all .15s;
}
.app-sidebar .nav-link:hover { color: #fff; background: rgba(255,255,255,.05); }
.app-sidebar .nav-link.active {
  color: #fff; background: rgba(255,255,255,.08);
  border-left-color: #a5b4fc; font-weight: 600;
}
.sidebar-section {
  font-size: .68rem; letter-spacing: .1em; color: #6b6893;
  padding: 1rem 1.2rem .3rem; text-transform: uppercase;
}

/* ── Main ── */
.app-main { width: calc(100% - 230px); }

/* ── Cards ── */
.card { border: none; border-radius: .75rem; box-shadow: var(--card-shadow); }
.stat-card .stat-value { font-size: 1.6rem; font-weight: 700; }

/* ── Tables ── */
.table thead th {
  background: #f0f1fa; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .04em; color: #666;
}

/* ── Badges ── */
.badge-status-active       { background: #198754; }
.badge-status-unsubscribed { background: #6c757d; }
.badge-status-bounced      { background: #dc3545; }
.badge-campaign-draft      { background: #6c757d; }
.badge-campaign-scheduled  { background: #0dcaf0; color:#000; }
.badge-campaign-sending    { background: #fd7e14; }
.badge-campaign-sent       { background: #198754; }
.badge-campaign-failed     { background: #dc3545; }
.badge-user-active         { background: #198754; }
.badge-user-suspended      { background: #dc3545; }
.badge-user-pending        { background: #fd7e14; }
.badge-sub-active          { background: #198754; }
.badge-sub-expired         { background: #dc3545; }
.badge-sub-cancelled       { background: #6c757d; }

/* ── Login ── */
.login-wrapper {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
}
.login-card { width: 100%; max-width: 400px; border-radius: 1rem; box-shadow: 0 20px 50px rgba(0,0,0,.25); }

/* ── Plan cards ── */
.plan-card { transition: transform .15s, box-shadow .15s; cursor: pointer; }
.plan-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(79,70,229,.15); }
.plan-card.popular { border: 2px solid var(--primary) !important; }

/* ── Progress ── */
.progress { border-radius: 6px; height: 10px; }
#progress-bar { transition: width .4s ease; }

/* ── Pagination ── */
.pagination .page-link { color: var(--primary); }
.pagination .page-item.active .page-link { background: var(--primary); border-color: var(--primary); }

/* ── Usage bar ── */
.usage-bar { height: 6px; border-radius: 3px; background: #e5e7eb; }
.usage-bar-fill { height: 100%; border-radius: 3px; background: var(--primary); transition: width .3s; }
.usage-bar-fill.warn { background: #f59e0b; }
.usage-bar-fill.danger { background: #ef4444; }

/* ── Attachment widget ── */
.border-2  { border-width: 2px !important; }
.border-dashed { border-style: dashed !important; }
#drop-zone:hover { border-color: var(--primary) !important; background: rgba(79,70,229,.03); }
.attach-row { transition: background .15s; }
.attach-row:hover { background: #f8f9ff; }

/* ── Template editor ── */
.ql-toolbar { border-radius: .375rem .375rem 0 0; }
.ql-container { border-radius: 0 0 .375rem .375rem; font-family: "Segoe UI", Arial, sans-serif; }
.merge-tag-btn { font-size: .72rem; padding: 1px 7px; }

/* ── CC/BCC tag pills ── */
.badge.bg-info.text-dark { font-size: .75rem; }

/* Link modal */
#link-modal input.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 .2rem rgba(79,70,229,.2); }

/* ── Template attachment widget ── */
#att-drop-zone:hover, #inline-drop-zone:hover {
  border-color: var(--primary) !important;
  background: rgba(79,70,229,.03);
}
#tab-email-attach .border, #tab-inline-link .border {
  border-color: #e5e7eb !important;
}
.input-group-sm .form-control[readonly] {
  background: #f8f9ff;
  font-size: .72rem;
  color: #4f46e5;
}

/* ── Contact Groups ── */
.badge-status-active       { background: #198754; }
.badge-status-unsubscribed { background: #6c757d; }
.badge-status-bounced      { background: #dc3545; }

.badge.bg-light.text-dark.border {
  border-color: #dee2e6 !important;
  font-weight: 500;
  transition: all .15s;
}
.badge.bg-light.text-dark.border:hover {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}
.badge.bg-primary[href] { text-decoration: none; }

/* Group card hover effect */
.col-md-4 > .card,
.col-sm-6 > .card {
  transition: transform .15s, box-shadow .15s;
}
.col-md-4 > .card:hover,
.col-sm-6 > .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(79,70,229,.12);
}
