/* ============================================================
   Phoenix CRM — Core Stylesheet
   Customizable via CSS variables set by theme settings
   ============================================================ */

:root {
  --phoenix-primary:    #2563eb;
  --phoenix-secondary:  #1e40af;
  --phoenix-accent:     #f59e0b;
  --phoenix-sidebar:    #0f172a;
  --phoenix-sidebar-w:  260px;
  --phoenix-header-h:   60px;
  --phoenix-text:       #1e293b;
  --phoenix-muted:      #64748b;
  --phoenix-border:     #e2e8f0;
  --phoenix-bg:         #f1f5f9;
  --phoenix-card-bg:    #ffffff;
  --phoenix-success:    #16a34a;
  --phoenix-warning:    #d97706;
  --phoenix-danger:     #dc2626;
  --phoenix-info:       #0891b2;
  --phoenix-purple:     #7c3aed;
  --phoenix-teal:       #0d9488;
}

/* ── Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: var(--phoenix-text);
  background: var(--phoenix-bg);
  overflow-x: hidden;
}

a { color: var(--phoenix-primary); text-decoration: none; }
a:hover { color: var(--phoenix-secondary); }

/* ── Sidebar ────────────────────────────────────────────── */
#sidebar {
  position: fixed;
  top: 0; left: 0;
  width: var(--phoenix-sidebar-w);
  height: 100vh;
  background: var(--phoenix-sidebar);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  transition: width 0.25s ease, transform 0.25s ease;
  display: flex;
  flex-direction: column;
}

#sidebar .sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  min-height: var(--phoenix-header-h);
  flex-shrink: 0;
}

#sidebar .sidebar-logo img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  border-radius: 6px;
}

#sidebar .sidebar-logo .logo-text {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.3px;
  white-space: nowrap;
}

#sidebar .sidebar-logo .logo-sub {
  font-size: 10px;
  color: rgba(255,255,255,0.4);
  letter-spacing: 1px;
  text-transform: uppercase;
}

/* Sidebar nav */
.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.sidebar-section {
  padding: 12px 20px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: rgba(255,255,255,0.3);
}

.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: rgba(255,255,255,0.65);
  border-radius: 0;
  transition: all 0.15s;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
}

.sidebar-item:hover {
  background: rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.9);
}

.sidebar-item.active {
  background: var(--phoenix-primary);
  color: #fff;
}

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

.sidebar-item .nav-icon {
  width: 18px;
  text-align: center;
  font-size: 15px;
  flex-shrink: 0;
}

.sidebar-item .nav-label {
  font-size: 13.5px;
  font-weight: 500;
}

.sidebar-item .nav-badge {
  margin-left: auto;
  background: var(--phoenix-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* Submenu */
.sidebar-submenu {
  background: rgba(0,0,0,0.15);
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}

.sidebar-submenu.open {
  max-height: 400px;
}

.sidebar-submenu .sidebar-item {
  padding-left: 46px;
  font-size: 13px;
}

.sidebar-toggle-btn {
  margin-left: auto;
  transition: transform 0.2s;
}

.sidebar-item.has-sub.open .sidebar-toggle-btn {
  transform: rotate(90deg);
}

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid rgba(255,255,255,0.08);
  flex-shrink: 0;
}

.sidebar-footer .user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-footer .user-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--phoenix-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  flex-shrink: 0;
  overflow: hidden;
}

.sidebar-footer .user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-footer .user-name {
  font-size: 13px;
  font-weight: 600;
  color: rgba(255,255,255,0.9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer .user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.4);
}

/* ── Header ─────────────────────────────────────────────── */
#header {
  position: fixed;
  top: 0;
  left: var(--phoenix-sidebar-w);
  right: 0;
  height: var(--phoenix-header-h);
  background: #fff;
  border-bottom: 1px solid var(--phoenix-border);
  z-index: 999;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
  transition: left 0.25s;
}

.header-toggle {
  background: none;
  border: none;
  color: var(--phoenix-muted);
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.header-search {
  flex: 1;
  max-width: 340px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 7px 14px 7px 36px;
  border: 1px solid var(--phoenix-border);
  border-radius: 8px;
  font-size: 13px;
  background: var(--phoenix-bg);
  color: var(--phoenix-text);
  outline: none;
  transition: border-color 0.15s;
}

.header-search input:focus {
  border-color: var(--phoenix-primary);
  background: #fff;
}

.header-search .search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--phoenix-muted);
  font-size: 13px;
}

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--phoenix-muted);
  cursor: pointer;
  position: relative;
  transition: background 0.15s;
}

.header-icon-btn:hover {
  background: var(--phoenix-bg);
  color: var(--phoenix-text);
}

.header-icon-btn .notif-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--phoenix-danger);
  border: 2px solid #fff;
}

.header-lang {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--phoenix-muted);
  cursor: pointer;
}

.header-lang select {
  border: none;
  background: none;
  font-size: 12px;
  color: var(--phoenix-muted);
  cursor: pointer;
  outline: none;
}

/* ── Main Content ────────────────────────────────────────── */
#main-content {
  margin-left: var(--phoenix-sidebar-w);
  padding-top: var(--phoenix-header-h);
  min-height: 100vh;
  transition: margin-left 0.25s;
}

.page-body {
  padding: 24px;
}

/* ── Page Header ─────────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--phoenix-text);
  margin: 0;
  line-height: 1.3;
}

.page-header .breadcrumb {
  font-size: 12px;
  color: var(--phoenix-muted);
  margin: 2px 0 0;
}

.page-header .breadcrumb a {
  color: var(--phoenix-muted);
}

.page-header .breadcrumb a:hover {
  color: var(--phoenix-primary);
}

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background: var(--phoenix-card-bg);
  border: 1px solid var(--phoenix-border);
  border-radius: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

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

.card-header h5, .card-header .card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--phoenix-text);
  margin: 0;
}

.card-body {
  padding: 20px;
}

/* ── Stat Cards ──────────────────────────────────────────── */
.stat-card {
  background: #fff;
  border: 1px solid var(--phoenix-border);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: box-shadow 0.15s, transform 0.15s;
}

.stat-card:hover {
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transform: translateY(-1px);
}

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-card .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--phoenix-text);
  line-height: 1;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--phoenix-muted);
  margin-top: 4px;
}

.stat-card .stat-change {
  font-size: 11px;
  font-weight: 600;
  margin-top: 6px;
}

.stat-card .stat-change.up    { color: var(--phoenix-success); }
.stat-card .stat-change.down  { color: var(--phoenix-danger); }

/* ── Tables ──────────────────────────────────────────────── */
.table {
  font-size: 13.5px;
}

.table th {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--phoenix-muted);
  border-bottom-width: 1px;
  padding: 10px 16px;
  white-space: nowrap;
}

.table td {
  padding: 12px 16px;
  vertical-align: middle;
  color: var(--phoenix-text);
}

.table tbody tr:hover {
  background: rgba(37,99,235,0.03);
}

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
}

.bg-purple { background-color: var(--phoenix-purple) !important; }
.bg-teal   { background-color: var(--phoenix-teal) !important; }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  font-size: 13.5px;
  font-weight: 500;
  border-radius: 7px;
  padding: 7px 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s;
}

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

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

.btn-sm {
  font-size: 12px;
  padding: 5px 11px;
}

.btn-icon {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 7px;
  justify-content: center;
}

/* ── Forms ───────────────────────────────────────────────── */
.form-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--phoenix-text);
  margin-bottom: 5px;
}

.form-control, .form-select {
  font-size: 13.5px;
  border-color: var(--phoenix-border);
  border-radius: 7px;
  padding: 8px 12px;
  color: var(--phoenix-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}

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

.form-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--phoenix-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 24px 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid rgba(37,99,235,0.12);
}

/* ── Pipeline (Placement) ────────────────────────────────── */
.pipeline-stages {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pipeline-col {
  min-width: 240px;
  max-width: 240px;
  background: var(--phoenix-bg);
  border-radius: 10px;
  padding: 12px;
  flex-shrink: 0;
}

.pipeline-col-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.pipeline-col-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--phoenix-muted);
}

.pipeline-count {
  background: rgba(0,0,0,0.08);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  color: var(--phoenix-muted);
}

.pipeline-card {
  background: #fff;
  border: 1px solid var(--phoenix-border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}

.pipeline-card:hover {
  box-shadow: 0 3px 10px rgba(0,0,0,0.08);
  border-color: var(--phoenix-primary);
}

.pipeline-card .pc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--phoenix-text);
}

.pipeline-card .pc-course {
  font-size: 11px;
  color: var(--phoenix-muted);
  margin-top: 2px;
}

.pipeline-card .pc-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
}

/* Stage dots */
.stage-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
.stage-inquiry        { background: #94a3b8; }
.stage-profile        { background: #3b82f6; }
.stage-shortlisting   { background: #8b5cf6; }
.stage-application    { background: #f59e0b; }
.stage-offer          { background: #10b981; }
.stage-visa           { background: #0891b2; }
.stage-departure      { background: #6366f1; }
.stage-enrolled       { background: #16a34a; }

/* ── Alerts ──────────────────────────────────────────────── */
.alert {
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  padding: 12px 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.alert-dismissible .btn-close {
  padding: 12px;
}

/* ── Notifications dropdown ──────────────────────────────── */
.notif-dropdown {
  width: 340px;
  padding: 0;
  border: 1px solid var(--phoenix-border);
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.12);
}

.notif-item {
  display: flex;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--phoenix-border);
  transition: background 0.1s;
  cursor: pointer;
}

.notif-item:hover {
  background: var(--phoenix-bg);
}

.notif-item.unread {
  background: rgba(37,99,235,0.04);
}

.notif-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* ── Profile avatar ──────────────────────────────────────── */
.avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.avatar-sm  { width: 30px;  height: 30px;  font-size: 11px; }
.avatar-md  { width: 40px;  height: 40px;  font-size: 14px; }
.avatar-lg  { width: 56px;  height: 56px;  font-size: 18px; }
.avatar-xl  { width: 80px;  height: 80px;  font-size: 24px; }

/* ── Collapsed sidebar ───────────────────────────────────── */
body.sidebar-collapsed #sidebar {
  width: 60px;
}

body.sidebar-collapsed #sidebar .logo-text,
body.sidebar-collapsed #sidebar .logo-sub,
body.sidebar-collapsed #sidebar .nav-label,
body.sidebar-collapsed #sidebar .nav-badge,
body.sidebar-collapsed #sidebar .sidebar-section,
body.sidebar-collapsed #sidebar .sidebar-toggle-btn,
body.sidebar-collapsed #sidebar .user-name,
body.sidebar-collapsed #sidebar .user-role,
body.sidebar-collapsed #sidebar .sidebar-submenu {
  display: none;
}

body.sidebar-collapsed #sidebar .sidebar-item {
  justify-content: center;
  padding: 9px 0;
}

body.sidebar-collapsed #sidebar .sidebar-logo {
  justify-content: center;
  padding: 18px 0;
}

body.sidebar-collapsed #sidebar .sidebar-footer .user-info {
  justify-content: center;
}

body.sidebar-collapsed #main-content,
body.sidebar-collapsed #header {
  margin-left: 60px;
  left: 60px;
}

/* ── WhatsApp Chat ───────────────────────────────────────── */
.chat-container {
  display: flex;
  height: calc(100vh - 140px);
  border: 1px solid var(--phoenix-border);
  border-radius: 10px;
  overflow: hidden;
  background: #fff;
}

.chat-sidebar {
  width: 300px;
  border-right: 1px solid var(--phoenix-border);
  overflow-y: auto;
  flex-shrink: 0;
}

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

.chat-messages {
  flex: 1;
  padding: 16px;
  overflow-y: auto;
  background: #f0f4f8;
}

.chat-bubble {
  max-width: 65%;
  margin-bottom: 12px;
}

.chat-bubble.out {
  margin-left: auto;
}

.bubble-body {
  padding: 9px 13px;
  border-radius: 10px;
  font-size: 13.5px;
  line-height: 1.5;
}

.chat-bubble.in .bubble-body {
  background: #fff;
  border-radius: 2px 10px 10px 10px;
}

.chat-bubble.out .bubble-body {
  background: #dcf8c6;
  border-radius: 10px 10px 2px 10px;
}

.bubble-time {
  font-size: 10.5px;
  color: var(--phoenix-muted);
  margin-top: 2px;
  text-align: right;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 768px) {
  #sidebar {
    transform: translateX(-100%);
    z-index: 1050;
  }

  #sidebar.show {
    transform: translateX(0);
  }

  #main-content, #header {
    margin-left: 0;
    left: 0;
  }

  .pipeline-stages {
    flex-direction: column;
  }

  .pipeline-col {
    max-width: 100%;
    min-width: 0;
  }

  body.sidebar-collapsed #sidebar {
    width: var(--phoenix-sidebar-w);
  }

  body.sidebar-collapsed #main-content,
  body.sidebar-collapsed #header {
    margin-left: 0;
    left: 0;
  }
}

/* ── Utils ───────────────────────────────────────────────── */
.text-muted  { color: var(--phoenix-muted) !important; }
.text-small  { font-size: 12px; }
.fw-600      { font-weight: 600; }
.gap-2       { gap: 8px; }

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(2px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Scrollbar */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ── Overflow fix — prevent tables from blowing out the viewport ─────────── */
#main-content {
  overflow-x: hidden;
  max-width: calc(100vw - var(--phoenix-sidebar-w));
}
.page-body {
  overflow-x: hidden;
}
.table-responsive {
  max-width: 100%;
}
.table td, .table th {
  max-width: 220px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Name column with avatar can be a bit wider */
.table td:first-child { max-width: 240px; }
/* Actions column never truncates */
.table td:last-child  { max-width: none; white-space: nowrap; }
/* Allow the updates / notes columns to wrap */
.table td.text-wrap   { white-space: normal; max-width: 280px; }

/* ── Lead Drawer (slide-in panel from right) ─────────────────────────────── */
.lead-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 1040;
  transition: opacity 0.25s;
}
.lead-drawer-backdrop.open { display: block; }

.lead-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: 420px;
  max-width: 100vw;
  background: var(--phoenix-card-bg);
  box-shadow: -4px 0 32px rgba(0,0,0,0.15);
  z-index: 1045;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4,0,0.2,1);
  overflow: hidden;
}
.lead-drawer.open { transform: translateX(0); }

.lead-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--phoenix-border);
  flex-shrink: 0;
}
.lead-drawer-header .ld-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--phoenix-text);
}
.lead-drawer-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding: 10px 20px;
  background: var(--phoenix-bg);
  font-size: 12.5px;
  color: var(--phoenix-muted);
  border-bottom: 1px solid var(--phoenix-border);
  flex-shrink: 0;
}
.lead-drawer-meta i { margin-right: 4px; }
.lead-drawer-actions {
  display: flex;
  gap: 8px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--phoenix-border);
  flex-shrink: 0;
  flex-wrap: wrap;
  align-items: center;
}
.lead-drawer-updates {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
}
.lead-drawer-compose {
  flex-shrink: 0;
  padding: 12px 20px;
  border-top: 1px solid var(--phoenix-border);
  background: var(--phoenix-card-bg);
}
.lead-drawer-compose textarea {
  width: 100%;
  resize: none;
  font-size: 13px;
  border: 1px solid var(--phoenix-border);
  border-radius: 8px;
  padding: 8px 12px;
  outline: none;
  font-family: inherit;
  color: var(--phoenix-text);
  background: var(--phoenix-bg);
  margin-bottom: 8px;
  transition: border-color 0.15s;
}
.lead-drawer-compose textarea:focus { border-color: var(--phoenix-primary); background: #fff; }

/* Update timeline item */
.update-item {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.update-item .update-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--phoenix-primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}
.update-item .update-body {
  flex: 1;
  min-width: 0;
}
.update-item .update-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  margin-bottom: 4px;
}
.update-item .update-text {
  background: var(--phoenix-bg);
  border: 1px solid var(--phoenix-border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.5;
}

/* Row hover to hint it's clickable */
.leads-table tbody tr {
  cursor: pointer;
  transition: background 0.12s;
}
.leads-table tbody tr:hover td:first-child .ld-row-name {
  color: var(--phoenix-primary);
  text-decoration: underline;
}

/* ── Dashboard widget customizer ─────────────────────────────────────────── */
.dash-widget-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--phoenix-border);
  font-size: 13px;
}
.dash-widget-toggle:last-child { border-bottom: none; }

@media (max-width: 768px) {
  .lead-drawer { width: 100vw; }
  #main-content { max-width: 100vw; }
}
