/* FORTVISION Posts — Styles (LTR English) */

/* Login Screen */
/* ── App loading splash ── */
.app-loading-screen {
  position: fixed; inset: 0; z-index: 99999;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 36px;
  background: linear-gradient(135deg, #0f1623 0%, #1a2540 50%, #0f1623 100%);
  transition: opacity .35s ease, transform .35s ease;
}
.app-loading-screen--out { opacity: 0; pointer-events: none; }
.app-loading-logo { height: 38px; width: auto; filter: brightness(1); animation: appLogoFadeIn .5s ease both; }
@keyframes appLogoFadeIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes dialerPulse { 0% { transform: scale(1); opacity: .7; } 70% { transform: scale(1.55); opacity: 0; } 100% { transform: scale(1.55); opacity: 0; } }
@keyframes dialerBlink { 0%,100% { opacity: 1; } 50% { opacity: .25; } }
.app-loading-spinner { display: flex; gap: 8px; }
.app-loading-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #359BFF;
  animation: appDotBounce 1.2s ease-in-out infinite;
}
.app-loading-dot:nth-child(2) { animation-delay: .2s; background: #8b5cf6; }
.app-loading-dot:nth-child(3) { animation-delay: .4s; background: #25BA64; }
@keyframes appDotBounce {
  0%, 80%, 100% { transform: scale(0.7); opacity: .5; }
  40% { transform: scale(1.2); opacity: 1; }
}

/* ── Login (shadcn-style centered card) ─────────────────────────────────────── */
.login-screen { display: flex; align-items: center; justify-content: center; min-height: 100vh; position: fixed; inset: 0; z-index: 9999; background: #f4f5f7; }
.login-screen.hidden { display: none; }
.login-card { width: 400px; max-width: calc(100vw - 32px); background: #ffffff; border: 1px solid #e5e7eb; border-radius: 14px; padding: 36px 34px; box-shadow: 0 10px 40px rgba(16,24,40,.08); }
.login-logo { display: flex; align-items: center; justify-content: center; margin-bottom: 18px; }
.login-logo-img { height: 34px; width: auto; object-fit: contain; }
.login-title { font-size: 1.4rem; font-weight: 700; color: #111827; margin: 0; text-align: center; letter-spacing: -.01em; }
.login-subtitle { text-align: center; font-size: .9rem; color: #6b7280; margin: 6px 0 24px; }
.login-error { background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; padding: 10px 14px; border-radius: 8px; font-size: .82rem; margin-bottom: 16px; text-align: center; }
.login-error.hidden { display: none; }
.login-field { margin-bottom: 16px; }
.login-field label { display: block; font-size: .82rem; font-weight: 500; color: #374151; margin-bottom: 7px; }
.login-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 7px; }
.login-label-row label { margin-bottom: 0; }
.login-forgot { font-size: .8rem; color: #6b7280; text-decoration: none; }
.login-forgot:hover { color: #111827; text-decoration: underline; }
.login-field input { width: 100%; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: #111827; font-size: .9rem; outline: none; box-sizing: border-box; transition: border-color .15s, box-shadow .15s; }
.login-field input::placeholder { color: #9ca3af; }
.login-field input:focus { border-color: #111827; box-shadow: 0 0 0 3px rgba(17,24,39,.08); }
.login-btn { width: 100%; padding: 11px; border: none; border-radius: 8px; font-size: .9rem; font-weight: 600; cursor: pointer; transition: opacity .15s, transform .1s; background: #111827; color: #fff; }
.login-btn:hover { opacity: .9; }
.login-btn:active { transform: translateY(1px); }
.login-btn:disabled { opacity: .5; cursor: not-allowed; }
.login-divider { display: flex; align-items: center; margin: 20px 0 16px; gap: 12px; }
.login-divider::before, .login-divider::after { content: ''; flex: 1; height: 1px; background: #e5e7eb; }
.login-divider span { font-size: .78rem; color: #9ca3af; white-space: nowrap; }
.login-social { display: flex; gap: 10px; }
.login-social-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; color: #374151; font-size: .86rem; font-weight: 500; cursor: pointer; transition: background .15s, border-color .15s; }
.login-social-btn:hover { background: #f9fafb; border-color: #9ca3af; }
.login-social-btn:disabled { opacity: .55; cursor: not-allowed; }
.login-footer { text-align: center; font-size: .85rem; color: #6b7280; margin: 22px 0 0; }
.login-footer a { color: #111827; font-weight: 600; text-decoration: none; }
.login-footer a:hover { text-decoration: underline; }

/* Sidebar user/logout */
.sidebar-user-email { font-size: .7rem; color: rgba(255,255,255,.45); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-name  { font-size: .78rem; font-weight: 600; color: rgba(255,255,255,.9); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; line-height: 1.3; }
.sidebar-user-actions { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.sidebar-logout-btn { background: none; border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.5); font-size: .72rem; padding: 4px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; transition: all .15s; }
.sidebar-logout-btn:hover { border-color: #ef4444; color: #ef4444; }
.sidebar-disconnect-btn { background: none; border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.5); font-size: .72rem; padding: 4px 10px; border-radius: 6px; cursor: pointer; white-space: nowrap; transition: all .15s; display: inline-flex; align-items: center; gap: 4px; }
.sidebar-disconnect-btn:hover { border-color: #f59e0b; color: #f59e0b; }
.sidebar-signout-btn { flex-shrink: 0; background: none; border: none; color: rgba(255,255,255,.35); cursor: pointer; padding: 5px; border-radius: 6px; display: flex; align-items: center; transition: all .15s; margin-left: auto; }
.sidebar-signout-btn:hover { color: #ef4444; background: rgba(239,68,68,.12); }

:root {
  --font: 'Mulish', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bg: #F5F7FA; --bg-secondary: #FFFFFF; --bg-card: #FFFFFF; --bg-card-hover: #F8FAFA;
  --bg-input: #F8FAFA; --bg-elevated: #F8FAFA;
  --border: #E1E1E1; --border-hover: #D2D2D2; --border-focus: #359BFF;
  --text: #2C454A; --text-secondary: #808080; --text-muted: #949D9E; --text-placeholder: #B0B0B0;
  --primary: #359BFF; --primary-hover: #2080E0; --primary-glow: rgba(53,155,255,.12);
  --accent: #1a1a1a; --accent-hover: #333;
  --accent-blue: #359BFF; --accent-purple: #8b5cf6; --accent-pink: #ec4899; --accent-green: #22c55e;
  --facebook: #1877f2; --instagram: #e4405f; --linkedin: #0a66c2; --tiktok: #00f2ea; --meta: #0081fb;
  --radius: 8px; --radius-sm: 6px; --radius-lg: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,.06); --shadow-md: 0 2px 4px rgba(0,0,0,.11);
  --shadow-lg: 2px 2px 20px rgba(107,106,106,.08);
  --sidebar-w: 240px;
  --sidebar-w-collapsed: 60px;
  --sidebar-bg: #0f172a;
  --nav-active-bg: rgba(255,255,255,.1);
  --nav-hover-bg: rgba(255,255,255,.06);
  --nav-text: rgba(255,255,255,.6);
  --nav-text-active: #ffffff;
  --success: #22c55e; --error: #ef4444; --danger: #ef4444; --topbar-h: 60px;
  --transition: 200ms cubic-bezier(.4,0,.2,1);
  --spark-color: #91DBFF;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.7; direction: ltr; }

/* Background */
.bg-glow { display: none; }

/* Layout */
#app { display: flex; min-height: 100vh; position: relative; z-index: 1; }
.sidebar {
  width: var(--sidebar-w); background: var(--sidebar-bg); border-right: none;
  box-shadow: 1px 0 0 rgba(255,255,255,.06);
  display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100; transition: width .22s ease, transform var(--transition); overflow: hidden;
}
.sidebar-header {
  padding: 18px 16px 14px; display: flex; align-items: center;
  justify-content: space-between; gap: 8px; min-height: 62px;
}
.logo { display: flex; align-items: center; overflow: hidden; flex: 1; min-width: 0; }
.logo-text { font-weight: 700; font-size: 1.05rem; letter-spacing: -0.02em; color: #fff; }
.logo-img { height: 26px; width: auto; object-fit: contain; display: block; transition: opacity .18s; white-space: nowrap; filter: brightness(0) invert(1); }

/* Collapse toggle button */
.sidebar-collapse-btn {
  flex-shrink: 0; background: none; border: 1px solid rgba(255,255,255,.12); border-radius: 6px;
  width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: rgba(255,255,255,.4); transition: all .15s; padding: 0;
}
.sidebar-collapse-btn:hover { background: rgba(255,255,255,.08); color: #fff; border-color: rgba(255,255,255,.25); }
.collapse-icon-collapse { display: none; }
.collapse-icon-expand { display: block; }

/* ── Collapsed sidebar ── */
.sidebar.collapsed { width: var(--sidebar-w-collapsed); }
.sidebar.collapsed .logo-img { opacity: 0; width: 0; }
.sidebar.collapsed .collapse-icon-expand { display: none; }
.sidebar.collapsed .collapse-icon-collapse { display: block; }
.sidebar.collapsed .nav-item span { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 10px; }
.sidebar.collapsed .sidebar-footer { padding: 10px 6px; }
.sidebar.collapsed .sidebar-user-info { display: none; }
.sidebar.collapsed .sidebar-user { justify-content: center; padding: 12px 6px; }
.sidebar.collapsed .sidebar-user-avatar { margin: 0 auto; }
.sidebar.collapsed .sidebar-signout-btn { display: none; }

/* Tooltip on collapsed nav items */
.sidebar.collapsed .nav-item { position: relative; }
.sidebar.collapsed .nav-item::after {
  content: attr(data-tooltip);
  position: absolute; left: calc(100% + 10px); top: 50%; transform: translateY(-50%);
  background: #1e293b; color: #fff; font-size: .78rem; font-weight: 500;
  padding: 5px 10px; border-radius: 6px; white-space: nowrap;
  pointer-events: none; opacity: 0; transition: opacity .15s;
  box-shadow: 0 4px 12px rgba(0,0,0,.35); z-index: 200; border: 1px solid rgba(255,255,255,.08);
}
.sidebar.collapsed .nav-item:hover::after { opacity: 1; }

.login-logo-img { height: 40px; width: auto; object-fit: contain; display: block; margin: 0 auto 8px; }

/* Nav */
.sidebar-nav { flex: 1; padding: 8px 10px; display: flex; flex-direction: column; gap: 1px; overflow-y: auto; overflow-x: hidden; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px;
  border-radius: 7px; color: var(--nav-text); text-decoration: none;
  font-size: .84rem; font-weight: 500; transition: all .15s; cursor: pointer;
}
.nav-item:hover { background: var(--nav-hover-bg); color: rgba(255,255,255,.85); }
.nav-item.active { background: var(--nav-active-bg); color: var(--nav-text-active); font-weight: 600; }
.nav-item svg { flex-shrink: 0; opacity: .75; }
.nav-item.active svg { opacity: 1; }
.nav-item:hover svg { opacity: .9; }

/* Footer / User */
.sidebar-footer { padding: 12px 10px; border-top: 1px solid rgba(255,255,255,.07); }
.api-status { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: rgba(255,255,255,.4); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.status-dot.online { background: #22c55e; box-shadow: 0 0 6px rgba(34,197,94,.6); }
.status-dot.offline { background: rgba(255,255,255,.25); }
.status-dot.demo { background: #f59e0b; box-shadow: 0 0 6px rgba(245,158,11,.5); }
.main-content { flex: 1; margin-left: var(--sidebar-w); min-height: 100vh; display: flex; flex-direction: column; width: calc(100vw - var(--sidebar-w)); max-width: calc(100vw - var(--sidebar-w)); overflow-x: hidden; transition: margin-left .22s ease, width .22s ease, max-width .22s ease; position: relative; }
.main-content.lp-builder-open { overflow: hidden; }
.sidebar.collapsed ~ .main-content { margin-left: var(--sidebar-w-collapsed); width: calc(100vw - var(--sidebar-w-collapsed)); max-width: calc(100vw - var(--sidebar-w-collapsed)); }

/* User section in footer */
.sidebar-user {
  display: flex; align-items: center; gap: 10px; padding: 10px 8px;
  border-radius: 8px; transition: background .15s; cursor: default;
}
.sidebar-user:hover { background: rgba(255,255,255,.05); }
.sidebar-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: .8rem; font-weight: 700; flex-shrink: 0;
  text-transform: uppercase; letter-spacing: .03em;
}
.sidebar-user-info { flex: 1; min-width: 0; }

/* Top Bar */
.top-bar { height: var(--topbar-h); padding: 0 24px; display: flex; align-items: center; gap: 16px; border-bottom: 1px solid #E1E1E1; background: #fff; position: sticky; top: 0; z-index: 50; }
.menu-toggle { display: none; background: none; border: none; color: var(--text-secondary); cursor: pointer; padding: 4px; border-radius: 6px; }
.menu-toggle:hover { color: var(--text); background: var(--bg-card-hover); }
.page-title { font-size: 1rem; font-weight: 600; white-space: nowrap; }
.global-ctx { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.global-ctx:empty { display: none; }
.global-ctx-select { padding: 6px 10px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; color: #374151; font-size: 13px; font-weight: 500; min-width: 180px; max-width: 280px; outline: none; cursor: pointer; transition: border-color .15s; text-overflow: ellipsis; }
.global-ctx-select:focus { border-color: #1a1a1a; box-shadow: 0 0 0 2px rgba(26,26,26,.08); }
.global-ctx-label { font-size: 11px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .5px; white-space: nowrap; }
.global-ctx-group { display: flex; align-items: center; gap: 6px; }
.global-ctx-switch-btn { display: flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid var(--border-color, #e5e7eb); border-radius: 7px; background: var(--card-bg, #fff); cursor: pointer; font-size: 13px; font-weight: 500; color: var(--text-primary, #374151); max-width: 260px; transition: all .15s; }
.global-ctx-switch-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.global-ctx-switch-btn:hover { background: var(--bg-hover, #f3f4f6); border-color: #1a1a1a; color: #1a1a1a; }
.global-ctx-sep { width: 1px; height: 24px; background: #e5e7eb; }
.top-actions { margin-inline-start: auto; display: flex; gap: 8px; flex-shrink: 0; }

/* Global account selector in top bar */
.global-acct-wrap { position: relative; }
.global-acct-btn { display: flex; align-items: center; gap: 7px; padding: 6px 12px; border-radius: 8px; border: 1.5px solid #d1d5db; background: #fff; color: #1a1a1a; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; white-space: nowrap; max-width: 260px; }
.global-acct-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 200px; }
.global-acct-btn:hover { background: #ede9fe; border-color: #a5b4fc; }
.global-acct-btn--empty { border-color: #e5e7eb; background: #f9fafb; color: #6b7280; }
.global-acct-btn--empty:hover { border-color: #1a1a1a; color: #1a1a1a; background: #f5f5f5; }
.global-acct-chevron { transition: transform .2s; flex-shrink: 0; }
.global-ctx-connect-btn { display: flex; align-items: center; gap: 3px; padding: 5px 8px; border: 1px solid #e5e7eb; border-radius: 7px; background: #fff; cursor: pointer; transition: background .15s; flex-shrink: 0; }
.global-ctx-connect-btn:hover { background: #f3f4f6; }
.btn-icon { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: transparent; border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text-secondary); cursor: pointer; transition: all var(--transition); }
.btn-icon:hover { background: var(--bg-card-hover); color: var(--text); border-color: var(--border-hover); }

/* Sections */
.section { padding: 20px 16px; width: 100%; }
.section.hidden { display: none; }
.hero { text-align: center; margin-bottom: 32px; }
.hero-title { font-size: 2rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.3; margin-bottom: 10px; }
.gradient-text { color: #359BFF; -webkit-text-fill-color: #359BFF; }
.hero-subtitle { color: var(--text-secondary); font-size: 1rem; max-width: 600px; margin: 0 auto; line-height: 1.7; }

/* Inputs (base) */
input[type="text"], input[type="password"], select, textarea { width: 100%; height: 44px; padding: 0 14px; background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--text); font-family: var(--font); font-size: .9rem; transition: all var(--transition); outline: none; direction: ltr; }
input::placeholder, textarea::placeholder { color: var(--text-placeholder); }
input:focus, select:focus, textarea:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--primary-glow); }
select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e"); background-position: right 10px center; background-repeat: no-repeat; background-size: 20px; padding-right: 36px; }


/* Buttons */
.btn-primary { background: #359BFF; color: #fff; border: none; border-radius: 4px; padding: 10px 20px; font-weight: 700; font-size: 13px; cursor: pointer; transition: all .2s; display: inline-flex; align-items: center; gap: 6px; box-shadow: 0 2px 4px rgba(0,0,0,.11); }
.btn-primary:hover { background: #2080E0; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(53,155,255,.25); }
.btn-primary:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-secondary { background: #fff; color: #2C454A; border: 1px solid #D2D2D2; border-radius: 4px; padding: 10px 20px; font-weight: 700; font-size: 13px; cursor: pointer; transition: all .2s; display: inline-flex; align-items: center; gap: 6px; }
.btn-secondary:hover { border-color: #359BFF; color: #359BFF; }
.btn-sm { padding: 6px 12px; font-size: .78rem; }
.btn-lg { padding: 14px 28px; font-size: .92rem; }

/* Toast */
/* Connect Platforms Modal (auth only) */
.acct-picker-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); z-index: 9000; display: flex; align-items: center; justify-content: center; padding: 16px; }
.acct-picker-overlay.hidden { display: none; }
.acct-picker-modal--auth { background: #fff; border-radius: 16px; box-shadow: 0 24px 80px rgba(0,0,0,.18); padding: 28px 32px 28px; width: 1100px; max-width: calc(100vw - 32px); max-height: calc(100vh - 32px); overflow-y: auto; display: flex; flex-direction: column; }
.acct-picker-auth-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.acct-picker-title { font-size: 18px; font-weight: 600; color: #111827; margin: 0; }
.acct-picker-auth-close { background: none; border: none; cursor: pointer; color: #9ca3af; padding: 4px; border-radius: 6px; display: flex; align-items: center; transition: color .15s; }
.acct-picker-auth-close:hover { color: #374151; }
.acct-picker-sub { font-size: 13px; color: #6b7280; margin: 0 0 16px; }
.acct-picker-auth-body { display: flex; flex-direction: column; gap: 10px; }
.acct-picker-platforms-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 600px) { .acct-picker-platforms-row { grid-template-columns: 1fr; } }
.acct-picker-connect-row { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border: 1.5px solid #e5e7eb; border-radius: 12px; font-size: 13px; color: var(--text); }
.acct-picker-connect-row svg { flex-shrink: 0; }
.acct-picker-connect-row span { flex: 1; font-weight: 500; }
.acct-picker-connect-btn { padding: 6px 12px; border-radius: 7px; font-size: 12px; font-weight: 500; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); cursor: pointer; white-space: nowrap; transition: background .15s; }
.acct-picker-connect-btn:hover { background: var(--bg-hover); }
.acct-picker-connect-btn--danger { color: #ef4444; border-color: #fca5a5; }
.acct-picker-connect-btn--danger:hover { background: #fef2f2; }
.acct-picker-mcc-row { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #f8fafc; border-radius: 8px; border: 1px dashed #e5e7eb; }
.acct-picker-mcc-input { flex: 1; padding: 5px 10px; border-radius: 6px; border: 1px solid var(--border); background: #fff; color: var(--text); font-size: 12px; outline: none; transition: border-color .15s; }
.acct-picker-mcc-input:focus { border-color: #1a1a1a; }
.acct-picker-mcc-input::placeholder { color: var(--text-muted); }
.acct-picker-token-warn { display: flex; align-items: flex-start; gap: 6px; padding: 8px 10px; border-radius: 8px; background: #fef9c3; border: 1px solid #fde047; color: #854d0e; font-size: 11px; line-height: 1.5; }
.acct-picker-token-warn svg { flex-shrink: 0; margin-top: 1px; color: #ca8a04; }
.acct-picker-token-warn a { color: #1d4ed8; text-decoration: underline; }
.acct-picker-done-btn { padding: 10px 24px; border-radius: 9px; font-size: 14px; font-weight: 600; border: none; background: #f3f4f6; color: #374151; cursor: pointer; transition: background .15s; }
.acct-picker-done-btn:hover { background: #e5e7eb; }
/* Two-column accounts grid */
.picker-columns-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 4px; }
.picker-columns-grid--single { grid-template-columns: 1fr; }
.picker-columns-grid--three  { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 860px) { .picker-columns-grid--three { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) { .picker-columns-grid { grid-template-columns: 1fr; } }
.picker-col { display: flex; flex-direction: column; border: 1.5px solid #e5e7eb; border-radius: 12px; overflow: hidden; min-height: 200px; }
.picker-col-header { display: flex; align-items: center; gap: 7px; padding: 10px 14px; background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
.picker-col-header-label { font-size: .8rem; font-weight: 700; color: #374151; flex: 1; }
.picker-col-count { font-size: .72rem; color: #9ca3af; font-weight: 400; }
.picker-col-controls { display: flex; align-items: center; gap: 5px; padding: 7px 10px; border-bottom: 1px solid #f3f4f6; background: #fff; }
.picker-col-search { flex: 1; padding: 5px 9px; border-radius: 7px; border: 1px solid #d1d5db; background: #f9fafb; font-size: .75rem; color: #374151; outline: none; transition: border-color .15s; }
.picker-col-search:focus { border-color: #374151; background: #fff; }
.picker-col-action { padding: 4px 9px; border-radius: 6px; font-size: .7rem; font-weight: 500; border: 1px solid #e5e7eb; background: none; color: #6b7280; cursor: pointer; white-space: nowrap; transition: background .12s; }
.picker-col-action:hover { background: #f3f4f6; color: #374151; }
.picker-col-list { flex: 1; overflow-y: auto; max-height: 300px; }
.picker-footer-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #f3f4f6; }
.acct-picker-apply-btn { padding: 10px 28px; border-radius: 9px; font-size: .85rem; font-weight: 600; border: none; background: #1a1a1a; color: #fff; cursor: pointer; transition: background .15s; }
.acct-picker-apply-btn:hover { background: #374151; }

/* Ad accounts list inside picker */
.acct-picker-section-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 4px 0 6px; }
.acct-picker-section-header > span { font-size: .75rem; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; }
.acct-picker-search { flex: 1; max-width: 200px; padding: 5px 10px; border-radius: 7px; border: 1px solid #d1d5db; background: #f9fafb; font-size: .78rem; color: #374151; outline: none; transition: border-color .15s; }
.acct-picker-search:focus { border-color: #1a1a1a; background: #fff; }
.acct-picker-accounts-list { max-height: 280px; overflow-y: auto; border: 1px solid #e5e7eb; border-radius: 10px; margin-bottom: 8px; }
.acct-picker-group-label { display: flex; align-items: center; gap: 6px; padding: 7px 12px 5px; font-size: .72rem; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid #f3f4f6; background: #f9fafb; position: sticky; top: 0; }
.acct-picker-acct-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; transition: background .12s; border-bottom: 1px solid #f3f4f6; }
.acct-picker-acct-row:last-child { border-bottom: none; }
.acct-picker-acct-row:hover { background: #f9fafb; }
.acct-picker-acct-row.checked { background: #f0fdf4; }
.acct-picker-acct-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.acct-picker-acct-name { font-size: .83rem; font-weight: 500; color: #1f2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-picker-acct-id { font-size: .72rem; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-picker-empty { padding: 16px 12px; text-align: center; font-size: .8rem; color: #9ca3af; }
.acct-picker-apply-btn { width: 100%; padding: 10px; border-radius: 9px; font-size: .85rem; font-weight: 600; border: none; background: #1a1a1a; color: #fff; cursor: pointer; margin-bottom: 6px; transition: background .15s; }
.acct-picker-apply-btn:hover { background: #333; }
.acct-picker-modal--auth { max-height: 90vh; overflow-y: auto; }
.acct-picker-redirect-hint { display: flex; flex-direction: column; gap: 6px; background: #fffbeb; border: 1px solid #fde68a; border-radius: 10px; padding: 10px 13px; font-size: .75rem; color: #92400e; line-height: 1.5; }
.acct-picker-redirect-hint > svg { flex-shrink: 0; }
.acct-picker-redirect-hint a { color: #b45309; font-weight: 600; }
.acct-picker-redirect-hint > * { display: flex; align-items: center; gap: 6px; }
.acct-picker-redirect-uri { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid #fcd34d; border-radius: 7px; padding: 5px 8px 5px 10px; margin-top: 2px; }
.acct-picker-redirect-uri code { flex: 1; font-size: .73rem; font-family: 'SF Mono','Consolas',monospace; color: #1e293b; word-break: break-all; user-select: all; }

/* Account Selector Popup (multi-select, used from Leads & init) */
.acct-sel-search-wrap { display: flex; align-items: center; gap: 8px; border: 1.5px solid #e5e7eb; border-radius: 10px; padding: 0 12px; height: 40px; margin-bottom: 10px; transition: border-color .15s; }
.acct-sel-search-wrap:focus-within { border-color: #1a1a1a; box-shadow: 0 0 0 2px rgba(26,26,26,.08); }
.acct-sel-search { border: none; outline: none; flex: 1; font-size: 13.5px; color: #374151; background: transparent; }
.acct-sel-list { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; margin-bottom: 2px; }
.acct-sel-section { font-size: 10.5px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .06em; padding: 4px 4px 2px; }
.acct-sel-item { display: flex; align-items: center; gap: 9px; padding: 9px 10px; border: 1.5px solid #e5e7eb; border-radius: 10px; cursor: pointer; transition: all .12s; user-select: none; }
.acct-sel-item:hover { background: #f8fafc; border-color: #c7d2fe; }
.acct-sel-item--checked { border-color: #1a1a1a; background: #f5f5f5; }
.acct-sel-check { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #d1d5db; background: #fff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all .12s; }
.acct-sel-item--checked .acct-sel-check { background: #1a1a1a; border-color: #1a1a1a; }
.acct-sel-icon { flex-shrink: 0; }
.acct-sel-body { flex: 1; min-width: 0; }
.acct-sel-name { font-size: 13.5px; font-weight: 500; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-sel-id { font-size: 11.5px; color: #9ca3af; }
.acct-sel-status { font-size: 11px; font-weight: 500; padding: 2px 8px; border-radius: 9999px; white-space: nowrap; }
.acct-sel-status.active { background: #dcfce7; color: #16a34a; }
.acct-sel-status.inactive { background: #fee2e2; color: #dc2626; }
.acct-sel-empty { padding: 24px; text-align: center; color: #9ca3af; font-size: 13px; }
.acct-sel-link { background: none; border: none; color: #1a1a1a; font-size: 13px; cursor: pointer; text-decoration: underline; padding: 0; }
.acct-sel-footer { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; border-top: 1px solid #f1f5f9; margin-top: 4px; }
.acct-sel-connect-link { display: flex; align-items: center; gap: 5px; background: none; border: none; color: #6b7280; font-size: 12px; font-weight: 500; cursor: pointer; padding: 4px 6px; border-radius: 6px; transition: color .12s; }
.acct-sel-connect-link:hover { color: #374151; background: #f1f5f9; }

/* Ads Manager account selector dropdown */
.am-title-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; flex-wrap: wrap; gap: 10px; }
.am-title-left { display: flex; align-items: center; gap: 12px; }
.am-title-right { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.am-acct-picker-btn { display: flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 9px; border: 1.5px solid #d1d5db; background: #fff; color: #1a1a1a; font-size: 12px; font-weight: 600; cursor: pointer; transition: all .15s; white-space: nowrap; }
.am-acct-picker-btn:hover { background: #f0f4ff; border-color: #6366f1; }
.am-acct-picker-btn--empty { border-color: #e5e7eb; background: #f9fafb; }
.am-acct-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 5px; font-size: 11px; font-weight: 600; }
.am-acct-chip--meta   { background: rgba(24,119,242,.1); color: #1877f2; }
.am-acct-chip--google { background: rgba(66,133,244,.1); color: #2e7d32; }
.am-acct-chip--dv360  { background: rgba(57,73,171,.1);  color: #3949ab; }
.am-account-selector-wrap { position: relative; }
.am-account-selector-btn { display: flex; align-items: center; gap: 7px; padding: 7px 12px; border-radius: 8px; border: 1.5px solid #d1d5db; background: #fff; color: #1a1a1a; font-size: 13px; font-weight: 600; cursor: pointer; transition: all .15s; white-space: nowrap; }
.am-account-selector-btn:hover { background: #ede9fe; border-color: #a5b4fc; }
.am-acct-chevron { transition: transform .2s; }
.am-account-selector-btn[aria-expanded="true"] .am-acct-chevron { transform: rotate(180deg); }
.am-account-dropdown { position: absolute; top: calc(100% + 6px); left: 0; width: 360px; background: #fff; border: 1.5px solid #e5e7eb; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.16); z-index: 500; overflow: hidden; }
.am-account-dropdown.hidden { display: none; }
.am-acct-dd-search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #f1f5f9; }
.am-acct-dd-search input { border: none; outline: none; flex: 1; font-size: 13px; color: #374151; background: transparent; }
.am-acct-dd-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.am-acct-dd-section { font-size: 10.5px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px 4px; }
.am-acct-item { display: flex; align-items: center; gap: 9px; padding: 8px 10px; border-radius: 8px; cursor: pointer; transition: background .12s; }
.am-acct-item:hover { background: #f8fafc; }
.am-acct-item--checked { background: #f5f3ff; }
.am-acct-item--checked:hover { background: #ede9fe; }
.am-acct-item-check { width: 17px; height: 17px; border-radius: 4px; border: 1.5px solid #d1d5db; background: #fff; flex-shrink: 0; display: flex; align-items: center; justify-content: center; transition: all .12s; }
.am-acct-item--checked .am-acct-item-check { background: #1a1a1a; border-color: #1a1a1a; }
.am-acct-item--partial { background: #faf5ff; }
.am-acct-item--partial:hover { background: #f3e8ff; }
.am-acct-item--partial .am-acct-item-check { background: #a78bfa; border-color: #a78bfa; }
.am-acct-item--partial { background: #faf5ff; }
.am-acct-item--partial:hover { background: #f3e8ff; }
.am-acct-item--partial .am-acct-item-check { background: #a78bfa; border-color: #a78bfa; }
.am-acct-item-icon { flex-shrink: 0; }
.am-acct-item-body { flex: 1; min-width: 0; }
.am-acct-item-name { font-size: 13px; font-weight: 500; color: #111827; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-acct-item-id { font-size: 11px; color: #9ca3af; }
.am-acct-dd-empty { padding: 18px 12px; text-align: center; font-size: 13px; color: #9ca3af; }
.am-acct-dd-loading { display: flex; align-items: center; gap: 8px; padding: 10px 10px; font-size: 12px; color: #6b7280; }
.am-acct-dd-connect { background: none; border: none; color: #1a1a1a; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: underline; padding: 0; }
.am-acct-dd-footer { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px; border-top: 1px solid #f1f5f9; }
.am-acct-dd-connect-btn { display: flex; align-items: center; gap: 5px; background: none; border: none; color: #6b7280; font-size: 12px; font-weight: 500; cursor: pointer; padding: 4px 6px; border-radius: 6px; transition: color .12s; }
.am-acct-dd-connect-btn:hover { color: #374151; background: #f1f5f9; }
.am-acct-dd-refresh { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; background: none; border: 1px solid #e5e7eb; border-radius: 6px; cursor: pointer; color: #6b7280; transition: all .12s; }
.am-acct-dd-refresh:hover { background: #f1f5f9; color: #374151; border-color: #d1d5db; }
.am-acct-dd-apply { padding: 7px 16px; border-radius: 7px; background: #1a1a1a; color: #fff; font-size: 13px; font-weight: 600; border: none; cursor: pointer; transition: background .15s; }
.am-acct-dd-apply:hover { background: #333; }
.am-acct-dd-clear { padding: 6px 12px; border-radius: 7px; background: none; border: 1px solid #e5e7eb; color: #6b7280; font-size: 12px; font-weight: 500; cursor: pointer; transition: all .12s; }
.am-acct-dd-clear:hover { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,.05); }

.toast { position: fixed; bottom: 24px; right: 24px; display: flex; align-items: center; gap: 8px; padding: 12px 20px; border-radius: 10px; font-size: .84rem; font-weight: 500; z-index: 10000; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.toast.success { background: rgba(34,197,94,.15); border: 1px solid rgba(34,197,94,.3); color: #22c55e; }
.toast.error { background: rgba(239,68,68,.15); border: 1px solid rgba(239,68,68,.3); color: #ef4444; }
.toast.hidden { display: none; }
.hidden { display: none !important; }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 1000; display: flex; align-items: center; justify-content: center; }
.modal-overlay.hidden { display: none; }

/* Responsive */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main-content { margin-left: 0; }
  .menu-toggle { display: flex; }
  .section { padding: 24px 16px; }
  .hero-title { font-size: 1.5rem; }
}

/* Lead Forms Table */
.lf-forms-table { table-layout: fixed; width: 100%; }
.lf-col-name { width: 28%; }
.lf-col-page { width: 16%; }
.lf-col-status { width: 8%; text-align: center; }
.lf-col-date { width: 10%; white-space: nowrap; }
.lf-col-num { width: 7%; text-align: center; font-weight: 700; }
.lf-col-q { width: 7%; text-align: center; }
.lf-col-locale { width: 7%; text-align: center; }
.lf-form-row { cursor: pointer; transition: background .15s; }
.lf-form-row:hover { background: rgba(99,102,241,.04); }
.lf-form-selected { background: rgba(99,102,241,.08) !important; border-left: 3px solid var(--primary); }
.lf-form-name { font-weight: 600; font-size: .84rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.lf-forms-table td { vertical-align: middle; padding: 10px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; height: 42px; max-height: 42px; box-sizing: border-box; }
.lf-forms-table th { cursor: pointer; user-select: none; padding: 8px; font-size: .75rem; text-transform: uppercase; letter-spacing: .3px; white-space: nowrap; }
.lf-forms-table th:hover { color: var(--primary); }

/* Lead Forms CRM */
.lf-crm-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 18px; }
.lf-stat-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; transition: border-color .2s, box-shadow .2s, transform .2s; position: relative; overflow: hidden; }
.lf-stat-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: #1a1a1a; opacity: 0; transition: opacity .2s; }
.lf-stat-card:hover { border-color: rgba(99,102,241,.3); box-shadow: 0 4px 16px rgba(99,102,241,.08); transform: translateY(-1px); }
.lf-stat-card:hover::before { opacity: 1; }
.lf-stat-label { font-size: .7rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--text-muted); margin-bottom: 6px; }
.lf-stat-value { font-size: 1.6rem; font-weight: 800; color: var(--text-primary); line-height: 1.1; }
.lf-stat-sub { font-size: .73rem; color: var(--text-muted); margin-top: 4px; }

/* Compact 10-block single-row stats bar */
.lf-crm-stats--compact { gap: 6px; }
.lf-stat-card--mini { border-radius: 8px; padding: 7px 10px; }
.lf-stat-card--mini .lf-stat-label { font-size: .6rem; letter-spacing: .3px; margin-bottom: 2px; }
.lf-stat-card--mini .lf-stat-value { font-size: .95rem; font-weight: 700; }
.lf-stat-card--mini .lf-stat-sub   { font-size: .6rem; margin-top: 1px; }

.lf-charts-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 18px; }
.lf-chart-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; transition: border-color .2s, box-shadow .2s; }
.lf-chart-card:hover { border-color: rgba(99,102,241,.2); box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.lf-chart-title { font-size: .82rem; font-weight: 700; color: var(--text-primary); margin-bottom: 12px; display: flex; align-items: center; gap: 6px; }

.lf-bar-chart { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.lf-bar-col { display: flex; flex-direction: column; align-items: center; flex: 1; height: 100%; justify-content: flex-end; position: relative; cursor: pointer; }
.lf-bar { background: var(--primary); border-radius: 3px 3px 0 0; width: 100%; min-width: 8px; transition: height .3s; }
.lf-bar-col:hover .lf-bar { background: var(--primary-hover, #818cf8); }
.lf-bar-label { font-size: .58rem; color: var(--text-muted); margin-top: 4px; white-space: nowrap; }
.lf-bar-count { font-size: .6rem; font-weight: 600; color: var(--text-secondary); position: absolute; top: -14px; }

.lf-h-bars { display: flex; flex-direction: column; gap: 8px; }
.lf-hbar-row { display: flex; align-items: center; gap: 8px; }
.lf-hbar-name { font-size: .74rem; color: var(--text-secondary); width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.lf-hbar-track { flex: 1; height: 18px; background: var(--bg-secondary); border-radius: 4px; overflow: hidden; }
.lf-hbar-fill { height: 100%; background: linear-gradient(90deg, var(--primary), #818cf8); border-radius: 4px; transition: width .4s; }
.lf-hbar-val { font-size: .72rem; font-weight: 700; color: var(--text-primary); width: 30px; text-align: right; }

.lf-platform-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.lf-platform-item { display: flex; align-items: center; gap: 6px; background: var(--bg-secondary); border-radius: 6px; padding: 6px 12px; font-size: .78rem; }
.lf-platform-name { color: var(--text-secondary); }
.lf-platform-count { font-weight: 700; color: var(--text-primary); }

.lf-cpl-list { display: flex; flex-direction: column; gap: 2px; max-height: 140px; overflow-y: auto; }
.lf-cpl-row { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 4px; padding: 4px 8px; border-radius: 4px; font-size: .72rem; color: var(--text-secondary); cursor: pointer; }
.lf-cpl-row:hover { background: var(--bg-secondary); }
.lf-cpl-val { font-weight: 700; color: var(--primary); text-align: right; }

.lf-leads-table { min-width: 900px; border-collapse: collapse; }
.lf-leads-table th { position: sticky; top: 0; background: #fff; z-index: 2; white-space: nowrap; font-size: 13px; font-weight: 500; color: #6b7280; text-align: left; padding: 10px 16px !important; height: 40px; border-bottom: 1px solid #e5e7eb; position: relative; }
.lf-leads-table td { height: 40px; max-height: 40px; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 400; color: #374151; padding: 8px 16px !important; vertical-align: middle; border-bottom: 1px solid #f3f4f6; }
.lf-leads-table tbody tr:hover { background: #f9fafb; }
.lf-row-num { color: #949D9E; font-size: 14px; text-align: center; }
.lf-cpl-cell { font-weight: 600; color: var(--primary); font-size: 14px; white-space: nowrap; }
.lf-del-cell { width: 40px; text-align: center; }
.lf-del-btn { background: none; border: none; cursor: pointer; color: #d1d5db; padding: 4px 6px; border-radius: 6px; display: flex; align-items: center; justify-content: center; transition: color .15s, background .15s; }
.lf-del-btn:hover { color: #ef4444; background: #fef2f2; }
.lf-phone-cell { white-space: nowrap; }
.lf-phone-iso { display: inline-block; font-size: 10px; font-weight: 700; background: #e8f4ff; color: #1d4ed8; border-radius: 4px; padding: 1px 5px; margin-right: 5px; letter-spacing: 0.5px; vertical-align: middle; cursor: help; }
.lf-phone-local { font-size: 13px; color: #374151; letter-spacing: 0.01em; vertical-align: middle; }
.lf-phone-link { text-decoration: none; white-space: nowrap; display: inline-flex; align-items: center; gap: 0; }
.lf-phone-link:hover .lf-phone-local,
.lf-phone-link:hover { text-decoration: underline; color: #1d4ed8; }
@media (pointer: coarse) {
  .lf-phone-link { padding: 4px 0; }
}
.lf-cost-meeting-col, .lf-cost-meeting-cell { white-space: nowrap; text-align: center; }
.lf-cost-meeting-cell { font-weight: 600; color: #f59e0b; font-size: 14px; }
.lf-cost-won-col, .lf-cost-won-cell { white-space: nowrap; text-align: center; }
.lf-cost-won-cell { font-weight: 600; color: #22c55e; font-size: 14px; }
.lf-status-cell { padding: 2px 4px !important; }
.lf-status-select { font-size: 12px; padding: 2px 6px; border-radius: 6px; border: 1.5px solid #6b7280; background: var(--bg-primary); color: #6b7280; font-weight: 700; cursor: pointer; outline: none; appearance: auto; min-width: 100px; max-width: 130px; transition: border-color .2s, color .2s; height: 26px; }
.lf-status-select:focus { box-shadow: 0 0 0 2px rgba(53,155,255,.15); }
.lf-status-pill { display: inline-block; padding: 3px 12px; border-radius: 6px; font-size: 12px; font-weight: 700; color: #fff; white-space: nowrap; letter-spacing: 0; }
.lf-status-subscribed { background: #25BA64; }
.lf-status-unsubscribed { background: #FF6B66; }
.lf-editable { cursor: pointer; transition: background .15s; max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-editable:hover { background: rgba(53,155,255,.06); }
.lf-duration-pill { display: inline-flex; align-items: center; justify-content: center; padding: 2px 10px; background: #E3F1FF; color: #359BFF; font-size: 12px; font-weight: 700; border-radius: 10px; white-space: nowrap; line-height: 16px; }
.lf-graph-col { padding: 0 !important; }
.lf-graph-cell { display: flex; flex-direction: column; justify-content: space-between; height: 34px; padding: 3px 6px 2px; box-sizing: border-box; }
.lf-graph-val { font-size: 9px; font-weight: 400; color: #808080; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; }
.lf-graph-vs { font-size: 8px; color: #359BFF; }
.lf-graph-svg { width: 100%; height: 16px; display: block; flex-shrink: 0; }
.lf-cell-input { width: 100%; padding: 2px 6px; font-size: .78rem; border: 1.5px solid var(--primary); border-radius: 4px; background: var(--bg-primary); color: var(--text-primary); outline: none; height: 26px; box-sizing: border-box; }
.lf-col-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: .9rem; padding: 0 2px; margin-left: 4px; }
.lf-col-del:hover { color: var(--danger); }
.lf-del-cell { width: 36px; padding: 0 4px !important; }
.lf-del-btn { background: none; border: none; cursor: pointer; color: #d1d5db; padding: 4px 6px; border-radius: 6px; display: flex; align-items: center; transition: color .15s, background .15s; }
.lf-del-btn:hover { color: #ef4444; background: #fef2f2; }

/* View bar & toggle */
.lf-view-bar { display: flex; justify-content: space-between; align-items: center; margin: 16px 0 12px; }
.lf-view-bar-right { display: flex; align-items: center; gap: 8px; }
.lf-view-toggle { display: flex; background: var(--bg-secondary); border-radius: 10px; padding: 3px; gap: 2px; }
.lf-view-btn { border: none; background: transparent; color: var(--text-muted); padding: 6px 10px; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .2s; }
.lf-view-btn:hover { color: var(--text); background: rgba(99,102,241,.06); }
.lf-view-btn.active { background: #359BFF; color: #fff; box-shadow: 0 2px 6px rgba(53,155,255,.25); }

/* Board / Kanban View */
.lf-board { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; min-height: 400px; }
.lf-board::-webkit-scrollbar { height: 6px; }
.lf-board::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 3px; }
.lf-board-col { min-width: 260px; max-width: 300px; flex-shrink: 0; background: var(--bg-secondary); border-radius: 14px; display: flex; flex-direction: column; max-height: 70vh; }
.lf-board-col-header { padding: 14px 16px 10px; display: flex; align-items: center; justify-content: space-between; border-top-left-radius: 14px; border-top-right-radius: 14px; }
.lf-board-col-title { font-size: .82rem; font-weight: 700; color: var(--text-primary); }
.lf-board-col-count { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 10px; }
.lf-board-cards { flex: 1; overflow-y: auto; padding: 6px 10px 12px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.lf-board-cards::-webkit-scrollbar { width: 4px; }
.lf-board-cards::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.lf-board-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; cursor: pointer; transition: all .2s; }
.lf-board-card:hover { border-color: rgba(99,102,241,.3); box-shadow: 0 4px 12px rgba(0,0,0,.08); transform: translateY(-1px); }
.lf-board-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.lf-board-card-name { font-size: .82rem; font-weight: 700; color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 170px; }
.lf-board-card-date { font-size: .68rem; color: var(--text-muted); white-space: nowrap; flex-shrink: 0; }
.lf-board-card-info { display: flex; align-items: center; gap: 5px; font-size: .72rem; color: var(--text-secondary); margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-board-card-info svg { flex-shrink: 0; color: var(--text-muted); }
.lf-board-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
.lf-board-card-source { font-size: .66rem; color: var(--text-muted); background: var(--bg-secondary); padding: 2px 8px; border-radius: 4px; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-board-card-cpl { font-size: .72rem; font-weight: 700; color: var(--primary); }

/* ── View Toggle (Table / Kanban) ── */
.lf-vt-btn { border: none; background: transparent; color: var(--text-muted); padding: 5px 11px; border-radius: 7px; font-size: .78rem; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 5px; transition: all .15s; white-space: nowrap; }
.lf-vt-btn:hover { color: var(--text); background: rgba(99,102,241,.06); }
.lf-vt-btn--active { background: #fff; color: #1a1a1a; box-shadow: 0 1px 4px rgba(0,0,0,.12); font-weight: 600; }

/* ── Kanban Board ── */
.lf-kanban { display: flex; gap: 14px; overflow-x: auto; padding: 4px 2px 20px; min-height: calc(100vh - 360px); scrollbar-width: thin; scrollbar-color: #e2e8f0 transparent; -webkit-overflow-scrolling: touch; }
.lf-kanban::-webkit-scrollbar { height: 6px; }
.lf-kanban::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
.lf-kb-col { min-width: 248px; max-width: 248px; flex-shrink: 0; background: #f8fafc; border: 1.5px solid #e2e8f0; border-radius: 14px; display: flex; flex-direction: column; max-height: calc(100vh - 340px); transition: background .15s, border-color .15s; }
.lf-kb-col--over { background: #eff6ff; border-color: #93c5fd; }
.lf-kb-col-header { padding: 12px 14px 10px; display: flex; align-items: center; justify-content: space-between; border-radius: 12px 12px 0 0; flex-shrink: 0; }
.lf-kb-col-title { font-size: .8rem; font-weight: 700; color: #1e293b; }
.lf-kb-col-count { font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 20px; line-height: 1.5; }
.lf-kb-cards { flex: 1; overflow-y: auto; padding: 4px 10px 12px; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; scrollbar-color: #e2e8f0 transparent; }
.lf-kb-cards::-webkit-scrollbar { width: 4px; }
.lf-kb-cards::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 3px; }
.lf-kb-col-empty { padding: 16px; text-align: center; color: #94a3b8; font-size: .75rem; border: 1.5px dashed #e2e8f0; border-radius: 10px; margin: 4px; }

/* ── Kanban Card ── */
.lf-kb-card { background: #fff; border: 1.5px solid #e5e7eb; border-radius: 12px; padding: 12px 13px 10px; cursor: pointer; user-select: none; transition: box-shadow .15s, transform .12s, border-color .15s; position: relative; }
.lf-kb-card:hover { border-color: #a5b4fc; box-shadow: 0 4px 16px rgba(99,102,241,.12); transform: translateY(-2px); }
.lf-kb-card--dragging { opacity: .45; transform: rotate(1.5deg) scale(1.02); border-color: #818cf8; box-shadow: 0 8px 24px rgba(99,102,241,.2); }
.lf-kb-card-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 7px; gap: 6px; }
.lf-kb-card-name { font-size: .83rem; font-weight: 700; color: #111827; line-height: 1.3; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-kb-card-del { background: none; border: none; padding: 2px 3px; cursor: pointer; color: #d1d5db; border-radius: 5px; flex-shrink: 0; line-height: 0; transition: color .15s, background .15s; }
.lf-kb-card-del:hover { color: #ef4444; background: #fee2e2; }
.lf-kb-card-phone { display: flex; align-items: center; gap: 5px; font-size: .75rem; color: #374151; margin-bottom: 4px; }
.lf-kb-card-phone svg { color: #6b7280; flex-shrink: 0; }
.lf-kb-card-campaign { display: flex; align-items: center; gap: 4px; font-size: .7rem; color: #374151; background: #f3f4f6; padding: 3px 7px; border-radius: 5px; margin-bottom: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-kb-card-campaign svg { color: #818cf8; flex-shrink: 0; }
.lf-kb-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; padding-top: 8px; border-top: 1px solid #f3f4f6; }
.lf-kb-card-date { font-size: .68rem; color: #9ca3af; }
.lf-kb-card-meta { display: flex; align-items: center; gap: 6px; }
.lf-kb-card-cpl { font-size: .72rem; font-weight: 700; color: #374151; background: #f3f4f6; padding: 2px 6px; border-radius: 5px; }
.lf-kb-card-stars { display: flex; gap: 1px; }

.lf-source-cell { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-source-tag { display: inline-block; max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; padding: 3px 10px; border-radius: 6px; font-weight: 500; }
.lf-src-campaign { background: rgba(53,155,255,.08); color: #359BFF; }
.lf-src-adset { background: rgba(139,92,246,.08); color: #8b5cf6; }
.lf-src-ad { background: rgba(236,72,153,.08); color: #ec4899; }
.lf-panel-id { font-family: 'SF Mono','Consolas',monospace; font-size: .7rem; color: var(--text-muted); user-select: all; }

/* Resizable columns */
.lf-resize-handle { position: absolute; right: 0; top: 0; width: 6px; height: 100%; cursor: col-resize; z-index: 3; background: transparent; border-right: 1px solid transparent; transition: border-color .15s; }
.lf-resize-handle:hover, .lf-resize-handle.lf-resizing { border-right-color: var(--accent, #6366f1); background: rgba(99,102,241,.08); }

/* Leads table — compact, narrower columns, smaller font */
#leadsMainTable { min-width: 0 !important; font-size: .72rem !important; }
#leadsMainTable th { font-size: .7rem !important; padding: 5px 8px !important; height: 32px !important; white-space: nowrap; overflow: hidden; text-overflow: clip; box-sizing: border-box; }
#leadsMainTable td { font-size: .72rem !important; padding: 3px 8px !important; height: auto !important; max-height: none !important; max-width: 0; overflow: hidden; text-overflow: clip; white-space: normal; word-break: break-word; line-height: 1.35; vertical-align: top; box-sizing: border-box; }

/* Lead row click highlight */
.lf-leads-table tbody tr { cursor: pointer; transition: background .15s; }
.lf-leads-table tbody tr.lf-row-active { background: #eff6ff !important; }

/* Last Lead cell */
.lf-last-lead-cell { cursor: default; }
.lf-last-lead-tag { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; background: rgba(53,155,255,.08); color: #359BFF; white-space: nowrap; }

/* Rating cell */
.lf-rating { display: inline-flex; gap: 2px; align-items: center; }
.lf-rating-lg { gap: 4px; }
.lf-star { cursor: pointer; color: #d1d5db; transition: color .12s, transform .12s; line-height: 0; display: inline-flex; padding: 1px; border-radius: 2px; }
.lf-star:hover { transform: scale(1.2); }
.lf-star.lf-star-on { color: #f59e0b; }
.lf-star.lf-star-hover { color: #fbbf24; }

/* Date cell */
.lf-date-input { font-size: .76rem; border: 1.5px solid var(--primary); border-radius: 4px; background: var(--bg-primary); color: var(--text-primary); padding: 2px 4px; height: 26px; box-sizing: border-box; outline: none; }

/* Notes side panel */
.lf-panel-overlay { display: none; }
.lf-panel-overlay.open { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.25); z-index: 998; }
.lf-side-panel { position: fixed; top: 0; right: -480px; width: 460px; height: 100vh; background: var(--bg-card); border-left: 1px solid var(--border); box-shadow: -4px 0 24px rgba(0,0,0,.12); z-index: 999; transition: right .25s ease; display: flex; flex-direction: column; overflow: hidden; }
.lf-side-panel.open { right: 0; }
.lf-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.lf-panel-header h3 { font-size: .95rem; font-weight: 700; margin: 0; color: var(--text-primary); }
.lf-panel-close { background: none; border: none; font-size: 1.2rem; cursor: pointer; color: var(--text-muted); padding: 4px 8px; border-radius: 6px; }
.lf-panel-close:hover { background: var(--bg-secondary); color: var(--text-primary); }
.lf-panel-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.lf-panel-section { margin-bottom: 20px; }
.lf-panel-section-title { font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; color: var(--text-muted); margin-bottom: 8px; }
.lf-panel-field { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: .82rem; }
.lf-panel-field-label { color: var(--text-muted); font-size: .76rem; }
.lf-panel-field-value { color: var(--text-primary); font-weight: 500; max-width: 60%; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lf-notes-area { width: 100%; min-height: 120px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; font-size: .84rem; font-family: inherit; color: var(--text-primary); background: var(--bg-primary); resize: vertical; outline: none; line-height: 1.5; }
.lf-notes-area:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(99,102,241,.15); }
.lf-notes-time { font-size: .68rem; color: var(--text-muted); margin-top: 4px; }
.lf-panel-status-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: .76rem; font-weight: 600; }

/* Add column modal */
.lf-col-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.3); z-index: 1000; justify-content: center; align-items: center; }
.lf-col-modal-overlay.open { display: flex; }
.lf-col-modal { background: var(--bg-card); border-radius: 12px; padding: 24px; width: 340px; box-shadow: 0 8px 32px rgba(0,0,0,.18); }
.lf-col-modal h3 { margin: 0 0 16px; font-size: 1rem; }
.lf-col-modal label { display: block; font-size: .82rem; font-weight: 600; margin-bottom: 4px; color: var(--text-secondary); }
.lf-col-modal input, .lf-col-modal select { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: .84rem; background: var(--bg-primary); color: var(--text-primary); margin-bottom: 12px; box-sizing: border-box; }
.lf-col-modal-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }


/* ========== ADS MANAGER ========== */
.am-title-left { display: flex; align-items: baseline; gap: 12px; }
.am-page-title { font-family: 'Mulish', sans-serif; font-size: 22px; font-weight: 600; color: #2C454A; margin: 0; line-height: 1.3; }
.am-page-count { font-family: 'Mulish', sans-serif; font-size: 16px; font-weight: 300; color: #2C454A; }
.am-title-right { display: flex; align-items: center; gap: 10px; }

.am-no-auth { padding: 40px; text-align: center; color: var(--text-muted); }
.am-no-auth p { margin-bottom: 16px; }

.am-tabs-row { display: flex; align-items: flex-end; margin-bottom: 0; background: #fff; border: 1px solid var(--border); border-bottom: none; border-radius: 8px 8px 0 0; padding: 0 16px; box-shadow: var(--shadow); }
.am-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; background: #fff; border: 1px solid var(--border); border-top: none; border-radius: 0 0 8px 8px; padding: 10px 16px; box-shadow: var(--shadow); }
.am-toolbar-left { flex-shrink: 1; min-width: 0; }
.am-toolbar-right { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.am-account-select { padding: 7px 12px; border: 1px solid #D2D2D2; border-radius: 8px; background: #fff; color: var(--text); font-size: 14px; font-weight: 600; min-width: 200px; outline: none; cursor: pointer; transition: border-color .2s; }
.am-account-select:focus { border-color: #359BFF; box-shadow: 0 0 0 2px rgba(53,155,255,.12); }

.am-tabs { display: flex; gap: 0; background: transparent; border-radius: 0; padding: 0; border-bottom: 1px solid #e5e7eb; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; width: 100%; }
.am-tabs::-webkit-scrollbar { display: none; }
.am-tab { padding: 11px 18px; border: none; background: transparent; color: #6b7280; font-size: 13px; font-weight: 500; border-radius: 0; cursor: pointer; transition: all .15s; white-space: nowrap; position: relative; flex-shrink: 0; }
.am-tab:hover { color: #111827; }
.am-tab.active { color: #111827; background: transparent; box-shadow: none; font-weight: 600; }
.am-tab.active::after { content: ''; position: absolute; bottom: -1px; left: 0; right: 0; height: 2px; background: #111827; border-radius: 1px; }

.am-summary-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.am-sum-chip { font-size: 13px; color: #6b7280; padding: 4px 12px; background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 9999px; white-space: nowrap; }
.am-sum-chip strong { color: #111827; font-weight: 600; }
.am-sum-chip.am-sum-active strong { color: #16a34a; }
.am-sum-chip.am-sum-spent strong { color: #2563eb; }

#sectionAdsmanager { padding: 8px 8px; max-width: 100%; width: 100%; }
.am-table { table-layout: auto; min-width: 1800px; border-collapse: collapse; }
.am-table th { position: sticky; top: 0; background: #fff; z-index: 2; white-space: nowrap; font-size: 13px; font-weight: 500; letter-spacing: 0; color: #6b7280; cursor: default; border-bottom: 1px solid #e5e7eb; padding: 10px 16px !important; height: 44px; text-transform: none; text-align: left; position: relative; overflow: hidden; }
.am-col-filters th { position: sticky; top: 44px; background: #f8f9fb; z-index: 2; padding: 2px 4px !important; height: 26px; border-bottom: 1px solid #e5e7eb; }
.am-col-filters th input:focus { border-color: var(--accent) !important; box-shadow: 0 0 0 2px rgba(53,155,255,.12); }
.am-table td { height: 52px; max-height: 52px; box-sizing: border-box; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; font-weight: 400; color: #374151; padding: 8px 16px !important; vertical-align: middle; position: relative; border-bottom: 1px solid #f3f4f6; }
.am-table td:has(.am-ad-name-wrap):hover { overflow: visible; }
.am-table tbody tr { transition: background .15s; }
.am-table tbody tr:hover { background: #f9fafb; }

/* ─── shadcn-inspired CRM & Leads tables ─────────────────────── */
.crm-tab-bar { display: flex; gap: 3px; padding: 4px; background: #f1f5f9; border-radius: 10px; width: fit-content; margin-bottom: 16px; }
.crm-tab-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border: none; border-radius: 7px; background: transparent; cursor: pointer; font-size: .83rem; font-weight: 500; color: #64748b; transition: all .15s; white-space: nowrap; }
.crm-tab-btn.active { background: #fff; color: #0f172a; font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06); }
.crm-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.03); }
.crm-table { width: 100%; border-collapse: collapse; }
.crm-table th { padding: 11px 16px; text-align: left; font-size: .71rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .6px; background: #f8fafc; border-bottom: 1px solid var(--border); white-space: nowrap; position: sticky; top: 0; z-index: 1; }
.crm-table td { padding: 12px 16px; font-size: .84rem; color: var(--text-primary); border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.crm-table tbody tr:last-child td { border-bottom: none; }
.crm-table tbody tr { transition: background .1s; }
.crm-table tbody tr:hover { background: #f8fafc; }
.crm-num { color: #94a3b8; font-size: .78rem; font-weight: 500; }
.crm-name-link { font-weight: 600; cursor: pointer; color: var(--text-primary); transition: color .12s; background: none; border: none; padding: 0; font-size: inherit; font-family: inherit; }
.crm-name-link:hover { color: var(--accent); }
.crm-muted { color: #94a3b8; font-size: .82rem; }
a.crm-link { color: var(--accent); font-size: .8rem; text-decoration: none; }
a.crm-link:hover { text-decoration: underline; }
.crm-badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px; font-size: .71rem; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.crm-badge-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.crm-badge-green  { background: #dcfce7; color: #15803d; }
.crm-badge-gray   { background: #f1f5f9; color: #64748b; }
.crm-badge-blue   { background: #dbeafe; color: #1d4ed8; }
.crm-badge-indigo { background: #e0e7ff; color: #4338ca; }
.crm-badge-amber  { background: #fef3c7; color: #b45309; }
.crm-badge-pink   { background: #fce7f3; color: #be185d; }
.crm-badge-red    { background: #fee2e2; color: #dc2626; }
.crm-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 7px; border: 1px solid transparent; background: transparent; cursor: pointer; color: #94a3b8; transition: all .12s; flex-shrink: 0; }
.crm-icon-btn:hover { background: #f1f5f9; color: #334155; border-color: #e2e8f0; }
.crm-icon-btn.danger:hover { background: #fee2e2; color: #dc2626; border-color: #fca5a5; }
.crm-chip-wrap { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.crm-chip { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 6px; font-size: .71rem; font-weight: 500; cursor: pointer; white-space: nowrap; max-width: 110px; overflow: hidden; text-overflow: ellipsis; transition: opacity .12s; line-height: 1.6; }
.crm-chip:hover { opacity: .72; }
.crm-chip-contact { background: #eff6ff; color: #2563eb; }
.crm-chip-company { background: #f3e8ff; color: #7c3aed; }
.crm-chip-deal    { background: #fffbeb; color: #b45309; }
.crm-chip-add { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: 1.5px dashed #cbd5e1; border-radius: 6px; font-size: .82rem; background: none; cursor: pointer; color: #94a3b8; line-height: 1; transition: all .12s; }
.crm-chip-add:hover { border-color: var(--accent); color: var(--accent); background: #eff6ff; }
.crm-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.crm-count { font-size: .84rem; font-weight: 700; color: var(--text-primary); }
.crm-count-sub { font-size: .8rem; color: #94a3b8; }
.crm-add-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: none; border-radius: 8px; background: var(--accent); color: #fff; cursor: pointer; font-size: .83rem; font-weight: 600; transition: opacity .15s; letter-spacing: .01em; }
.crm-add-btn:hover { opacity: .86; }
/* Leads table shadcn card wrapper */
.leads-tbl-wrap { border: 1px solid var(--border); border-radius: 12px; overflow: auto; max-height: calc(100vh - 270px); box-shadow: 0 1px 3px rgba(0,0,0,.05), 0 1px 2px rgba(0,0,0,.03); }
.leads-tbl-wrap .am-table th { background: #f8fafc; font-size: .71rem; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .5px; height: 40px; }
/* CRM inline picker dropdown */
.crm-inline-drop { position: fixed; background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.14); overflow: hidden; z-index: 10003; min-width: 230px; max-width: 290px; }
.crm-drop-search { padding: 8px; border-bottom: 1px solid var(--border); background: #f8fafc; }
.crm-drop-search input { width: 100%; padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: .82rem; outline: none; background: #fff; box-sizing: border-box; height: auto; }
.crm-drop-search input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(99,102,241,.1); }
.crm-drop-list { max-height: 230px; overflow-y: auto; }
.crm-drop-item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; cursor: pointer; font-size: .83rem; color: var(--text-primary); border-bottom: 1px solid #f1f5f9; transition: background .1s; user-select: none; }
.crm-drop-item:last-child { border-bottom: none; }
.crm-drop-item:hover { background: #f8fafc; }
.crm-drop-item.linked { font-weight: 500; }
.crm-drop-check { width: 18px; height: 18px; display: inline-flex; align-items: center; justify-content: center; border: 1.5px solid #e2e8f0; border-radius: 4px; flex-shrink: 0; color: #2563eb; background: #fff; transition: all .12s; }
.crm-drop-item.linked .crm-drop-check { background: #2563eb; border-color: #2563eb; color: #fff; }
.crm-drop-empty { padding: 20px 12px; text-align: center; color: #94a3b8; font-size: .82rem; }
/* Inline add row in CRM tables */
.crm-table .crm-inline-new td { background: #f0fdf4 !important; border-bottom: 2px solid #22c55e !important; }
.crm-table .crm-inline-new td:first-child { border-left: 3px solid #22c55e; }
.crm-inline-input { width: 100%; padding: 5px 8px; border: 1px solid transparent; border-radius: 6px; font-size: .84rem; background: transparent; color: var(--text-primary); outline: none; font-family: inherit; transition: border-color .15s, box-shadow .15s; min-width: 60px; box-sizing: border-box; height: auto; }
.crm-inline-input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 2px rgba(99,102,241,.08); }
select.crm-inline-input { height: 30px; cursor: pointer; }
/* Contact table CRM cells (allow wrapping) */
.am-table td.crm-contact-cell { white-space: normal; overflow: visible; max-height: none; height: auto; min-height: 52px; }
/* ── CRM Entity Detail Panel ──────────────────────────────────────────────── */
.crm-panel-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.45); z-index: 20000;
  display: flex; align-items: stretch; justify-content: flex-end;
  opacity: 0; pointer-events: none; transition: opacity .22s;
}
.crm-panel-overlay.open { opacity: 1; pointer-events: all; }
.crm-panel {
  width: min(1080px, 100vw); height: 100vh;
  background: #f8fafc; display: flex; flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,.18);
  transform: translateX(60px); transition: transform .25s cubic-bezier(.22,.68,0,1.1);
}
.crm-panel-overlay.open .crm-panel { transform: translateX(0); }
/* top bar */
.crm-panel-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px; height: 48px; min-height: 48px;
  background: #1e293b; color: #cbd5e1; font-size: .82rem;
}
.crm-panel-topbar-back {
  background: none; border: none; color: #94a3b8; cursor: pointer; padding: 6px 8px;
  border-radius: 6px; display: flex; align-items: center; gap: 5px; font-size: .82rem;
  transition: background .12s, color .12s;
}
.crm-panel-topbar-back:hover { background: rgba(255,255,255,.08); color: #e2e8f0; }
.crm-panel-topbar-title { color: #e2e8f0; font-weight: 600; font-size: .88rem; }
.crm-panel-topbar-spacer { flex: 1; }
/* body */
.crm-panel-body {
  flex: 1; display: grid; overflow: hidden;
  grid-template-columns: 260px 1fr 280px;
}
/* LEFT SIDEBAR */
.crm-panel-left {
  border-right: 1px solid #e2e8f0; overflow-y: auto; padding: 24px 18px;
  background: #fff; display: flex; flex-direction: column; gap: 16px;
}
.crm-pl-avatar {
  width: 52px; height: 52px; border-radius: 14px; background: linear-gradient(135deg,#6366f1,#818cf8);
  display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
  font-weight: 700; color: #fff; flex-shrink: 0; letter-spacing: -.01em;
}
.crm-pl-avatar.co { background: linear-gradient(135deg,#0ea5e9,#38bdf8); }
.crm-pl-avatar.de { background: linear-gradient(135deg,#10b981,#34d399); }
.crm-pl-avatar.ct { background: linear-gradient(135deg,#f59e0b,#fbbf24); }
.crm-pl-name { font-size: 1.05rem; font-weight: 700; color: #0f172a; line-height: 1.3; }
.crm-pl-sub { font-size: .8rem; color: #64748b; display: flex; align-items: center; gap: 4px; }
.crm-pl-sub a { color: #3b82f6; text-decoration: none; }
.crm-pl-sub a:hover { text-decoration: underline; }
.crm-pl-meta { font-size: .74rem; color: #94a3b8; }
/* action buttons row */
.crm-pl-actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0; }
.crm-pl-action {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 10px;
  background: #f8fafc; cursor: pointer; font-size: .67rem; color: #475569;
  transition: background .12s, border-color .12s; min-width: 50px;
}
.crm-pl-action:hover { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }
.crm-pl-action svg { width: 16px; height: 16px; flex-shrink: 0; }
/* details section */
.crm-pl-section-title {
  font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .7px;
  color: #94a3b8; margin-bottom: 8px;
}
.crm-pl-field { display: flex; flex-direction: column; gap: 1px; margin-bottom: 6px; }
.crm-pl-field-label { font-size: .69rem; color: #94a3b8; font-weight: 600; letter-spacing: .3px; text-transform: uppercase; padding-left: 7px; }
.crm-pl-field-value { font-size: .83rem; color: #0f172a; font-weight: 500; word-break: break-word; padding: 5px 7px; }
.crm-pl-field-empty { font-size: .8rem; color: #cbd5e1; font-style: italic; }
/* Editable inputs sit inside .crm-pl-field — hover/focus handled inline */
.crm-pl-field input, .crm-pl-field select, .crm-pl-field textarea { font-family: inherit; }
.crm-pl-badge {
  display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px;
  font-size: .72rem; font-weight: 600; letter-spacing: .01em;
}
/* CENTER */
.crm-panel-center {
  display: flex; flex-direction: column; overflow: hidden; background: #f8fafc;
}
.crm-pc-activity-bar {
  display: flex; align-items: center; gap: 8px; padding: 14px 20px 0;
  background: #fff; border-bottom: 1px solid #e2e8f0;
}
.crm-pc-search {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 8px;
  padding: 7px 12px; font-size: .82rem; color: #64748b; max-width: 260px;
}
.crm-pc-tabs {
  display: flex; gap: 0; border-bottom: 1px solid #e2e8f0;
  background: #fff; padding: 0 20px; overflow-x: auto;
}
.crm-pc-tab {
  padding: 10px 14px; border: none; background: none; cursor: pointer;
  font-size: .8rem; color: #64748b; border-bottom: 2px solid transparent;
  white-space: nowrap; transition: color .12s, border-color .12s; font-weight: 500;
}
.crm-pc-tab.active { color: #6366f1; border-bottom-color: #6366f1; font-weight: 600; }
.crm-pc-tab:hover:not(.active) { color: #334155; border-bottom-color: #cbd5e1; }
.crm-create-note-btn {
  margin-left: auto; padding: 7px 14px; border: none; border-radius: 8px;
  background: #6366f1; color: #fff; font-size: .8rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 5px; transition: background .12s;
}
.crm-create-note-btn:hover { background: #4f46e5; }
/* notes list */
.crm-notes-list {
  flex: 1; overflow-y: auto; padding: 20px;
  display: flex; flex-direction: column; gap: 16px;
}
.crm-notes-date-group { font-size: .72rem; font-weight: 700; color: #94a3b8; text-transform: uppercase; letter-spacing: .5px; margin: 4px 0 6px; }
.crm-note-card {
  background: #fff; border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 14px 16px; position: relative;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
}
.crm-note-card.pinned { border-color: #fbbf24; background: #fffbeb; box-shadow: 0 1px 4px rgba(251,191,36,.15); }
.crm-note-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.crm-note-avatar { width: 26px; height: 26px; border-radius: 50%; background: #6366f1; color: #fff; font-size: .72rem; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.crm-note-author { font-size: .8rem; font-weight: 600; color: #334155; }
.crm-note-date { font-size: .73rem; color: #94a3b8; margin-left: auto; }
.crm-note-menu-btn { background: none; border: none; cursor: pointer; color: #94a3b8; padding: 2px 6px; border-radius: 4px; font-size: .9rem; transition: background .1s, color .1s; }
.crm-note-menu-btn:hover { background: #f1f5f9; color: #334155; }
.crm-note-text { font-size: .83rem; color: #334155; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
/* floating note menu */
.crm-note-menu {
  position: fixed; background: #fff; border: 1px solid #e2e8f0;
  border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,.12);
  z-index: 21000; overflow: hidden; min-width: 140px;
}
.crm-note-menu-item { display: flex; align-items: center; gap: 8px; padding: 9px 14px; font-size: .82rem; color: #334155; cursor: pointer; transition: background .1s; border: none; background: none; width: 100%; text-align: left; }
.crm-note-menu-item:hover { background: #f8fafc; }
.crm-note-menu-item.danger { color: #ef4444; }
.crm-note-menu-item.danger:hover { background: #fef2f2; }
/* note editor */
.crm-note-editor-wrap {
  border-top: 1px solid #e2e8f0; padding: 14px 20px; background: #fff;
  display: none; flex-direction: column; gap: 8px;
}
.crm-note-editor-wrap.open { display: flex; }
.crm-note-editor-header { display: flex; align-items: center; gap: 8px; }
.crm-note-editor-header span { font-size: .8rem; font-weight: 600; color: #1e293b; background: #6366f1; color: #fff; padding: 3px 12px; border-radius: 20px; }
.crm-note-editor-close { margin-left: auto; background: none; border: none; cursor: pointer; color: #94a3b8; font-size: 1rem; padding: 2px 6px; border-radius: 4px; transition: background .1s; }
.crm-note-editor-close:hover { background: #f1f5f9; color: #334155; }
.crm-note-textarea { 
  width: 100%; min-height: 90px; padding: 10px 12px; border: 1px solid #e2e8f0; 
  border-radius: 8px; font-size: .84rem; font-family: inherit; resize: vertical;
  outline: none; transition: border-color .15s, box-shadow .15s; color: #0f172a;
  background: #f8fafc; box-sizing: border-box;
}
.crm-note-textarea:focus { border-color: #6366f1; background: #fff; box-shadow: 0 0 0 3px rgba(99,102,241,.1); }
.crm-note-editor-footer { display: flex; justify-content: flex-end; gap: 8px; }
.crm-note-save-btn { padding: 7px 18px; border: none; border-radius: 8px; background: #6366f1; color: #fff; font-size: .82rem; font-weight: 600; cursor: pointer; transition: background .12s; }
.crm-note-save-btn:hover { background: #4f46e5; }
.crm-note-cancel-btn { padding: 7px 14px; border: 1px solid #e2e8f0; border-radius: 8px; background: #fff; color: #64748b; font-size: .82rem; cursor: pointer; transition: background .12s; }
.crm-note-cancel-btn:hover { background: #f1f5f9; }
.crm-notes-empty { color: #cbd5e1; text-align: center; font-size: .84rem; padding: 40px 20px; }
/* RIGHT SIDEBAR */
.crm-panel-right {
  border-left: 1px solid #e2e8f0; overflow-y: auto;
  padding: 20px 16px; background: #fff;
  display: flex; flex-direction: column; gap: 20px;
}
.crm-pr-section { display: flex; flex-direction: column; gap: 8px; }
.crm-pr-section-header {
  display: flex; align-items: center; gap: 6px; padding-bottom: 8px;
  border-bottom: 1px solid #f1f5f9;
}
.crm-pr-section-title { font-size: .75rem; font-weight: 700; color: #475569; text-transform: uppercase; letter-spacing: .5px; flex: 1; }
.crm-pr-count { background: #f1f5f9; color: #64748b; border-radius: 20px; padding: 1px 7px; font-size: .72rem; font-weight: 600; }
.crm-pr-add-btn { background: none; border: 1px solid #e2e8f0; color: #6366f1; padding: 3px 8px; border-radius: 6px; font-size: .75rem; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 3px; transition: background .1s; }
.crm-pr-add-btn:hover { background: #f5f3ff; border-color: #c4b5fd; }
.crm-pr-entity-card {
  border: 1px solid #f1f5f9; border-radius: 10px; padding: 10px 10px 10px 12px;
  background: #fafafa; transition: border-color .12s, box-shadow .12s;
  display: flex; align-items: flex-start; gap: 6px;
}
.crm-pr-entity-card:hover { border-color: #c7d2fe; box-shadow: 0 2px 8px rgba(99,102,241,.08); }
.crm-pr-entity-name { font-size: .83rem; font-weight: 600; color: #1e293b; margin-bottom: 4px; display: flex; align-items: center; gap: 5px; }
.crm-pr-entity-sub { font-size: .74rem; color: #64748b; line-height: 1.4; }
.crm-pr-remove { background: none; border: none; cursor: pointer; color: #cbd5e1; padding: 2px 4px; border-radius: 4px; font-size: .75rem; line-height: 1; flex-shrink: 0; margin-top: 1px; }
.crm-pr-remove:hover { color: #ef4444; background: #fef2f2; }
.crm-pr-empty { color: #cbd5e1; font-size: .8rem; text-align: center; padding: 10px; }
.crm-pr-avatar { width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: .65rem; font-weight: 700; flex-shrink: 0; }
.crm-pr-avatar.ct { background: #f59e0b; color: #fff; }
.crm-pr-avatar.co { background: #0ea5e9; color: #fff; }
.crm-pr-avatar.de { background: #6366f1; color: #fff; }
/* Task row in panel */
.crm-task-row { display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #f1f5f9; transition: background .1s; }
.crm-task-row:hover { background: #f8fafc; }
.crm-task-check { width: 15px; height: 15px; flex-shrink: 0; margin-top: 3px; accent-color: #6366f1; cursor: pointer; }
.crm-pr-entity-chip { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 20px; font-size: .7rem; font-weight: 600; }
/* stage chips */
.stage-chip-new { background: #eff6ff; color: #1d4ed8; }
.stage-chip-qualified { background: #f0fdf4; color: #15803d; }
.stage-chip-proposal { background: #fefce8; color: #a16207; }
.stage-chip-negotiation { background: #fff7ed; color: #c2410c; }
.stage-chip-closed-won { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.stage-chip-closed-lost { background: #fef2f2; color: #b91c1c; }
.stage-chip-default { background: #f1f5f9; color: #475569; }
/* ─────────────────────────────────────────────────────────────── */

.am-ad-name-wrap { display: flex; align-items: center; gap: 8px; position: relative; }
.am-ad-thumb-inline { width: 32px; height: 32px; border-radius: 6px; object-fit: cover; flex-shrink: 0; border: 1px solid #E1E1E1; }
.am-ad-preview { display: none; position: absolute; left: 0; top: 100%; z-index: 100; padding: 8px; background: #fff; border: 1px solid #E1E1E1; border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.12); pointer-events: none; }
.am-ad-preview img { width: 300px; max-height: 300px; object-fit: contain; border-radius: 6px; display: block; }
.am-ad-name-wrap:hover .am-ad-preview { display: block; }
.am-r { text-align: right; }
.am-spend { font-weight: 600; color: #111827; }
.am-name { font-weight: 500; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: flex; align-items: center; gap: 6px; max-width: 280px; color: #111827; }
.am-platform-icon { width: 14px; height: 14px; flex-shrink: 0; border-radius: 3px; }
.am-sub { font-size: 13px; color: #6b7280; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.am-toggle { width: 34px; height: 18px; border-radius: 9px; background: #D2D2D2; position: relative; cursor: default; display: inline-flex; align-items: center; transition: background .2s; }
.am-toggle.on { background: #22c55e; }
.am-toggle-dot { width: 14px; height: 14px; border-radius: 50%; background: #fff; position: absolute; left: 2px; top: 2px; transition: left .2s; box-shadow: 0 1px 2px rgba(0,0,0,.1); }
.am-toggle.on .am-toggle-dot { left: 18px; }

.am-status-badge { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 9999px; font-size: 12px; font-weight: 500; letter-spacing: 0; white-space: nowrap; }
.am-st-active { background: #D9F5E5; color: #25BA64; }
.am-st-paused { background: #FFF3CD; color: #E5A100; }
.am-st-deleted { background: #FFE8E7; color: #FF6B66; }
.am-st-archived { background: #F3F4F6; color: #6B7280; }
.am-st-off { background: #F3F4F6; color: #8A9597; }
.am-st-completed { background: #D5F0ED; color: #17A98B; }
.am-st-draft { background: #F3F4F6; color: #8A9597; }
.am-st-rejected { background: #FFE8E7; color: #E53935; }
.am-st-review { background: #FFF3CD; color: #B45309; }
.am-republish-btn { background: #fff0f0; color: #E53935; border: 1px solid #fca5a5; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s; }
.am-republish-btn:hover { background: #fee2e2; }
.am-republish-btn:disabled { opacity: .55; cursor: not-allowed; }

/* Global loading bar (top of page) */
#amGlobalLoadBar { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 999999; pointer-events: none; border-radius: 0 2px 2px 0; background: linear-gradient(90deg, #6366f1 0%, #8b5cf6 55%, #a78bfa 100%); box-shadow: 0 0 8px rgba(99,102,241,.55); opacity: 0; transition: opacity .2s; }
#amGlobalLoadBar.am-glb-loading { opacity: 1; animation: amGlbAnim 2.4s cubic-bezier(.1,.05,.6,1) forwards; }
#amGlobalLoadBar.am-glb-done { width: 100% !important; opacity: 0; animation: none; transition: width .12s ease, opacity .5s ease .12s; }
@keyframes amGlbAnim { 0% { width: 2%; } 20% { width: 35%; } 50% { width: 60%; } 80% { width: 73%; } 100% { width: 77%; } }

/* Inline "Refreshing" badge on leads header */
.am-refreshing-badge { display: inline-flex; align-items: center; gap: 3px; font-size: .68rem; color: var(--accent, #6366f1); font-weight: 500; background: rgba(99,102,241,.08); border-radius: 20px; padding: 2px 7px 2px 5px; white-space: nowrap; }

/* Sparkline expanded popup */
.am-spark-popup { position: fixed; z-index: 99999; background: var(--bg-card, #fff); border: 1px solid var(--border, #e5e7eb); border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.13), 0 2px 6px rgba(0,0,0,.06); padding: 10px 14px 8px; width: 300px; pointer-events: all; display: none; }
.am-sp-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; min-height: 18px; }
.am-sp-title { font-size: 10px; font-weight: 700; color: var(--text-secondary, #6b7280); text-transform: uppercase; letter-spacing: .05em; }
.am-sp-callout2 { font-size: 11px; color: var(--text-primary, #111827); font-weight: 600; }
.am-sp-footer { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: var(--text-secondary, #6b7280); margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--border, #f3f4f6); gap: 8px; }
.am-sp-footer strong { color: var(--text-primary, #111827); }

.am-footer { text-align: left; padding: 12px 16px; font-size: 13px; color: #6b7280; border-top: 1px solid #e5e7eb; }

.am-cb { width: 16px; height: 16px; cursor: pointer; accent-color: #359BFF; border-radius: 3px; }
.am-row-selected { background: #f0f9ff !important; }
.am-row-selected:hover { background: #e0f2fe !important; }

.am-filter-bar { display: flex; align-items: center; gap: 8px; padding: 8px 14px; background: #F1F8FF; border: 1px solid rgba(53,155,255,.2); border-radius: 8px; margin-bottom: 10px; font-size: 13px; color: #359BFF; font-weight: 600; }
.am-clear-filter { background: none; border: 1px solid #359BFF; color: #359BFF; font-size: 12px; padding: 3px 12px; border-radius: 4px; cursor: pointer; transition: all .15s; font-weight: 700; }
.am-clear-filter:hover { background: #359BFF; color: #fff; }

.am-tab-badge { display: inline-flex; align-items: center; justify-content: center; background: rgba(53,155,255,.15); color: #359BFF; font-size: 11px; min-width: 18px; height: 18px; border-radius: 9px; padding: 0 5px; margin-left: 5px; font-weight: 700; }

.am-status-filter { display: inline-flex; border: 1px solid #e5e7eb; border-radius: 8px; overflow: hidden; }
.am-sf-btn { padding: 6px 14px; border: none; background: #fff; color: #6b7280; font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; }
.am-sf-btn:not(:last-child) { border-right: 1px solid #e5e7eb; }
.am-sf-btn:hover { background: #f9fafb; color: #374151; }
.am-sf-btn.active { background: #111827; color: #fff; }
.am-search-wrap { display: flex; align-items: center; gap: 6px; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 0 10px; height: 36px; transition: border-color .15s; }
.am-search-wrap:focus-within { border-color: #1a1a1a; box-shadow: 0 0 0 2px rgba(26,26,26,.08); }
.am-search-wrap svg { color: #9ca3af; flex-shrink: 0; }
.am-search { border: none; background: transparent; color: #2C454A; font-size: 13px; font-style: italic; outline: none; width: 160px; font-family: var(--font); }
.am-search::placeholder { color: #B0B0B0; }

.am-date-select { padding: 6px 12px; border: 1px solid #D2D2D2; border-radius: 8px; background: #fff; color: #2C454A; font-size: 13px; outline: none; cursor: pointer; height: 36px; transition: border-color .2s; font-family: var(--font); font-weight: 600; }
.am-date-select:focus { border-color: #359BFF; box-shadow: 0 0 0 2px rgba(53,155,255,.12); }

.am-custom-dates { display: flex; align-items: center; gap: 4px; }
.am-custom-dates.hidden { display: none; }
.am-date-input { padding: 5px 8px; border: 1px solid #D2D2D2; border-radius: 8px; background: #fff; color: #2C454A; font-size: 13px; outline: none; height: 36px; box-sizing: border-box; transition: border-color .2s; }
.am-date-input:focus { border-color: #359BFF; }
.am-date-sep { color: #949D9E; font-size: 13px; }

.am-lead-link { color: #359BFF; text-decoration: none; font-weight: 700; cursor: pointer; transition: all .15s; }
.am-lead-link:hover { color: #2080E0; text-decoration: underline; }
.am-result-row { display: flex; align-items: center; justify-content: flex-end; gap: 6px; line-height: 1.6; white-space: nowrap; }
.am-result-row + .am-result-row { border-top: 1px solid var(--border); padding-top: 2px; margin-top: 2px; }
.am-result-type { font-size: 11px; }
.am-result-left { display: flex; align-items: baseline; gap: 4px; }
.am-result-cpe { font-size: 11px; font-weight: 600; color: var(--text-secondary); background: var(--bg-hover, #f3f4f6); padding: 0 5px; border-radius: 4px; line-height: 1.6; }
.am-result-spark { flex-shrink: 0; vertical-align: middle; display: inline-block; }

/* Google Ads asset type badges */
.am-asset-type-badge { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 4px; font-size: 11px; font-weight: 600; letter-spacing: .3px; white-space: nowrap; text-transform: capitalize; }
.am-asset-headline { background: rgba(66,133,244,.12); color: #4285F4; }
.am-asset-desc     { background: rgba(52,168,83,.12);  color: #34A853; }
.am-asset-ad       { background: rgba(251,188,5,.14);  color: #9a7000; }

/* Google Ads asset performance label badges */
.am-perf-badge { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 9999px; font-size: 11px; font-weight: 700; letter-spacing: .3px; white-space: nowrap; }
.am-perf-best     { background: rgba(34,197,94,.15);  color: #16a34a; }
.am-perf-good     { background: rgba(59,130,246,.12); color: #2563eb; }
.am-perf-low      { background: rgba(239,68,68,.12);  color: #dc2626; }
.am-perf-learning { background: rgba(234,179,8,.14);  color: #92400e; }
.am-perf-unrated  { background: rgba(107,114,128,.1); color: #6b7280; }

.am-opt-btn { background: rgba(53,155,255,.06); border: 1px solid rgba(53,155,255,.2); border-radius: 4px; padding: 4px 10px; cursor: pointer; color: #359BFF; font-size: 12px; font-weight: 700; transition: all .15s; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; }
.am-opt-btn:hover { border-color: #359BFF; background: #359BFF; color: #fff; }
.gads-opt-btn { background: rgba(24,119,242,.06); border-color: rgba(24,119,242,.2); color: #1877F2; }
.gads-opt-btn:hover { border-color: #1877F2; background: #1877F2; color: #fff; }
.am-dv360-opt-btn { background: none; border: none; cursor: pointer; font-size: 15px; color: #1a73e8; padding: 2px 4px; border-radius: 4px; line-height: 1; transition: background .12s; }
.am-dv360-opt-btn:hover { background: rgba(26,115,232,.12); }

/* DV360 Line Item Optimization */
.dv360-li-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; font-size: 11px; color: #6b7280; }
.dv360-li-obj { background: #eef2ff; color: #4338ca; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.dv360-li-refresh { color: #9ca3af; }
.dv360-li-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.dv360-li-card { background: var(--bg-elevated, #f8faff); border: 1px solid var(--border, #e9ecef); border-radius: 8px; padding: 10px 12px; display: flex; flex-direction: column; gap: 3px; }
.dv360-li-card-label { font-size: 10px; text-transform: uppercase; letter-spacing: .04em; color: #9ca3af; }
.dv360-li-card-val { font-size: 17px; font-weight: 700; color: #111827; }
.dv360-li-table th, .dv360-li-table td { font-size: 12px; padding: 7px 8px; }
.dv360-li-table .dv360-li-seg { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.dv360-li-row-bad { background: #fef2f2; }
.dv360-li-row-watch { background: #fffbeb; }
.dv360-li-score { display: inline-block; min-width: 26px; text-align: center; border-radius: 10px; font-weight: 700; font-size: 11px; padding: 1px 6px; }
.dv360-li-score.bad { background: #fee2e2; color: #b91c1c; }
.dv360-li-score.watch { background: #fef3c7; color: #92400e; }
.dv360-li-score.ok { background: #dcfce7; color: #166534; }
.dv360-li-rec-text { display: inline-block; max-width: 320px; font-size: 11px; color: #4b5563; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv360-li-actions { display: flex; gap: 4px; }
.dv360-li-act { font-size: 10px; padding: 3px 7px; border-radius: 5px; border: 1px solid var(--border, #e5e7eb); background: #fff; cursor: pointer; white-space: nowrap; }
.dv360-li-act.exclude { background: #fee2e2; color: #b91c1c; border-color: #fca5a5; font-weight: 600; }
.dv360-li-act.ignore:hover { background: #f3f4f6; }
.dv360-li-act.review:hover { background: #eff6ff; }
.dv360-li-status { font-size: 10px; text-transform: capitalize; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.dv360-li-status.applied { background: #dcfce7; color: #166534; }
.dv360-li-status.ignored { background: #f3f4f6; color: #6b7280; }
.dv360-li-status.reviewed { background: #eff6ff; color: #1d4ed8; }

/* ── DV360 Optimization Drawer ── */
.am-dv360-drawer { position: fixed; inset: 0; display: none; align-items: flex-end; justify-content: flex-end; background: rgba(0,0,0,.35); z-index: 1200; backdrop-filter: blur(2px); }
.am-dv360-drawer-inner { background: var(--bg-card, #fff); width: 420px; max-width: 96vw; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; box-shadow: -4px 0 32px rgba(0,0,0,.18); transform: translateX(100%); transition: transform .26s cubic-bezier(.4,0,.2,1); }
.am-dv360-drawer--open .am-dv360-drawer-inner { transform: translateX(0); }
.am-dv360-drawer-header { display: flex; align-items: flex-start; justify-content: space-between; padding: 18px 20px 12px; border-bottom: 1px solid var(--border-color, #e5e7eb); position: sticky; top: 0; background: var(--bg-card, #fff); z-index: 1; }
.am-dv360-drawer-title { font-size: 15px; font-weight: 700; color: var(--text-primary, #111827); }
.am-dv360-drawer-subtitle { font-size: 12px; color: var(--text-muted, #6b7280); margin-top: 2px; max-width: 320px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.am-dv360-close-btn { background: none; border: none; cursor: pointer; font-size: 22px; color: var(--text-muted, #6b7280); padding: 0 4px; line-height: 1; transition: color .12s; flex-shrink: 0; }
.am-dv360-close-btn:hover { color: var(--text-primary, #111827); }
.am-dv360-mode-bar { display: flex; align-items: center; gap: 6px; padding: 10px 20px; background: var(--bg-surface, #f9fafb); border-bottom: 1px solid var(--border-color, #e5e7eb); }
.am-dv360-mode-label { font-size: 11px; font-weight: 600; color: var(--text-muted, #6b7280); text-transform: uppercase; letter-spacing: .04em; }
.am-dv360-mode-btn { font-size: 12px; font-weight: 500; padding: 4px 12px; border: 1px solid var(--border-color, #e5e7eb); border-radius: 6px; background: var(--bg-card, #fff); color: var(--text-muted, #6b7280); cursor: pointer; transition: all .12s; }
.am-dv360-mode-btn:hover { border-color: #1a73e8; color: #1a73e8; }
.am-dv360-mode-btn.active { background: #1a73e8; border-color: #1a73e8; color: #fff; }
.am-dv360-mode-hint { font-size: 11px; color: var(--text-muted, #6b7280); margin-left: 4px; }
.am-dv360-section { padding: 16px 20px; border-bottom: 1px solid var(--border-color, #e5e7eb); }
.am-dv360-section-title { font-size: 11px; font-weight: 700; color: var(--text-muted, #9ca3af); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.am-dv360-score-row { display: flex; align-items: center; gap: 16px; }
.am-dv360-score-label { font-size: 11px; font-weight: 600; color: var(--text-muted, #6b7280); margin-bottom: 2px; }
.am-dv360-score-val { font-size: 28px; font-weight: 800; line-height: 1; }
.am-dv360-score-sub { font-size: 11px; color: var(--text-muted, #6b7280); margin-top: 4px; }
.am-dv360-bar-wrap { height: 6px; background: var(--bg-surface, #f3f4f6); border-radius: 99px; overflow: hidden; margin-bottom: 4px; }
.am-dv360-bar { height: 100%; border-radius: 99px; transition: width .4s; }
.am-dv360-signals { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.am-dv360-sig { display: flex; flex-direction: column; }
.am-dv360-sig-k { font-size: 10px; color: var(--text-muted, #9ca3af); text-transform: uppercase; letter-spacing: .04em; }
.am-dv360-sig-v { font-size: 13px; font-weight: 600; color: var(--text-primary, #111827); margin-top: 1px; }
.am-dv360-rec-section { }
.am-dv360-rec-type { font-size: 14px; font-weight: 700; color: var(--text-primary, #111827); margin-bottom: 6px; }
.am-dv360-rec-reason { font-size: 12.5px; color: var(--text-secondary, #374151); line-height: 1.55; }
.am-dv360-conf-badge { font-size: 10px; font-weight: 600; padding: 1px 7px; border-radius: 99px; border: 1px solid; margin-left: 6px; vertical-align: middle; }
.am-conf-high { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.am-conf-med  { background: #fffbeb; color: #92400e; border-color: #fde68a; }
.am-conf-low  { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }
.am-dv360-bid-row { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; font-size: 13px; }
.am-dv360-bid-from { color: var(--text-muted, #6b7280); text-decoration: line-through; }
.am-dv360-bid-arrow { color: var(--text-muted, #9ca3af); }
.am-dv360-bid-to { font-weight: 700; color: #10b981; font-size: 15px; }
.am-dv360-bid-pct { font-size: 11px; background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; border-radius: 99px; padding: 2px 7px; }
.am-dv360-apply-row { display: flex; gap: 8px; margin-top: 10px; }
.am-dv360-apply-btn { flex: 1; background: #f59e0b; color: #fff; border: none; border-radius: 7px; padding: 9px 16px; font-size: 13px; font-weight: 700; cursor: pointer; transition: background .13s; }
.am-dv360-apply-btn:hover { background: #d97706; }
.am-dv360-apply-btn:disabled { background: #9ca3af; cursor: not-allowed; }
.am-dv360-apply-btn--decrease { background: #3b82f6; }
.am-dv360-apply-btn--decrease:hover { background: #2563eb; }
.am-dv360-skip-btn { padding: 9px 14px; border: 1px solid var(--border-color, #e5e7eb); border-radius: 7px; background: var(--bg-card, #fff); color: var(--text-muted, #6b7280); font-size: 13px; cursor: pointer; }
.am-dv360-skip-btn:hover { border-color: #9ca3af; }
.am-dv360-hints { margin: 0; padding-left: 18px; color: var(--text-secondary, #374151); font-size: 12.5px; line-height: 1.7; }
.am-dv360-history-section { flex: 1; }
.am-dv360-hist-item { padding: 10px 0; border-bottom: 1px solid var(--border-color, #f3f4f6); }
.am-dv360-hist-item:last-child { border-bottom: none; }
.am-dv360-hist-date { font-size: 11px; color: var(--text-muted, #9ca3af); margin-bottom: 2px; }
.am-dv360-hist-change { font-size: 13px; font-weight: 600; color: var(--text-primary, #111827); }
.am-dv360-proof { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 5px; }
.am-dv360-proof-item { font-size: 11px; background: var(--bg-surface, #f3f4f6); border-radius: 4px; padding: 2px 7px; color: var(--text-secondary, #374151); }
.am-dv360-proof-status { font-size: 11px; border-radius: 4px; padding: 2px 7px; }
.am-dv360-proof-ok { background: #f0fdf4; color: #166534; }
.am-dv360-proof-pending { background: #fffbeb; color: #92400e; }
.am-dv360-loading { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 48px 20px; gap: 12px; color: var(--text-muted, #6b7280); font-size: 13px; }
/* inline metrics-fetching indicator in table cells */
span.am-dv360-loading { display: inline; padding: 0; color: #9ca3af; font-size: 13px; animation: dv360spin 1.2s linear infinite; display: inline-block; }
@keyframes dv360spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.am-dv360-spinner { width: 28px; height: 28px; border: 3px solid var(--border-color, #e5e7eb); border-top-color: #1a73e8; border-radius: 50%; animation: spin .7s linear infinite; }
.am-dv360-error { padding: 16px 20px; color: #ef4444; font-size: 13px; }
.am-dv360-empty { color: var(--text-muted, #6b7280); font-size: 12.5px; font-style: italic; }

/* ── DV360 Segment Analysis ── */
.am-dv360-tab-bar { display: flex; gap: 2px; padding: 8px 20px 0; background: var(--bg-surface, #f9fafb); border-bottom: 1px solid var(--border-color, #e5e7eb); }
.am-dv360-tab-btn { font-size: 12px; font-weight: 600; padding: 6px 14px; border: none; border-bottom: 2px solid transparent; background: transparent; color: var(--text-muted, #6b7280); cursor: pointer; border-radius: 6px 6px 0 0; transition: all .12s; }
.am-dv360-tab-btn:hover { color: #1a73e8; background: rgba(26,115,232,.06); }
.am-dv360-tab-btn.active { color: #1a73e8; border-bottom-color: #1a73e8; background: transparent; }
.am-dv360-seg-toolbar { display: flex; align-items: center; gap: 8px; padding: 10px 20px; background: var(--bg-surface, #f9fafb); border-bottom: 1px solid var(--border-color, #e5e7eb); }
/* ── DV360 Segment Analysis — toolbar ── */
.am-dv360-seg-toolbar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.am-dv360-seg-select { font-size: 12px; padding: 4px 8px; border: 1px solid var(--border-color, #e5e7eb); border-radius: 6px; background: var(--bg-card, #fff); color: var(--text-primary, #111827); cursor: pointer; }
.am-dv360-seg-refresh-btn { font-size: 12px; font-weight: 500; padding: 4px 10px; border: 1px solid var(--border-color, #e5e7eb); border-radius: 6px; background: var(--bg-card, #fff); color: var(--text-muted, #6b7280); cursor: pointer; transition: all .12s; }
.am-dv360-seg-refresh-btn:hover { border-color: #1a73e8; color: #1a73e8; }
.am-dv360-seg-ai-btn { font-size: 12px; font-weight: 600; padding: 4px 12px; border: 1px solid #6366f1; border-radius: 6px; background: linear-gradient(135deg,#6366f1,#8b5cf6); color: #fff; cursor: pointer; transition: opacity .12s; }
.am-dv360-seg-ai-btn:hover { opacity: .85; }
.am-dv360-seg-ai-btn:disabled { opacity: .5; cursor: wait; }

/* ── Segment type pill tabs ── */
.am-dv360-seg-type-tabs { display: flex; gap: 4px; flex-wrap: wrap; padding: 10px 16px 0; }
.am-dv360-seg-type-btn { font-size: 11.5px; font-weight: 500; padding: 4px 12px; border: 1px solid var(--border-color, #e5e7eb); border-radius: 20px; background: var(--bg-card, #fff); color: var(--text-muted, #6b7280); cursor: pointer; white-space: nowrap; transition: all .12s; position: relative; }
.am-dv360-seg-type-btn:hover { border-color: #6366f1; color: #6366f1; }
.am-dv360-seg-type-btn.active { background: #6366f1; border-color: #6366f1; color: #fff; }
.seg-type-badge { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; background: #ef4444; color: #fff; font-size: 9px; font-weight: 700; margin-left: 4px; vertical-align: middle; }
.am-dv360-seg-type-btn.active .seg-type-badge { background: rgba(255,255,255,.3); }

/* ── Summary bar ── */
.am-dv360-seg-summary { display: flex; gap: 0; border-bottom: 1px solid var(--border-color, #e5e7eb); }
.am-dv360-seg-sum-item { flex: 1; text-align: center; padding: 12px 8px; font-size: 11px; color: var(--text-muted, #6b7280); border-right: 1px solid var(--border-color, #e5e7eb); }
.am-dv360-seg-sum-item span { font-size: 18px; font-weight: 700; display: block; }
.am-dv360-seg-sum-item:last-child { border-right: none; }

/* ── Segment section headers ── */
.am-dv360-seg-section { border-bottom: 1px solid var(--border-color, #e5e7eb); padding-bottom: 4px; }
.am-dv360-seg-section:last-child { border-bottom: none; }
.am-dv360-seg-section-title { padding: 10px 14px 4px; font-size: 10.5px; font-weight: 700; color: var(--text-muted, #6b7280); text-transform: uppercase; letter-spacing: .07em; }

/* ── Segment cards (replaces old table) ── */
.am-seg-card { padding: 9px 14px 8px; border-left: 3px solid transparent; border-bottom: 1px solid var(--border-color, #f3f4f6); }
.am-seg-card:last-child { border-bottom: none; }
.am-seg-card-exclude { border-left-color: #ef4444; background: rgba(239,68,68,.02); }
.am-seg-card-monitor { border-left-color: #f59e0b; background: rgba(245,158,11,.02); }
.am-seg-card-top     { border-left-color: #10b981; background: rgba(16,185,129,.02); }
.am-seg-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.am-seg-card-right { display: flex; align-items: center; gap: 5px; flex-shrink: 0; }
.am-seg-name { font-weight: 600; font-size: 12.5px; color: var(--text-primary, #111827); flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.am-seg-metrics { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 4px; }
.am-seg-metric { font-size: 11.5px; color: var(--text-muted, #6b7280); background: var(--bg-surface, #f3f4f6); padding: 2px 7px; border-radius: 6px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.am-seg-metric b { color: var(--text-primary, #374151); font-weight: 600; }
.am-seg-reason { font-size: 10.5px; color: var(--text-muted, #6b7280); font-style: italic; line-height: 1.5; margin-top: 2px; }

/* ── Status badges ── */
.am-seg-badge { display: inline-flex; align-items: center; gap: 3px; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 9999px; white-space: nowrap; }
.am-seg-badge-excl { background: rgba(239,68,68,.1);  color: #dc2626; }
.am-seg-badge-mon  { background: rgba(245,158,11,.12); color: #b45309; }
.am-seg-badge-top  { background: rgba(16,185,129,.1);  color: #059669; }
.am-seg-badge-ok   { background: rgba(107,114,128,.08); color: #6b7280; }

/* ── Exclude action button ── */
.am-seg-excl-btn { font-size: 11px; font-weight: 600; padding: 3px 10px; border: 1px solid #ef4444; border-radius: 6px; background: transparent; color: #ef4444; cursor: pointer; white-space: nowrap; transition: all .12s; }
.am-seg-excl-btn:hover:not(:disabled) { background: #ef4444; color: #fff; }
.am-seg-excl-btn:disabled { opacity: .5; cursor: wait; }
.am-seg-split-btn { font-size: 11px; font-weight: 600; padding: 3px 10px; border: 1px solid #6366f1; border-radius: 6px; background: transparent; color: #6366f1; cursor: pointer; white-space: nowrap; transition: all .12s; margin-left: 4px; }
.am-seg-split-btn:hover:not(:disabled) { background: #6366f1; color: #fff; }
.am-seg-split-btn:disabled { opacity: .5; cursor: wait; }
.am-seg-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: middle; }
.am-seg-excl-err { font-size: 10px; color: #ef4444; margin-top: 3px; max-width: 200px; line-height: 1.4; }

/* ── Creative segment card ── */
.am-seg-card-head--creative { align-items: flex-start; gap: 10px; }
.am-seg-creative-preview { flex-shrink: 0; width: 52px; height: 40px; border-radius: 6px; overflow: hidden; background: #f3f4f6; display: flex; align-items: center; justify-content: center; }
.am-seg-creative-thumb { width: 100%; height: 100%; object-fit: contain; display: block; }
.am-seg-creative-icon { font-size: 18px; color: #9ca3af; line-height: 1; }
.am-seg-creative-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.am-seg-creative-info .am-seg-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.am-seg-creative-meta { font-size: 10.5px; color: #9ca3af; font-variant-numeric: tabular-nums; letter-spacing: .01em; }

/* ── Legacy table classes (kept for backward compat) ── */
.seg-badge { font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 9999px; white-space: nowrap; }
.seg-badge-exclude { background: rgba(239,68,68,.1);  color: #ef4444; }
.seg-badge-monitor { background: rgba(245,158,11,.1); color: #d97706; }
.seg-badge-ok      { background: rgba(107,114,128,.08); color: #6b7280; }
.seg-badge-top     { background: rgba(16,185,129,.1);  color: #059669; }
.seg-exclude-btn { font-size: 11px; font-weight: 600; padding: 3px 9px; border: 1px solid #ef4444; border-radius: 6px; background: rgba(239,68,68,.06); color: #ef4444; cursor: pointer; white-space: nowrap; transition: all .12s; }
.seg-exclude-btn:hover:not(:disabled) { background: #ef4444; color: #fff; }
.seg-exclude-btn:disabled { opacity: .6; cursor: wait; }

/* ── Empty / error states ── */
.am-dv360-seg-empty { padding: 32px 20px; text-align: center; color: var(--text-muted, #6b7280); font-size: 13px; line-height: 1.6; }
#amDv360SegBody { padding: 0; overflow-y: auto; }

/* ── AI suggestions panel ── */
#amDv360AiSuggestBody { border-bottom: 1px solid var(--border-color, #e5e7eb); }
.am-dv360-ai-panel { padding: 12px 16px; }
.am-dv360-ai-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.am-dv360-ai-title { font-size: 13px; font-weight: 700; color: var(--text-primary, #111827); }
.am-dv360-ai-list { display: flex; flex-direction: column; gap: 8px; }
.am-dv360-ai-card { background: var(--bg-surface, #f9fafb); border: 1px solid var(--border-color, #e5e7eb); border-radius: 10px; padding: 12px 14px; }
.am-dv360-ai-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.am-dv360-ai-icon { font-size: 16px; flex-shrink: 0; }
.am-dv360-ai-card-title { font-size: 13px; font-weight: 600; color: var(--text-primary, #111827); flex: 1; }
.am-dv360-ai-impact { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 9999px; background: rgba(0,0,0,.06); }
.am-dv360-ai-card-reason { font-size: 12px; color: var(--text-muted, #6b7280); line-height: 1.5; margin-bottom: 8px; }
.am-dv360-ai-manual-note { font-size: 11px; color: var(--text-muted, #9ca3af); font-style: italic; }

/* ── Google Ads Optimizer UI ── */
.gads-opt-metrics { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.gads-opt-metric { display: flex; flex-direction: column; background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 6px; padding: 6px 10px; min-width: 64px; }
.gads-opt-metric-label { font-size: 10px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .04em; }
.gads-opt-metric-val { font-size: 13px; font-weight: 700; color: #111827; margin-top: 2px; }
.gads-opt-delta { font-size: 12.5px; color: #374151; margin-bottom: 8px; line-height: 1.5; }
.gads-opt-impact { font-size: 12px; color: #374151; background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 6px; padding: 6px 10px; margin-top: 8px; }
.gads-conf-badge { font-size: 10px; font-weight: 600; color: #6b7280; background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 9999px; padding: 1px 7px; }

/* ── Google Ads Expansion Mode Panel ── */
.gads-expansion-panel { background: linear-gradient(135deg, rgba(99,102,241,.06) 0%, rgba(16,185,129,.06) 100%); border: 1px solid rgba(99,102,241,.2); border-radius: 12px; padding: 16px; margin-bottom: 16px; }
.gads-expansion-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 12px; }
.gads-expansion-icon { font-size: 24px; flex-shrink: 0; margin-top: 1px; }
.gads-expansion-title-col { flex: 1; }
.gads-expansion-title { font-size: 14px; font-weight: 700; color: #111827; line-height: 1.3; }
.gads-expansion-sub { font-size: 12px; color: #6b7280; margin-top: 3px; line-height: 1.4; }
.gads-expansion-product { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; background: rgba(255,255,255,.7); border: 1px solid rgba(99,102,241,.15); border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.gads-expansion-product-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: #9ca3af; }
.gads-expansion-product-text { font-size: 13px; font-weight: 600; color: #111827; flex: 1; }
.gads-expansion-lang-badge { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 9999px; background: rgba(99,102,241,.1); color: #6366f1; }
.gads-expansion-reason { font-size: 12px; color: #374151; line-height: 1.5; margin-bottom: 8px; }
.gads-expansion-insight { font-size: 12px; color: #6b7280; background: rgba(99,102,241,.06); border-left: 3px solid #6366f1; border-radius: 0 6px 6px 0; padding: 8px 12px; margin-bottom: 12px; line-height: 1.5; }
.gads-expansion-add-all-btn { width: 100%; padding: 9px 16px; background: linear-gradient(135deg, #6366f1, #8b5cf6); color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 7px; transition: opacity .12s; }
.gads-expansion-add-all-btn:hover { opacity: .88; }
.gads-expansion-add-all-btn:disabled { opacity: .6; cursor: wait; }
.gads-mode-btn { font-size: 11.5px; font-weight: 500; padding: 4px 12px; border: 1px solid #e5e7eb; border-radius: 6px; background: #fff; color: #6b7280; cursor: pointer; transition: all .12s; }
.gads-mode-btn:hover { border-color: #1877F2; color: #1877F2; }
.gads-mode-btn.active { background: #1877F2; border-color: #1877F2; color: #fff; }

.am-opt-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); backdrop-filter: blur(4px); z-index: 99999; display: none; justify-content: center; align-items: flex-start; padding: 40px 20px; overflow-y: auto; }
/* ═══════════════════════════════════════
   OPTIMIZATION INSIGHTS  — modern design
   ═══════════════════════════════════════ */
.am-opt-modal {
  background: #fff; border-radius: 16px;
  width: 800px; max-width: 96vw;
  box-shadow: 0 20px 60px rgba(0,0,0,.18);
  animation: amOptIn .2s cubic-bezier(.16,1,.3,1);
  display: flex; flex-direction: column; overflow: hidden;
}
@keyframes amOptIn { from { opacity: 0; transform: translateY(-16px) scale(.98) } to { opacity: 1; transform: translateY(0) scale(1) } }
@keyframes fadeInRow { from { opacity: 0; background: rgba(99,102,241,.12); } to { opacity: 1; background: transparent; } }
.am-opt-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
  flex-shrink: 0; gap: 12px;
}
.am-opt-header-left { display: flex; align-items: center; gap: 12px; }
.am-opt-header-icon {
  width: 36px; height: 36px; border-radius: 9px; flex-shrink: 0;
  background: #1a1a1a;
  display: flex; align-items: center; justify-content: center;
}
.am-opt-header-icon svg { color: #fff; }
.am-opt-title { font-size: 15px; font-weight: 700; color: #111827; letter-spacing: -.01em; }
.am-opt-subtitle {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 2px; font-size: 11.5px; font-weight: 500;
  color: #6b7280; background: #efefef;
  padding: 2px 8px; border-radius: 20px;
}
.am-opt-daterange {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 4px; font-size: 11px; font-weight: 500;
  color: #6366f1; background: rgba(99,102,241,.08);
  padding: 2px 8px; border-radius: 20px;
}
.am-opt-table-daterange {
  display: inline-flex; align-items: center; gap: 3px;
  margin-left: 8px; font-size: 10.5px; font-weight: 500;
  color: #6366f1; background: rgba(99,102,241,.08);
  padding: 1px 7px; border-radius: 20px;
  vertical-align: middle; white-space: nowrap;
}
.am-opt-table-daterange svg { flex-shrink: 0; opacity: .8; }
.am-opt-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.am-opt-hist-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 6px 12px; border: 1px solid #e5e7eb; border-radius: 7px;
  background: #fff; color: #374151; font-size: 12px; font-weight: 500;
  cursor: pointer; transition: all .15s;
}
.am-opt-hist-btn:hover { border-color: #adb5bd; color: #1a1a1a; background: #f1f3f5; }
.am-opt-close {
  width: 30px; height: 30px; border-radius: 7px;
  background: rgba(0,0,0,.05); border: none;
  color: #6b7280; cursor: pointer; font-size: 17px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
}
.am-opt-close:hover { background: #f1f3f5; color: #374151; }
.am-opt-body { padding: 16px 20px; max-height: 72vh; overflow-y: auto; }

/* ── Summary stat chips ── */
.am-opt-summary { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.am-opt-summary-chip {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 8px;
  font-size: 12px; font-weight: 600;
  border: 1px solid transparent;
}
.am-opt-summary-chip-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.am-opt-summary-chip.high { background: #fff5f5; border-color: #ffd7d7; color: #c0392b; }
.am-opt-summary-chip.high .am-opt-summary-chip-dot { background: #c0392b; }
.am-opt-summary-chip.medium { background: #fffaf0; border-color: #fde8a0; color: #b7770d; }
.am-opt-summary-chip.medium .am-opt-summary-chip-dot { background: #e0a020; }
.am-opt-summary-chip.low { background: #f0f4ff; border-color: #c5d5f5; color: #2c5fbd; }
.am-opt-summary-chip.low .am-opt-summary-chip-dot { background: #1877F2; }

/* ── Affected entities ── */
.am-opt-affected {
  background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 10px;
  padding: 10px 14px; margin-bottom: 14px;
}
.am-opt-affected-title { font-size: 10.5px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; }
.am-opt-affected-grid { display: flex; gap: 14px; flex-wrap: wrap; }
.am-opt-affected-col { flex: 1; min-width: 110px; }
.am-opt-affected-label { font-size: 10.5px; font-weight: 600; color: #9ca3af; text-transform: uppercase; letter-spacing: .04em; margin-bottom: 4px; }
.am-opt-affected-item {
  display: inline-flex; align-items: center;
  font-size: 11.5px; color: #374151; font-weight: 500;
  background: #fff; border: 1px solid #e5e7eb;
  padding: 2px 8px; border-radius: 5px; margin: 2px 0;
  max-width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.am-opt-affected-more { font-size: 11px; color: #374151; font-weight: 500; margin-top: 2px; }
.am-opt-section-title { font-size: 11.5px; font-weight: 700; color: #6b7280; margin-bottom: 8px; text-transform: uppercase; letter-spacing: .07em; display: flex; align-items: center; gap: 7px; }
.am-opt-section-title::before { content: ''; display: inline-block; width: 3px; height: 12px; background: #adb5bd; border-radius: 2px; }
.am-opt-section-desc { font-size: 12.5px; color: #6b7280; margin: 0 0 12px; line-height: 1.6; padding-left: 10px; }
.am-opt-why {
  font-size: 12.5px; color: #374151; line-height: 1.6;
  margin-bottom: 10px; padding: 9px 12px;
  background: #fefdf5; border-left: 3px solid #d4a017;
  border-radius: 0 6px 6px 0;
}
.am-opt-vr-explain { font-size: 11.5px; color: #6b7280; margin: 3px 0 8px; line-height: 1.5; }

/* Optimization History */
.am-hist-list { display: flex; flex-direction: column; gap: 8px; }
.am-hist-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; background: var(--bg-secondary); border: 1px solid var(--border); border-radius: 10px; transition: border-color .15s; }
.am-hist-item:hover { border-color: rgba(24,119,242,.2); }
.am-hist-item.am-hist-rolled-back { opacity: .55; }
.am-hist-item-left { display: flex; align-items: flex-start; gap: 10px; flex: 1; min-width: 0; }
.am-hist-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 2px; }
.am-hist-info { flex: 1; min-width: 0; }
.am-hist-desc { font-size: .82rem; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.am-hist-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.am-hist-entity { font-size: .72rem; color: var(--primary); background: rgba(24,119,242,.08); padding: 1px 8px; border-radius: 4px; font-weight: 500; }
.am-hist-date { font-size: .7rem; color: var(--text-muted); }
.am-hist-adsets { font-size: .7rem; color: var(--text-muted); }
.am-hist-badge-verified { font-size: .66rem; font-weight: 700; color: #1877F2; background: rgba(24,119,242,.1); padding: 1px 8px; border-radius: 4px; }
.am-hist-badge-rb { font-size: .66rem; font-weight: 700; color: #b7770d; background: rgba(224,160,32,.1); padding: 1px 8px; border-radius: 4px; }
.am-hist-rollback-btn { display: flex; align-items: center; gap: 5px; padding: 6px 12px; border: 1px solid #e5e7eb; border-radius: 7px; background: #fff; color: #6b7280; font-size: .76rem; font-weight: 600; cursor: pointer; white-space: nowrap; flex-shrink: 0; transition: all .15s; }
.am-hist-rollback-btn:hover { background: #f8f9fa; color: #374151; border-color: #adb5bd; }
.am-hist-rollback-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Empty / no-insights ── */
.am-opt-empty { text-align: center; padding: 32px 20px; }
.am-opt-empty-icon { width: 52px; height: 52px; border-radius: 50%; background: #e8f5e9; display: flex; align-items: center; justify-content: center; margin: 0 auto 14px; }
.am-opt-empty-title { font-size: 15px; font-weight: 700; color: #2e7d32; margin: 0 0 6px; }
.am-opt-empty-desc { font-size: 13px; color: #6b7280; max-width: 340px; margin: 0 auto; line-height: 1.6; }
.am-opt-lq-empty { font-size: 12.5px; color: #6b7280; background: #f8f9fa; border: 1px dashed #ced4da; border-radius: 8px; padding: 10px 14px; margin-bottom: 12px; line-height: 1.6; }

/* ── Insight cards ── */
.am-opt-card {
  border: 1px solid #e5e7eb; border-radius: 10px; margin-bottom: 8px;
  overflow: hidden; transition: box-shadow .15s, border-color .15s;
  box-shadow: 0 1px 2px rgba(0,0,0,.03);
}
.am-opt-card:hover { box-shadow: 0 3px 12px rgba(0,0,0,.07); border-color: #d1d5db; }
.am-opt-card.am-opt-sev-high { border-left: 3px solid #c0392b; }
.am-opt-card.am-opt-sev-medium { border-left: 3px solid #e0a020; }
.am-opt-card.am-opt-sev-low { border-left: 3px solid #1877F2; }
.am-opt-card-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; user-select: none; }
.am-opt-card-head:hover { background: #f9fafb; }
.am-opt-card-icon-wrap {
  width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 1.1rem;
}
.am-opt-sev-high .am-opt-card-icon-wrap { background: #fff0ee; }
.am-opt-sev-medium .am-opt-card-icon-wrap { background: #fff8e6; }
.am-opt-sev-low .am-opt-card-icon-wrap { background: #eef3ff; }
.am-opt-card-icon { display: flex; }
.am-opt-card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.am-opt-card-title-row { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.am-opt-card-title { font-size: 13.5px; font-weight: 600; color: #111827; }
.am-opt-sev-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 9999px;
  text-transform: uppercase; letter-spacing: .04em;
}
.am-opt-sev-badge.am-opt-sev-high { background: #fff0ee; color: #c0392b; border: 1px solid #ffd7d7; }
.am-opt-sev-badge.am-opt-sev-medium { background: #fff8e6; color: #b7770d; border: 1px solid #fde8a0; }
.am-opt-sev-badge.am-opt-sev-low { background: #eef3ff; color: #2c5fbd; border: 1px solid #c5d5f5; }
.am-opt-adset-badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 500; color: #6b46c1;
  background: #f5f3ff; border: 1px solid #ddd6fe; border-radius: 5px;
  padding: 2px 7px; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.am-opt-hierarchy { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.am-opt-hier-campaign { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: #6b7280; }
.am-opt-hier-adset { display: inline-flex; align-items: center; gap: 3px; font-size: 11px; color: #6b46c1; font-weight: 500; }
.am-opt-hier-sep { font-size: 10px; color: #9ca3af; }
.am-opt-vr-account { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #6b7280; margin: 4px 0 8px; }
.am-opt-entity-table-wrap { margin: 10px 0 4px; overflow-x: auto; }
.am-opt-entity-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.am-opt-entity-table thead th {
  text-align: left; font-size: 11px; font-weight: 600; color: #6b7280;
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 1px solid #e5e7eb; padding: 5px 8px;
}
.am-opt-entity-table thead th.am-opt-et-r { text-align: right; }
.am-opt-entity-table tbody tr { border-bottom: 1px solid #f3f4f6; }
.am-opt-entity-table tbody tr:last-child { border-bottom: none; }
.am-opt-entity-table tbody td { padding: 6px 8px; color: #374151; vertical-align: middle; }
.am-opt-et-r { text-align: right; font-variant-numeric: tabular-nums; }
.am-opt-et-name { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.am-opt-et-row-bad { background: #fff8f6; }
.am-opt-et-row-best { background: #f0fdf4; }
.am-opt-et-metric-bad { color: #dc2626; font-weight: 700; }
.am-opt-et-metric-best { color: #16a34a; font-weight: 700; }
.am-opt-et-badge { font-size: 10px; font-weight: 600; padding: 1px 5px; border-radius: 4px; margin-left: 5px; white-space: nowrap; }
.am-opt-et-badge-bad { background: #fee2e2; color: #b91c1c; }
.am-opt-et-badge-best { background: #dcfce7; color: #15803d; }
.am-opt-toggle { background: none; border: none; cursor: pointer; color: #9ca3af; padding: 5px; border-radius: 5px; transition: transform .2s, background .12s; flex-shrink: 0; }
.am-opt-toggle:hover { background: #f3f4f6; color: #374151; }
.am-opt-card.expanded .am-opt-toggle { transform: rotate(180deg); }
.am-opt-card-detail { display: none; padding: 0 14px 14px; border-top: 1px solid #f3f4f6; }
.am-opt-card.expanded .am-opt-card-detail { display: block; padding-top: 12px; }
.am-opt-detail-text { font-size: 12.5px; color: #6b7280; margin: 0 0 9px; line-height: 1.5; }

/* ── Chart bars ── */
.am-opt-chart-section { margin: 10px 0; background: #f8f9fa; border: 1px solid #f0f0f0; border-radius: 8px; padding: 10px 12px; }
.am-opt-chart-title { font-size: 10.5px; font-weight: 700; color: #9ca3af; text-transform: uppercase; letter-spacing: .07em; margin-bottom: 8px; }
.am-opt-chart-header { display: flex; align-items: center; gap: 10px; font-size: 10px; font-weight: 700; color: #6b7280; text-transform: uppercase; letter-spacing: .05em; padding-bottom: 5px; border-bottom: 1px solid #e0e4e8; margin-bottom: 6px; }
.am-opt-bar-header-bar { flex: 1; padding-left: 2px; color: #9ca3af; }
.am-opt-bar-header-right { text-align: right; font-weight: 700; color: #6b7280; }
.am-opt-chart { display: flex; flex-direction: column; gap: 5px; }
.am-opt-bar-row { display: flex; align-items: center; gap: 10px; font-size: 12px; }
.am-opt-bar-label { width: 96px; text-align: right; color: #374151; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex-shrink: 0; }
.am-opt-bar-wrap { flex: 1; height: 18px; background: #e9ecef; border-radius: 4px; overflow: hidden; }
.am-opt-bar { height: 100%; border-radius: 4px; min-width: 3px; transition: width .4s ease; }
.am-opt-bar-results { width: 40px; text-align: right; color: #374151; font-size: 11.5px; font-weight: 600; flex-shrink: 0; }
.am-opt-bar-val { width: 52px; text-align: right; color: #9ca3af; font-size: 11px; flex-shrink: 0; }
.am-opt-bar-metric { width: 64px; text-align: right; font-weight: 700; color: #374151; font-size: 11.5px; flex-shrink: 0; }
.am-opt-bar-metric.am-opt-best { color: #1877F2; }

/* ── Action recommendation ── */
.am-opt-action {
  background: #f8f9fa;
  border: 1px solid #e9ecef; border-radius: 8px;
  padding: 10px 14px; font-size: 12.5px; color: #374151; line-height: 1.6;
  margin-top: 10px; display: flex; gap: 8px; align-items: flex-start;
}
.am-opt-action svg { flex-shrink: 0; margin-top: 2px; color: #6b7280; }

/* ── Action buttons ── */
.am-opt-apply-row { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }
.am-opt-apply-btn {
  background: #1a1a1a; color: #fff;
  border: none; border-radius: 7px; padding: 7px 16px;
  font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: all .15s; display: inline-flex; align-items: center; gap: 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.1);
}
.am-opt-apply-btn:hover { background: #333; box-shadow: 0 3px 10px rgba(0,0,0,.15); }
.am-opt-apply-btn:disabled { opacity: .7; cursor: not-allowed; }
.am-opt-apply-btn.applied { background: #1877F2; box-shadow: 0 2px 8px rgba(24,119,242,.25); cursor: default; }
.am-opt-pause-btn { background: #c0392b; box-shadow: 0 1px 4px rgba(192,57,43,.2); }
.am-opt-pause-btn:hover { background: #a93226; box-shadow: 0 3px 10px rgba(192,57,43,.3); }

.am-opt-vr { margin-top: 12px; background: #f8f9fa; border: 1px solid #e9ecef; border-radius: 8px; padding: 12px; }
.am-opt-vr-title { font-size: 13px; font-weight: 600; color: #374151; display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.am-opt-vr-account { font-size: 11px; color: #6b7280; display: flex; align-items: center; gap: 5px; margin: 2px 0 6px; }
.am-opt-vr-rules { display: flex; flex-direction: column; gap: 6px; }
.am-opt-vr-rule { display: flex; align-items: center; gap: 10px; background: #fff; border-radius: 6px; padding: 8px 10px; border: 1px solid #e9ecef; }
.am-opt-vr-arrow { font-size: 1rem; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center; border-radius: 50%; font-weight: 700; }
.am-opt-vr-boost .am-opt-vr-arrow { background: #eef3ff; color: #1877F2; }
.am-opt-vr-decrease .am-opt-vr-arrow { background: #fff0ee; color: #c0392b; }
.am-opt-vr-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.am-opt-vr-segment { font-size: 12.5px; font-weight: 500; color: #111827; }
.am-opt-vr-desc { font-size: 11.5px; color: #6b7280; }
.am-opt-vr-pct-wrap { display: flex; align-items: center; gap: 3px; font-size: 13px; font-weight: 600; color: #1a1a1a; }
.am-opt-vr-pct { width: 48px; border: 1px solid #d1d5db; border-radius: 5px; padding: 4px 5px; font-size: 13px; font-weight: 600; color: #1a1a1a; text-align: center; background: #fff; outline: none; }
.am-opt-vr-pct:focus { border-color: #1877F2; box-shadow: 0 0 0 2px rgba(24,119,242,.12); }
.am-opt-vr-apply { margin-top: 10px; width: 100%; padding: 8px 16px; border: none; border-radius: 7px; background: #1a1a1a; color: #fff; font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: all .15s; }
.am-opt-vr-apply:hover { background: #333; }
.am-opt-vr-apply:disabled { opacity: .65; cursor: not-allowed; }
.am-opt-vr-apply.applied { background: #1877F2; }

.am-opt-breakdowns { margin-top: 16px; border-top: 1px solid #e9ecef; padding-top: 14px; }
.am-opt-bd-section { border: 1px solid #e9ecef; border-radius: 8px; margin-bottom: 6px; overflow: hidden; }
.am-opt-bd-label { display: flex; align-items: center; gap: 7px; padding: 9px 12px; font-size: 12.5px; font-weight: 600; color: #374151; cursor: pointer; user-select: none; background: #f8f9fa; }
.am-opt-bd-label:hover { background: #f1f3f5; }
.am-opt-bd-label svg { margin-left: auto; transition: transform .2s; }
.am-opt-bd-section.open .am-opt-bd-label svg { transform: rotate(180deg); }
.am-opt-bd-count { font-weight: 400; color: #9ca3af; font-size: 11.5px; }
.am-opt-bd-table { display: none; }
.am-opt-bd-section.open .am-opt-bd-table { display: block; }
.am-opt-bd-table table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.am-opt-bd-table th { background: #f8f9fa; padding: 5px 8px; text-align: right; font-weight: 600; color: #9ca3af; border-top: 1px solid #e9ecef; white-space: nowrap; text-transform: uppercase; font-size: 10.5px; letter-spacing: .04em; }
.am-opt-bd-table th:first-child { text-align: left; }
.am-opt-bd-table td { padding: 5px 8px; text-align: right; color: #374151; border-top: 1px solid #f3f4f6; white-space: nowrap; }
.am-opt-bd-table td:first-child { text-align: left; font-weight: 500; }
.am-bd-act-col { text-align: center !important; width: 80px; }
.am-bd-act-cell { text-align: center !important; padding: 3px 6px !important; }
.am-bd-excl-btn { font-size: 10.5px; padding: 2px 8px; border-radius: 4px; border: 1px solid #d1d5db; background: #fff; color: #374151; cursor: pointer; white-space: nowrap; transition: background .15s,border-color .15s,color .15s; }
.am-bd-excl-btn:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }
.am-bd-excl-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Graph cell (Figma-style inline chart) */
.am-graph-col { padding: 0 !important; }
.am-table td.am-graph-col { height: 58px; max-height: 58px; overflow: visible; }
.am-graph-cell { display: flex; flex-direction: column; justify-content: space-between; height: 58px; padding: 6px 8px 4px; box-sizing: border-box; }
.am-graph-val { font-size: 10px; font-weight: 400; color: #808080; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; letter-spacing: -0.02px; }
.am-graph-vs { font-size: 8px; color: #359BFF; }
.am-graph-svg { width: 100%; height: 24px; display: block; flex-shrink: 0; }

/* Daily Spent bar chart cell */
.am-daily-cell { display: flex; flex-direction: column; gap: 2px; }
.am-daily-val { font-size: 11px; font-weight: 600; color: var(--text-primary, #334155); white-space: nowrap; }
.am-daily-svg { width: 100px; height: 28px; display: block; }

/* Duration pill (Figma-style) */
.am-duration-pill { display: inline-flex; align-items: center; justify-content: center; padding: 3px 12px; background: #E3F1FF; color: #359BFF; font-size: 13px; font-weight: 700; border-radius: 10px; white-space: nowrap; line-height: 18px; }

/* Budget Spent cell with progress bar */
.am-budget-amount { font-size: 13px; font-weight: 500; color: var(--text-primary, #2C454A); }

/* Legacy spark styles kept for hover tooltip */
.am-spark { display: inline-flex; align-items: center; gap: 4px; position: relative; cursor: pointer; }
.am-spark > svg { flex-shrink: 0; }
.am-spark-val { font-size: 13px; font-weight: 600; white-space: nowrap; }
.am-spark-tooltip { display: none; position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 1000; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.15), 0 2px 8px rgba(0,0,0,.06); padding: 0; width: 400px; overflow: hidden; }
.am-spark:hover .am-spark-tooltip { display: block; pointer-events: auto; }
.am-spark-tt-title { font-size: .82rem; font-weight: 700; color: #1f2937; padding: 14px 18px 0; }
.am-spark-tt-chart { position: relative; padding: 4px 12px 0; }
.am-spark-tt-chart svg { display: block; cursor: crosshair; }
.am-sp-callout { position: absolute; top: 0; background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; box-shadow: 0 4px 12px rgba(0,0,0,.1); padding: 8px 14px; pointer-events: none; min-width: 100px; z-index: 2; }
.am-sp-callout-date { font-size: .7rem; color: #9ca3af; margin-bottom: 2px; }
.am-sp-callout-label { font-size: .68rem; color: #6b7280; }
.am-sp-callout-val { font-size: 1.1rem; font-weight: 700; color: #111827; }
.am-spark-tt-footer { display: flex; justify-content: space-between; padding: 10px 18px; border-top: 1px solid #f3f4f6; font-size: .72rem; color: #9ca3af; background: #fafafa; }
.am-spark-tt-footer span { white-space: nowrap; }

.meta-connect-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; padding: 60px 30px; text-align: center; background: var(--bg-elevated); border: 1px dashed var(--border); border-radius: 12px; margin: 20px 0; }
.meta-connect-card h3 { font-size: 1.1rem; font-weight: 700; color: var(--text); margin: 0; }
.meta-connect-card p { font-size: .88rem; color: var(--text-secondary); margin: 0; max-width: 420px; line-height: 1.5; }
.meta-connect-icon { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: rgba(99,102,241,.08); border-radius: 50%; }
.btn-meta-connect { display: inline-flex; align-items: center; gap: 8px; padding: 10px 24px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: .88rem; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.btn-meta-connect:hover { opacity: .9; }
.btn-meta-connect svg { flex-shrink: 0; }

/* Lead Forms Empty States */
.lf-empty-state { display: flex; align-items: flex-start; gap: 28px; padding: 40px 36px; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: 16px; margin: 8px 0; max-width: 680px; }
.lf-empty-state--loading { align-items: center; gap: 14px; padding: 48px 36px; color: var(--text-muted); font-size: 14px; font-weight: 500; }
.lf-empty-icon { width: 64px; height: 64px; min-width: 64px; border-radius: 14px; display: flex; align-items: center; justify-content: center; }
.lf-empty-icon--connect { background: linear-gradient(135deg,#1877f2 0%,#42a5f5 100%); color: #fff; }
.lf-empty-icon--account { background: linear-gradient(135deg,#1a1a1a 0%,#818cf8 100%); color: #fff; }
.lf-empty-icon--warn { background: linear-gradient(135deg,#f59e0b 0%,#fbbf24 100%); color: #fff; }
.lf-empty-body { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.lf-empty-title { font-size: 17px; font-weight: 700; color: var(--text); margin: 0; line-height: 1.3; }
.lf-empty-desc { font-size: 13.5px; color: var(--text-secondary); margin: 0; line-height: 1.6; }
.lf-empty-steps { display: flex; flex-direction: column; gap: 7px; margin-top: 4px; }
.lf-empty-step { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--text-secondary); line-height: 1.5; }
.lf-step-num { min-width: 20px; height: 20px; border-radius: 50%; background: rgba(99,102,241,.12); color: #1a1a1a; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.lf-step-num--warn { background: rgba(245,158,11,.12); color: #d97706; }
.lf-empty-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }
.lf-empty-btn { display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; background: #1a1a1a; color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: opacity .15s; }
.lf-empty-btn:hover { opacity: .88; }
.lf-empty-btn--secondary { background: transparent; color: var(--text); border: 1px solid var(--border); }
.lf-empty-btn--secondary:hover { background: var(--bg-hover,rgba(0,0,0,.04)); opacity: 1; }
@media (max-width: 600px) { .lf-empty-state { flex-direction: column; } .lf-empty-icon { width: 48px; height: 48px; min-width: 48px; border-radius: 10px; } }

/* Table title bar */
.am-camp-type-badge { display: inline-block; padding: 1px 6px; border-radius: 4px; font-size: 10px; font-weight: 600; vertical-align: middle; margin-left: 4px; }
.am-camp-pmax { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.am-camp-search { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; }
.am-camp-display { background: #f3e8ff; color: #6b21a8; border: 1px solid #e9d5ff; }
.am-camp-shopping { background: #d1fae5; color: #065f46; border: 1px solid #a7f3d0; }
.am-camp-video { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; }
.am-drilldown-banner { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: #eff6ff; border: 1px solid #bfdbfe; border-bottom: none; border-radius: 12px 12px 0 0; font-size: 12px; color: #1e40af; }
.am-drilldown-banner + .am-table-title-bar { border-radius: 0; }
.am-drilldown-banner strong { font-weight: 600; }
.am-drilldown-clear { margin-left: auto; padding: 2px 8px; border: 1px solid #93c5fd; border-radius: 4px; background: #fff; color: #1d4ed8; font-size: 11px; cursor: pointer; }
.am-drilldown-clear:hover { background: #dbeafe; }
.am-table-title-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; background: #fff; border: 1px solid #e5e7eb; border-bottom: none; border-radius: 12px 12px 0 0; }
.am-table-title { display: flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: #2C454A; }
.am-table-title svg { color: #359BFF; }
.am-table-subtitle { font-size: 13px; color: #949D9E; font-weight: 400; margin-left: auto; }

/* Scroll loading indicator */
.am-scroll-loading { text-align: center; padding: 16px; font-size: 13px; color: #949D9E; display: flex; align-items: center; justify-content: center; gap: 8px; }
.am-scroll-end { text-align: center; padding: 10px; font-size: 12px; color: #B0B0B0; }

/* Platform-split tables */
.am-platform-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 20px; font-size: 11px; font-weight: 600; white-space: nowrap; line-height: 1.6; }
.am-platform-badge--google { background: #e8f0fe; color: #1a73e8; }
.am-platform-badge--meta   { background: #e7f0fd; color: #1877f2; }
.am-platform-badge--dv360  { background: #e3f0ff; color: #1a56db; }

/* Keyword match type badges */
.am-match-badge { display: inline-block; padding: 1px 7px; border-radius: 10px; font-size: 10px; font-weight: 700; text-transform: capitalize; letter-spacing: .02em; }
.am-match-exact  { background: #e8f5e9; color: #2e7d32; }
.am-match-phrase { background: #fff8e1; color: #f57f17; }
.am-match-broad  { background: #f3e5f5; color: #7b1fa2; }

/* Quality score badges */
.am-qs-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.am-qs-good { background: #e8f5e9; color: #2e7d32; }
.am-qs-ok   { background: #fff8e1; color: #f57f17; }
.am-qs-bad  { background: #ffebee; color: #c62828; }
.dark .am-platform-badge--google { background: #1a2e5a; color: #8ab4f8; }
.dark .am-platform-badge--meta   { background: #1a2e4a; color: #7fa8f5; }
.dark .am-platform-badge--dv360  { background: #1a2e5a; color: #7fa8f5; }
.am-platform-section { margin-bottom: 20px; }
.am-platform-section-hdr { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #fff; border: 1px solid #e5e7eb; border-bottom: none; border-radius: 10px 10px 0 0; }
.am-platform-section-title { font-size: 13px; font-weight: 700; color: #1f2937; }
.am-platform-section-count { font-size: 12px; color: #9ca3af; font-weight: 400; margin-left: auto; }
.am-platform-section-hdr + .am-platform-wrap { border-top-left-radius: 0; border-top-right-radius: 0; }
.am-platform-wrap { max-height: 480px; overflow: auto; -webkit-overflow-scrolling: touch; }
.am-platform-empty { padding: 24px; text-align: center; font-size: 13px; color: #9ca3af; border: 1px solid #e5e7eb; border-top: none; border-radius: 0 0 10px 10px; background: #fafafa; }

/* Keyword match type badges */
.am-match-badge { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 11px; font-weight: 600; text-transform: capitalize; }
.am-match-exact  { background: #dbeafe; color: #1d4ed8; }
.am-match-phrase { background: #fef3c7; color: #92400e; }
.am-match-broad  { background: #f3f4f6; color: #4b5563; }
.dark .am-match-exact  { background: #1e3a5f; color: #93c5fd; }
.dark .am-match-phrase { background: #3b2a00; color: #fcd34d; }
.dark .am-match-broad  { background: #374151; color: #d1d5db; }

/* Quality score badges */
.am-qs-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; }
.am-qs-good { background: #dcfce7; color: #15803d; }
.am-qs-ok   { background: #fef9c3; color: #854d0e; }
.am-qs-bad  { background: #fee2e2; color: #b91c1c; }
.dark .am-qs-good { background: #14532d; color: #86efac; }
.dark .am-qs-ok   { background: #3b2a00; color: #fde68a; }
.dark .am-qs-bad  { background: #450a0a; color: #fca5a5; }

/* Keyword match type badges */
.am-match-badge { display: inline-block; padding: 2px 7px; border-radius: 4px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.am-match-exact  { background: #dbeafe; color: #1d4ed8; }
.am-match-phrase { background: #fef9c3; color: #854d0e; }
.am-match-broad  { background: #f3f4f6; color: #6b7280; }
.dark .am-match-exact  { background: #1e3a5f; color: #93c5fd; }
.dark .am-match-phrase { background: #3b2f00; color: #fcd34d; }
.dark .am-match-broad  { background: #374151; color: #9ca3af; }

/* Keyword quality score badges */
.am-qs-badge { display: inline-flex; align-items: baseline; gap: 1px; padding: 2px 8px; border-radius: 20px; font-size: 12px; font-weight: 700; }
.am-qs-good { background: #dcfce7; color: #166534; }
.am-qs-ok   { background: #fef9c3; color: #854d0e; }
.am-qs-bad  { background: #fee2e2; color: #991b1b; }
.dark .am-qs-good { background: #14532d; color: #86efac; }
.dark .am-qs-ok   { background: #422006; color: #fcd34d; }
.dark .am-qs-bad  { background: #450a0a; color: #fca5a5; }

/* Board header (Lead Forms / Instagram boards) */
.acc-board { margin-bottom: 24px; }
.acc-board-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #fff; border: 1px solid #e5e7eb; border-radius: 12px 12px 0 0; border-bottom: none; }
.acc-board-title { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: #111827; }
.acc-board-title svg { color: #6b7280; flex-shrink: 0; }
.acc-board-count { font-size: 12px; font-weight: 400; color: #9ca3af; margin-left: 2px; }
.acc-add-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; font-size: 13px; font-weight: 500; color: #374151; background: #fff; border: 1px solid #d1d5db; border-radius: 8px; cursor: pointer; transition: all .15s; white-space: nowrap; }
.acc-add-btn:hover { border-color: #1a1a1a; color: #1a1a1a; background: #f5f3ff; }
.acc-add-btn:active { background: #ede9fe; }
.acc-add-btn svg { flex-shrink: 0; }

/* Base table styles — shadcn-inspired */
.acc-table-wrap { border: 1px solid #e5e7eb; border-radius: 12px; background: #fff; overflow: auto; display: block; }
.am-table-title-bar + .acc-table-wrap { border-top-left-radius: 0; border-top-right-radius: 0; }
.acc-board .acc-table-wrap { border-top-left-radius: 0; border-top-right-radius: 0; border-top: none; }
.acc-table-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
.acc-table-wrap::-webkit-scrollbar-track { background: transparent; }
.acc-table-wrap::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
.acc-table-wrap::-webkit-scrollbar-thumb:hover { background: #9ca3af; }
.acc-table-wrap::-webkit-scrollbar-corner { background: transparent; }
.acc-table { width: max-content; min-width: 100%; border-collapse: collapse; }
.acc-table th { font-size: 13px; font-weight: 500; color: #6b7280; padding: 12px 16px; background: transparent; text-align: left; white-space: nowrap; border-bottom: 1px solid #e5e7eb; letter-spacing: 0; }
.acc-table td { font-size: 14px; color: #111827; padding: 12px 16px; border-bottom: 1px solid #f3f4f6; white-space: nowrap; }
.acc-table tbody tr { transition: background .15s; }
.acc-table tbody tr:hover { background: #f9fafb; }

/* Active section left accent */
.am-table-wrap-active { border-left: none; }

/* Column visibility toggle */
.tbl-col-toggle { position: relative; display: inline-block; }
.tbl-col-btn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid #e5e7eb; border-radius: 8px; background: #fff; color: #374151; font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; }
.tbl-col-btn:hover { background: #f9fafb; border-color: #d1d5db; }
.tbl-col-btn svg { color: #6b7280; }
.tbl-col-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; box-shadow: 0 10px 25px rgba(0,0,0,.1), 0 2px 8px rgba(0,0,0,.04); padding: 6px; min-width: 200px; max-height: 320px; overflow-y: auto; z-index: 100; }
.tbl-col-dropdown.open { display: block; }
.tbl-col-item { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; font-size: 13px; color: #374151; cursor: pointer; transition: background .1s; user-select: none; }
.tbl-col-item:hover { background: #f3f4f6; }
.tbl-col-item input[type=checkbox] { accent-color: #359BFF; width: 15px; height: 15px; cursor: pointer; }

/* Loading states */
.am-loading-full { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 60px 20px; font-size: 14px; color: #949D9E; }
.am-insights-bar-wrap { display: flex; align-items: center; gap: 10px; padding: 8px 16px; background: #F8FAFA; border: 1px solid #E1E1E1; border-radius: 8px; margin-bottom: 8px; font-size: 12px; color: #949D9E; }
.am-insights-progress { flex: 1; height: 4px; background: #e5e7eb; border-radius: 2px; overflow: hidden; max-width: 200px; }
.am-insights-bar-fill { height: 100%; background: #359BFF; border-radius: 2px; transition: width .3s; }
@keyframes am-bar-pulse { 0%,100% { opacity: 1; } 50% { opacity: .4; } }

/* ========== AI CHAT ========== */
.ai-chat-wrap { display: flex; flex-direction: column; height: calc(100vh - 80px); max-width: 900px; margin: 0 auto; }
.ai-chat-header { display: flex; align-items: center; gap: 12px; padding: 18px 20px; background: #fff; border: 1px solid #E1E1E1; border-radius: 12px; margin-bottom: 12px; box-shadow: 0 2px 4px rgba(0,0,0,.04); }
.ai-chat-header-icon { width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; background: #EBF5FF; border-radius: 10px; flex-shrink: 0; }
.ai-chat-title { font-size: 15px; font-weight: 700; color: #2C454A; }
.ai-chat-subtitle { font-size: 12px; color: #949D9E; margin-top: 2px; }
.ai-chat-clear { margin-left: auto; background: none; border: 1px solid #E1E1E1; border-radius: 8px; padding: 7px 8px; cursor: pointer; color: #949D9E; transition: all .15s; display: flex; align-items: center; }
.ai-chat-clear:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }

.ai-chat-context-bar { display: flex; align-items: center; gap: 8px; padding: 10px 16px; background: #F8FAFA; border: 1px solid #E1E1E1; border-radius: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.ai-ctx-label { font-size: 11px; font-weight: 700; color: #949D9E; text-transform: uppercase; letter-spacing: .5px; }
.ai-ctx-chip { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600; color: #2C454A; background: #fff; border: 1px solid #E1E1E1; border-radius: 6px; padding: 4px 10px; }
.ai-ctx-chip svg { color: #359BFF; }
.ai-ctx-empty { color: #949D9E; font-weight: 400; font-style: italic; border-style: dashed; }
.ai-ctx-loading { color: #6b7280; background: #f3f4f6; border-color: #d1d5db; animation: aiCtxPulse 1.5s ease-in-out infinite; }
@keyframes aiCtxPulse { 0%,100%{opacity:1} 50%{opacity:.6} }

.ai-chat-messages { flex: 1; overflow-y: auto; padding: 16px 4px; display: flex; flex-direction: column; gap: 12px; }
.ai-chat-messages::-webkit-scrollbar { width: 5px; }
.ai-chat-messages::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 10px; }

.ai-welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 50px 20px; gap: 10px; flex: 1; }
.ai-welcome-icon { width: 64px; height: 64px; display: flex; align-items: center; justify-content: center; background: #EBF5FF; border-radius: 50%; margin-bottom: 6px; }
.ai-welcome h3 { font-size: 18px; font-weight: 700; color: #2C454A; margin: 0; }
.ai-welcome p { font-size: 13px; color: #949D9E; margin: 0 0 14px; }
.ai-suggestions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; max-width: 500px; }
.ai-suggestion { background: #fff; border: 1px solid #E1E1E1; border-radius: 20px; padding: 8px 16px; font-size: 12.5px; color: #2C454A; cursor: pointer; transition: all .15s; font-family: inherit; }
.ai-suggestion:hover { border-color: #359BFF; color: #359BFF; background: #EBF5FF; }

.ai-msg { display: flex; }
.ai-msg-user { justify-content: flex-end; }
.ai-msg-assistant { justify-content: flex-start; }
.ai-msg-bubble { max-width: 80%; border-radius: 14px; padding: 12px 16px; font-size: 13.5px; line-height: 1.6; word-break: break-word; }
.ai-msg-user-bubble { background: #359BFF; color: #fff; border-bottom-right-radius: 4px; }
.ai-msg-ai-bubble { background: #fff; border: 1px solid #E1E1E1; border-bottom-left-radius: 4px; display: flex; gap: 10px; align-items: flex-start; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.ai-msg-ai-icon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; background: #EBF5FF; border-radius: 50%; flex-shrink: 0; margin-top: 2px; }
.ai-msg-content { color: #2C454A; flex: 1; }
.ai-msg-content h2, .ai-msg-content h3, .ai-msg-content h4 { margin: 8px 0 4px; color: #2C454A; }
.ai-msg-content h2 { font-size: 16px; }
.ai-msg-content h3 { font-size: 14px; }
.ai-msg-content h4 { font-size: 13px; }
.ai-msg-content code { background: #F0F4F8; padding: 1px 5px; border-radius: 4px; font-size: 12px; color: #e11d48; }
.ai-msg-content ul { margin: 4px 0; padding-left: 18px; }
.ai-msg-content li { margin-bottom: 2px; }
.ai-msg-content strong { color: #1e293b; }

.ai-chat-input-wrap { display: flex; align-items: flex-end; gap: 8px; padding: 14px 16px; background: #fff; border: 1px solid #E1E1E1; border-radius: 12px; margin-top: 12px; box-shadow: 0 -2px 8px rgba(0,0,0,.03); }
.ai-chat-input { flex: 1; border: none; outline: none; font-size: 14px; font-family: inherit; resize: none; max-height: 120px; color: #2C454A; line-height: 1.5; background: transparent; }
.ai-chat-input::placeholder { color: #b0b0b0; }
.ai-chat-send { width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: #359BFF; color: #fff; border: none; border-radius: 10px; cursor: pointer; transition: all .15s; flex-shrink: 0; }
.ai-chat-send:hover { background: #2080E0; }
.ai-chat-send:disabled { opacity: .5; cursor: not-allowed; }

.ai-chart-wrap { margin: 10px 0 4px; border-radius: 10px; overflow: hidden; border: 1px solid #e8eaed; display: block; max-width: 100%; box-shadow: 0 1px 4px rgba(0,0,0,.06); }
.ai-chart-wrap svg { display: block; width: 100%; max-width: 460px; height: auto; }
.ai-chart-err { padding: 10px 14px; background: #fff8f8; border: 1px solid #ffd0d0; border-radius: 8px; color: #e57373; font-size: 12px; margin: 6px 0; }
.ai-msg-ai-bubble { max-width: 100%; }
.ai-msg-content h2,.ai-msg-content h3,.ai-msg-content h4 { margin: 8px 0 4px; font-weight: 600; }
.ai-msg-content ul { margin: 4px 0 4px 16px; padding: 0; }
.ai-msg-content li { margin: 2px 0; }
.ai-dots { display: flex; gap: 4px; padding: 4px 0; }
.ai-dots span { width: 7px; height: 7px; background: #359BFF; border-radius: 50%; opacity: .4; animation: aiDot 1.4s infinite ease-in-out; }
.ai-dots span:nth-child(2) { animation-delay: .2s; }
.ai-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: .4; transform: scale(.8); } 40% { opacity: 1; transform: scale(1); } }

/* ── AI Chat — Create Campaign button ─────────────────────────────────────── */
.ai-chat-create-btn {
  display: inline-flex; align-items: center; gap: 6px;
  margin-left: auto; margin-right: 6px;
  padding: 7px 14px; border-radius: 8px; border: none; cursor: pointer;
  font-size: 12.5px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, #1877f2 0%, #0d5ec9 100%);
  box-shadow: 0 2px 6px rgba(24,119,242,.3);
  transition: all .15s;
}
.ai-chat-create-btn:hover { opacity: .9; transform: translateY(-1px); box-shadow: 0 4px 10px rgba(24,119,242,.35); }
.ai-chat-create-btn svg { flex-shrink: 0; }

.ai-suggestion--create {
  background: linear-gradient(135deg, #1877f2 0%, #0d5ec9 100%) !important;
  color: #fff !important; border-color: transparent !important;
  font-weight: 700 !important;
  display: inline-flex; align-items: center; gap: 6px;
}
.ai-suggestion--create:hover { opacity: .88; }

/* ══════════════════════════════════════════════════════════════════════════════
   Campaign Wizard — Cards embedded in AI Chat
══════════════════════════════════════════════════════════════════════════════ */
.cw-card {
  background: #fff; border: 1px solid #e1e1e1; border-radius: 12px;
  padding: 18px 20px; margin: 2px 0; max-width: 620px;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
  transition: opacity .2s;
}
.cw-card--frozen { opacity: .65; pointer-events: none; }
.cw-card--warn  { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.cw-card--error { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.cw-card--success {
  background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
  border-color: #86efac; text-align: center;
}

.cw-card-title {
  font-size: 15px; font-weight: 700; color: #1e293b; margin-bottom: 6px;
}
.cw-card-desc {
  font-size: 13px; color: #64748b; margin-bottom: 14px; line-height: 1.5;
}
.cw-hint {
  font-size: 12px; color: #94a3b8; margin: 6px 0 14px;
}

/* Objective grid */
.cw-obj-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 4px;
}
.cw-obj-btn {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; background: #f8fafc; border: 1.5px solid #e2e8f0;
  border-radius: 10px; cursor: pointer; text-align: left;
  transition: all .15s;
}
.cw-obj-btn:hover  { border-color: #1877f2; background: #eff6ff; }
.cw-obj-btn:disabled { opacity: .5; cursor: not-allowed; }
.cw-obj-icon { font-size: 22px; flex-shrink: 0; }
.cw-obj-text { display: flex; flex-direction: column; }
.cw-obj-label { font-size: 13px; font-weight: 700; color: #1e293b; }
.cw-obj-desc  { font-size: 11px; color: #64748b; line-height: 1.3; margin-top: 2px; }

/* Form fields */
.cw-field-group { margin-bottom: 12px; }
.cw-label {
  display: block; font-size: 12px; font-weight: 600;
  color: #475569; margin-bottom: 5px;
}
.cw-optional { font-weight: 400; color: #94a3b8; }
.cw-input, .cw-textarea, .cw-select {
  width: 100%; padding: 9px 12px; border: 1px solid #e1e1e1; border-radius: 8px;
  background: #f8fafa; color: #2c454a; font-size: 13px; font-family: inherit;
  outline: none; transition: border-color .15s; box-sizing: border-box;
}
.cw-input:focus, .cw-textarea:focus, .cw-select:focus {
  border-color: #1877f2; box-shadow: 0 0 0 3px rgba(24,119,242,.1);
  background: #fff;
}
.cw-input-sm { padding: 7px 10px; font-size: 12px; }
.cw-textarea { resize: vertical; line-height: 1.5; }
.cw-input-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.cw-input-row .cw-input { flex: 1; }
.cw-input-suffix { font-size: 12px; color: #64748b; white-space: nowrap; }

/* Radio group */
.cw-radio-group { display: flex; flex-direction: column; gap: 8px; }
.cw-radio { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; color: #334155; }
.cw-radio input { accent-color: #1877f2; width: 15px; height: 15px; cursor: pointer; }
.cw-radio span { line-height: 1.4; }

/* Buttons */
.cw-btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; background: #1877f2; color: #fff;
  border: none; border-radius: 8px; font-size: 13px; font-weight: 700;
  cursor: pointer; transition: all .15s; margin-top: 8px;
}
.cw-btn-primary:hover    { background: #0d5ec9; transform: translateY(-1px); }
.cw-btn-primary:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.cw-btn-primary.cw-btn-publish { background: linear-gradient(135deg, #1877f2 0%, #0d5ec9 100%); box-shadow: 0 2px 8px rgba(24,119,242,.3); }

.cw-btn-secondary {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px; background: transparent; color: #475569;
  border: 1.5px solid #e2e8f0; border-radius: 8px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all .15s; margin-top: 8px;
}
.cw-btn-secondary:hover { border-color: #cbd5e1; background: #f8fafc; }

.cw-btn-ai {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; background: linear-gradient(135deg, #7c3aed 0%, #4f46e5 100%);
  color: #fff; border: none; border-radius: 7px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; transition: all .15s;
}
.cw-btn-ai:hover    { opacity: .9; transform: translateY(-1px); }
.cw-btn-ai:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* Ad set section in audience setup */
.cw-adset-section { margin-bottom: 18px; padding: 14px; background: #f8fafc; border-radius: 10px; border: 1px solid #e8edf3; }
.cw-adset-section-title {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: #1e293b; margin-bottom: 4px;
}
.cw-adset-section-desc { font-size: 12px; color: #64748b; margin-bottom: 10px; line-height: 1.4; }
.cw-adset-row { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; padding: 12px; margin-bottom: 8px; }
.cw-adset-row-header { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; }
.cw-adset-row-title  { font-size: 12.5px; font-weight: 600; color: #334155; }
.cw-adset-row-desc   { font-size: 11.5px; color: #64748b; margin-bottom: 8px; }

/* Badges */
.cw-badge {
  display: inline-flex; align-items: center; padding: 3px 9px;
  border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .3px;
  white-space: nowrap;
}
.cw-badge-sm { padding: 2px 7px; font-size: 10px; }
.cw-badge-purple { background: #f3e8ff; color: #6d28d9; }
.cw-badge-blue   { background: #dbeafe; color: #1d4ed8; }
.cw-badge-green  { background: #dcfce7; color: #15803d; }
.cw-badge-orange { background: #ffedd5; color: #c2410c; }

/* Creative assets grid */
.cw-assets-label {
  font-size: 12px; font-weight: 700; color: #475569;
  text-transform: uppercase; letter-spacing: .4px; margin-bottom: 8px;
}
.cw-assets-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.cw-asset-slot { display: flex; flex-direction: column; gap: 6px; }
.cw-asset-thumb {
  width: 100%; aspect-ratio: 1; background: #f1f5f9;
  border: 2px dashed #cbd5e1; border-radius: 8px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 6px; font-size: 11px; color: #94a3b8; overflow: hidden;
  transition: border-color .15s;
}
.cw-asset-thumb--video { aspect-ratio: 16/9; }
.cw-asset-btn {
  padding: 5px 8px; background: #f8fafc; border: 1px solid #e2e8f0;
  border-radius: 6px; font-size: 11.5px; font-weight: 600; color: #475569;
  cursor: pointer; transition: all .15s; text-align: center;
}
.cw-asset-btn:hover    { background: #eff6ff; border-color: #1877f2; color: #1877f2; }
.cw-asset-btn:disabled { opacity: .5; cursor: not-allowed; }
.cw-asset-status { font-size: 11px; min-height: 16px; text-align: center; }
.cw-st-loading { color: #94a3b8; }
.cw-st-done    { color: #22c55e; font-weight: 700; }
.cw-st-error   { color: #ef4444; }

/* Ad copy */
.cw-copy-ai-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.cw-copy-row    { display: flex; gap: 12px; }
.cw-copy-suggestions {
  background: #faf5ff; border: 1px solid #e9d5ff; border-radius: 10px;
  padding: 12px; margin-bottom: 14px;
}
.cw-copy-sug-label { font-size: 11.5px; font-weight: 700; color: #7c3aed; margin-bottom: 8px; }
.cw-copy-sug-item {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px; background: #fff; border: 1.5px solid #e9d5ff;
  border-radius: 8px; cursor: pointer; margin-bottom: 6px; transition: all .15s;
}
.cw-copy-sug-item:hover           { border-color: #7c3aed; background: #faf5ff; }
.cw-copy-sug-item--active          { border-color: #7c3aed; background: #f3e8ff; }
.cw-copy-sug-item strong           { font-size: 13px; font-weight: 700; color: #1e293b; }
.cw-copy-sug-item > span           { font-size: 12px; color: #475569; }
.cw-copy-sug-cta {
  font-size: 10.5px; font-weight: 700; color: #7c3aed;
  background: #ede9fe; border-radius: 4px; padding: 1px 6px; align-self: flex-start;
}

/* Review step */
.cw-review-section { margin-bottom: 16px; }
.cw-review-section-title {
  font-size: 11px; font-weight: 700; color: #94a3b8;
  text-transform: uppercase; letter-spacing: .5px; margin-bottom: 8px;
  padding-bottom: 5px; border-bottom: 1px solid #f1f5f9;
}
.cw-review-row {
  display: flex; align-items: baseline; gap: 8px; padding: 5px 0;
  border-bottom: 1px solid #f8fafc; font-size: 13px;
}
.cw-review-label { min-width: 110px; color: #64748b; font-weight: 600; font-size: 12px; flex-shrink: 0; }
.cw-review-value { color: #1e293b; flex: 1; word-break: break-word; }
.cw-review-notice {
  display: flex; align-items: flex-start; gap: 8px;
  background: #fffbeb; border: 1px solid #fde68a; border-radius: 8px;
  padding: 10px 14px; font-size: 12.5px; color: #78350f;
  margin: 12px 0 16px;
}
.cw-review-actions {
  display: flex; align-items: center; gap: 10px; justify-content: flex-end; flex-wrap: wrap;
}

/* Success state */
.cw-success-check { margin: 0 auto 12px; display: flex; justify-content: center; }
.cw-success-title { font-size: 20px; font-weight: 800; color: #15803d; margin-bottom: 4px; }
.cw-success-sub   { font-size: 13px; color: #64748b; margin-bottom: 16px; }
.cw-success-stats { display: flex; justify-content: center; gap: 24px; }
.cw-stat-box      { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.cw-stat-num      { font-size: 28px; font-weight: 800; color: #15803d; line-height: 1; }
.cw-stat-lbl      { font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; letter-spacing: .4px; }

/* Spinner */
.cw-spinner-sm {
  display: inline-block; width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: cwSpin .6s linear infinite;
  vertical-align: middle;
}
@keyframes cwSpin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 540px) {
  .cw-obj-grid { grid-template-columns: 1fr; }
  .cw-assets-grid { grid-template-columns: repeat(2, 1fr); }
  .cw-copy-row { flex-direction: column; }
  .cw-review-label { min-width: 80px; }
  .cw-review-actions { justify-content: stretch; flex-direction: column; }
  .cw-btn-primary, .cw-btn-secondary { width: 100%; justify-content: center; }
}

/* ---------- User Management ---------- */
.um-wrap { max-width: 1100px; margin: 0 auto; padding: 24px 0; }
.um-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 24px; gap: 16px; flex-wrap: wrap; }
.um-title { font-size: 22px; font-weight: 700; color: var(--text-primary, #1e293b); margin: 0 0 4px; }
.um-subtitle { font-size: 13px; color: var(--text-secondary, #64748b); margin: 0; }
.um-add-btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; background: #1a1a1a; color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
.um-add-btn:hover { background: #333; }

.um-loading { display: flex; align-items: center; gap: 10px; padding: 48px 0; justify-content: center; color: var(--text-secondary, #64748b); font-size: 14px; }
.um-empty { text-align: center; padding: 48px 0; color: var(--text-secondary, #64748b); font-size: 14px; }

.um-table-wrap { border: 1px solid var(--border-color, #e2e8f0); border-radius: 10px; overflow: hidden; background: var(--card-bg, #fff); }
.um-table { width: 100%; border-collapse: collapse; }
.um-table thead { background: var(--bg-hover, #f8fafc); }
.um-table th { text-align: left; padding: 11px 16px; font-size: 12px; font-weight: 600; color: var(--text-secondary, #64748b); text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid var(--border-color, #e2e8f0); }
.um-table td { padding: 14px 16px; border-bottom: 1px solid var(--border-color, #f1f5f9); font-size: 13px; color: var(--text-primary, #334155); vertical-align: middle; }
.um-table tbody tr:last-child td { border-bottom: none; }
.um-table tbody tr:hover { background: var(--bg-hover, #f8fafc); }

.um-user-cell { display: flex; align-items: center; gap: 10px; }
.um-avatar { width: 34px; height: 34px; border-radius: 50%; background: #1a1a1a; color: #fff; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; flex-shrink: 0; }
.um-user-name { font-weight: 600; font-size: 13px; color: var(--text-primary, #1e293b); }
.um-user-email { font-size: 12px; color: var(--text-secondary, #94a3b8); }

.um-role-badge { display: inline-block; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.um-role-sa { background: #fef3c7; color: #92400e; }
.um-role-user { background: #e0e7ff; color: #3730a3; }

.um-accts-cell { display: flex; flex-wrap: wrap; gap: 4px; }
.um-badge { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: 11px; font-weight: 500; background: var(--bg-hover, #f1f5f9); color: var(--text-primary, #475569); border: 1px solid var(--border-color, #e2e8f0); }
.um-badge-all { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.um-badge-none { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

.um-actions { display: flex; gap: 6px; }
.um-action-btn { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--border-color, #e2e8f0); background: var(--card-bg, #fff); border-radius: 6px; cursor: pointer; color: var(--text-secondary, #64748b); transition: all .15s; }
.um-action-btn:hover { background: var(--bg-hover, #f1f5f9); color: var(--text-primary, #334155); }
.um-action-del:hover { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* User modal */
.um-modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,.45); z-index: 1100; display: flex; align-items: center; justify-content: center; padding: 24px; }
.um-modal-overlay.hidden { display: none; }
.um-modal { background: var(--card-bg, #fff); border-radius: 14px; width: 100%; max-width: 520px; max-height: 85vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.um-modal-header { display: flex; justify-content: space-between; align-items: center; padding: 20px 24px 16px; border-bottom: 1px solid var(--border-color, #e2e8f0); }
.um-modal-header h3 { margin: 0; font-size: 17px; font-weight: 700; color: var(--text-primary, #1e293b); }
.um-modal-close { background: none; border: none; font-size: 22px; color: var(--text-secondary, #94a3b8); cursor: pointer; padding: 0 4px; line-height: 1; }
.um-modal-close:hover { color: var(--text-primary, #334155); }
.um-modal-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.um-modal-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px; border-top: 1px solid var(--border-color, #e2e8f0); }

.um-field { margin-bottom: 16px; }
.um-field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-secondary, #64748b); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .03em; }
.um-field input[type="email"],
.um-field input[type="text"],
.um-field input[type="password"] { width: 100%; padding: 9px 12px; border: 1px solid var(--border-color, #e2e8f0); border-radius: 8px; font-size: 13px; font-family: inherit; background: var(--card-bg, #fff); color: var(--text-primary, #334155); transition: border-color .15s; box-sizing: border-box; }
.um-field input:focus { outline: none; border-color: #1a1a1a; box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
.um-field input:disabled { background: var(--bg-hover, #f8fafc); color: var(--text-secondary, #94a3b8); cursor: not-allowed; }
.um-field-hint { font-size: 11px; color: var(--text-secondary, #94a3b8); margin-top: 4px; }

.um-acct-picker { max-height: 220px; overflow-y: auto; border: 1px solid var(--border-color, #e2e8f0); border-radius: 8px; padding: 4px; }
.um-acct-option { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 6px; cursor: pointer; transition: background .1s; }
.um-acct-option:hover { background: var(--bg-hover, #f8fafc); }
.um-acct-chk { width: 16px; height: 16px; cursor: pointer; accent-color: #1a1a1a; flex-shrink: 0; }
.um-acct-label { font-size: 13px; color: var(--text-primary, #334155); }
.um-acct-id { font-size: 11px; color: var(--text-secondary, #94a3b8); }
.um-acct-empty { padding: 16px; text-align: center; font-size: 12px; color: var(--text-secondary, #94a3b8); }
.um-picker-section-hd { display: flex; align-items: center; gap: 5px; padding: 8px 8px 4px; font-size: .68rem; font-weight: 700; color: var(--text-secondary, #64748b); text-transform: uppercase; letter-spacing: .05em; border-top: 1px solid var(--border-color, #e2e8f0); margin-top: 4px; }
.um-picker-section-hd:first-child { border-top: none; margin-top: 0; }
.um-gads-chk  { width: 16px; height: 16px; cursor: pointer; accent-color: #2e7d32; flex-shrink: 0; }
.um-dv360-chk { width: 16px; height: 16px; cursor: pointer; accent-color: #3949ab; flex-shrink: 0; }
.um-page-chk  { width: 16px; height: 16px; cursor: pointer; accent-color: #1877F2; flex-shrink: 0; }

.um-error { padding: 8px 12px; background: #fef2f2; color: #dc2626; border-radius: 6px; font-size: 12px; border: 1px solid #fecaca; margin-top: 8px; }
.um-error.hidden { display: none; }

.um-save-btn { padding: 9px 20px; background: #1a1a1a; color: #fff; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; transition: background .15s; }
.um-save-btn:hover { background: #333; }
.um-save-btn:disabled { opacity: .6; cursor: not-allowed; }


/* ========== MOBILE SIDEBAR OVERLAY ========== */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 99; }
.sidebar-overlay.open { display: block; }

/* ========== RESPONSIVE — 900px ========== */
@media (max-width: 900px) {
  .lf-crm-stats { grid-template-columns: repeat(2, 1fr); }
  .lf-charts-row { grid-template-columns: 1fr; }
  .lf-side-panel { width: 100%; right: -100%; }
  .am-toolbar { flex-direction: column; align-items: stretch; }
  .am-toolbar-right { flex-wrap: wrap; }
  .am-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .am-tabs::-webkit-scrollbar { display: none; }
  .um-table th:nth-child(4), .um-table td:nth-child(4) { display: none; }
  .am-opt-modal { width: calc(100vw - 32px); }
}

/* ========== RESPONSIVE — 768px ========== */
@media (max-width: 768px) {
  /* Sidebar */
  .sidebar { transform: translateX(-100%); z-index: 200; }
  .sidebar.open { transform: translateX(0); box-shadow: 4px 0 24px rgba(0,0,0,.18); }
  .main-content { margin-left: 0; width: 100vw; max-width: 100vw; }
  .menu-toggle { display: flex; }

  /* Top bar */
  .top-bar { padding: 0 12px; gap: 8px; }
  .page-title { font-size: .88rem; }
  .global-ctx { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; flex-wrap: nowrap; min-width: 0; }
  .global-ctx::-webkit-scrollbar { display: none; }
  .global-ctx-switch-btn { white-space: nowrap; font-size: 12px; padding: 4px 8px; max-width: 160px; }
  .global-ctx-select { min-width: 120px; max-width: 200px; font-size: 12px; }
  .global-ctx-label { display: none; }
  .top-actions { gap: 4px; }

  /* Section padding */
  .section { padding: 12px 10px; }

  /* Hero */
  .hero { margin-bottom: 20px; }
  .hero-title { font-size: 1.4rem; }
  .hero-subtitle { font-size: .85rem; }

  /* Login */
  .login-card { width: calc(100vw - 32px); padding: 28px 20px; }

  /* Leads stats */
  .lf-crm-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .lf-stat-value { font-size: 1.3rem; }
  .lf-charts-row { grid-template-columns: 1fr; }

  /* Leads view bar */
  .lf-view-bar { flex-direction: column; align-items: stretch; gap: 8px; }
  .lf-view-bar-right { flex-wrap: wrap; gap: 6px; }

  /* Leads table wrapper — horizontal scroll */
  .acc-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .lf-leads-table { min-width: 700px; }

  /* Side panel full-width */
  .lf-side-panel { width: 100%; right: -100%; }
  .lf-side-panel.open { right: 0; }

  /* Ads Manager section */
  #sectionAdsmanager { padding: 6px 4px; }
  .am-title-row { flex-wrap: wrap; gap: 10px; }
  .am-title-left { flex-wrap: wrap; }
  .am-page-title { font-size: 18px; }
  .am-toolbar { flex-direction: column; align-items: stretch; gap: 8px; }
  .am-toolbar-right { flex-wrap: wrap; gap: 6px; }
  .am-account-select { width: 100%; min-width: unset; }
  .am-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 1px; }
  .am-tabs::-webkit-scrollbar { display: none; }
  .am-tab { padding: 8px 14px; font-size: 13px; white-space: nowrap; }
  .am-summary-bar { gap: 5px; }
  .am-sum-chip { font-size: 11px; padding: 3px 8px; }
  .am-search { width: 100px; }
  .am-date-select { font-size: 12px; }

  /* Ads Manager table — horizontal scroll */
  .acc-table-wrap { overflow-x: auto; }
  .am-table { min-width: 800px; }

  /* Optimization modal */
  .am-opt-overlay { padding: 0; align-items: flex-end; }
  .am-opt-modal { width: 100vw; max-width: 100vw; border-radius: 20px 20px 0 0; max-height: 92vh; }
  .am-opt-body { max-height: 75vh; padding: 14px 14px; }
  .am-opt-header { padding: 16px 16px; }
  .am-opt-header-icon { width: 36px; height: 36px; border-radius: 9px; }
  .am-opt-vr-rule { flex-wrap: wrap; gap: 6px; }
  .am-opt-bar-label { width: 70px; font-size: 11px; }
  .am-opt-bd-table { overflow-x: auto; }
  .am-opt-summary { gap: 6px; }
  .am-opt-summary-chip { padding: 6px 10px; font-size: 12px; }
  .am-opt-bd-table table { min-width: 500px; }
  .am-opt-apply-row { flex-wrap: wrap; }
  .am-opt-apply-btn { font-size: 12px; padding: 7px 12px; }

  /* AI Chat */
  .ai-chat-wrap { height: calc(100vh - 70px); }
  .ai-chat-header { padding: 12px 14px; }
  .ai-chat-input-wrap { padding: 10px 12px; }
  .ai-suggestions { flex-direction: column; align-items: stretch; max-width: 100%; }
  .ai-suggestion { text-align: left; }
  .ai-msg-bubble { max-width: 90%; font-size: 13px; }

  /* Account picker */
  .acct-picker-modal { padding: 20px 16px; width: calc(100vw - 24px); }
  .acct-picker-connect-row { flex-wrap: wrap; gap: 6px; }

  /* User management */
  .um-wrap { padding: 16px 0; }
  .um-header { flex-direction: column; gap: 10px; }
  .um-table th:nth-child(3), .um-table td:nth-child(3) { display: none; }
  .um-table th:nth-child(4), .um-table td:nth-child(4) { display: none; }
  .um-modal-overlay { padding: 0; align-items: flex-end; }
  .um-modal { max-width: 100%; border-radius: 20px 20px 0 0; max-height: 90vh; }

  /* Column add modal */
  .lf-col-modal { width: calc(100vw - 40px); }

  /* Toast */
  .toast { bottom: 12px; right: 12px; left: 12px; right: 12px; font-size: .8rem; }
}

/* ======================================================
   LANDING PAGES
====================================================== */

/* Source tabs (FB Leads / LP Leads toggle) */
.lf-source-tabs {
  display: flex;
  gap: 4px;
  padding: 0 0 16px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.lf-src-tab {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.lf-src-tab:hover { background: var(--bg-card-hover); color: var(--text); }
.lf-src-tab.active { background: rgba(53,155,255,.1); color: #359BFF; border-color: rgba(53,155,255,.25); font-weight: 600; }

/* LP section header */
.lp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}
.lp-title { font-size: 1.5rem; font-weight: 700; color: var(--text); margin: 0 0 4px; }
.lp-subtitle { font-size: .875rem; color: var(--text-secondary); margin: 0; }

/* Buttons */
.lp-btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 18px;
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity var(--transition), transform var(--transition);
  white-space: nowrap;
}
.lp-btn-primary:hover { opacity: .9; transform: translateY(-1px); }

/* Loading */
.lp-loading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 60px 0;
  justify-content: center;
  color: var(--text-secondary);
  font-size: .9rem;
}
.lp-spinner, .lp-gen-spinner {
  width: 20px; height: 20px;
  border: 2px solid var(--border);
  border-top-color: #359BFF;
  border-radius: 50%;
  animation: lpSpin .7s linear infinite;
}
.lp-gen-spinner { width: 16px; height: 16px; }
@keyframes lpSpin { to { transform: rotate(360deg); } }

/* Empty state */
.lp-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 60px 24px;
  gap: 14px;
}
.lp-empty-icon { color: var(--text-muted); opacity: .5; }
.lp-empty h3 { font-size: 1.1rem; font-weight: 600; color: var(--text); margin: 0; }
.lp-empty p { font-size: .875rem; color: var(--text-secondary); max-width: 440px; margin: 0; line-height: 1.6; }

/* Page cards grid */
.lp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.lp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}
.lp-card:hover { border-color: rgba(53,155,255,.4); transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.1); }

/* Thumbnail */
.lp-card-thumb {
  position: relative;
  width: 100%;
  height: 160px;
  overflow: hidden;
  background: #e8edf3;
  cursor: pointer;
  flex-shrink: 0;
}
.lp-card-thumb-iframe {
  position: absolute;
  top: 0; left: 0;
  width: 1280px;
  height: 900px;
  transform: scale(0.234);
  transform-origin: top left;
  pointer-events: none;
  border: none;
}
.lp-card-thumb-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  background: transparent;
}
.lp-card-thumb-badge {
  position: absolute;
  bottom: 8px; left: 8px; right: 8px;
  display: flex; align-items: center; justify-content: space-between;
  z-index: 3;
  pointer-events: none;
}

/* Card body */
.lp-card-body { padding: 12px 14px 8px; display: flex; flex-direction: column; gap: 6px; }
.lp-card-top { display: flex; align-items: center; gap: 10px; }
.lp-card-icon {
  width: 38px; height: 38px;
  background: rgba(53,155,255,.1);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: #359BFF;
  flex-shrink: 0;
}
.lp-card-meta { flex: 1; min-width: 0; }
.lp-card-name { font-size: .9rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-card-date { font-size: .75rem; color: var(--text-muted); margin-top: 2px; }
.lp-card-title-preview { font-size: .75rem; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-style: italic; }
.lp-card-status {
  font-size: .7rem; font-weight: 600; padding: 3px 8px;
  border-radius: 20px; text-transform: capitalize;
  background: rgba(37,186,100,.12); color: #25BA64;
}
.lp-status-draft { background: rgba(107,114,128,.12); color: #6b7280; }
.lp-card-campaign {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; color: #8b5cf6; font-weight: 500;
  padding: 2px 8px; border-radius: 20px;
  background: rgba(139,92,246,.1); border: 1px solid rgba(139,92,246,.2);
  width: fit-content; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.lp-card-stats { display: flex; gap: 16px; }
.lp-card-stat { display: flex; flex-direction: column; gap: 1px; }
.lp-stat-num { font-size: 1.2rem; font-weight: 700; color: var(--text); }
.lp-stat-label { font-size: .7rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.lp-card-actions { display: flex; gap: 6px; flex-wrap: wrap; padding: 0 14px 12px; }
.lp-card-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 10px; border-radius: 6px;
  font-size: .75rem; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-secondary); transition: all var(--transition);
}
.lp-card-btn:hover { background: var(--bg-card-hover); color: var(--text); }
.lp-card-btn-preview:hover { border-color: #359BFF; color: #359BFF; background: rgba(53,155,255,.06); }
.lp-card-btn-copy:hover { border-color: #8b5cf6; color: #8b5cf6; background: rgba(139,92,246,.06); }
.lp-card-btn-edit:hover { border-color: #f59e0b; color: #f59e0b; background: rgba(245,158,11,.06); }
.lp-card-btn-delete { margin-left: auto; }
.lp-card-btn-delete:hover { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,.06); }

/* ── Builder Modal ── */
/* ════════════════════════════════════════
   STRUCTURE PICKER (Step 1)
   ════════════════════════════════════════ */
.main-content.lp-mode { overflow: hidden !important; height: 100vh; }

.lp-struct-picker {
  position: absolute; inset: 0; z-index: 201;
  background: #0d0f14;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.lp-struct-picker.hidden { display: none; }
.lp-struct-inner { width: 100%; max-width: 900px; position: relative; }
.lp-struct-close {
  position: absolute; top: -8px; right: -8px;
  width: 36px; height: 36px;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12);
  border-radius: 50%; color: rgba(255,255,255,.7);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s;
}
.lp-struct-close:hover { background: rgba(255,255,255,.16); color: #fff; }
.lp-struct-heading { text-align: center; margin-bottom: 36px; }
.lp-struct-badge {
  display: inline-flex; align-items: center;
  padding: 4px 12px; border-radius: 20px;
  background: rgba(139,92,246,.18); color: #a78bfa;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 14px;
}
.lp-struct-title { margin: 0 0 10px; font-size: 1.75rem; font-weight: 700; color: #fff; }
.lp-struct-sub { margin: 0; font-size: .9rem; color: rgba(255,255,255,.5); }
.lp-struct-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.lp-struct-card {
  background: rgba(255,255,255,.04);
  border: 1.5px solid rgba(255,255,255,.1);
  border-radius: 16px; padding: 20px;
  cursor: pointer; transition: all .2s;
  display: flex; flex-direction: column; gap: 16px;
  position: relative; overflow: hidden;
}
.lp-struct-card:hover {
  border-color: rgba(139,92,246,.6);
  background: rgba(139,92,246,.08);
  transform: translateY(-2px);
  box-shadow: 0 12px 36px rgba(139,92,246,.2);
}
.lp-struct-card--active { border-color: #8b5cf6; background: rgba(139,92,246,.12); }
.lp-struct-card-visual {
  border-radius: 10px; overflow: hidden;
  height: 120px; background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.08);
  padding: 10px; display: flex; flex-direction: column; gap: 5px;
}
/* Mini-site visual */
.lp-sv-header { height: 10px; background: rgba(139,92,246,.5); border-radius: 3px; }
.lp-sv-body { flex: 1; display: flex; flex-direction: column; gap: 4px; padding-top: 4px; }
.lp-sv-headline { height: 10px; background: rgba(255,255,255,.25); border-radius: 3px; width: 80%; }
.lp-sv-sub { height: 7px; background: rgba(255,255,255,.12); border-radius: 3px; width: 65%; }
.lp-sv-sub--short { width: 45%; }
.lp-sv-form { margin-top: auto; display: flex; flex-direction: column; gap: 4px; }
.lp-sv-field { height: 8px; background: rgba(255,255,255,.1); border-radius: 3px; border: 1px solid rgba(255,255,255,.15); }
.lp-sv-btn { height: 12px; background: linear-gradient(90deg,#8b5cf6,#3b82f6); border-radius: 4px; width: 55%; align-self: center; }
/* Funnel visual */
.lp-struct-visual-funnel { gap: 6px; justify-content: center; }
.lp-sv-step { display: flex; justify-content: center; }
.lp-sv-step-bar { height: 18px; background: rgba(255,255,255,.1); border-radius: 4px; border: 1px solid rgba(255,255,255,.1); }
.lp-sv-step--1 .lp-sv-step-bar { width: 95%; background: rgba(139,92,246,.4); }
.lp-sv-step--2 .lp-sv-step-bar { width: 75%; background: rgba(139,92,246,.25); }
.lp-sv-step--3 .lp-sv-step-bar { width: 58%; background: rgba(139,92,246,.15); }
.lp-sv-step--4 .lp-sv-step-bar { width: 40%; background: linear-gradient(90deg,#8b5cf6,#3b82f6); }
/* Floors visual */
.lp-struct-visual-floors { gap: 0; padding: 0; }
.lp-sv-floor { flex: 1; }
.lp-sv-floor--hero { background: linear-gradient(135deg,rgba(139,92,246,.4),rgba(59,130,246,.3)); border-bottom: 1px solid rgba(255,255,255,.08); }
.lp-sv-floor--features { background: rgba(255,255,255,.06); border-bottom: 1px solid rgba(255,255,255,.08); }
.lp-sv-floor--cta { background: rgba(37,186,100,.15); }
.lp-struct-card-info { flex: 1; }
.lp-struct-card-name { font-size: 1rem; font-weight: 700; color: #fff; margin-bottom: 6px; }
.lp-struct-card-desc { font-size: .8rem; color: rgba(255,255,255,.5); line-height: 1.55; }
.lp-struct-card-arrow {
  width: 32px; height: 32px; border-radius: 50%;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,.4); transition: all .2s; align-self: flex-end;
}
.lp-struct-card:hover .lp-struct-card-arrow { background: #8b5cf6; border-color: #8b5cf6; color: #fff; }

/* ════════════════════════════════════════
   FULL-SCREEN BUILDER
   ════════════════════════════════════════ */
.lp-builder-overlay {
  position: absolute; inset: 0; z-index: 200;
  background: #f9fafb;
  display: flex; flex-direction: column;
}
.lp-builder-overlay.hidden { display: none; }

/* ── Top toolbar ── */
.lp-topbar {
  height: 52px; flex-shrink: 0;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  display: flex; align-items: center;
  padding: 0 14px; gap: 0;
  justify-content: space-between;
}

/* LEFT: close + action buttons */
.lp-topbar-left {
  display: flex; align-items: center; gap: 6px;
  flex-shrink: 0;
}
.lp-topbar-divider {
  width: 1px; height: 22px; background: #e5e7eb;
  margin: 0 6px; flex-shrink: 0;
}

/* RIGHT: page name */
.lp-topbar-right {
  display: flex; align-items: center; gap: 8px;
  flex-shrink: 0; min-width: 0; max-width: 45%;
}
.lp-topbar-namewrap {
  display: flex; align-items: center; gap: 6px;
  min-width: 0;
}
.lp-topbar-name {
  background: transparent; border: 1px solid transparent;
  border-radius: 7px; color: #1f2937;
  font-size: .88rem; font-weight: 600;
  padding: 5px 8px; min-width: 120px; max-width: 280px; width: auto;
  transition: all .15s; font-family: inherit;
}
.lp-topbar-name:hover { background: #f9fafb; border-color: #d1d5db; }
.lp-topbar-name:focus { outline: none; background: #fff; border-color: #1a1a1a; box-shadow: 0 0 0 3px rgba(0,0,0,.08); }
.lp-topbar-name::placeholder { color: #9ca3af; font-weight: 400; }

.lp-topbar-close {
  width: 32px; height: 32px; flex-shrink: 0;
  background: #f3f4f6; border: 1px solid #e5e7eb;
  border-radius: 8px; color: #6b7280;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s;
}
.lp-topbar-close:hover { background: #fef2f2; border-color: #fca5a5; color: #ef4444; }

.lp-topbar-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 8px;
  font-size: .78rem; font-weight: 600; cursor: pointer;
  transition: all .15s; white-space: nowrap; border: 1px solid transparent;
}
.lp-topbar-btn.hidden { display: none; }

/* Publish = green accent */
.lp-topbar-btn-publish {
  background: #16a34a; border-color: #15803d; color: #fff;
}
.lp-topbar-btn-publish:hover { background: #15803d; }

/* Ghost = subtle gray */
.lp-topbar-btn-ghost {
  background: #f3f4f6; border-color: #e5e7eb; color: #4b5563;
}
.lp-topbar-btn-ghost:hover { background: #e5e7eb; color: #1f2937; }
.lp-topbar-btn-ghost.active { background: #ede9fe; border-color: #c4b5fd; color: #7c3aed; }

/* Legacy primary (keep for other places) */
.lp-topbar-btn-primary { background: #1a1a1a; border: none; color: #fff; }
.lp-topbar-btn-primary:hover { background: #333; }

.lp-topbar-type-badge {
  display: inline-flex; align-items: center;
  padding: 3px 10px; border-radius: 20px;
  background: #ede9fe; color: #1a1a1a;
  font-size: .7rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  white-space: nowrap; flex-shrink: 0;
}

/* ── Split body ── */
.lp-split-body {
  flex: 1; display: flex; overflow: hidden;
}

/* ── Left: preview panel ── */
.lp-preview-panel {
  flex: 1; display: flex; flex-direction: column;
  border-right: 1px solid #e5e7eb;
  overflow: hidden; background: #f3f4f6;
  position: relative;
}

/* Device toggle toolbar */
.lp-preview-toolbar {
  height: 38px; flex-shrink: 0;
  background: #fff; border-bottom: 1px solid #e5e7eb;
  display: flex; align-items: center; padding: 0 12px; gap: 12px;
}
.lp-device-btns {
  display: flex; align-items: center; gap: 2px;
  background: #f3f4f6; border-radius: 8px; padding: 3px;
}
.lp-device-btn {
  width: 28px; height: 28px; border-radius: 6px;
  background: transparent; border: none; color: #9ca3af;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all .15s;
}
.lp-device-btn:hover { color: #4b5563; background: #e5e7eb; }
.lp-device-btn.active { background: #fff; color: #1f2937; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.lp-preview-label {
  font-size: .72rem; color: #9ca3af; font-weight: 500;
}

.lp-preview-wrap {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden;
}
.lp-preview-placeholder {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  color: #d1d5db; text-align: center;
}
.lp-preview-placeholder p { margin: 0; font-size: .9rem; font-weight: 500; color: #9ca3af; }
.lp-preview-placeholder span { font-size: .78rem; color: #d1d5db; }
.lp-preview-iframe { width: 100%; height: 100%; border: none; flex: 1; display: block; }

/* Code view overlay */
.lp-code-view {
  position: absolute; inset: 38px 0 0 0;
  background: #1e1e2e; display: flex; flex-direction: column;
  z-index: 10;
}
.lp-code-view.hidden { display: none; }
.lp-code-view-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 14px; background: #2a2a3e; border-bottom: 1px solid #3a3a50;
  color: #c4b5fd; font-size: .78rem; font-weight: 600; flex-shrink: 0;
}
.lp-code-pre {
  flex: 1; overflow: auto; margin: 0;
  padding: 16px; font-size: .72rem; line-height: 1.5;
  color: #e2e8f0; font-family: 'Fira Code', 'Cascadia Code', monospace;
  white-space: pre; tab-size: 2;
}

/* ── Right: config header + chat panel ── */
.lp-right-panel {
  width: 380px; flex-shrink: 0;
  display: flex; flex-direction: column;
  background: #fff;
  overflow: hidden;
  border-left: 1px solid #e5e7eb;
}

/* Collapsible config header */
.lp-panel-config {
  flex-shrink: 0; border-bottom: 1px solid #e5e7eb;
  background: #fff;
}
.lp-panel-config-header {
  width: 100%; display: flex; align-items: center;
  justify-content: space-between; gap: 8px;
  padding: 10px 14px; background: transparent; border: none;
  cursor: pointer; font-size: .8rem; font-weight: 600; color: #374151;
  transition: background .15s;
}
.lp-panel-config-header:hover { background: #f9fafb; }
.lp-panel-config-title {
  font-size: .8rem; font-weight: 600; color: #374151;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.lp-panel-config-chevron {
  flex-shrink: 0; color: #9ca3af; transition: transform .2s;
}
.lp-panel-config-body {
  padding: 8px 14px 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.lp-panel-config-body.hidden { display: none; }
.lp-panel-config-row {
  display: flex; flex-direction: column; gap: 4px;
}
.lp-panel-config-label {
  font-size: .72rem; font-weight: 600; color: #6b7280; text-transform: uppercase; letter-spacing: .05em;
}
.lp-panel-config-select {
  width: 100%; padding: 6px 8px; font-size: .8rem;
  background: #f9fafb; border: 1px solid #d1d5db;
  border-radius: 7px; color: #374151;
  cursor: pointer; font-family: inherit;
}
.lp-right-inner {
  flex: 1; overflow-y: auto;
  padding: 18px 18px 24px;
  display: flex; flex-direction: column; gap: 16px;
  background: #fff;
}
.lp-right-inner.hidden { display: none; }
.lp-setup-actions { margin-top: 4px; display: flex; flex-direction: column; gap: 8px; }

/* ── Chat pane ── */
.lp-chat-pane-inner {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; background: #fff;
}
.lp-chat-pane-inner.hidden { display: none; }
.lp-chat-topbar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid #e5e7eb;
  flex-shrink: 0;
}
.lp-chat-setup-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 7px;
  background: #f3f4f6; border: 1px solid #e5e7eb;
  color: #6b7280; font-size: .75rem; font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.lp-chat-setup-btn:hover { background: #e5e7eb; color: #1f2937; }
.lp-chat-topbar-label { font-size: .8rem; font-weight: 600; color: #6b7280; }
.lp-chat-input-area {
  flex-shrink: 0;
  padding: 10px 14px 14px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

/* ── Override field styles for builder ── */
.lp-builder-overlay .lp-label { color: #6b7280; }
.lp-builder-overlay .lp-label-hint { color: #9ca3af; }
.lp-builder-overlay .lp-input,
.lp-builder-overlay .lp-textarea {
  background: #fff;
  border-color: #d1d5db;
  color: #1f2937;
}
.lp-builder-overlay .lp-input::placeholder,
.lp-builder-overlay .lp-textarea::placeholder { color: #9ca3af; }
.lp-builder-overlay .lp-input:focus,
.lp-builder-overlay .lp-textarea:focus { background: #fff; border-color: #1a1a1a; box-shadow: 0 0 0 3px rgba(124,58,237,.1); }
.lp-builder-overlay .lp-content-divider span { color: #9ca3af; }
.lp-builder-overlay .lp-content-divider::before,
.lp-builder-overlay .lp-content-divider::after { background: #e5e7eb; }
.lp-builder-overlay .lp-img-upload-slot { border-color: #e5e7eb; background: #f9fafb; }
.lp-builder-overlay .lp-img-upload-slot:hover { border-color: #1a1a1a; background: #ede9fe; }
.lp-builder-overlay .lp-img-slot-empty { color: #9ca3af; }
.lp-builder-overlay .lp-generate-status { background: #ede9fe; border-color: #c4b5fd; color: #1a1a1a; }
.lp-builder-overlay .lp-generate-error { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }
.lp-builder-overlay .lp-para-num { background: #f3f4f6; color: #6b7280; }
.lp-builder-overlay .lp-para-remove { background: none; border-color: #e5e7eb; color: #9ca3af; }
.lp-builder-overlay .lp-para-remove:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }
.lp-builder-overlay .lp-add-para-btn { border-color: #c4b5fd; background: #ede9fe; color: #1a1a1a; }
.lp-builder-overlay .lp-add-para-btn:hover { background: #ddd6fe; }
.lp-builder-overlay .lp-chat-input { background: #fff; border-color: #d1d5db; color: #1f2937; }
.lp-builder-overlay .lp-chat-input::placeholder { color: #9ca3af; }
.lp-builder-overlay .lp-chat-input:focus { background: #fff; border-color: #1a1a1a; }
.lp-builder-overlay .lp-chat-msg-user { background: #ede9fe; color: #1f2937; }
.lp-builder-overlay .lp-chat-msg-ai { background: #f3f4f6; color: #374151; }
.lp-builder-overlay .lp-chat-history { padding: 12px 14px; }
.lp-builder-overlay .lp-campaign-select option { background: #fff; }

/* ── Canvas UI (light theme) ── */
.lp-canvas-pane {
  flex: 1; display: flex; flex-direction: column;
  overflow: hidden; padding: 0 !important; gap: 0 !important;
  background: #fff;
}
.lp-canvas-config {
  flex-shrink: 0;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid #e5e7eb;
}
.lp-canvas-campaign {
  flex: 1; min-width: 0;
  padding: 6px 8px; font-size: .75rem;
  background: #f9fafb; border: 1px solid #d1d5db;
  border-radius: 6px; color: #374151;
  cursor: pointer; font-family: inherit;
}
.lp-canvas-campaign option { background: #fff; }
.lp-canvas-type-pills {
  display: flex; gap: 2px; flex-shrink: 0;
  background: #f3f4f6; border-radius: 6px; padding: 2px;
}
.lp-type-pill {
  padding: 4px 10px; font-size: .7rem; font-weight: 600;
  border: none; border-radius: 5px;
  background: transparent; color: #9ca3af;
  cursor: pointer; transition: all .15s;
}
.lp-type-pill.active {
  background: #1a1a1a; color: #fff;
}
.lp-type-pill:hover:not(.active) { color: #4b5563; background: #e5e7eb; }

.lp-canvas-chat {
  flex: 1; overflow-y: auto;
  padding: 16px 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.lp-canvas-welcome {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; gap: 8px; padding: 40px 20px;
}
.lp-canvas-welcome-icon { opacity: .6; }
.lp-canvas-welcome h3 {
  margin: 0; font-size: 1.1rem; font-weight: 700;
  color: #1f2937;
}
.lp-canvas-welcome p {
  margin: 0; font-size: .82rem; color: #9ca3af; line-height: 1.5;
}

.lp-canvas-attachments {
  flex-shrink: 0;
  display: flex; gap: 6px; padding: 6px 14px 0;
  overflow-x: auto;
}
.lp-canvas-att-item {
  position: relative; flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: 8px; overflow: hidden;
  border: 1px solid #e5e7eb;
}
.lp-canvas-att-thumb {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.lp-canvas-att-remove {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; border: none;
  font-size: 10px; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  opacity: 0; transition: opacity .15s;
}
.lp-canvas-att-item:hover .lp-canvas-att-remove { opacity: 1; }

.lp-canvas-input-area {
  flex-shrink: 0; position: relative;
  padding: 10px 14px 16px;
  border-top: 1px solid #e5e7eb;
}
.lp-canvas-input-row {
  display: flex; align-items: flex-end; gap: 6px;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 12px; padding: 8px 10px;
  transition: border-color .15s;
}
.lp-canvas-input-row:focus-within {
  border-color: #1a1a1a;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(124,58,237,.1);
}
.lp-canvas-attach-btn {
  flex-shrink: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: transparent;
  color: #9ca3af; cursor: pointer;
  border-radius: 8px; transition: all .15s;
}
.lp-canvas-attach-btn:hover { color: #1a1a1a; background: rgba(124,58,237,.08); }
.lp-canvas-input {
  flex: 1; min-width: 0;
  padding: 6px 4px; font-size: .85rem;
  background: transparent; border: none;
  color: #1f2937; font-family: inherit;
  resize: none; outline: none;
  line-height: 1.5; min-height: 80px; max-height: 240px;
  overflow-y: auto;
}
.lp-canvas-input::placeholder { color: #9ca3af; }
.lp-canvas-send-btn {
  flex-shrink: 0; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 8px;
  background: #1a1a1a;
  color: #fff; cursor: pointer; transition: background .15s;
}
.lp-canvas-send-btn:hover { background: #333; }

.lp-canvas-drop-overlay {
  position: absolute; inset: 0;
  background: rgba(124,58,237,.08);
  border: 2px dashed #1a1a1a;
  border-radius: 12px;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 6px;
  z-index: 10; pointer-events: none;
}
.lp-canvas-drop-overlay span {
  font-size: .8rem; font-weight: 600; color: #1a1a1a;
}

.lp-canvas-msg-attachments {
  display: flex; gap: 6px; margin-bottom: 6px; flex-wrap: wrap;
}
.lp-canvas-msg-thumb {
  width: 60px; height: 60px; object-fit: cover;
  border-radius: 6px; border: 1px solid #e5e7eb;
}

/* Chat messages - light theme overrides in canvas */
.lp-canvas-pane .lp-chat-msg-user {
  background: #ede9fe; color: #1f2937;
}
.lp-canvas-pane .lp-chat-msg-ai {
  background: #f3f4f6; color: #374151;
}
.lp-canvas-pane .lp-chat-msg-ai svg { stroke: #1a1a1a; }
.lp-canvas-pane .lp-chat-msg-error {
  background: #fef2f2; color: #991b1b;
}
.lp-field-group { display: flex; flex-direction: column; gap: 6px; }
.lp-label { font-size: .8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; }
.lp-input, .lp-textarea {
  width: 100%; padding: 10px 12px;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text); font-size: .875rem;
  transition: border-color var(--transition);
  box-sizing: border-box; font-family: inherit;
  resize: vertical;
}
.lp-input:focus, .lp-textarea:focus {
  outline: none; border-color: #359BFF;
  background: var(--bg-card);
}
.lp-builder-actions { display: flex; flex-direction: column; gap: 8px; }
.lp-btn-generate {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px;
  background: linear-gradient(135deg, #8b5cf6, #3b82f6);
  color: #fff; border: none;
  border-radius: 8px; font-size: .875rem; font-weight: 600;
  cursor: pointer; transition: opacity var(--transition);
}
.lp-btn-generate:hover:not(:disabled) { opacity: .9; }
.lp-btn-generate:disabled { opacity: .6; cursor: not-allowed; }
.lp-btn-save {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px;
  background: rgba(37,186,100,.1);
  color: #25BA64;
  border: 1px solid rgba(37,186,100,.3);
  border-radius: 8px; font-size: .875rem; font-weight: 600;
  cursor: pointer; transition: all var(--transition);
}
.lp-btn-save:hover:not(:disabled) { background: rgba(37,186,100,.18); }
.lp-generate-status {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; background: rgba(53,155,255,.07);
  border: 1px solid rgba(53,155,255,.2);
  border-radius: 8px; font-size: .82rem; color: #359BFF;
}
.lp-generate-status.hidden { display: none; }
.lp-generate-error {
  padding: 10px 12px;
  background: rgba(239,68,68,.08);
  border: 1px solid rgba(239,68,68,.2);
  border-radius: 8px; font-size: .82rem; color: #ef4444;
}
.lp-generate-error.hidden { display: none; }
.lp-preview-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.lp-preview-label { font-size: .8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; }
.lp-preview-open-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 5px 10px; border-radius: 6px;
  font-size: .75rem; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-secondary); transition: all var(--transition);
}
.lp-preview-open-btn:hover { border-color: #359BFF; color: #359BFF; }
.lp-preview-open-btn.hidden { display: none; }
.lp-preview-wrap {
  flex: 1; display: flex; flex-direction: column;
  background: #fff; overflow: hidden;
}
.lp-preview-placeholder {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 12px;
  color: #94a3b8; font-size: .875rem;
  background: var(--bg-hover);
}
.lp-preview-placeholder p { margin: 0; }
.lp-preview-iframe { width: 100%; height: 100%; border: none; flex: 1; }

/* ── Content fields ── */
.lp-label-hint { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text-muted); font-size: .75rem; }
.lp-content-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 4px 0;
}
.lp-content-divider::before, .lp-content-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}
.lp-content-divider span { font-size: .72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }

.lp-paragraphs-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.lp-paragraphs-header .lp-label { margin-bottom: 0; }
.lp-add-para-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 10px; border-radius: 6px;
  font-size: .75rem; font-weight: 600; cursor: pointer;
  border: 1px solid rgba(53,155,255,.3);
  background: rgba(53,155,255,.07); color: #359BFF;
  transition: all var(--transition);
}
.lp-add-para-btn:hover { background: rgba(53,155,255,.15); }
.lp-para-row {
  display: flex; align-items: flex-start; gap: 8px;
  margin-bottom: 8px;
}
.lp-para-num {
  width: 22px; height: 22px; flex-shrink: 0;
  background: var(--bg-hover); border-radius: 50%;
  font-size: .72rem; font-weight: 700; color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  margin-top: 10px;
}
.lp-para-textarea { flex: 1; min-width: 0; font-size: .82rem; }
.lp-para-remove {
  width: 26px; height: 26px; flex-shrink: 0;
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-muted); cursor: pointer; display: flex;
  align-items: center; justify-content: center;
  margin-top: 8px; transition: all var(--transition);
}
.lp-para-remove:hover { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,.06); }

/* ── Image Upload Slots ── */
.lp-img-upload-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.lp-img-upload-slot {
  position: relative;
  border: 1.5px dashed var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: var(--bg-hover);
  transition: border-color var(--transition), background var(--transition);
  aspect-ratio: 3/2;
  display: flex; align-items: center; justify-content: center;
}
.lp-img-upload-slot:hover { border-color: #359BFF; background: rgba(53,155,255,.04); }
.lp-img-slot-empty {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 12px;
  color: var(--text-muted); font-size: .75rem; font-weight: 500;
  text-align: center; pointer-events: none;
}
.lp-img-slot-empty svg { opacity: .5; }
.lp-img-compressing {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: .72rem; color: #359BFF;
}
.lp-img-slot-preview {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
}
.lp-img-slot-preview img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
.lp-img-remove {
  position: absolute; top: 5px; right: 5px;
  width: 22px; height: 22px;
  background: rgba(0,0,0,.65); color: #fff;
  border: none; border-radius: 50%;
  font-size: .7rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background var(--transition);
  line-height: 1;
}
.lp-img-remove:hover { background: #ef4444; }
.lp-img-slot-label {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 4px 8px;
  background: rgba(0,0,0,.55);
  color: #fff; font-size: .68rem; font-weight: 600;
  text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ── Page Type Selector ── */
.lp-type-cards { display: flex; flex-direction: column; gap: 8px; }
.lp-type-card {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all var(--transition);
  background: transparent;
  position: relative;
}
.lp-type-card:hover { border-color: rgba(53,155,255,.4); background: rgba(53,155,255,.04); }
.lp-type-card.active { border-color: #359BFF; background: rgba(53,155,255,.07); }
.lp-type-card-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  background: var(--bg-hover);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: all var(--transition);
}
.lp-type-card.active .lp-type-card-icon { background: rgba(53,155,255,.12); color: #359BFF; }
.lp-type-card-body { flex: 1; }
.lp-type-card-name { font-size: .875rem; font-weight: 600; color: var(--text); margin-bottom: 3px; }
.lp-type-card-desc { font-size: .77rem; color: var(--text-muted); line-height: 1.5; }
.lp-type-card-check {
  width: 20px; height: 20px; border-radius: 50%;
  border: 1.5px solid var(--border); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: transparent; transition: all var(--transition);
  margin-top: 2px;
}
.lp-type-card.active .lp-type-card-check { background: #359BFF; border-color: #359BFF; color: #fff; }

/* Type badge on page cards */
.lp-type-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; border-radius: 20px;
  font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.lp-type-badge-minisite { background: rgba(53,155,255,.12); color: #359BFF; }
.lp-type-badge-funnel { background: rgba(139,92,246,.12); color: #8b5cf6; }
.lp-type-badge-floors { background: rgba(245,158,11,.12); color: #f59e0b; }

/* LP Leads table */
.lp-leads-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.lp-leads-count { font-size: .85rem; font-weight: 600; color: var(--text); }
.lp-leads-refresh {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 6px;
  font-size: .78rem; font-weight: 500; cursor: pointer;
  border: 1px solid var(--border); background: transparent;
  color: var(--text-secondary); transition: all var(--transition);
}
.lp-leads-refresh:hover { background: var(--bg-card-hover); color: var(--text); }
.lp-leads-table th, .lp-leads-table td { padding: 10px 12px; }
.lp-page-tag {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 20px;
  font-size: .75rem; font-weight: 600;
  background: rgba(139,92,246,.12); color: #8b5cf6;
  white-space: nowrap;
}
.lp-campaign-tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 8px; border-radius: 20px;
  font-size: .75rem; font-weight: 600;
  background: rgba(37,186,100,.1); color: #25BA64;
  white-space: nowrap;
}
.lp-campaign-select { cursor: pointer; }
.lp-leads-empty { padding: 80px 24px; }

/* ── AI Chat pane ── */
.lp-chat-history {
  flex: 1;
  display: flex; flex-direction: column; gap: 6px;
  padding: 4px 0;
}
.lp-chat-empty { font-size: .78rem; color: var(--text-muted); text-align: center; padding: 10px 0; font-style: italic; }
.lp-chat-msg {
  padding: 7px 11px; border-radius: 8px;
  font-size: .8rem; line-height: 1.5; max-width: 92%;
}
.lp-chat-msg-user {
  background: rgba(53,155,255,.12); color: var(--text);
  align-self: flex-end; border-bottom-right-radius: 3px;
}
.lp-chat-msg-ai {
  background: rgba(139,92,246,.1); color: var(--text);
  align-self: flex-start; border-bottom-left-radius: 3px;
  display: flex; align-items: flex-start; gap: 6px;
}
.lp-chat-msg-ai svg { flex-shrink: 0; margin-top: 2px; opacity: .7; }
.lp-chat-msg-error {
  background: rgba(239,68,68,.1); color: #ef4444;
  align-self: flex-start; border-bottom-left-radius: 3px;
  font-size: .77rem;
}
.lp-chat-input-row { display: flex; gap: 8px; align-items: flex-end; }
.lp-chat-input {
  flex: 1; padding: 9px 12px;
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: .82rem;
  resize: none; font-family: inherit; line-height: 1.5;
  transition: border-color var(--transition);
}
.lp-chat-input:focus { outline: none; border-color: #8b5cf6; background: var(--bg-card); }
.lp-chat-send {
  width: 36px; height: 36px; flex-shrink: 0;
  background: #1a1a1a;
  color: #fff; border: none; border-radius: 8px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lp-chat-send:hover { background: #333; }
.lp-chat-send:disabled { opacity: .5; cursor: not-allowed; }

/* LP leads badge on tab */
.lf-src-tab-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: #8b5cf6; color: #fff;
  border-radius: 20px; font-size: .68rem; font-weight: 700;
  margin-left: 6px; line-height: 1;
}

/* LP Builder responsive */
@media (max-width: 900px) {
  .lp-split-body { flex-direction: column; }
  .lp-preview-panel { border-right: none; border-bottom: 1px solid #e5e7eb; height: 50vh; min-height: 240px; flex: none; }
  .lp-right-panel { width: 100%; flex: 1; }
  .lp-struct-grid { grid-template-columns: 1fr; max-height: 80vh; overflow-y: auto; }
  .lp-code-view { top: 38px; }
}
@media (max-width: 640px) {
  .lp-struct-title { font-size: 1.35rem; }
  .lp-topbar-name { max-width: 140px; }
  .lp-topbar-btn span { display: none; }
  .lp-topbar-btn { padding: 6px 8px; }
}
@media (max-width: 768px) {
  .lp-grid { grid-template-columns: 1fr; }
  .lp-header { flex-direction: column; }
}

/* ========== RESPONSIVE — 480px ========== */
@media (max-width: 480px) {
  .lf-crm-stats { grid-template-columns: 1fr 1fr; }
  .lf-hbar-name { width: 80px; }
  .hero-title { font-size: 1.2rem; }
  .am-page-title { font-size: 16px; }
  .am-opt-hist-btn span { display: none; }
  .global-ctx-sep { display: none; }
  .am-sf-btn { padding: 5px 10px; font-size: 12px; }
  .am-search { width: 80px; }
  .lf-board { gap: 10px; }
  .lf-board-col { min-width: 220px; }
  .sidebar-user { flex-direction: row; align-items: center; }
}

/* Unified Kanban */
.ukanban-col-over { background: color-mix(in srgb, var(--accent) 8%, var(--bg-card)) !important; border-color: var(--accent) !important; }
.ukanban-card[draggable="true"]:active { cursor: grabbing; opacity: .7; transform: scale(.97); }
.ukanban-board::-webkit-scrollbar { height: 6px; }
.ukanban-board::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.ukanban-cards::-webkit-scrollbar { width: 4px; }
.ukanban-cards::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ── Calendar View ── */
.ucal-wrap { background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.ucal-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.ucal-nav {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--bg-page,#f9fafb); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; color: var(--text-secondary); transition: all .15s;
}
.ucal-nav:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.ucal-title { font-size: 1rem; font-weight: 700; color: var(--text-primary); min-width: 160px; text-align: center; }
.ucal-today-btn {
  margin-left: auto; padding: 5px 14px; border-radius: 7px;
  background: var(--bg-page,#f9fafb); border: 1px solid var(--border);
  font-size: .78rem; font-weight: 600; color: var(--text-secondary);
  cursor: pointer; transition: all .15s;
}
.ucal-today-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.ucal-grid {
  display: grid; grid-template-columns: repeat(7, 1fr);
}
.ucal-day-name {
  padding: 8px 0; text-align: center;
  font-size: .72rem; font-weight: 700; text-transform: uppercase;
  color: var(--text-secondary); background: var(--bg-page,#f9fafb);
  border-bottom: 1px solid var(--border);
}
.ucal-cell {
  min-height: 100px; padding: 4px 6px;
  border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .1s;
  display: flex; flex-direction: column; gap: 2px;
}
.ucal-cell:nth-child(7n) { border-right: none; }
.ucal-cell:hover { background: rgba(124,58,237,.03); }
.ucal-cell.ucal-empty { background: var(--bg-page,#fafafa); cursor: default; }
.ucal-cell.ucal-today { background: rgba(124,58,237,.04); }
.ucal-cell.ucal-has-leads { background: rgba(124,58,237,.02); }
.ucal-cell.ucal-cell-drag-over {
  background: rgba(124,58,237,.12) !important;
  outline: 2px dashed var(--accent);
  outline-offset: -2px;
}
.ucal-date {
  font-size: .78rem; font-weight: 600; color: var(--text-secondary);
  margin-bottom: 2px; width: 24px; height: 24px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.ucal-date-today {
  background: var(--accent); color: #fff !important;
}
.ucal-lead {
  padding: 2px 6px; border-radius: 4px;
  background: var(--bg-page,#fff); font-size: .68rem;
  overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  display: flex; align-items: center; gap: 4px;
  cursor: pointer; transition: background .1s;
}
.ucal-lead:hover { background: #ede9fe; }
.ucal-lead-name { overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); font-weight: 500; }
.ucal-due-badge {
  font-size: .55rem; padding: 0 4px; border-radius: 4px;
  background: #fef3c7; color: #92400e; font-weight: 700; flex-shrink: 0;
}
.ucal-more { font-size: .65rem; color: var(--accent); font-weight: 600; padding: 1px 6px; cursor: pointer; }

/* Calendar day popup */
.ucal-day-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.3); display: flex;
  align-items: center; justify-content: center;
}
.ucal-day-popup {
  background: var(--bg-card); border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.15);
  width: 420px; max-width: 92vw; max-height: 80vh;
  display: flex; flex-direction: column; overflow: hidden;
}
.ucal-day-popup-hdr {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  font-size: .92rem; font-weight: 700; color: var(--text-primary);
}
.ucal-day-popup-body { flex: 1; overflow-y: auto; padding: 10px 14px; }
.ucal-day-lead {
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--border); margin-bottom: 8px;
  transition: all .15s;
}
.ucal-day-lead:hover { background: #ede9fe; border-color: var(--accent); }

/* ── Updates / Comments Panel ── */
.lupd-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.35); display: flex;
  justify-content: flex-end;
  backdrop-filter: blur(2px);
}
.lupd-panel {
  width: 480px; max-width: 95vw; height: 100vh;
  background: var(--bg-card); box-shadow: -8px 0 40px rgba(0,0,0,.12);
  display: flex; flex-direction: column;
  animation: lupd-slide .22s ease-out;
}
@keyframes lupd-slide { from { transform: translateX(100%); } to { transform: translateX(0); } }
.lupd-header {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
  flex-shrink: 0; background: var(--bg-card);
}
.lupd-lead-name { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); letter-spacing: -.01em; }
.lupd-close {
  background: none; border: none; font-size: 1.3rem;
  color: var(--text-secondary); cursor: pointer; padding: 2px 6px;
  line-height: 1; transition: all .15s; border-radius: 6px;
}
.lupd-close:hover { color: #ef4444; background: #fef2f2; }
.lupd-scroll-body {
  flex: 1; overflow-y: auto; display: flex; flex-direction: column;
}
.lupd-section {
  padding: 16px 24px; border-bottom: 1px solid var(--border);
}
.lupd-section-title {
  display: flex; align-items: center; gap: 6px;
  font-size: .72rem; font-weight: 700; color: var(--text-secondary);
  text-transform: uppercase; letter-spacing: .6px; margin-bottom: 12px;
}
.lupd-contact-grid {
  display: flex; flex-direction: column; gap: 8px;
}
.lupd-contact-card {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
  border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-page, #f9fafb); text-decoration: none;
  transition: all .15s; cursor: pointer;
}
.lupd-contact-card span {
  font-size: .82rem; color: var(--text-primary); font-weight: 500;
}
.lupd-contact-card:hover {
  border-color: var(--accent); background: #f0f7ff;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}
.lupd-details-grid {
  display: grid; grid-template-columns: 1fr; gap: 0;
}
.lupd-detail-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 7px 0; border-bottom: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
  gap: 12px;
}
.lupd-detail-row:last-child { border-bottom: none; }
.lupd-detail-row input[type="date"] {
  font-size: .78rem; padding: 3px 8px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg-card); color: var(--text-primary);
  font-family: inherit; cursor: pointer; outline: none;
  transition: border-color .15s;
}
.lupd-detail-row input[type="date"]:hover,
.lupd-detail-row input[type="date"]:focus { border-color: var(--accent); }
.lupd-detail-label {
  font-size: .75rem; color: var(--text-secondary); font-weight: 600;
  white-space: nowrap; text-transform: capitalize; flex-shrink: 0;
}
.lupd-detail-val {
  font-size: .8rem; color: var(--text-primary); text-align: right;
  word-break: break-word; min-width: 0;
}
.lupd-updates-section {
  flex: 1; display: flex; flex-direction: column; border-bottom: none;
}
.lupd-compose {
  display: flex; gap: 10px; margin-bottom: 14px;
}
.lupd-avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #1a1a1a; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .72rem; font-weight: 700; flex-shrink: 0;
}
.lupd-compose-box { flex: 1; min-width: 0; }
.lupd-textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 10px; font-size: .82rem; font-family: inherit;
  color: var(--text-primary); background: var(--bg-page,#f9fafb);
  resize: none; outline: none; transition: all .15s;
  line-height: 1.5;
}
.lupd-textarea:focus { border-color: var(--accent); background: var(--bg-card); box-shadow: 0 0 0 3px rgba(0,0,0,.05); }
.lupd-send-btn {
  padding: 6px 16px; border-radius: 8px; font-size: .78rem;
  font-weight: 600; border: none; cursor: pointer;
  background: #1a1a1a; color: #fff;
  display: flex; align-items: center; gap: 5px; transition: background .15s;
}
.lupd-send-btn:hover { background: #333; }
.lupd-timeline {
  flex: 1; display: flex; flex-direction: column; gap: 10px;
}
.lupd-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 30px 0;
}
.lupd-item {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; background: var(--bg-page,#fafafa);
  transition: border-color .15s;
}
.lupd-item:hover { border-color: var(--accent); }
.lupd-item-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.lupd-author { font-size: .82rem; font-weight: 600; color: var(--text-primary); }
.lupd-time { font-size: .68rem; color: var(--text-secondary); }
.lupd-delete {
  margin-left: auto; background: none; border: none;
  color: var(--text-secondary); cursor: pointer;
  font-size: 1rem; opacity: 0; transition: all .15s;
}
.lupd-item:hover .lupd-delete { opacity: 1; }
.lupd-delete:hover { color: #ef4444; }
.lupd-body { font-size: .82rem; color: var(--text-primary); line-height: 1.6; padding-left: 38px; }

/* ---- Status Badge (shadcn pill style) ---- */
.usb-badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 9px; border-radius: 9999px;
  font-size: .72rem; font-weight: 600; cursor: pointer;
  white-space: nowrap; user-select: none;
  transition: filter .12s, box-shadow .12s;
  line-height: 1.5;
}
.usb-badge:hover { filter: brightness(.94); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.usb-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.usb-picker {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.13);
  padding: 4px; min-width: 190px; max-height: 300px; overflow-y: auto;
}
.usb-option {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 6px;
  font-size: .8rem; cursor: pointer; color: var(--text-primary);
  transition: background .1s;
}
.usb-option:hover { background: var(--bg-page); }
.usb-option-active { font-weight: 600; }

/* ---- Advanced Filter Panel ---- */
.af-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 1200;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px;
  box-shadow: 0 8px 32px rgba(0,0,0,.14);
  min-width: 640px; max-width: 860px; width: max-content;
}
.af-header {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px; flex-wrap: wrap;
}
.af-rules { display: flex; flex-direction: column; gap: 8px; }
.af-rule-row {
  display: flex; align-items: center; gap: 8px; flex-wrap: nowrap;
}
.af-rule-row select { flex-shrink: 0; }
.af-rule-row [data-af-val] { flex: 1; min-width: 120px; }
.af-add-rule {
  display: inline-flex; align-items: center; gap: 5px;
  margin-top: 12px; padding: 0; background: none; border: none;
  font-size: .8rem; color: var(--accent); cursor: pointer; font-weight: 500;
}
.af-add-rule:hover { text-decoration: underline; }
.af-btn-ghost {
  padding: 4px 10px; border: none; background: none;
  font-size: .78rem; color: var(--text-secondary); cursor: pointer;
  border-radius: 6px;
}
.af-btn-ghost:hover { background: var(--bg-page); color: var(--text-primary); }
.af-btn-outline {
  padding: 4px 12px; border: 1px solid var(--border); background: var(--bg-card);
  font-size: .78rem; color: var(--text-primary); cursor: pointer; border-radius: 6px;
}
.af-btn-outline:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 640px) {
  .af-panel { min-width: 92vw; max-width: 98vw; left: -8px; }
  .af-rule-row { flex-wrap: wrap; }
}

/* ── Phone cell — call / SMS / WhatsApp actions ──────────────────────────── */
.lf-phone-cell-wrap {
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap;
}
.lf-phone-link-plain {
  color: var(--accent); text-decoration: none;
}
.lf-phone-link-plain:hover { text-decoration: underline; }

.lf-phone-actions {
  display: inline-flex; align-items: center; gap: 3px;
  opacity: 0; transition: opacity .15s;
}
tr:hover .lf-phone-actions { opacity: 1; }

.lf-phone-act {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  border: none; cursor: pointer; text-decoration: none;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
}
.lf-phone-act:hover { transform: scale(1.15); }

.lf-phone-act--call { background: #22c55e; color: #fff; }
.lf-phone-act--call:hover { background: #16a34a; }

.lf-phone-act--sms  { background: #3b82f6; color: #fff; }
.lf-phone-act--sms:hover  { background: #2563eb; }

.lf-phone-act--wa   { background: #25d366; color: #fff; }
.lf-phone-act--wa:hover   { background: #128c50; }

/* ── Billing Tab ─────────────────────────────────────────────────────────── */
.bl-wrap { padding: 20px 24px; max-width: 1100px; }

.bl-toolbar {
  display: flex; align-items: center; gap: 10px; margin-bottom: 20px;
}
.bl-dr-select {
  padding: 7px 12px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-card); color: var(--text-primary); font-size: .83rem;
  font-family: inherit; cursor: pointer;
}
.bl-refresh-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--bg-card); color: var(--text-secondary); font-size: .83rem;
  cursor: pointer; font-family: inherit; transition: border-color .15s, color .15s;
}
.bl-refresh-btn:hover { border-color: var(--accent); color: var(--accent); }

.bl-cards {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px;
}
@media (max-width: 900px) { .bl-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .bl-cards { grid-template-columns: 1fr; } }

.bl-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 16px 18px;
  transition: box-shadow .15s;
}
.bl-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.07); }
.bl-card-top {
  display: flex; align-items: center; gap: 7px; margin-bottom: 10px;
}
.bl-card-icon { font-size: 16px; }
.bl-card-label { font-size: .78rem; color: var(--text-secondary); font-weight: 500; }
.bl-card-value { font-size: 1.55rem; font-weight: 700; line-height: 1; margin-bottom: 4px; }
.bl-card-sub   { font-size: .75rem; color: var(--text-secondary); }

.bl-section-title {
  font-size: .9rem; font-weight: 700; color: var(--text-primary);
  margin: 0 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.bl-chart-wrap {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 18px 16px; margin-bottom: 24px; overflow: hidden;
}
.bl-no-chart {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 12px; padding: 32px; text-align: center;
  color: var(--text-secondary); font-size: .84rem; margin-bottom: 24px;
}
.bl-table-wrap {
  border: 1px solid var(--border); border-radius: 10px;
  overflow: hidden; margin-bottom: 24px; overflow-x: auto;
}
.bl-table {
  width: 100%; border-collapse: collapse; font-size: .82rem;
  background: var(--bg-card);
}
.bl-table thead tr { background: var(--bg-page); }
.bl-table th {
  padding: 9px 14px; text-align: left; font-weight: 600;
  color: var(--text-secondary); font-size: .77rem;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
.bl-table td {
  padding: 9px 14px; border-bottom: 1px solid var(--border);
  color: var(--text-primary); vertical-align: middle;
}
.bl-table tr:last-child td { border-bottom: none; }
.bl-table tbody tr:hover { background: var(--bg-page); }

/* Billing per-user badges */
.bl-badge { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: .7rem; font-weight: 600; margin-right: 3px; }
.bl-badge-meta  { background: #e7f0fd; color: #1877f2; }
.bl-badge-gads  { background: #e8f5e9; color: #2e7d32; }
.bl-badge-dv360 { background: #e8eaf6; color: #3949ab; }
.bl-badge-none  { background: var(--bg-page); color: var(--text-muted); }

/* ── Browser Dialer Popup ────────────────────────────────────────────────── */
.lf-dialer-popup {
  position: fixed; bottom: 24px; right: 24px; z-index: 9999;
  width: 420px; border-radius: 12px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
  font-family: inherit; font-size: 14px;
  transition: transform .2s, opacity .2s;
  background: var(--bg-card, #fff);
}
.lf-dialer-hidden { display: none; }
.lf-dialer-minimized .lf-dialer-body { display: none; }

.lf-dialer-header {
  display: flex; align-items: center; gap: 8px;
  background: #3d8ef8; color: #fff;
  padding: 12px 14px; cursor: default; user-select: none;
}
.lf-dialer-chevron {
  font-size: 18px; cursor: pointer; opacity: .8; flex-shrink: 0;
  transform: rotate(180deg); display: inline-block;
}
.lf-dialer-minimized .lf-dialer-chevron { transform: rotate(0deg); }
.lf-dialer-name  { font-weight: 700; font-size: 15px; flex-shrink: 0; }
.lf-dialer-phone { font-size: 12px; opacity: .85; flex-shrink: 0; }
.lf-dialer-timer {
  margin-left: auto; font-size: 13px; font-weight: 600;
  letter-spacing: .5px; flex-shrink: 0;
}
.lf-dialer-hangup {
  width: 40px; height: 30px; border-radius: 6px;
  background: #e74c3c; color: #fff; border: none; cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; transition: background .15s;
}
.lf-dialer-hangup:hover { background: #c0392b; }
.lf-dialer-close-x {
  background: none; border: none; color: #fff; font-size: 16px;
  cursor: pointer; opacity: .8; flex-shrink: 0; padding: 0 2px;
}
.lf-dialer-close-x:hover { opacity: 1; }

.lf-dialer-body {
  padding: 16px; background: var(--bg-card, #fff);
  display: flex; flex-direction: column; gap: 0;
}

/* Controls row */
.lf-dialer-controls {
  display: flex; gap: 12px; justify-content: flex-start;
  margin-bottom: 14px; flex-wrap: wrap;
}
.lf-dialer-ctrl {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  background: #f0f4ff; border: none; border-radius: 50%;
  width: 56px; height: 56px; cursor: pointer;
  font-size: 10px; color: #3d8ef8; font-weight: 600; letter-spacing: .3px;
  transition: background .15s, color .15s;
}
.lf-dialer-ctrl svg { width: 22px; height: 22px; }
.lf-dialer-ctrl:hover { background: #dbeafe; }
.lf-dialer-ctrl-on { background: #3d8ef8 !important; color: #fff !important; }

/* Keypad */
.lf-dialer-keypad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px;
  margin-bottom: 10px;
}
.lf-dialer-key {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--bg-page, #f4f6fa); border: 1px solid var(--border, #e5e7eb);
  border-radius: 10px; height: 54px; cursor: pointer; font-family: inherit;
  transition: background .1s;
}
.lf-dialer-key:hover { background: #e0e7ff; }
.lf-dialer-key-main { font-size: 18px; font-weight: 600; color: var(--text-primary, #111); }
.lf-dialer-key-sub  { font-size: 9px; letter-spacing: 1px; color: var(--text-secondary, #6b7280); }
.lf-dialer-dismiss-keypad {
  width: 100%; padding: 10px; border-radius: 8px;
  background: #3d8ef8; color: #fff; border: none; cursor: pointer;
  font-size: 13px; font-weight: 700; letter-spacing: 1px; margin-top: 4px;
}
.lf-dialer-dismiss-keypad:hover { background: #2563eb; }

/* Audio panel */
.lf-dialer-audio-panel {
  background: var(--bg-page, #f4f6fa); border-radius: 8px;
  padding: 12px; margin-bottom: 10px; border: 1px solid var(--border, #e5e7eb);
}
.lf-dialer-audio-label { font-size: 12px; font-style: italic; color: var(--text-secondary); margin-bottom: 6px; }
.lf-dialer-audio-select {
  width: 100%; padding: 6px 10px; border: 1px solid var(--border, #e5e7eb);
  border-radius: 6px; background: var(--bg-card, #fff); color: var(--text-primary);
  font-size: 13px; font-family: inherit;
}

/* Note area */
.lf-dialer-note-label { font-size: 12px; font-style: italic; color: var(--text-secondary); margin-bottom: 6px; margin-top: 2px; }
.lf-dialer-note {
  width: 100%; box-sizing: border-box; height: 90px; resize: vertical;
  border: 1px solid var(--border, #e5e7eb); border-radius: 8px;
  padding: 10px; font-size: 13px; font-family: inherit;
  background: var(--bg-card, #fff); color: var(--text-primary);
  outline: none;
}
.lf-dialer-note:focus { border-color: #3d8ef8; }
.lf-dialer-note-toolbar {
  display: flex; gap: 4px; padding: 6px 8px;
  border: 1px solid var(--border, #e5e7eb); border-top: none;
  border-radius: 0 0 8px 8px; background: var(--bg-page, #f4f6fa);
  margin-bottom: 2px;
}
.lf-dialer-note-toolbar button {
  background: none; border: none; cursor: pointer; padding: 2px 5px;
  color: var(--text-secondary); font-size: 13px; border-radius: 3px;
}
.lf-dialer-note-toolbar button:hover { background: var(--border); color: var(--text-primary); }

/* Post-call outcome */
.lf-dialer-outcome-select {
  width: 100%; padding: 8px 12px; border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px; background: var(--bg-card, #fff); color: var(--text-primary);
  font-size: 13px; font-family: inherit; cursor: pointer;
}
.lf-dialer-save-btn {
  margin-top: 14px; width: 100%; padding: 11px;
  background: #3d8ef8; color: #fff; border: none; border-radius: 8px;
  font-size: 13px; font-weight: 700; letter-spacing: .8px;
  cursor: pointer; transition: background .15s;
}
.lf-dialer-save-btn:hover { background: #2563eb; }

/* Dark mode */
@media (prefers-color-scheme: dark) {
  .lf-dialer-popup { box-shadow: 0 12px 40px rgba(0,0,0,.6); }
}

/* ── Ads Manager: left account sidebar layout ───────────────────────────── */
#sectionAdsmanager { display: flex; flex-direction: row; align-items: flex-start; gap: 0; }

.am-acct-sidebar {
  flex-shrink: 0;
  width: 210px;
  min-height: 200px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-right: 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: width .2s ease;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 80px);
}
.am-acct-sidebar.collapsed {
  width: 36px;
  min-height: 0;
}

.am-main-content { flex: 1; min-width: 0; }

.am-side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 10px 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  gap: 6px;
}
.am-side-title {
  font-size: .72rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: .4px;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
}
.am-side-toggle {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px 3px;
  color: var(--text-secondary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  margin-left: auto;
}
.am-side-toggle:hover { background: var(--bg-elevated); color: var(--text-primary); }

.am-acct-sidebar.collapsed .am-side-header { justify-content: center; border-bottom: none; padding: 10px 0; }
.am-acct-sidebar.collapsed .am-side-title { display: none; }

.am-side-body { overflow-y: auto; flex: 1; }

.am-side-section { border-bottom: 1px solid var(--border); }
.am-side-section:last-child { border-bottom: none; }

.am-side-section-hd {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px 5px;
  font-size: .68rem;
  font-weight: 700;
  color: var(--text-secondary);
  letter-spacing: .4px;
  text-transform: uppercase;
  background: var(--bg-subtle, #f9fafb);
  user-select: none;
}
.am-side-count {
  margin-left: auto;
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 1px 5px;
  font-size: .65rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.am-side-items { padding: 2px 0; }
.am-side-search { display: flex; align-items: center; gap: 6px; margin: 6px 10px 4px; padding: 5px 8px; background: var(--bg-elevated, #f3f4f6); border: 1px solid var(--border, #e5e7eb); border-radius: 6px; color: var(--text-tertiary, #9ca3af); }
.am-side-search input { border: none; background: transparent; outline: none; font-size: .78rem; width: 100%; color: var(--text-primary, #111827); }
.am-side-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: .78rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: background .1s;
  white-space: nowrap;
}
.am-side-item span { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.am-side-item-count { color: var(--text-tertiary, #9ca3af); font-size: 11px; font-weight: 600; }
.am-side-item:hover { background: var(--bg-elevated); }
.am-side-item.active { background: #eff6ff; color: #1d4ed8; font-weight: 500; }

.am-side-empty {
  padding: 16px 12px;
  font-size: .75rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
