/* ===================================================
   Lucrei CRM - Main Stylesheet
   Dark Mode by default
=================================================== */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

:root {
  --bg:           #0f1117;
  --card:         #1a1f2e;
  --card-border:  #252d3d;
  --text:         #e2e8f0;
  --text-muted:   #8892a4;
  --border:       #252d3d;
  --blue:         #3b82f6;
  --blue-hover:   #2563eb;
  --green:        #22c55e;
  --red:          #ef4444;
  --orange:       #f97316;
  --purple:       #a855f7;
  --yellow:       #eab308;
  --fb:           #4267B2;
  --ig:           #E1306C;
  --wpp:          #25d366;
  --sidebar-w:    260px;
  --topbar-h:     60px;
  --radius:       10px;
  --radius-sm:    6px;
  --shadow:       0 4px 20px rgba(0,0,0,0.3);
  --transition:   0.2s ease;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; scroll-behavior: smooth; }

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--blue-hover); }

img { max-width: 100%; }

ul { list-style: none; }

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--card-border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ===== LAYOUT ===== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding-top: var(--topbar-h);
  min-height: 100vh;
  transition: margin-left var(--transition);
}

.page-content {
  padding: 24px;
}

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: var(--card);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transition: transform var(--transition);
  overflow-y: auto;
}

.sidebar-brand {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--topbar-h);
}

.sidebar-brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--blue), var(--green));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.sidebar-section-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 8px 20px 4px;
  letter-spacing: 0.08em;
}

.sidebar-nav a,
.sidebar-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  border-radius: 0;
  position: relative;
  cursor: pointer;
}

.sidebar-nav a:hover,
.sidebar-nav-item:hover {
  color: var(--text);
  background: rgba(59,130,246,0.08);
}

.sidebar-nav a.active,
.sidebar-nav-item.active {
  color: var(--blue);
  background: rgba(59,130,246,0.12);
  font-weight: 600;
}

.sidebar-nav a.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--blue);
  border-radius: 0 2px 2px 0;
}

.sidebar-nav a .mdi,
.sidebar-nav-item .mdi {
  font-size: 1.2rem;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-nav .badge {
  margin-left: auto;
  background: var(--green);
  color: #fff;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 600;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer .avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-footer .user-info { flex: 1; min-width: 0; }
.sidebar-footer .user-name { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-footer .user-role { font-size: 0.7rem; color: var(--text-muted); }

.sidebar-footer .logout-btn {
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  transition: color var(--transition);
  background: none;
  border: none;
}
.sidebar-footer .logout-btn:hover { color: var(--red); }

/* ===== TOPBAR ===== */
.topbar {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  z-index: 99;
  transition: left var(--transition);
}

.topbar-title {
  font-size: 1rem;
  font-weight: 600;
  flex: 1;
}

.topbar-site-select {
  background: var(--bg);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  cursor: pointer;
  max-width: 200px;
}

.topbar-site-select:focus { outline: none; border-color: var(--blue); }

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.topbar-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--card-border);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  transition: all var(--transition);
  position: relative;
}
.topbar-icon-btn:hover { background: var(--card-border); color: var(--text); }

.topbar-user {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  position: relative;
}
.topbar-user:hover { background: var(--card-border); }

.topbar-user .avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
}

.topbar-user .user-name { font-size: 0.82rem; font-weight: 500; }

/* Dropdown */
.dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  min-width: 180px;
  box-shadow: var(--shadow);
  z-index: 200;
  display: none;
  overflow: hidden;
}
.dropdown.open { display: block; animation: fadeIn 0.15s ease; }
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background var(--transition);
}
.dropdown-item:hover { background: var(--card-border); }
.dropdown-item.danger { color: var(--red); }
.dropdown-divider { height: 1px; background: var(--card-border); }

/* ===== STAT CARDS ===== */
.adm-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.adm-stat {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform var(--transition), box-shadow var(--transition);
  cursor: default;
}
.adm-stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.adm-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.adm-stat-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.adm-stat-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.adm-stat-icon.blue { background: rgba(59,130,246,0.15); color: var(--blue); }
.adm-stat-icon.green { background: rgba(34,197,94,0.15); color: var(--green); }
.adm-stat-icon.red { background: rgba(239,68,68,0.15); color: var(--red); }
.adm-stat-icon.orange { background: rgba(249,115,22,0.15); color: var(--orange); }
.adm-stat-icon.purple { background: rgba(168,85,247,0.15); color: var(--purple); }
.adm-stat-icon.yellow { background: rgba(234,179,8,0.15); color: var(--yellow); }
.adm-stat-icon.wpp { background: rgba(37,211,102,0.15); color: var(--wpp); }

.adm-stat-value {
  font-size: 1.7rem;
  font-weight: 700;
  margin-bottom: 4px;
  line-height: 1.1;
}
.adm-stat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}
.adm-stat-sub .up { color: var(--green); }
.adm-stat-sub .down { color: var(--red); }

/* ===== CARDS GENÉRICOS ===== */
.adm-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  overflow: hidden;
}

.adm-card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.adm-card-title {
  font-size: 0.9rem;
  font-weight: 600;
}

.adm-card-body {
  padding: 20px;
}

/* ===== TABELA ===== */
.adm-table-wrapper {
  overflow-x: auto;
}

.adm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.adm-table thead th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--card-border);
  white-space: nowrap;
}

.adm-table tbody tr {
  border-bottom: 1px solid rgba(37,45,61,0.5);
  transition: background var(--transition);
  cursor: pointer;
}

.adm-table tbody tr:hover { background: rgba(59,130,246,0.04); }
.adm-table tbody tr:last-child { border-bottom: none; }

.adm-table td {
  padding: 12px 14px;
  vertical-align: middle;
}

.adm-table .avatar-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}
.adm-table .lead-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.adm-table .lead-name { font-weight: 500; }
.adm-table .lead-email { font-size: 0.75rem; color: var(--text-muted); }

/* ===== BADGES ===== */
.adm-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}
.adm-badge::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.adm-badge-new,
.adm-badge-blue { background: rgba(59,130,246,0.15); color: #60a5fa; }

.adm-badge-paid,
.adm-badge-green,
.adm-badge-completed,
.adm-badge-connected { background: rgba(34,197,94,0.15); color: #4ade80; }

.adm-badge-churned,
.adm-badge-red,
.adm-badge-expired,
.adm-badge-failed,
.adm-badge-disconnected { background: rgba(239,68,68,0.15); color: #f87171; }

.adm-badge-pix_generated,
.adm-badge-pending,
.adm-badge-orange,
.adm-badge-sending { background: rgba(249,115,22,0.15); color: #fb923c; }

.adm-badge-recovered,
.adm-badge-purple { background: rgba(168,85,247,0.15); color: #c084fc; }

.adm-badge-yellow,
.adm-badge-draft,
.adm-badge-connecting,
.adm-badge-scheduled { background: rgba(234,179,8,0.15); color: #facc15; }

.adm-badge-paused { background: rgba(136,146,164,0.15); color: #94a3b8; }

.adm-badge-active { background: rgba(34,197,94,0.15); color: #4ade80; }
.adm-badge-inactive { background: rgba(239,68,68,0.15); color: #f87171; }

/* ===== BOTÕES ===== */
.adm-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  font-size: 0.83rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.adm-btn:hover { background: var(--card-border); }
.adm-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.adm-btn-primary {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}
.adm-btn-primary:hover { background: var(--blue-hover); border-color: var(--blue-hover); }

.adm-btn-success {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.adm-btn-success:hover { background: #16a34a; border-color: #16a34a; }

.adm-btn-danger {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.adm-btn-danger:hover { background: #dc2626; border-color: #dc2626; }

.adm-btn-warning {
  background: var(--orange);
  border-color: var(--orange);
  color: #fff;
}
.adm-btn-warning:hover { background: #ea580c; }

.adm-btn-ghost {
  background: transparent;
  border-color: transparent;
}
.adm-btn-ghost:hover { background: var(--card-border); }

.adm-btn-sm { padding: 5px 11px; font-size: 0.78rem; }
.adm-btn-lg { padding: 11px 22px; font-size: 0.95rem; }
.adm-btn-full { width: 100%; justify-content: center; }
.adm-btn-icon { padding: 7px; }

/* ===== FORMS ===== */
.adm-form-group {
  margin-bottom: 16px;
}

.adm-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.adm-input,
.adm-select,
.adm-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--card-border);
  color: var(--text);
  padding: 9px 13px;
  border-radius: var(--radius-sm);
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  transition: border-color var(--transition);
  outline: none;
}

.adm-input:focus,
.adm-select:focus,
.adm-textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.adm-input::placeholder,
.adm-textarea::placeholder { color: var(--text-muted); opacity: 0.7; }

.adm-textarea { resize: vertical; min-height: 100px; }

.adm-select { cursor: pointer; }
.adm-select option { background: var(--card); }

.adm-input-group {
  display: flex;
  gap: 0;
}
.adm-input-group .adm-input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  flex: 1;
}
.adm-input-group .adm-btn {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  border-left: none;
}

/* ===== FILTROS ===== */
.adm-filters {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.adm-filter-input {
  flex: 1;
  min-width: 200px;
  max-width: 320px;
}

/* ===== PAGINAÇÃO ===== */
.adm-pagination {
  display: flex;
  align-items: center;
  justify-content: between;
  gap: 4px;
  padding: 16px 20px;
  border-top: 1px solid var(--card-border);
  flex-wrap: wrap;
}

.adm-pagination-info {
  flex: 1;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.adm-pagination-btns { display: flex; gap: 4px; }

.adm-page-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--card-border);
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-size: 0.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.adm-page-btn:hover { background: var(--card-border); }
.adm-page-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.adm-page-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ===== MODAL ===== */
.adm-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
  animation: fadeIn 0.15s ease;
}

.adm-modal {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.2s ease;
  box-shadow: var(--shadow);
}

.adm-modal-header {
  padding: 18px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.adm-modal-title { font-weight: 600; font-size: 0.95rem; }
.adm-modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.2rem;
  padding: 4px;
  border-radius: 4px;
  transition: color var(--transition);
}
.adm-modal-close:hover { color: var(--text); }

.adm-modal-body { padding: 20px; }
.adm-modal-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--card-border);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

/* Drawer lateral */
.adm-drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: none;
}
.adm-drawer-overlay.open { display: block; animation: fadeIn 0.15s ease; }

.adm-drawer {
  position: fixed;
  top: 0;
  right: -600px;
  width: 560px;
  max-width: 95vw;
  height: 100vh;
  background: var(--card);
  border-left: 1px solid var(--card-border);
  z-index: 201;
  overflow-y: auto;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
}
.adm-drawer.open { right: 0; }

.adm-drawer-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}

.adm-drawer-title { font-weight: 600; }
.adm-drawer-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
}
.adm-drawer-close:hover { color: var(--text); }

.adm-drawer-body { padding: 20px; flex: 1; }

/* ===== TABS ===== */
.adm-tabs {
  display: flex;
  border-bottom: 1px solid var(--card-border);
  gap: 0;
  margin-bottom: 20px;
}

.adm-tab {
  padding: 8px 16px;
  font-size: 0.83rem;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all var(--transition);
  white-space: nowrap;
}
.adm-tab:hover { color: var(--text); }
.adm-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.adm-tab-content { display: none; }
.adm-tab-content.active { display: block; animation: fadeIn 0.15s ease; }

/* ===== TOAST ===== */
.toast-container {
  position: fixed;
  top: 70px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 280px;
  max-width: 380px;
  box-shadow: var(--shadow);
  animation: slideInRight 0.3s ease;
  pointer-events: all;
  font-size: 0.85rem;
}

.toast-success { border-left: 3px solid var(--green); }
.toast-error { border-left: 3px solid var(--red); }
.toast-info { border-left: 3px solid var(--blue); }
.toast-warning { border-left: 3px solid var(--orange); }

.toast .toast-icon { font-size: 1.1rem; }
.toast-success .toast-icon { color: var(--green); }
.toast-error .toast-icon { color: var(--red); }
.toast-info .toast-icon { color: var(--blue); }
.toast-warning .toast-icon { color: var(--orange); }

.toast-body { flex: 1; }
.toast-title { font-weight: 600; }
.toast-msg { color: var(--text-muted); font-size: 0.78rem; }
.toast-close { cursor: pointer; color: var(--text-muted); background: none; border: none; font-size: 1rem; }

/* ===== CHARTS ===== */
.chart-container {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
}

.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

/* ===== ACTIVITY FEED ===== */
.activity-feed {
  list-style: none;
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(37,45,61,0.5);
  animation: slideUp 0.3s ease;
}
.activity-item:last-child { border-bottom: none; }

.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 5px;
  flex-shrink: 0;
}
.activity-dot.green { background: var(--green); }
.activity-dot.blue { background: var(--blue); }
.activity-dot.orange { background: var(--orange); }
.activity-dot.purple { background: var(--purple); }
.activity-dot.red { background: var(--red); }

.activity-text { flex: 1; font-size: 0.83rem; }
.activity-text strong { font-weight: 600; }
.activity-time { font-size: 0.72rem; color: var(--text-muted); white-space: nowrap; }

/* ===== LOGIN PAGE ===== */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
  padding: 20px;
}

.login-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease;
}

.login-logo {
  text-align: center;
  margin-bottom: 28px;
}

.login-title {
  font-size: 1.4rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 6px;
}

.login-subtitle {
  color: var(--text-muted);
  text-align: center;
  font-size: 0.85rem;
  margin-bottom: 28px;
}

/* ===== EMPTY STATE ===== */
.adm-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.adm-empty .mdi { font-size: 3rem; opacity: 0.3; display: block; margin-bottom: 12px; }
.adm-empty-title { font-size: 0.95rem; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.adm-empty-sub { font-size: 0.82rem; }

/* ===== CHIPS / TAGS ===== */
.adm-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.adm-tag {
  background: rgba(59,130,246,0.12);
  color: var(--blue);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.72rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.adm-tag .remove-tag {
  cursor: pointer;
  opacity: 0.7;
}
.adm-tag .remove-tag:hover { opacity: 1; }

/* ===== PROGRESS ===== */
.adm-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--card-border);
  border-radius: 3px;
  overflow: hidden;
}
.adm-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--purple));
  border-radius: 3px;
  transition: width 0.5s ease;
}

/* ===== WHATSAPP CHAT ===== */
.chat-layout {
  display: flex;
  height: calc(100vh - var(--topbar-h));
  overflow: hidden;
}

.chat-sidebar {
  width: 300px;
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.chat-sidebar-header {
  padding: 16px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-list {
  flex: 1;
  overflow-y: auto;
}

.chat-list-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: background var(--transition);
  border-bottom: 1px solid rgba(37,45,61,0.4);
}
.chat-list-item:hover { background: rgba(59,130,246,0.05); }
.chat-list-item.active { background: rgba(59,130,246,0.1); }

.chat-list-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--wpp), #1da851);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.chat-list-info { flex: 1; min-width: 0; }
.chat-list-name { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-last { font-size: 0.75rem; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-list-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.chat-list-time { font-size: 0.7rem; color: var(--text-muted); }
.chat-unread { background: var(--wpp); color: #fff; width: 18px; height: 18px; border-radius: 50%; font-size: 0.65rem; display: flex; align-items: center; justify-content: center; font-weight: 700; }

.chat-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 12px 20px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.chat-bubble {
  max-width: 70%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.85rem;
  line-height: 1.5;
  word-wrap: break-word;
}

.chat-bubble-in {
  background: var(--card-border);
  border-bottom-left-radius: 3px;
  align-self: flex-start;
}

.chat-bubble-out {
  background: rgba(37,211,102,0.15);
  color: var(--text);
  border-bottom-right-radius: 3px;
  align-self: flex-end;
}

.chat-bubble-time {
  font-size: 0.68rem;
  color: var(--text-muted);
  margin-top: 4px;
  text-align: right;
}

.chat-input-area {
  padding: 12px 16px;
  border-top: 1px solid var(--card-border);
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.chat-input-area textarea {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: 20px;
  padding: 10px 16px;
  color: var(--text);
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  resize: none;
  max-height: 120px;
  outline: none;
}
.chat-input-area textarea:focus { border-color: var(--wpp); }

/* ===== QR CODE AREA ===== */
.qr-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px;
  gap: 16px;
  text-align: center;
}

.qr-image {
  width: 250px;
  height: 250px;
  border-radius: var(--radius);
  border: 2px solid var(--card-border);
  padding: 8px;
  background: #fff;
}

/* ===== WIZARD ===== */
.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
  gap: 0;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
}

.wizard-step-num {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  background: var(--card-border);
  color: var(--text-muted);
  flex-shrink: 0;
  transition: all var(--transition);
}

.wizard-step.active .wizard-step-num {
  background: var(--blue);
  color: #fff;
}

.wizard-step.done .wizard-step-num {
  background: var(--green);
  color: #fff;
}

.wizard-step-label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}
.wizard-step.active .wizard-step-label { color: var(--text); }

.wizard-step-line {
  flex: 1;
  height: 1px;
  background: var(--card-border);
  margin: 0 8px;
}

.wizard-panel { display: none; }
.wizard-panel.active { display: block; animation: fadeIn 0.2s ease; }

/* ===== SEGMENT CARDS ===== */
.segment-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.segment-card {
  background: var(--bg);
  border: 2px solid var(--card-border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.segment-card:hover {
  border-color: var(--blue);
  background: rgba(59,130,246,0.05);
}

.segment-card.selected {
  border-color: var(--blue);
  background: rgba(59,130,246,0.1);
}

.segment-card .mdi {
  font-size: 2rem;
  display: block;
  margin-bottom: 8px;
}

.segment-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
}

.segment-card-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ===== METRIC ROW ===== */
.metric-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid rgba(37,45,61,0.5);
}
.metric-row:last-child { border-bottom: none; }
.metric-label { font-size: 0.82rem; color: var(--text-muted); }
.metric-value { font-size: 0.9rem; font-weight: 600; }

/* ===== API KEY BOX ===== */
.api-key-box {
  background: var(--bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-family: 'Courier New', monospace;
  font-size: 0.83rem;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 8px;
  word-break: break-all;
}

.code-block {
  background: #0a0e18;
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 16px;
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
  color: #7dd3fc;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.6;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-content {
    margin-left: 0;
  }
  .topbar {
    left: 0;
  }
  .charts-grid {
    grid-template-columns: 1fr;
  }
  .adm-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .chat-sidebar {
    display: none;
  }
  .adm-modal {
    margin: 10px;
  }
  .page-content {
    padding: 16px;
  }
}

@media (max-width: 480px) {
  .adm-stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInRight {
  from { opacity: 0; transform: translateX(100%); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.spin { animation: spin 1s linear infinite; }

/* ===== LOADER ===== */
.adm-loader {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.adm-loader::after {
  content: '';
  width: 28px;
  height: 28px;
  border: 3px solid var(--card-border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ===== COPY BTN ===== */
.copy-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color var(--transition);
}
.copy-btn:hover { color: var(--blue); }

/* ===== SWITCH TOGGLE ===== */
.adm-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
}
.adm-switch input { opacity: 0; width: 0; height: 0; }
.adm-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--card-border);
  border-radius: 24px;
  transition: background var(--transition);
}
.adm-switch-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform var(--transition);
}
.adm-switch input:checked + .adm-switch-slider { background: var(--blue); }
.adm-switch input:checked + .adm-switch-slider::before { transform: translateX(18px); }

/* ===== DIVIDER ===== */
.adm-divider {
  height: 1px;
  background: var(--card-border);
  margin: 20px 0;
}

/* ===== CAMPAIGN PROGRESS ===== */
.campaign-progress-row {
  padding: 16px 20px;
  background: rgba(59,130,246,0.05);
  border-radius: var(--radius);
  border: 1px solid rgba(59,130,246,0.2);
  margin-bottom: 8px;
}

/* ===== DATE FILTER BAR (dashboard, deposits, leads) ===== */
.df-filter-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.df-btn {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 5px 13px;
  border-radius: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: .72rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.df-btn:hover { border-color: var(--blue); color: var(--text); }
.df-btn.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.df-input {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 5px 8px;
  border-radius: 6px;
  font-family: 'Poppins', sans-serif;
  font-size: .72rem;
  cursor: pointer;
  height: 30px;
}
.df-input:focus { outline: none; border-color: var(--blue); }
.df-sep { color: var(--text-muted); font-size: .72rem; }
.df-label { font-size: .72rem; color: var(--text-muted); font-weight: 500; }
