/**
 * EngageFlow UI — Phase 1
 * Visual layer on top of AdminLTE 3 + Bootstrap 4.
 * Load AFTER adminlte.min.css. Scoped via body.engageflow-ui
 */

/* ── Design tokens ─────────────────────────────────────────────── */
:root {
  --ef-primary:          #2563eb;
  --ef-primary-hover:    #1d4ed8;
  --ef-primary-soft:     rgba(37, 99, 235, 0.12);

  --ef-sidebar-bg:       #0f172a;
  --ef-sidebar-border:   rgba(255, 255, 255, 0.06);
  --ef-sidebar-text:     #cbd5e1;
  --ef-sidebar-muted:    #94a3b8;
  --ef-sidebar-hover:    rgba(255, 255, 255, 0.06);
  --ef-sidebar-active:   rgba(37, 99, 235, 0.18);

  --ef-navbar-bg:        #ffffff;
  --ef-navbar-border:    #e2e8f0;
  --ef-navbar-height:    56px;

  --ef-content-bg:       #f1f5f9;
  --ef-surface:          #ffffff;

  --ef-text:             #0f172a;
  --ef-text-muted:       #64748b;
  --ef-border:           #e2e8f0;

  --ef-danger:           #dc2626;
  --ef-danger-soft:      rgba(220, 38, 38, 0.12);

  --ef-radius-sm:        6px;
  --ef-radius-md:        10px;
  --ef-radius-lg:        12px;

  --ef-shadow-sm:        0 1px 2px rgba(15, 23, 42, 0.05);
  --ef-shadow-md:        0 4px 12px rgba(15, 23, 42, 0.07);

  --ef-font:             Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --ef-sidebar-width:    250px;
}

/* ── Base typography ───────────────────────────────────────────── */
body.engageflow-ui {
  font-family: var(--ef-font);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ef-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.engageflow-ui .wrapper {
  background-color: var(--ef-content-bg);
}

/* ── Navbar ────────────────────────────────────────────────────── */
body.engageflow-ui .main-header.navbar {
  background-color: var(--ef-navbar-bg);
  border-bottom: 1px solid var(--ef-navbar-border);
  box-shadow: var(--ef-shadow-sm);
  min-height: var(--ef-navbar-height);
  padding-left: 0.5rem;
  padding-right: 0.75rem;
}

body.engageflow-ui .main-header .navbar-nav .nav-link {
  color: var(--ef-text-muted);
  padding: 0.5rem 0.75rem;
  border-radius: var(--ef-radius-sm);
  transition: color 0.15s ease, background-color 0.15s ease;
}

body.engageflow-ui .main-header .navbar-nav .nav-link:hover,
body.engageflow-ui .main-header .navbar-nav .nav-link:focus {
  color: var(--ef-text);
  background-color: #f8fafc;
}

body.engageflow-ui .ef-navbar-toggle {
  color: var(--ef-text-muted);
  cursor: pointer;
  padding: 0.5rem 0.65rem;
  line-height: 1;
  border: none;
  background: transparent;
}

body.engageflow-ui .ef-navbar-toggle:hover {
  color: var(--ef-primary);
  background-color: #f8fafc;
  border-radius: var(--ef-radius-sm);
}

body.engageflow-ui .ef-navbar-brand {
  color: var(--ef-text) !important;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  padding-left: 0.25rem;
}

body.engageflow-ui .ef-navbar-brand:hover {
  color: var(--ef-primary) !important;
}

/* ── Sidebar shell ─────────────────────────────────────────────── */
body.engageflow-ui .main-sidebar {
  background-color: var(--ef-sidebar-bg) !important;
  border-right: 1px solid var(--ef-sidebar-border);
  box-shadow: none;
}

body.engageflow-ui .main-sidebar.elevation-4 {
  box-shadow: 2px 0 12px rgba(15, 23, 42, 0.08);
}

body.engageflow-ui .brand-link {
  border-bottom: 1px solid var(--ef-sidebar-border) !important;
  padding: 0.85rem 1rem;
  transition: background-color 0.15s ease;
}

body.engageflow-ui .brand-link:hover {
  background-color: var(--ef-sidebar-hover);
}

body.engageflow-ui .brand-link .brand-image {
  opacity: 0.95 !important;
  max-height: 34px;
}

body.engageflow-ui .brand-link .brand-text {
  color: #f8fafc !important;
  font-weight: 600 !important;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
}

/* ── User panel ────────────────────────────────────────────────── */
body.engageflow-ui .sidebar .user-panel {
  border-bottom: 1px solid var(--ef-sidebar-border);
  margin: 0 !important;
  padding: 1rem !important;
}

body.engageflow-ui .ef-user-panel-inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
}

body.engageflow-ui .ef-user-avatar {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--ef-primary), #3b82f6);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
}

body.engageflow-ui .sidebar .user-panel .info {
  overflow: hidden;
}

body.engageflow-ui .sidebar .user-panel .info a,
body.engageflow-ui .sidebar .user-panel .info .ef-user-name {
  color: #f1f5f9;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  line-height: 1.3;
}

body.engageflow-ui .ef-user-role {
  color: var(--ef-sidebar-muted);
  font-size: 0.75rem;
  margin-top: 0.1rem;
  display: block;
}

/* ── Sidebar navigation ────────────────────────────────────────── */
body.engageflow-ui .nav-sidebar > .nav-item {
  margin-bottom: 2px;
}

body.engageflow-ui .nav-sidebar > .nav-item > .nav-link {
  color: var(--ef-sidebar-text);
  border-radius: var(--ef-radius-sm);
  margin: 0 0.5rem;
  padding: 0.55rem 0.75rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

body.engageflow-ui .nav-sidebar > .nav-item > .nav-link:hover {
  background-color: var(--ef-sidebar-hover);
  color: #f8fafc;
}

/* Parent items marked active by AdminLTE — soften so not all look "selected" */
body.engageflow-ui .nav-sidebar > .nav-item > .nav-link.active {
  background-color: transparent;
  color: #f8fafc;
  box-shadow: none;
}

body.engageflow-ui .nav-sidebar > .nav-item > .nav-link.active:hover {
  background-color: var(--ef-sidebar-hover);
}

body.engageflow-ui .nav-sidebar .nav-icon {
  width: 1.5rem;
  font-size: 1rem;
  margin-right: 0.35rem;
  text-align: center;
  color: var(--ef-sidebar-muted);
  transition: color 0.15s ease;
}

body.engageflow-ui .nav-sidebar > .nav-item > .nav-link:hover .nav-icon,
body.engageflow-ui .nav-sidebar > .nav-item.menu-open > .nav-link .nav-icon {
  color: #e2e8f0;
}

body.engageflow-ui .nav-sidebar .nav-link p {
  font-size: 0.875rem;
  font-weight: 500;
}

body.engageflow-ui .nav-sidebar .nav-link .right {
  color: var(--ef-sidebar-muted);
  font-size: 0.75rem;
  transition: transform 0.2s ease;
}

body.engageflow-ui .nav-sidebar .menu-open > .nav-link .right {
  transform: rotate(-90deg);
}

/* Submenu */
body.engageflow-ui .nav-sidebar .nav-treeview {
  padding-left: 0.25rem;
}

body.engageflow-ui .nav-sidebar .nav-treeview > .nav-item > .nav-link {
  color: var(--ef-sidebar-muted);
  border-radius: var(--ef-radius-sm);
  margin: 0 0.5rem 0 1.25rem;
  padding: 0.4rem 0.65rem;
  font-size: 0.8125rem;
  transition: background-color 0.15s ease, color 0.15s ease;
}

body.engageflow-ui .nav-sidebar .nav-treeview > .nav-item > .nav-link:hover {
  background-color: var(--ef-sidebar-hover);
  color: #e2e8f0;
}

body.engageflow-ui .nav-sidebar .nav-treeview > .nav-item > .nav-link.active,
body.engageflow-ui .nav-sidebar .nav-treeview > .nav-item > .nav-link.nav-item-link.active {
  background-color: var(--ef-sidebar-active);
  color: #ffffff;
  box-shadow: inset 3px 0 0 var(--ef-primary);
}

body.engageflow-ui .nav-sidebar .nav-treeview .nav-icon {
  font-size: 0.45rem;
  color: var(--ef-sidebar-muted);
}

body.engageflow-ui .nav-sidebar .nav-treeview > .nav-item > .nav-link.active .nav-icon {
  color: var(--ef-primary);
}

/* Logout item */
body.engageflow-ui .ef-nav-logout {
  background-color: var(--ef-danger-soft) !important;
  color: #fca5a5 !important;
  margin-top: 0.5rem;
}

body.engageflow-ui .ef-nav-logout:hover {
  background-color: rgba(220, 38, 38, 0.22) !important;
  color: #fecaca !important;
}

body.engageflow-ui .ef-nav-logout .nav-icon {
  color: #f87171;
}

/* ── Content area ──────────────────────────────────────────────── */
body.engageflow-ui .content-wrapper {
  background-color: var(--ef-content-bg);
}

body.engageflow-ui .content-wrapper > .content,
body.engageflow-ui .content-wrapper .ef-content-area {
  padding: 1.25rem 1.5rem 1.5rem;
}

/* ── Footer ────────────────────────────────────────────────────── */
body.engageflow-ui .main-footer {
  background-color: var(--ef-navbar-bg);
  border-top: 1px solid var(--ef-navbar-border);
  color: var(--ef-text-muted);
  font-size: 0.8125rem;
  padding: 0.75rem 1.5rem;
}

body.engageflow-ui .ef-footer-text {
  color: var(--ef-text-muted);
}

/* Hide empty control sidebar placeholder */
body.engageflow-ui .control-sidebar {
  display: none;
}

/* ── Light global component polish (non-aggressive) ─────────────── */
body.engageflow-ui .card {
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-md);
  box-shadow: var(--ef-shadow-sm);
}

body.engageflow-ui .card-header {
  background-color: var(--ef-surface);
  border-bottom: 1px solid var(--ef-border);
  font-weight: 600;
  font-size: 0.9375rem;
}

body.engageflow-ui .btn {
  border-radius: var(--ef-radius-sm);
  font-weight: 500;
  font-size: 0.875rem;
}

body.engageflow-ui .btn-primary {
  background-color: var(--ef-primary);
  border-color: var(--ef-primary);
}

body.engageflow-ui .btn-primary:hover,
body.engageflow-ui .btn-primary:focus {
  background-color: var(--ef-primary-hover);
  border-color: var(--ef-primary-hover);
}

body.engageflow-ui .form-control {
  border-radius: var(--ef-radius-sm);
  border-color: var(--ef-border);
  font-size: 0.875rem;
}

body.engageflow-ui .form-control:focus {
  border-color: var(--ef-primary);
  box-shadow: 0 0 0 0.15rem rgba(37, 99, 235, 0.15);
}

body.engageflow-ui .table thead th {
  border-bottom-width: 1px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ef-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

body.engageflow-ui .badge {
  border-radius: 999px;
  font-weight: 500;
  font-size: 0.75rem;
  padding: 0.35em 0.65em;
}

body.engageflow-ui .alert {
  border-radius: var(--ef-radius-sm);
  border: none;
}

/* DataTables — cosmetic only */
body.engageflow-ui .dataTables_wrapper .dataTables_paginate .paginate_button.current {
  background: var(--ef-primary) !important;
  border-color: var(--ef-primary) !important;
  color: #fff !important;
  border-radius: var(--ef-radius-sm);
}

/* ── Responsive shell ──────────────────────────────────────────── */
@media (max-width: 991.98px) {
  body.engageflow-ui .main-header.navbar {
    padding-left: 0.25rem;
    padding-right: 0.5rem;
  }

  body.engageflow-ui .ef-navbar-brand {
    font-size: 0.85rem;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.engageflow-ui .content-wrapper > .content,
  body.engageflow-ui .content-wrapper .ef-content-area {
    padding: 1rem;
  }
}

@media (max-width: 575.98px) {
  body.engageflow-ui .ef-navbar-brand {
    max-width: 140px;
  }

  body.engageflow-ui .brand-link .brand-text {
    font-size: 0.8rem;
  }
}

/* Sidebar mini — preserve AdminLTE collapse behavior */
@media (min-width: 992px) {
  body.engageflow-ui.sidebar-mini.sidebar-collapse .main-sidebar:not(.sidebar-no-expand):hover {
    box-shadow: 4px 0 16px rgba(15, 23, 42, 0.12);
  }
}

/* =========================================================
   ENGAGEFLOW LOGIN
   ========================================================= */

body.ef-login-page {
  margin: 0;
  min-height: 100vh;
  font-family: var(--ef-font);
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ef-text);
  background-color: var(--ef-content-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Reset AdminLTE login-page defaults */
body.ef-login-page.login-page,
body.ef-login-page.hold-transition {
  height: auto;
  min-height: 100vh;
}

body.ef-login-page .ef-login-shell {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ── Brand panel (left) ──────────────────────────────────────── */
body.ef-login-page .ef-login-brand-panel {
  position: relative;
  flex: 0 0 45%;
  max-width: 45%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  background: linear-gradient(160deg, #0f172a 0%, #1e293b 55%, #0f172a 100%);
  overflow: hidden;
}

body.ef-login-page .ef-login-brand-content {
  position: relative;
  z-index: 2;
  max-width: 380px;
}

body.ef-login-page .ef-login-logo {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 2rem;
}

body.ef-login-page .ef-login-logo-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--ef-radius-md);
  background: rgba(37, 99, 235, 0.2);
  color: #93c5fd;
  font-size: 1rem;
}

body.ef-login-page .ef-login-logo-text {
  font-size: 1.25rem;
  font-weight: 700;
  color: #f8fafc;
  letter-spacing: -0.02em;
}

body.ef-login-page .ef-login-brand-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  line-height: 1.25;
}

body.ef-login-page .ef-login-brand-desc {
  font-size: 0.9375rem;
  color: #94a3b8;
  line-height: 1.65;
  margin: 0;
}

/* Decorative shapes — CSS only */
body.ef-login-page .ef-login-brand-decor {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

body.ef-login-page .ef-login-brand-decor--1 {
  width: 320px;
  height: 320px;
  top: -80px;
  right: -60px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.15) 0%, transparent 70%);
}

body.ef-login-page .ef-login-brand-decor--2 {
  width: 240px;
  height: 240px;
  bottom: -40px;
  left: -50px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 70%);
}

body.ef-login-page .ef-login-brand-decor--3 {
  width: 120px;
  height: 120px;
  bottom: 20%;
  right: 15%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.02);
}

/* ── Form panel (right) ─────────────────────────────────────── */
body.ef-login-page .ef-login-form-panel {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background-color: var(--ef-content-bg);
}

body.ef-login-page .ef-login-container {
  width: 100%;
  max-width: 420px;
}

body.ef-login-page .ef-login-header {
  margin-bottom: 2rem;
}

body.ef-login-page .ef-login-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ef-text);
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
  line-height: 1.3;
}

body.ef-login-page .ef-login-subtitle {
  font-size: 0.875rem;
  color: var(--ef-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── Form fields ─────────────────────────────────────────────── */
body.ef-login-page .ef-login-form {
  margin: 0;
}

body.ef-login-page .ef-login-field {
  margin-bottom: 1.25rem;
}

body.ef-login-page .ef-login-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ef-text);
  margin-bottom: 0.4rem;
}

body.ef-login-page .ef-login-input-wrap {
  position: relative;
}

body.ef-login-page .ef-login-input-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ef-text-muted);
  font-size: 0.8125rem;
  pointer-events: none;
  z-index: 2;
}

body.ef-login-page .ef-login-input.form-control {
  height: calc(2.25rem + 6px);
  padding: 0.5rem 0.85rem 0.5rem 2.35rem;
  font-size: 0.875rem;
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-sm);
  background-color: var(--ef-surface);
  color: var(--ef-text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

body.ef-login-page .ef-login-input.form-control:focus {
  border-color: var(--ef-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
  outline: none;
}

body.ef-login-page .ef-login-input.form-control.is-invalid {
  border-color: #dc3545;
}

body.ef-login-page .ef-login-input.form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

body.ef-login-page .ef-login-field .invalid-feedback {
  font-size: 0.8125rem;
  margin-top: 0.35rem;
}

body.ef-login-page .ef-login-field .invalid-feedback strong {
  font-weight: 500;
}

/* ── Submit button ───────────────────────────────────────────── */
body.ef-login-page .ef-login-actions {
  margin-top: 1.75rem;
}

body.ef-login-page .ef-login-submit.btn-primary {
  width: 100%;
  height: calc(2.25rem + 6px);
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: var(--ef-radius-sm);
  background-color: var(--ef-primary);
  border-color: var(--ef-primary);
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

body.ef-login-page .ef-login-submit.btn-primary:hover,
body.ef-login-page .ef-login-submit.btn-primary:focus {
  background-color: var(--ef-primary-hover);
  border-color: var(--ef-primary-hover);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.25);
}

body.ef-login-page .ef-login-submit.btn-primary:active {
  background-color: #1e40af;
  border-color: #1e40af;
  box-shadow: none;
}

body.ef-login-page .ef-login-submit.btn-primary:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ── Footer ──────────────────────────────────────────────────── */
body.ef-login-page .ef-login-footer {
  margin-top: 2.5rem;
  text-align: center;
  font-size: 0.75rem;
  color: var(--ef-text-muted);
}

/* ── Login responsive ────────────────────────────────────────── */
@media (max-width: 991.98px) {
  body.ef-login-page .ef-login-brand-panel {
    flex: 0 0 38%;
    max-width: 38%;
    padding: 2rem 1.5rem;
  }

  body.ef-login-page .ef-login-brand-title {
    font-size: 1.375rem;
  }

  body.ef-login-page .ef-login-brand-desc {
    font-size: 0.875rem;
  }
}

@media (max-width: 767.98px) {
  body.ef-login-page .ef-login-shell {
    flex-direction: column;
  }

  body.ef-login-page .ef-login-brand-panel {
    flex: none;
    max-width: 100%;
    padding: 2rem 1.5rem 1.75rem;
    min-height: auto;
  }

  body.ef-login-page .ef-login-brand-content {
    max-width: 100%;
    text-align: center;
  }

  body.ef-login-page .ef-login-logo {
    justify-content: center;
    margin-bottom: 1.25rem;
  }

  body.ef-login-page .ef-login-brand-title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
  }

  body.ef-login-page .ef-login-brand-desc {
    font-size: 0.8125rem;
  }

  body.ef-login-page .ef-login-brand-decor--3 {
    display: none;
  }

  body.ef-login-page .ef-login-form-panel {
    flex: 1;
    padding: 1.5rem 1.25rem 2rem;
  }

  body.ef-login-page .ef-login-container {
    max-width: 100%;
  }
}

@media (max-width: 575.98px) {
  body.ef-login-page .ef-login-form-panel {
    padding: 1.25rem 1rem 1.75rem;
  }

  body.ef-login-page .ef-login-header {
    margin-bottom: 1.5rem;
  }

  body.ef-login-page .ef-login-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 359.98px) {
  body.ef-login-page .ef-login-brand-panel {
    padding: 1.5rem 1rem 1.25rem;
  }

  body.ef-login-page .ef-login-form-panel {
    padding: 1rem 0.85rem 1.5rem;
  }
}

/* =========================================================
   ENGAGEFLOW DASHBOARD
   ========================================================= */

body.engageflow-ui .ef-dashboard {
  padding: 0;
}

/* ── Page header ─────────────────────────────────────────────── */
body.engageflow-ui .ef-page-header {
  margin-bottom: 1.5rem;
}

body.engageflow-ui .ef-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--ef-text);
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  line-height: 1.3;
}

body.engageflow-ui .ef-page-subtitle {
  font-size: 0.875rem;
  color: var(--ef-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ── Section spacing ─────────────────────────────────────────── */
body.engageflow-ui .ef-dashboard-section {
  margin-bottom: 1.5rem;
}

body.engageflow-ui .ef-dashboard-section:last-child {
  margin-bottom: 0;
}

body.engageflow-ui .ef-dashboard-section > [class*="col-"] {
  margin-bottom: 1.5rem;
}

body.engageflow-ui .ef-dashboard-section > [class*="col-"]:last-child {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  body.engageflow-ui .ef-dashboard-section > [class*="col-"] {
    margin-bottom: 0;
  }
}

/* ── Period navigation card ──────────────────────────────────── */
body.engageflow-ui .ef-period-card {
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-lg);
  box-shadow: var(--ef-shadow-sm);
  overflow: hidden;
}

body.engageflow-ui .ef-period-card-header {
  background-color: var(--ef-surface);
  border-bottom: 1px solid var(--ef-border);
  padding: 1rem 1.25rem;
}

body.engageflow-ui .ef-period-card-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ef-text);
  margin: 0;
}

body.engageflow-ui .ef-period-card-body {
  padding: 1.25rem;
}

body.engageflow-ui .ef-period-selector {
  display: flex;
  justify-content: center;
}

body.engageflow-ui .ef-period-selector--year {
  margin-bottom: 1rem;
}

body.engageflow-ui .ef-period-selector .pagination {
  flex-wrap: nowrap;
  gap: 0.35rem;
  margin: 0;
}

body.engageflow-ui .ef-period-selector .page-item {
  margin: 0;
}

body.engageflow-ui .ef-period-selector .page-link {
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-sm);
  color: var(--ef-text-muted);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.45rem 0.85rem;
  min-width: 2.5rem;
  text-align: center;
  line-height: 1.4;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.engageflow-ui .ef-period-selector .page-link:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: var(--ef-text);
}

body.engageflow-ui .ef-period-selector .page-link:focus {
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  outline: none;
}

body.engageflow-ui .ef-period-selector .page-item.active .page-link {
  background-color: var(--ef-primary);
  border-color: var(--ef-primary);
  color: #ffffff;
}

body.engageflow-ui .ef-period-selector .page-item.active .page-link:hover {
  background-color: var(--ef-primary-hover);
  border-color: var(--ef-primary-hover);
  color: #ffffff;
}

body.engageflow-ui .ef-period-button .page-link,
body.engageflow-ui .ef-period-selector .ef-period-button {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.45rem 0.65rem;
  color: var(--ef-text-muted);
}

body.engageflow-ui .ef-period-selector .ef-period-button:hover {
  background-color: #f1f5f9;
  color: var(--ef-primary);
}

body.engageflow-ui .ef-period-selector .page-year,
body.engageflow-ui .ef-period-selector .page-month {
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
}

body.engageflow-ui .ef-period-selector--month .page-month {
  font-weight: 600;
}

body.engageflow-ui .ef-period-selector--month .page-year {
  font-size: 0.6875rem;
  color: var(--ef-text-muted);
  font-weight: 400;
}

body.engageflow-ui .ef-period-selector--month .page-item.active .page-year {
  color: rgba(255, 255, 255, 0.75);
}

/* Month selector horizontal scroll on mobile */
body.engageflow-ui .ef-period-selector--month {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.25rem;
}

body.engageflow-ui .ef-period-selector--month .pagination {
  min-width: min-content;
}

/* ── Chart cards ───────────────────────────────────────────────── */
body.engageflow-ui .ef-chart-card,
body.engageflow-ui .ef-dashboard-table-card {
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-lg);
  box-shadow: var(--ef-shadow-sm);
  height: 100%;
  display: flex;
  flex-direction: column;
}

body.engageflow-ui .ef-chart-header {
  background-color: var(--ef-surface);
  border-bottom: 1px solid var(--ef-border);
  padding: 1rem 1.25rem;
}

body.engageflow-ui .ef-chart-title {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--ef-text);
  margin: 0;
  line-height: 1.35;
}

body.engageflow-ui .ef-chart-subtitle {
  font-size: 0.8125rem;
  color: var(--ef-text-muted);
  margin: 0.25rem 0 0;
  line-height: 1.4;
}

body.engageflow-ui .ef-chart-body {
  padding: 1.25rem;
  flex: 1;
}

body.engageflow-ui .ef-chart-canvas-wrap {
  min-height: 200px;
}

body.engageflow-ui .ef-chart-body--donut {
  display: flex;
  align-items: center;
  justify-content: center;
}

body.engageflow-ui .ef-chart-legend {
  font-size: 0.8125rem;
  color: var(--ef-text-muted);
}

body.engageflow-ui .ef-chart-legend .text-primary {
  color: var(--ef-primary) !important;
}

body.engageflow-ui .ef-chart-legend .text-gray {
  color: #94a3b8 !important;
}

/* ── Dashboard tables ──────────────────────────────────────────── */
body.engageflow-ui .ef-dashboard-table-body {
  padding: 0;
  flex: 1;
}

body.engageflow-ui .ef-dashboard-table {
  margin-bottom: 0;
  font-size: 0.875rem;
}

body.engageflow-ui .ef-dashboard-table thead th {
  background-color: #f8fafc;
  border-bottom: 1px solid var(--ef-border);
  border-top: none;
  color: var(--ef-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.65rem 1rem;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}

body.engageflow-ui .ef-dashboard-table tbody td {
  border-top: 1px solid var(--ef-border);
  color: var(--ef-text);
  padding: 0.75rem 1rem;
  vertical-align: middle;
}

body.engageflow-ui .ef-dashboard-table tbody tr:hover {
  background-color: #f8fafc;
}

body.engageflow-ui .ef-dashboard-table-footer {
  background-color: var(--ef-surface);
  border-top: 1px solid var(--ef-border);
  padding: 0.75rem 1rem;
}

/* ── Dashboard responsive ──────────────────────────────────────── */
@media (max-width: 767.98px) {
  body.engageflow-ui .ef-page-title {
    font-size: 1.25rem;
  }

  body.engageflow-ui .ef-period-card-body {
    padding: 1rem;
  }

  body.engageflow-ui .ef-period-selector .page-link {
    padding: 0.4rem 0.65rem;
    font-size: 0.8125rem;
  }

  body.engageflow-ui .ef-chart-body {
    padding: 1rem;
  }

  body.engageflow-ui .ef-chart-canvas-wrap {
    min-height: 180px;
  }

  body.engageflow-ui .ef-dashboard-table thead th,
  body.engageflow-ui .ef-dashboard-table tbody td {
    padding: 0.6rem 0.75rem;
    font-size: 0.8125rem;
  }
}

@media (max-width: 575.98px) {
  body.engageflow-ui .ef-dashboard-section {
    margin-bottom: 1.25rem;
  }

  body.engageflow-ui .ef-page-header {
    margin-bottom: 1.25rem;
  }
}

@media (max-width: 359.98px) {
  body.engageflow-ui .ef-period-selector .page-link {
    min-width: 2.25rem;
    padding: 0.35rem 0.5rem;
  }
}

/* =========================================================
   ENGAGEFLOW CRUD SYSTEM
   ========================================================= */

body.engageflow-ui .ef-crud-page {
  padding: 0;
}

/* ── Page header ─────────────────────────────────────────────── */
body.engageflow-ui .ef-crud-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

body.engageflow-ui .ef-crud-header--form {
  margin-bottom: 1.25rem;
}

body.engageflow-ui .ef-crud-heading {
  flex: 1;
  min-width: 0;
}

body.engageflow-ui .ef-crud-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--ef-text);
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  line-height: 1.3;
}

body.engageflow-ui .ef-crud-subtitle {
  font-size: 0.875rem;
  color: var(--ef-text-muted);
  margin: 0;
  line-height: 1.5;
}

body.engageflow-ui .ef-crud-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Alerts ──────────────────────────────────────────────────── */
body.engageflow-ui .ef-crud-alerts {
  margin-bottom: 1.25rem;
}

body.engageflow-ui .ef-crud-alerts .alert {
  margin-bottom: 0.75rem;
  font-size: 0.875rem;
}

body.engageflow-ui .ef-crud-alerts .alert:last-child {
  margin-bottom: 0;
}

body.engageflow-ui .ef-crud-page .alert-success {
  background-color: #ecfdf5;
  color: #065f46;
  border-left: 3px solid #10b981;
}

body.engageflow-ui .ef-crud-page .alert-danger {
  background-color: #fef2f2;
  color: #991b1b;
  border-left: 3px solid #ef4444;
}

/* ── Data card (index) ───────────────────────────────────────── */
body.engageflow-ui .ef-data-card {
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-lg);
  box-shadow: var(--ef-shadow-sm);
  overflow: hidden;
}

body.engageflow-ui .ef-data-card-toolbar {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--ef-border);
  background-color: var(--ef-surface);
}

body.engageflow-ui .ef-data-card-toolbar + .ef-data-card-toolbar {
  border-top: none;
}

body.engageflow-ui .ef-data-card-body {
  padding: 0;
  background-color: var(--ef-surface);
}

body.engageflow-ui .ef-data-card-footer {
  background-color: var(--ef-surface);
  border-top: 1px solid var(--ef-border);
  padding: 0.85rem 1.25rem;
}

body.engageflow-ui .ef-upload-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ef-text);
  margin-bottom: 0.5rem;
}

/* ── Search toolbar ──────────────────────────────────────────── */
body.engageflow-ui .ef-search-form .input-group {
  max-width: 420px;
}

body.engageflow-ui .ef-search-form .form-control {
  border-right: none;
  font-size: 0.875rem;
}

body.engageflow-ui .ef-search-form .input-group-append .btn {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

/* ── Tables ────────────────────────────────────────────────────── */
body.engageflow-ui .ef-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.engageflow-ui .ef-table {
  margin-bottom: 0;
  font-size: 0.875rem;
}

body.engageflow-ui .ef-table thead th {
  background-color: #f8fafc;
  border-bottom: 1px solid var(--ef-border);
  border-top: none;
  color: var(--ef-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.75rem 1rem;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}

body.engageflow-ui .ef-table tbody td {
  border-top: 1px solid var(--ef-border);
  color: var(--ef-text);
  padding: 0.8rem 1rem;
  vertical-align: middle;
}

body.engageflow-ui .ef-table tbody tr:hover {
  background-color: #f8fafc;
}

body.engageflow-ui .ef-table-actions {
  white-space: nowrap;
}

body.engageflow-ui .ef-table-actions .btn {
  margin-right: 0.25rem;
}

body.engageflow-ui .ef-table-actions form {
  display: inline-block;
}

/* ── Form card ─────────────────────────────────────────────────── */
body.engageflow-ui .ef-form-card {
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-lg);
  box-shadow: var(--ef-shadow-sm);
  max-width: 720px;
}

body.engageflow-ui .ef-form-card .card-body {
  padding: 1.5rem 1.25rem;
}

body.engageflow-ui .ef-form-card--wide {
  max-width: none;
}

body.engageflow-ui .ef-form-group {
  margin-bottom: 1.25rem;
}

body.engageflow-ui .ef-form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ef-text);
  margin-bottom: 0.4rem;
}

body.engageflow-ui .ef-form-group .form-control {
  font-size: 0.875rem;
}

body.engageflow-ui .ef-form-group .invalid-feedback {
  font-size: 0.8125rem;
  margin-top: 0.35rem;
}

body.engageflow-ui .ef-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ef-border);
  flex-wrap: wrap;
}

/* ── Buttons ───────────────────────────────────────────────────── */
body.engageflow-ui .ef-btn-primary.btn-primary {
  background-color: var(--ef-primary);
  border-color: var(--ef-primary);
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.45rem 1rem;
}

body.engageflow-ui .ef-btn-primary.btn-primary:hover,
body.engageflow-ui .ef-btn-primary.btn-primary:focus {
  background-color: var(--ef-primary-hover);
  border-color: var(--ef-primary-hover);
}

body.engageflow-ui .ef-btn-secondary.btn-secondary {
  background-color: #fff;
  border-color: var(--ef-border);
  color: var(--ef-text-muted);
  font-weight: 500;
  font-size: 0.875rem;
  padding: 0.45rem 1rem;
}

body.engageflow-ui .ef-btn-secondary.btn-secondary:hover,
body.engageflow-ui .ef-btn-secondary.btn-secondary:focus {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: var(--ef-text);
}

body.engageflow-ui .ef-btn-icon.btn-success {
  background-color: #ecfdf5;
  border-color: #a7f3d0;
  color: #059669;
  padding: 0.3rem 0.55rem;
}

body.engageflow-ui .ef-btn-icon.btn-success:hover {
  background-color: #d1fae5;
  border-color: #6ee7b7;
  color: #047857;
}

body.engageflow-ui .ef-btn-icon.btn-danger {
  background-color: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
  padding: 0.3rem 0.55rem;
}

body.engageflow-ui .ef-btn-icon.btn-danger:hover {
  background-color: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

body.engageflow-ui .ef-crud-actions .ef-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* ── Status badges ─────────────────────────────────────────────── */
body.engageflow-ui .ef-status {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.2em 0.65em;
  border-radius: 999px;
  line-height: 1.4;
}

body.engageflow-ui .ef-status-neutral {
  background-color: #f1f5f9;
  color: #475569;
}

body.engageflow-ui .ef-status-success {
  background-color: #ecfdf5;
  color: #047857;
}

body.engageflow-ui .ef-status-warning {
  background-color: #fffbeb;
  color: #b45309;
}

body.engageflow-ui .ef-status-danger {
  background-color: #fef2f2;
  color: #b91c1c;
}

/* ── DataTables (cosmetic — when used in CRUD) ───────────────── */
body.engageflow-ui .ef-table-wrap .dataTables_wrapper {
  padding: 1rem 1.25rem;
}

body.engageflow-ui .ef-table-wrap .dataTables_filter input {
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-sm);
  font-size: 0.875rem;
  padding: 0.35rem 0.65rem;
  margin-left: 0.5rem;
}

body.engageflow-ui .ef-table-wrap .dataTables_length select {
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-sm);
  font-size: 0.875rem;
  padding: 0.25rem 0.5rem;
  margin: 0 0.35rem;
}

body.engageflow-ui .ef-table-wrap .dataTables_info {
  font-size: 0.8125rem;
  color: var(--ef-text-muted);
  padding-top: 0.75rem;
}

body.engageflow-ui .ef-table-wrap .dataTables_paginate {
  padding-top: 0.75rem;
}

body.engageflow-ui .ef-table-wrap .dt-buttons .btn {
  font-size: 0.8125rem;
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
}

/* ── CRUD responsive ───────────────────────────────────────────── */
@media (max-width: 767.98px) {
  body.engageflow-ui .ef-crud-header {
    flex-direction: column;
    align-items: stretch;
    margin-bottom: 1.25rem;
  }

  body.engageflow-ui .ef-crud-actions {
    width: 100%;
  }

  body.engageflow-ui .ef-crud-actions .btn {
    width: 100%;
    justify-content: center;
  }

  body.engageflow-ui .ef-search-form .input-group {
    max-width: none;
  }

  body.engageflow-ui .ef-form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  body.engageflow-ui .ef-form-actions .btn {
    width: 100%;
  }

  body.engageflow-ui .ef-form-card .card-body {
    padding: 1.25rem 1rem;
  }

  body.engageflow-ui .ef-table thead th,
  body.engageflow-ui .ef-table tbody td {
    padding: 0.65rem 0.75rem;
    font-size: 0.8125rem;
  }
}

@media (max-width: 575.98px) {
  body.engageflow-ui .ef-crud-title {
    font-size: 1.2rem;
  }
}

/* =========================================================
   ENGAGEFLOW PLANES TACTICOS — INDEX
   ========================================================= */

body.engageflow-ui .ef-tactical-page {
  padding: 0;
}

/* ── Page header ─────────────────────────────────────────────── */
body.engageflow-ui .ef-tactical-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

body.engageflow-ui .ef-tactical-heading {
  flex: 1;
  min-width: 0;
}

body.engageflow-ui .ef-tactical-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--ef-text);
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  line-height: 1.3;
}

body.engageflow-ui .ef-tactical-subtitle {
  font-size: 0.875rem;
  color: var(--ef-text-muted);
  margin: 0;
  line-height: 1.5;
}

body.engageflow-ui .ef-tactical-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

body.engageflow-ui .ef-tactical-config-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

body.engageflow-ui .ef-tactical-config-form .form-group {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

body.engageflow-ui .ef-tactical-config-form label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ef-text);
  margin: 0;
  white-space: nowrap;
}

/* ── Filter toolbar ────────────────────────────────────────────── */
body.engageflow-ui .ef-tactical-data-card {
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-lg);
  box-shadow: var(--ef-shadow-sm);
  overflow: hidden;
}

body.engageflow-ui .ef-tactical-toolbar {
  background-color: var(--ef-surface);
  border-bottom: 1px solid var(--ef-border);
  padding: 1rem 1.25rem;
}

body.engageflow-ui .ef-filter-grid {
  margin: 0;
}

body.engageflow-ui .ef-filter-grid > [class*="col-"] {
  margin-bottom: 0.75rem;
}

@media (min-width: 768px) {
  body.engageflow-ui .ef-filter-grid > [class*="col-"] {
    margin-bottom: 0;
  }
}

body.engageflow-ui .ef-filter-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

body.engageflow-ui .ef-filter-group .form-control {
  font-size: 0.875rem;
  max-width: 100%;
}

body.engageflow-ui .ef-filter-group .btn-info {
  background-color: #f1f5f9;
  border-color: var(--ef-border);
  color: var(--ef-text);
  font-size: 0.875rem;
  font-weight: 500;
}

body.engageflow-ui .ef-filter-group .btn-info:hover {
  background-color: #e2e8f0;
  border-color: #cbd5e1;
  color: var(--ef-text);
}

body.engageflow-ui .ef-filter-group .dropdown-menu {
  font-size: 0.8125rem;
  border: 1px solid var(--ef-border);
  box-shadow: var(--ef-shadow-md);
  border-radius: var(--ef-radius-sm);
}

body.engageflow-ui .ef-tactical-page #mesesPaginador {
  flex-wrap: nowrap;
  gap: 0.25rem;
  margin: 0;
}

body.engageflow-ui .ef-tactical-page #mesesPaginador .page-link {
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-sm);
  color: var(--ef-text-muted);
  font-size: 0.8125rem;
  padding: 0.4rem 0.65rem;
  line-height: 1.3;
}

body.engageflow-ui .ef-tactical-page #mesesPaginador .page-item.active .page-link {
  background-color: var(--ef-primary);
  border-color: var(--ef-primary);
  color: #fff;
}

body.engageflow-ui .ef-tactical-search-wrap label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--ef-text-muted);
  margin: 0;
}

body.engageflow-ui .ef-tactical-search-wrap #searchText {
  font-size: 0.875rem;
  border-radius: var(--ef-radius-sm);
}

/* ── Table ─────────────────────────────────────────────────────── */
body.engageflow-ui .ef-tactical-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

body.engageflow-ui .ef-tactical-data-card .card-body {
  padding: 0;
  background-color: var(--ef-surface);
}

body.engageflow-ui .ef-tactical-page #example1 {
  font-size: 0.8em;
  margin-bottom: 0;
}

body.engageflow-ui .ef-tactical-page #example1 td,
body.engageflow-ui .ef-tactical-page #example1 th {
  padding: 0.45rem 0.5rem;
  vertical-align: middle;
}

body.engageflow-ui .ef-tactical-page #example1 thead th {
  background-color: #f8fafc;
  color: var(--ef-text-muted);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

body.engageflow-ui .ef-tactical-page #example1 tbody tr:hover {
  background-color: #f8fafc;
}

body.engageflow-ui .ef-tactical-page #example2 {
  font-size: 0.75em;
  margin-bottom: 0;
}

body.engageflow-ui .ef-tactical-actions-cell {
  white-space: nowrap;
}

body.engageflow-ui .ef-tactical-actions-cell .btn {
  margin-bottom: 0.2rem;
}

body.engageflow-ui .ef-tactical-status-approved {
  color: #047857;
  font-weight: 500;
}

/* ── Table sortable indicators ─────────────────────────────────── */
body.engageflow-ui .ef-tactical-page .table-sortable > thead > tr > th {
  cursor: pointer;
  position: relative;
}

body.engageflow-ui .ef-tactical-page .table-sortable > thead > tr > th:after {
  content: ' ';
  position: absolute;
  height: 0;
  width: 0;
  right: 10px;
  top: 16px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 5px solid #ccc;
  border-bottom: 0 solid transparent;
}

body.engageflow-ui .ef-tactical-page .table-sortable > thead > tr > th:hover:after {
  border-top-color: #888;
}

body.engageflow-ui .ef-tactical-page .table-sortable > thead > tr > th.asc:after {
  border-top: 0 solid transparent;
  border-bottom: 5px solid #333;
}

body.engageflow-ui .ef-tactical-page .table-sortable > thead > tr > th.asc:hover:after {
  border-bottom-color: #888;
}

body.engageflow-ui .ef-tactical-page .table-sortable > thead > tr > th.desc:after {
  border-top: 5px solid #333;
  border-bottom: 5px solid transparent;
}

/* ── Loading overlay ───────────────────────────────────────────── */
body.engageflow-ui #overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.45);
  z-index: 1060;
  display: none;
}

body.engageflow-ui #loading-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #fff;
  font-size: 1rem;
  font-weight: 500;
  background: rgba(15, 23, 42, 0.85);
  padding: 1rem 1.5rem;
  border-radius: var(--ef-radius-md);
}

/* ── Modals (Terminar plan / Galería) ──────────────────────────── */
body.engageflow-ui .ef-tactical-page .modal-dialog {
  max-width: 90%;
}

body.engageflow-ui .ef-tactical-page .modal-content {
  max-height: 90vh;
  overflow-y: auto;
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-lg);
  box-shadow: var(--ef-shadow-md);
}

body.engageflow-ui .ef-tactical-page .modal-header {
  border-bottom: 1px solid var(--ef-border);
  padding: 1rem 1.25rem;
}

body.engageflow-ui .ef-tactical-page .modal-body {
  padding: 1.25rem;
}

@media (max-width: 576px) {
  body.engageflow-ui .ef-tactical-page .modal-dialog {
    margin: 10px;
  }

  body.engageflow-ui .ef-tactical-header {
    flex-direction: column;
  }

  body.engageflow-ui .ef-tactical-top-bar {
    justify-content: stretch;
    flex-direction: column;
    align-items: stretch;
  }

  body.engageflow-ui .ef-tactical-config-form {
    flex-direction: column;
    align-items: stretch;
  }

  body.engageflow-ui .ef-tactical-config-form .form-group {
    flex-direction: column;
    align-items: stretch;
  }

  body.engageflow-ui .ef-filter-group {
    flex-direction: column;
    align-items: stretch;
  }

  body.engageflow-ui .ef-tactical-page #mesesPaginador {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start !important;
  }
}

/* ── DataTables in tactical page ───────────────────────────────── */
body.engageflow-ui .ef-tactical-page .dataTables_wrapper {
  padding: 0.75rem 1.25rem 0;
}

body.engageflow-ui .ef-tactical-page .dt-buttons .btn {
  font-size: 0.8125rem;
  border-radius: var(--ef-radius-sm);
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
}

body.engageflow-ui .ef-tactical-pagination {
  margin-top: 1rem;
  padding: 0 0.25rem;
}

body.engageflow-ui .ef-tactical-page .alert-success {
  margin: 0;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid #a7f3d0;
  background-color: #ecfdf5;
  color: #065f46;
  font-size: 0.875rem;
}

/* =========================================================
   ENGAGEFLOW PLANES TACTICOS — CREATE
   ========================================================= */

body.engageflow-ui .ef-tactical-form-page {
  padding: 0;
}

body.engageflow-ui .ef-tactical-form-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

body.engageflow-ui .ef-tactical-form-heading {
  flex: 1;
  min-width: 0;
}

body.engageflow-ui .ef-tactical-form-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--ef-text);
  letter-spacing: -0.02em;
  margin: 0 0 0.35rem;
  line-height: 1.3;
}

body.engageflow-ui .ef-tactical-form-subtitle {
  font-size: 0.875rem;
  color: var(--ef-text-muted);
  margin: 0;
  line-height: 1.5;
}

body.engageflow-ui .ef-tactical-form-card {
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-lg);
  box-shadow: var(--ef-shadow-sm);
  overflow: visible;
  max-width: none;
}

body.engageflow-ui .ef-tactical-form-card .card-body {
  padding: 1.5rem 1.25rem;
}

body.engageflow-ui .ef-tactical-form-errors {
  margin-bottom: 1.25rem;
}

body.engageflow-ui .ef-tactical-form-errors .alert-danger {
  background-color: #fef2f2;
  color: #991b1b;
  border-left: 3px solid #ef4444;
  border-radius: var(--ef-radius-sm);
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

body.engageflow-ui .ef-form-section {
  margin-bottom: 1.75rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--ef-border);
}

body.engageflow-ui .ef-form-section:last-of-type {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

body.engageflow-ui .ef-form-section-header {
  margin-bottom: 1.25rem;
}

body.engageflow-ui .ef-form-section-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ef-text);
  margin: 0 0 0.25rem;
  line-height: 1.35;
}

body.engageflow-ui .ef-form-section-description {
  font-size: 0.8125rem;
  color: var(--ef-text-muted);
  margin: 0;
  line-height: 1.45;
}

body.engageflow-ui .ef-tactical-form-page .ef-form-group label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ef-text);
}

body.engageflow-ui .ef-tactical-form-page .ef-form-group label b {
  color: var(--ef-primary);
  font-weight: 700;
}

body.engageflow-ui .ef-tactical-form-page .form-control:focus {
  border-color: var(--ef-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

body.engageflow-ui .ef-tactical-marca-group {
  padding-right: 7em;
}

body.engageflow-ui .ef-tactical-payment-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  align-items: center;
  padding-top: 0.25rem;
}

body.engageflow-ui .ef-tactical-payment-options label {
  font-weight: 500;
  font-size: 0.8125rem;
  margin: 0;
  cursor: pointer;
}

body.engageflow-ui .ef-tactical-medico-toolbar {
  margin-bottom: 1.25rem;
}

body.engageflow-ui .ef-tactical-medico-toolbar .col-md-2.ef-tactical-filter-ciudad {
  flex: 0 0 13.5%;
  max-width: 13.5%;
}

body.engageflow-ui .ef-tactical-medico-toolbar .col-md-1.ef-tactical-filter-tipo {
  flex: 0 0 11.5%;
  max-width: 11.5%;
}

body.engageflow-ui .ef-tactical-table-wrap #medicoTbl {
  margin-bottom: 0;
  font-size: 0.875rem;
}

body.engageflow-ui .ef-tactical-table-wrap #medicoTbl thead th {
  background-color: #f8fafc;
  color: var(--ef-text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-color: var(--ef-border);
}

body.engageflow-ui .ef-tactical-table-wrap #medicoTbl tbody td {
  vertical-align: middle;
  border-color: var(--ef-border);
}

body.engageflow-ui .ef-tactical-form-actions {
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--ef-border);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

/* jQuery UI autocomplete */
body.engageflow-ui .ef-tactical-form-page .ui-autocomplete {
  max-height: 200px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-sm);
  box-shadow: var(--ef-shadow-md);
  font-size: 0.875rem;
  z-index: 2000;
}

body.engageflow-ui .ef-tactical-form-page .ui-menu-item-wrapper {
  padding: 0.4rem 0.65rem;
}

body.engageflow-ui .ef-tactical-form-page .ui-state-active,
body.engageflow-ui .ef-tactical-form-page .ui-widget-content .ui-state-active {
  background: var(--ef-primary);
  border-color: var(--ef-primary);
  color: #fff;
}

/* Bootstrap multiselect */
body.engageflow-ui .ef-tactical-form-page .multiselect.dropdown-toggle {
  text-align: left;
  font-size: 0.875rem;
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-sm);
  background-color: #fff;
  color: var(--ef-text);
  min-height: calc(2.25rem + 2px);
}

body.engageflow-ui .ef-tactical-form-page .multiselect.dropdown-toggle:hover,
body.engageflow-ui .ef-tactical-form-page .multiselect.dropdown-toggle:focus {
  border-color: var(--ef-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

body.engageflow-ui .ef-tactical-form-page .multiselect-container {
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-sm);
  box-shadow: var(--ef-shadow-md);
  font-size: 0.875rem;
}

body.engageflow-ui .ef-tactical-form-page .multiselect-container > li > a {
  padding: 0.4rem 0.75rem;
}

body.engageflow-ui .ef-tactical-form-page .multiselect-container > li.active > a {
  background-color: var(--ef-primary-soft);
  color: var(--ef-primary);
}

/* Loading overlay (create) */
body.engageflow-ui #loading-overlay {
  position: fixed;
  display: none;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.45);
  z-index: 2000;
  cursor: pointer;
}

body.engageflow-ui #loading-overlay::after {
  content: '';
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 4px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  border-top-color: var(--ef-primary);
  animation: ef-spin 0.8s linear infinite;
}

@keyframes ef-spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Legacy wrapper id on create page */
body.engageflow-ui .ef-tactical-form-page#example1,
body.engageflow-ui #example1.ef-tactical-form-page {
  font-size: inherit;
}

@media (max-width: 767.98px) {
  body.engageflow-ui .ef-tactical-form-header {
    flex-direction: column;
  }

  body.engageflow-ui .ef-tactical-marca-group {
    padding-right: 0;
  }

  body.engageflow-ui .ef-tactical-medico-toolbar .col-md-2.ef-tactical-filter-ciudad,
  body.engageflow-ui .ef-tactical-medico-toolbar .col-md-1.ef-tactical-filter-tipo {
    flex: 0 0 100%;
    max-width: 100%;
  }

  body.engageflow-ui .ef-tactical-form-actions {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  body.engageflow-ui .ef-tactical-form-actions .btn {
    width: 100%;
  }

  body.engageflow-ui .ef-tactical-form-card .card-body {
    padding: 1.25rem 1rem;
  }
}

/* =========================================================
   ENGAGEFLOW LANGUAGE
   ========================================================= */

body.engageflow-ui .ef-language-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 1.625rem;
  padding: 0 0.5rem;
  margin-right: 0.35rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ef-text-muted);
  background-color: #f1f5f9;
  border: 1px solid var(--ef-border);
  border-radius: 999px;
  cursor: default;
  user-select: none;
}


/* ── Overflow & shell ─────────────────────────────────────────── */
body.engageflow-ui {
  overflow-x: hidden;
}

body.engageflow-ui .wrapper,
body.engageflow-ui .content-wrapper {
  overflow-x: hidden;
  max-width: 100%;
}

body.engageflow-ui .content-wrapper > .content {
  max-width: 100%;
}

/* ── Unified page titles ──────────────────────────────────────── */
body.engageflow-ui .ef-page-title,
body.engageflow-ui .ef-crud-title,
body.engageflow-ui .ef-tactical-title,
body.engageflow-ui .ef-tactical-form-title {
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--ef-text);
  letter-spacing: -0.02em;
  line-height: 1.3;
}

body.engageflow-ui .ef-page-subtitle,
body.engageflow-ui .ef-crud-subtitle,
body.engageflow-ui .ef-tactical-subtitle,
body.engageflow-ui .ef-tactical-form-subtitle {
  font-size: 0.875rem;
  color: var(--ef-text-muted);
  line-height: 1.5;
}

/* ── Unified card language ────────────────────────────────────── */
body.engageflow-ui .ef-data-card,
body.engageflow-ui .ef-form-card,
body.engageflow-ui .ef-chart-card,
body.engageflow-ui .ef-dashboard-table-card,
body.engageflow-ui .ef-tactical-data-card,
body.engageflow-ui .ef-tactical-form-card,
body.engageflow-ui .ef-period-card {
  background-color: var(--ef-surface);
}

body.engageflow-ui .card.card-outline.card-primary {
  border-top: 3px solid var(--ef-primary);
}

body.engageflow-ui .card.card-outline.card-primary > .card-header {
  background-color: var(--ef-surface);
  color: var(--ef-text);
}

/* ── Focus visible (accessibility) ────────────────────────────── */
body.engageflow-ui a:focus-visible,
body.engageflow-ui button:focus-visible,
body.engageflow-ui .btn:focus-visible,
body.engageflow-ui input:focus-visible,
body.engageflow-ui select:focus-visible,
body.engageflow-ui textarea:focus-visible,
body.engageflow-ui .page-link:focus-visible {
  outline: 2px solid var(--ef-primary);
  outline-offset: 2px;
}

body.engageflow-ui .form-control:focus {
  border-color: var(--ef-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

body.engageflow-ui .btn-primary:focus,
body.engageflow-ui .btn-primary.focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

body.engageflow-ui .btn-secondary:focus,
body.engageflow-ui .btn-secondary.focus,
body.engageflow-ui .btn-danger:focus,
body.engageflow-ui .btn-danger.focus,
body.engageflow-ui .btn-success:focus,
body.engageflow-ui .btn-success.focus,
body.engageflow-ui .btn-info:focus,
body.engageflow-ui .btn-info.focus {
  box-shadow: 0 0 0 3px rgba(100, 116, 139, 0.2);
}

body.engageflow-ui .ef-navbar-toggle:focus-visible {
  outline: 2px solid var(--ef-primary);
  outline-offset: 2px;
  border-radius: var(--ef-radius-sm);
}

/* ── Buttons — global consistency ─────────────────────────────── */
body.engageflow-ui .btn {
  min-height: calc(1.5em + 0.75rem + 2px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

body.engageflow-ui .btn-sm {
  min-height: calc(1.5em + 0.5rem + 2px);
  font-size: 0.8125rem;
}

body.engageflow-ui .btn:disabled,
body.engageflow-ui .btn.disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

body.engageflow-ui .btn-danger {
  background-color: var(--ef-danger);
  border-color: var(--ef-danger);
}

body.engageflow-ui .btn-danger:hover,
body.engageflow-ui .btn-danger:focus {
  background-color: #b91c1c;
  border-color: #b91c1c;
}

body.engageflow-ui .btn-success {
  background-color: #059669;
  border-color: #059669;
}

body.engageflow-ui .btn-success:hover,
body.engageflow-ui .btn-success:focus {
  background-color: #047857;
  border-color: #047857;
}

/* ── Forms — global polish ────────────────────────────────────── */
body.engageflow-ui .form-control,
body.engageflow-ui .custom-select {
  min-height: calc(2.25rem + 2px);
  color: var(--ef-text);
  background-color: var(--ef-surface);
}

body.engageflow-ui .form-control:disabled,
body.engageflow-ui .form-control[readonly],
body.engageflow-ui select:disabled {
  background-color: #f8fafc;
  color: var(--ef-text-muted);
  cursor: not-allowed;
}

body.engageflow-ui .form-control.is-invalid {
  border-color: #dc3545;
}

body.engageflow-ui .form-control.is-invalid:focus {
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

body.engageflow-ui .invalid-feedback {
  font-size: 0.8125rem;
  color: #b91c1c;
}

body.engageflow-ui textarea.form-control {
  min-height: 96px;
  resize: vertical;
}

body.engageflow-ui .custom-control-input:focus ~ .custom-control-label::before {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

body.engageflow-ui .custom-control-input:checked ~ .custom-control-label::before {
  background-color: var(--ef-primary);
  border-color: var(--ef-primary);
}

/* ── Multiselect — global (forms + tactical) ──────────────────── */
body.engageflow-ui .multiselect.dropdown-toggle {
  text-align: left;
  font-size: 0.875rem;
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-sm);
  background-color: #fff;
  color: var(--ef-text);
  min-height: calc(2.25rem + 2px);
}

body.engageflow-ui .multiselect.dropdown-toggle:hover,
body.engageflow-ui .multiselect.dropdown-toggle:focus {
  border-color: var(--ef-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

body.engageflow-ui .multiselect-container {
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-sm);
  box-shadow: var(--ef-shadow-md);
  font-size: 0.875rem;
  max-width: 100%;
}

body.engageflow-ui .multiselect-container > li > a {
  padding: 0.4rem 0.75rem;
}

body.engageflow-ui .multiselect-container > li.active > a {
  background-color: var(--ef-primary-soft);
  color: var(--ef-primary);
}

/* ── jQuery UI autocomplete — global ──────────────────────────── */
body.engageflow-ui .ui-autocomplete {
  max-height: 220px;
  overflow-y: auto;
  overflow-x: hidden;
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-sm);
  box-shadow: var(--ef-shadow-md);
  font-size: 0.875rem;
  z-index: 2000;
}

body.engageflow-ui .ui-menu-item-wrapper {
  padding: 0.4rem 0.65rem;
}

body.engageflow-ui .ui-state-active,
body.engageflow-ui .ui-widget-content .ui-state-active {
  background: var(--ef-primary);
  border-color: var(--ef-primary);
  color: #fff;
}

/* ── Tables — global baseline ─────────────────────────────────── */
body.engageflow-ui .table {
  color: var(--ef-text);
}

body.engageflow-ui .table-bordered {
  border-color: var(--ef-border);
}

body.engageflow-ui .table-bordered td,
body.engageflow-ui .table-bordered th {
  border-color: var(--ef-border);
}

body.engageflow-ui .table tbody tr:hover {
  background-color: #f8fafc;
}

body.engageflow-ui .ef-table-actions form,
body.engageflow-ui .ef-tactical-actions-cell form {
  display: inline-block;
}

/* ── DataTables — global polish ───────────────────────────────── */
body.engageflow-ui .dataTables_wrapper {
  font-size: 0.875rem;
  color: var(--ef-text);
}

body.engageflow-ui .dataTables_wrapper .dataTables_length,
body.engageflow-ui .dataTables_wrapper .dataTables_filter,
body.engageflow-ui .dataTables_wrapper .dataTables_info,
body.engageflow-ui .dataTables_wrapper .dataTables_paginate {
  margin-bottom: 0.75rem;
}

body.engageflow-ui .dataTables_wrapper .dataTables_filter input,
body.engageflow-ui .dataTables_wrapper .dataTables_length select {
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-sm);
  font-size: 0.875rem;
  padding: 0.35rem 0.65rem;
  margin: 0 0.35rem;
  min-height: calc(2rem + 2px);
}

body.engageflow-ui .dataTables_wrapper .dataTables_filter input:focus,
body.engageflow-ui .dataTables_wrapper .dataTables_length select:focus {
  border-color: var(--ef-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

body.engageflow-ui .dataTables_wrapper .dataTables_info {
  font-size: 0.8125rem;
  color: var(--ef-text-muted);
  padding-top: 0.75rem;
}

body.engageflow-ui .dataTables_wrapper .dataTables_paginate .paginate_button {
  border-radius: var(--ef-radius-sm) !important;
  border: 1px solid var(--ef-border) !important;
  padding: 0.35rem 0.65rem !important;
  margin-left: 0.2rem !important;
  font-size: 0.8125rem !important;
  color: var(--ef-text-muted) !important;
  background: #fff !important;
}

body.engageflow-ui .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
  background: #f8fafc !important;
  border-color: #cbd5e1 !important;
  color: var(--ef-text) !important;
}

body.engageflow-ui .dataTables_wrapper .dataTables_paginate .paginate_button.current,
body.engageflow-ui .dataTables_wrapper .dataTables_paginate .paginate_button.current:hover {
  background: var(--ef-primary) !important;
  border-color: var(--ef-primary) !important;
  color: #fff !important;
}

body.engageflow-ui .dataTables_wrapper .dataTables_paginate .paginate_button.disabled,
body.engageflow-ui .dataTables_wrapper .dataTables_paginate .paginate_button.disabled:hover {
  opacity: 0.5;
  cursor: not-allowed;
}

body.engageflow-ui .dt-buttons .btn {
  font-size: 0.8125rem;
  border-radius: var(--ef-radius-sm);
  margin-right: 0.35rem;
  margin-bottom: 0.35rem;
}

body.engageflow-ui .dataTables_processing {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-sm);
  box-shadow: var(--ef-shadow-sm);
  color: var(--ef-text-muted);
  font-size: 0.875rem;
}

/* ── Laravel pagination ───────────────────────────────────────── */
body.engageflow-ui .pagination {
  gap: 0.25rem;
  flex-wrap: wrap;
}

body.engageflow-ui .page-link {
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-sm);
  color: var(--ef-text-muted);
  font-size: 0.875rem;
  padding: 0.45rem 0.75rem;
  line-height: 1.4;
}

body.engageflow-ui .page-link:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: var(--ef-text);
}

body.engageflow-ui .page-item.active .page-link {
  background-color: var(--ef-primary);
  border-color: var(--ef-primary);
  color: #fff;
}

body.engageflow-ui .page-item.disabled .page-link {
  color: #94a3b8;
  background-color: #f8fafc;
}

/* ── Alerts — unified ─────────────────────────────────────────── */
body.engageflow-ui .alert {
  font-size: 0.875rem;
  border-radius: var(--ef-radius-sm);
}

body.engageflow-ui .alert-success {
  background-color: #ecfdf5;
  color: #065f46;
  border-left: 3px solid #10b981;
}

body.engageflow-ui .alert-danger {
  background-color: #fef2f2;
  color: #991b1b;
  border-left: 3px solid #ef4444;
}

body.engageflow-ui .alert-warning {
  background-color: #fffbeb;
  color: #92400e;
  border-left: 3px solid #f59e0b;
}

body.engageflow-ui .alert-info {
  background-color: #eff6ff;
  color: #1e40af;
  border-left: 3px solid var(--ef-primary);
}

/* ── Badges — semantic polish ─────────────────────────────────── */
body.engageflow-ui .badge-primary {
  background-color: var(--ef-primary);
}

body.engageflow-ui .badge-success {
  background-color: #059669;
}

body.engageflow-ui .badge-danger {
  background-color: var(--ef-danger);
}

body.engageflow-ui .badge-warning {
  background-color: #d97706;
  color: #fff;
}

body.engageflow-ui .badge-info {
  background-color: #0284c7;
}

body.engageflow-ui .badge-secondary {
  background-color: #64748b;
}

/* ── Modals — global ──────────────────────────────────────────── */
body.engageflow-ui .modal-content {
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-lg);
  box-shadow: var(--ef-shadow-md);
}

body.engageflow-ui .modal-header {
  border-bottom: 1px solid var(--ef-border);
  padding: 1rem 1.25rem;
  background-color: var(--ef-surface);
}

body.engageflow-ui .modal-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--ef-text);
}

body.engageflow-ui .modal-body {
  padding: 1.25rem;
}

body.engageflow-ui .modal-footer {
  border-top: 1px solid var(--ef-border);
  padding: 0.85rem 1.25rem;
  background-color: #f8fafc;
}

body.engageflow-ui .modal-footer .btn + .btn {
  margin-left: 0.5rem;
}

body.engageflow-ui .close {
  color: var(--ef-text-muted);
  opacity: 0.75;
  text-shadow: none;
}

body.engageflow-ui .close:hover {
  color: var(--ef-text);
  opacity: 1;
}

/* ── Dropdowns ────────────────────────────────────────────────── */
body.engageflow-ui .dropdown-menu {
  border: 1px solid var(--ef-border);
  border-radius: var(--ef-radius-sm);
  box-shadow: var(--ef-shadow-md);
  font-size: 0.875rem;
  padding: 0.35rem 0;
}

body.engageflow-ui .dropdown-item {
  padding: 0.45rem 1rem;
  color: var(--ef-text);
}

body.engageflow-ui .dropdown-item:hover,
body.engageflow-ui .dropdown-item:focus {
  background-color: #f8fafc;
  color: var(--ef-text);
}

body.engageflow-ui .dropdown-item.active,
body.engageflow-ui .dropdown-item:active {
  background-color: var(--ef-primary-soft);
  color: var(--ef-primary);
}

/* ── CKEditor container ───────────────────────────────────────── */
body.engageflow-ui .cke_chrome {
  border: 1px solid var(--ef-border) !important;
  border-radius: var(--ef-radius-sm) !important;
  box-shadow: none !important;
  overflow: hidden;
}

body.engageflow-ui .cke_top {
  background: #f8fafc !important;
  border-bottom: 1px solid var(--ef-border) !important;
}

body.engageflow-ui .cke_bottom {
  background: #f8fafc !important;
  border-top: 1px solid var(--ef-border) !important;
}

/* ── SweetAlert2 — cosmetic ───────────────────────────────────── */
body.engageflow-ui .swal2-popup {
  border-radius: var(--ef-radius-lg);
  font-family: var(--ef-font);
  font-size: 0.9375rem;
}

body.engageflow-ui .swal2-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--ef-text);
}

body.engageflow-ui .swal2-html-container {
  font-size: 0.875rem;
  color: var(--ef-text-muted);
}

body.engageflow-ui .swal2-styled.swal2-confirm {
  background-color: var(--ef-primary);
  border-radius: var(--ef-radius-sm);
  font-weight: 600;
  font-size: 0.875rem;
}

body.engageflow-ui .swal2-styled.swal2-confirm:focus {
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

body.engageflow-ui .swal2-styled.swal2-cancel {
  border-radius: var(--ef-radius-sm);
  font-size: 0.875rem;
}

/* ── Dashboard charts — responsive canvas ─────────────────────── */
body.engageflow-ui .ef-chart-canvas-wrap canvas,
body.engageflow-ui #sales-chart {
  max-width: 100%;
}

body.engageflow-ui #donutChart {
  max-width: 100%;
}

/* ── Sidebar — open submenu clarity ───────────────────────────── */
body.engageflow-ui .nav-sidebar > .nav-item.menu-open > .nav-link {
  background-color: rgba(255, 255, 255, 0.04);
  color: #f8fafc;
}

body.engageflow-ui.sidebar-mini.sidebar-collapse .main-sidebar .nav-sidebar .nav-link p,
body.engageflow-ui.sidebar-mini.sidebar-collapse .main-sidebar .brand-text {
  transition: opacity 0.15s ease;
}

/* ── Form actions alignment ───────────────────────────────────── */
body.engageflow-ui .ef-form-actions,
body.engageflow-ui .ef-tactical-form-actions {
  justify-content: flex-end;
}

/* ── Phase 6 responsive — tablet & mobile ─────────────────────── */
@media (max-width: 991.98px) {
  body.engageflow-ui .dataTables_wrapper .dataTables_length,
  body.engageflow-ui .dataTables_wrapper .dataTables_filter {
    text-align: left;
    float: none;
    width: 100%;
  }

  body.engageflow-ui .dataTables_wrapper .dataTables_filter input {
    width: 100%;
    max-width: 280px;
    margin-left: 0;
    margin-top: 0.35rem;
  }

  body.engageflow-ui .dataTables_wrapper .dt-buttons {
    margin-bottom: 0.5rem;
  }

  body.engageflow-ui .modal-dialog {
    max-width: calc(100% - 1.5rem);
    margin: 0.75rem auto;
  }
}

@media (max-width: 767.98px) {
  body.engageflow-ui .ef-page-title,
  body.engageflow-ui .ef-crud-title,
  body.engageflow-ui .ef-tactical-title,
  body.engageflow-ui .ef-tactical-form-title {
    font-size: 1.25rem;
  }

  body.engageflow-ui .dataTables_wrapper .dataTables_info,
  body.engageflow-ui .dataTables_wrapper .dataTables_paginate {
    float: none;
    text-align: center;
    width: 100%;
  }

  body.engageflow-ui .dataTables_wrapper .dataTables_paginate {
    margin-top: 0.5rem;
  }

  body.engageflow-ui .multiselect-container {
    max-width: calc(100vw - 2rem);
  }

  body.engageflow-ui .ef-tactical-payment-options {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  body.engageflow-ui .modal-body {
    padding: 1rem;
  }

  body.engageflow-ui .modal-footer {
    flex-direction: column-reverse;
    gap: 0.5rem;
  }

  body.engageflow-ui .modal-footer .btn {
    width: 100%;
    margin-left: 0 !important;
  }
}

@media (max-width: 575.98px) {
  body.engageflow-ui .content-wrapper > .content,
  body.engageflow-ui .content-wrapper .ef-content-area {
    padding: 0.85rem;
  }

  body.engageflow-ui .btn {
    font-size: 0.8125rem;
  }

  body.engageflow-ui .dataTables_wrapper .dt-buttons .btn {
    width: 100%;
    margin-right: 0;
  }

  body.engageflow-ui .pagination .page-link {
    padding: 0.4rem 0.6rem;
    font-size: 0.8125rem;
  }
}

@media (max-width: 359.98px) {
  body.engageflow-ui .ef-navbar-brand {
    max-width: 120px;
  }

  body.engageflow-ui .content-wrapper > .content {
    padding: 0.75rem;
  }
}
