/* ═══════════════════════════════════════════════════════════
   EMERA Newsletter Studio — style.css
   Typo: Inter (UI) + Playfair Display (titles)
   Palette: bg #1a1917 · surface #242220 · gold #c8a86b
═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,500;1,400&display=swap');

/* ── RESET & ROOT ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }

:root {
  /* Backgrounds */
  --bg:        #1a1917;
  --surface:   #242220;
  --surface2:  #2c2a27;
  --surface3:  #353330;
  --surface4:  #3e3c38;

  /* Borders */
  --border:    rgba(255,255,255,0.07);
  --border2:   rgba(255,255,255,0.12);
  --border3:   rgba(255,255,255,0.20);

  /* Gold accent */
  --gold:      #c8a86b;
  --gold-lt:   #dfc08a;
  --gold-dim:  rgba(200,168,107,0.10);
  --gold-glow: rgba(200,168,107,0.20);

  /* Text — high contrast, readable */
  --text:      #f4f0e8;
  --text2:     #c8c2b4;
  --text3:     #7a7468;
  --text4:     #4a4640;

  /* Status */
  --red:       #e05c4a;
  --red-dim:   rgba(224,92,74,0.12);
  --green:     #5aaa7a;
  --green-dim: rgba(90,170,122,0.12);
  --blue:      #6a9fd8;
  --blue-dim:  rgba(106,159,216,0.12);

  /* Misc */
  --radius:    6px;
  --radius-lg: 10px;
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --ease2:     cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font-ui:   'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Cascadia Code', monospace;

  /* Sidebar width */
  --sidebar-w: 240px;
  --topbar-h:  58px;
}


/* ══════════════════════════════════════════════
   LIGHT THEME — body.light overrides CSS vars
   Gold accent stays identical, text goes dark
══════════════════════════════════════════════ */
body.light {
  /* Backgrounds */
  --bg:        #f5f3ee;
  --surface:   #ffffff;
  --surface2:  #f0ede6;
  --surface3:  #e8e4db;
  --surface4:  #ddd9cf;

  /* Borders */
  --border:    rgba(0,0,0,0.07);
  --border2:   rgba(0,0,0,0.12);
  --border3:   rgba(0,0,0,0.20);

  /* Text */
  --text:      #1a1815;
  --text2:     #4a4540;
  --text3:     #8a8478;
  --text4:     #b0aa9e;

  /* Status dims — lighter on white */
  --red-dim:   rgba(224,92,74,0.10);
  --green-dim: rgba(90,170,122,0.10);
  --blue-dim:  rgba(106,159,216,0.10);
  --gold-dim:  rgba(200,168,107,0.12);
  --gold-glow: rgba(200,168,107,0.22);
}

/* Smooth theme transition */
body {
  transition: background 0.35s ease, color 0.35s ease;
}
.topbar, .sidebar, .modal, .send-panel,
.send-summary, .settings-card, .nl-card,
.table-wrap, .tabs, .info-box, .drop-zone,
.toast, .login-card {
  transition: background 0.35s ease, border-color 0.35s ease, color 0.35s ease;
}

/* ── TEXT SELECTION — blocked globally, re-enabled where needed ── */
* {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}
input, textarea,
.td-mono,
.card-code,
[data-allow-ctx] {
  -webkit-user-select: text;
  -moz-user-select: text;
  user-select: text;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  cursor: none;
}

/* ══════════════════════════════════════════════
   CUSTOM CURSOR — thème sombre EMERA
   cursor.js gère left/top via RAF
   className = '' | 'hover' | 'img' | 'hover-photo' | 'hover-dl'

   Structure visuelle (repos) :
     anneau doré fin  +  point central doré via ::after
════════════════════════════════════════════════ */

/* ── Anneau extérieur ── */
#cursor {
  position: fixed;
  top: -200px; left: -200px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(200, 168, 107, 0.6);
  background: transparent;
  pointer-events: none;
  z-index: 999999;
  /* translate(-50%,-50%) centres ring on cursor coords */
  transform: translate(-50%, -50%);
  /* position:relative needed so ::after (dot) is positioned inside */
  /* N.B. fixed+relative is valid — children are relative to this box */
  transition:
    width        0.35s var(--ease),
    height       0.35s var(--ease),
    border-color 0.3s  var(--ease),
    background   0.3s  var(--ease),
    opacity      0.2s;
  will-change: left, top;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Point central (repos) — uses flex centering, not absolute ── */
#cursor::after {
  content: '';
  display: block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--gold);
  flex-shrink: 0;
  transition:
    width    0.35s var(--ease),
    height   0.35s var(--ease),
    opacity  0.3s  var(--ease);
}

/* ── État hover : anneau agrandi, point disparaît ── */
#cursor.hover {
  width: 52px; height: 52px;
  border-color: var(--gold);
  background: rgba(200, 168, 107, 0.07);
}
#cursor.hover::after {
  width: 0; height: 0;
  opacity: 0;
}

/* ── État img : anneau réduit ── */
#cursor.img {
  width: 18px; height: 18px;
  border-color: rgba(200, 168, 107, 0.4);
}
#cursor.img::after {
  width: 3px; height: 3px;
}

/* ── État hover-photo ── */
#cursor.hover-photo {
  width: 48px; height: 48px;
  border-color: rgba(200, 168, 107, 0.2);
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(2px);
}
#cursor.hover-photo::after { opacity: 0; width: 0; height: 0; }

/* ── État hover-dl ── */
#cursor.hover-dl {
  width: 52px; height: 52px;
  border-color: var(--gold);
  background: rgba(200, 168, 107, 0.14);
}
#cursor.hover-dl::after { width: 0; height: 0; opacity: 0; }

/* ── App mode : curseur natif (après login) ── */
body.app-mode #cursor { display: none; }
body.app-mode,
body.app-mode * { cursor: auto !important; }
body.app-mode input,
body.app-mode textarea { cursor: text !important; caret-color: var(--gold); }


/* ── THEME SWITCH ── */
.theme-switch {
  display: flex; align-items: center; gap: 8px;
  padding: 0 4px;
}
.theme-switch-label {
  font-size: 11px; font-weight: 500; color: var(--text3);
  letter-spacing: 0.06em; text-transform: uppercase;
  transition: color 0.2s;
  user-select: none;
}
.theme-svg {
  color: var(--text3);
  transition: color 0.2s, opacity 0.2s;
  flex-shrink: 0;
  display: block;
}
.theme-switch:hover .theme-svg { color: var(--gold); }
.switch-track {
  position: relative;
  width: 36px; height: 20px;
  background: var(--surface3);
  border: 1px solid var(--border2);
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.25s, border-color 0.25s;
  flex-shrink: 0;
}
.switch-track:hover { border-color: var(--gold); }
body.light .switch-track {
  background: var(--gold-dim);
  border-color: var(--gold);
}
.switch-thumb {
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--text3);
  transition: transform 0.25s var(--ease), background 0.25s;
}
body.light .switch-thumb {
  transform: translateX(16px);
  background: var(--gold);
}
.theme-icon {
  font-size: 13px; line-height: 1;
  transition: opacity 0.2s;
}

/* ── Mobile : curseur natif ── */
@media (max-width: 768px) {
  #cursor          { display: none !important; }
  body             { cursor: auto !important; }
  *                { cursor: inherit !important; }
  input, textarea  { cursor: text !important; caret-color: var(--gold); }
}

/* cursor:none everywhere — but keep caret visible in inputs */
a, button, [onclick], label,
.nav-item, .tab, .nl-card, .nl-radio,
.contact-check, .drop-zone, .lang-btn,
select, [role="button"], thead th {
  cursor: none;
}
input, textarea {
  cursor: none !important;
  caret-color: var(--gold);
}

/* ── GRAIN OVERLAY ── */
body::after {
  content: '';
  position: fixed; inset: 0; z-index: 0;
  pointer-events: none;
  opacity: 0.028;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface4); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold); }

/* ════════════════════════════════════════════
   LOGIN SCREEN
════════════════════════════════════════════ */
#login-screen {
  position: fixed; inset: 0; z-index: 9000;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  overflow: hidden;
}

/* Animated geometric background */
.login-bg {
  position: absolute; inset: 0;
  overflow: hidden; pointer-events: none;
}
.login-bg-circle {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(200,168,107,0.08);
  animation: pulse-circle 8s ease-in-out infinite;
}
.login-bg-circle:nth-child(1) { width: 600px; height: 600px; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: 0s; }
.login-bg-circle:nth-child(2) { width: 900px; height: 900px; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: 1.5s; }
.login-bg-circle:nth-child(3) { width: 1200px; height: 1200px; top: 50%; left: 50%; transform: translate(-50%,-50%); animation-delay: 3s; }

.login-bg-line {
  position: absolute;
  background: linear-gradient(90deg, transparent, rgba(200,168,107,0.06), transparent);
  height: 1px; width: 100%;
  animation: line-sweep 6s ease-in-out infinite;
}
.login-bg-line:nth-child(4) { top: 30%; animation-delay: 0s; }
.login-bg-line:nth-child(5) { top: 50%; animation-delay: 2s; }
.login-bg-line:nth-child(6) { top: 70%; animation-delay: 4s; }

@keyframes pulse-circle {
  0%, 100% { opacity: 0.4; transform: translate(-50%,-50%) scale(1); }
  50%       { opacity: 0.8; transform: translate(-50%,-50%) scale(1.03); }
}
@keyframes line-sweep {
  0%   { opacity: 0; transform: translateX(-100%); }
  50%  { opacity: 1; }
  100% { opacity: 0; transform: translateX(100%); }
}

/* Login card */
.login-wrap {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; align-items: center;
  width: 400px;
}

.login-logo-wrap {
  margin-bottom: 52px;
  opacity: 0;
  animation: login-drop 0.9s 0.1s var(--ease) forwards;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}
.login-logo-img {
  height: 52px; width: auto;
  display: block;
  margin: 0 auto;
  filter: brightness(1.15);
}
.login-logo-sub {
  display: none; /* removed per request */
}

.login-card {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-top: 1px solid rgba(200,168,107,0.25);
  padding: 40px;
  position: relative; overflow: hidden;
  opacity: 0;
  animation: login-rise 0.9s 0.3s var(--ease) forwards;
}
.login-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.login-title {
  font-family: var(--font-display);
  font-size: 28px; font-weight: 400; font-style: italic;
  color: var(--text); margin-bottom: 6px; text-align: center;
}
.login-desc {
  font-size: 11px; font-weight: 400; letter-spacing: 0.1em;
  color: var(--text3); text-align: center; margin-bottom: 36px;
  text-transform: uppercase;
}

.field { margin-bottom: 20px; }
.field-label {
  display: block; font-size: 11px; font-weight: 500;
  letter-spacing: 0.08em; color: var(--text3);
  text-transform: uppercase; margin-bottom: 8px;
}
.field-input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-ui); font-size: 14px; font-weight: 400;
  padding: 11px 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.field-input:focus {
  border-color: var(--gold);
  background: var(--surface3);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.field-input::placeholder { color: var(--text4); }

.btn-login {
  width: 100%; margin-top: 8px;
  background: var(--gold); color: var(--bg);
  border: none; border-radius: var(--radius);
  font-family: var(--font-ui); font-size: 13px; font-weight: 600;
  letter-spacing: 0.05em; padding: 13px;
  cursor: none; transition: all 0.22s var(--ease);
  position: relative; overflow: hidden;
}
.btn-login::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.15);
  transform: translateX(-100%) skewX(-15deg);
  transition: transform 0.4s var(--ease);
}
.btn-login:hover { background: var(--gold-lt); transform: translateY(-1px); box-shadow: 0 8px 24px rgba(200,168,107,0.3); }
.btn-login:hover::after { transform: translateX(200%) skewX(-15deg); }
.btn-login:active { transform: translateY(0); }

.login-error {
  color: var(--red); font-size: 12px; font-weight: 500;
  text-align: center; margin-top: 14px;
  display: none; letter-spacing: 0.04em;
}

@keyframes login-drop {
  from { opacity: 0; transform: translateY(-16px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes login-rise {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ════════════════════════════════════════════
   APP SHELL
════════════════════════════════════════════ */
#app { display: none; height: 100vh; flex-direction: column; position: relative; z-index: 1; }
#app.visible { display: flex; }

/* ── TOPBAR ── */
.topbar {
  height: var(--topbar-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; flex-shrink: 0;
  position: relative; z-index: 100;
  opacity: 0; transform: translateY(-8px);
}
.topbar.in { animation: slide-down 0.5s 0.05s var(--ease) forwards; }

.tb-left { display: flex; align-items: center; gap: 16px; }
.tb-logo { height: 24px; width: auto; display: block; }
.tb-divider { width: 1px; height: 18px; background: var(--border3); }
.tb-title { font-size: 11px; font-weight: 500; letter-spacing: 0.12em; color: var(--text3); text-transform: uppercase; }

.tb-right { display: flex; align-items: center; gap: 12px; }

/* Language switcher */
.lang-switcher {
  display: flex; align-items: center;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 3px; gap: 2px;
}
.lang-btn {
  font-size: 11px; font-weight: 500; letter-spacing: 0.06em;
  padding: 4px 10px; border-radius: 16px;
  background: transparent; border: none; color: var(--text3);
  cursor: none; transition: all 0.18s;
  text-transform: uppercase;
}
.lang-btn.active { background: var(--gold); color: var(--bg); }
.lang-btn:not(.active):hover { color: var(--text2); }

.tb-user {
  font-size: 12px; font-weight: 500; color: var(--text2);
  padding: 5px 12px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: 20px;
}
.btn-topbar {
  font-size: 12px; font-weight: 500;
  padding: 6px 14px; border-radius: var(--radius);
  background: transparent; border: 1px solid var(--border2);
  color: var(--text3); cursor: none; transition: all 0.18s;
  letter-spacing: 0.02em;
}
.btn-topbar:hover { border-color: var(--red); color: var(--red); background: var(--red-dim); }

/* ── MAIN LAYOUT ── */
.main-layout { display: flex; flex: 1; overflow: hidden; }

/* ── SIDEBAR ── */
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  opacity: 0; transform: translateX(-12px);
}
.sidebar.in { animation: slide-right 0.5s 0.15s var(--ease) forwards; }

.sidebar-section {
  padding: 20px 16px 8px;
}
.sidebar-section-label {
  font-size: 10px; font-weight: 600; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text4);
  padding: 0 8px; margin-bottom: 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  cursor: none; transition: all 0.16s;
  color: var(--text3); font-size: 14px; font-weight: 400;
  margin-bottom: 2px; text-decoration: none;
  position: relative;
}
.nav-item:hover { background: var(--surface2); color: var(--text2); }
.nav-item.active {
  background: var(--gold-dim); color: var(--gold);
  font-weight: 500;
}
.nav-item.active::before {
  content: '';
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 3px; border-radius: 0 2px 2px 0;
  background: var(--gold);
}
.nav-icon {
  width: 18px; text-align: center;
  font-size: 15px; flex-shrink: 0;
  opacity: 0.7;
}
.nav-item.active .nav-icon { opacity: 1; }
.nav-label { flex: 1; }
.nav-badge {
  font-size: 11px; font-weight: 600;
  background: var(--surface3); color: var(--text3);
  padding: 2px 7px; border-radius: 10px;
  min-width: 22px; text-align: center;
}
.nav-item.active .nav-badge { background: var(--gold-dim); color: var(--gold); }

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--border);
  padding: 16px 24px 20px;
}
.stat-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 5px 0;
}
.stat-label { font-size: 12px; color: var(--text3); }
.stat-value { font-size: 12px; font-weight: 600; color: var(--gold); font-variant-numeric: tabular-nums; }

/* ── CONTENT ── */
.content {
  flex: 1; overflow-y: auto; padding: 36px 40px;
  opacity: 0; transform: translateY(10px);
}
.content.in { animation: fade-up 0.5s 0.22s var(--ease) forwards; }

.page { display: none; }
.page.active { display: block; }

/* ════════════════════════════════════════════
   PAGE STRUCTURE
════════════════════════════════════════════ */
.page-header {
  display: flex; align-items: flex-end; justify-content: space-between;
  margin-bottom: 32px; padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.page-eyebrow {
  font-size: 11px; font-weight: 500; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--gold); margin-bottom: 6px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 38px; font-weight: 400;
  color: var(--text); line-height: 1.1;
}
.page-title em { font-style: italic; color: var(--text2); font-weight: 400; }
.page-actions { display: flex; gap: 10px; align-items: center; }

/* ════════════════════════════════════════════
   BUTTONS
════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--font-ui); font-size: 13px; font-weight: 500;
  padding: 9px 18px; border-radius: var(--radius);
  cursor: none; border: none; transition: all 0.18s var(--ease2);
  white-space: nowrap; letter-spacing: 0.01em; text-decoration: none;
}
.btn svg { width: 15px; height: 15px; }

.btn-primary { background: var(--gold); color: var(--bg); }
.btn-primary:hover { background: var(--gold-lt); transform: translateY(-1px); box-shadow: 0 4px 16px rgba(200,168,107,0.25); }

.btn-secondary { background: var(--surface3); color: var(--text2); border: 1px solid var(--border2); }
.btn-secondary:hover { background: var(--surface4); color: var(--text); border-color: var(--border3); }

.btn-ghost { background: transparent; color: var(--text3); border: 1px solid var(--border2); }
.btn-ghost:hover { background: var(--surface2); color: var(--text2); }

.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(224,92,74,0.2); }
.btn-danger:hover { background: rgba(224,92,74,0.2); }

.btn-sm { padding: 6px 13px; font-size: 12px; }
.btn-xs { padding: 5px 10px; font-size: 11px; }
.btn-icon { width: 32px; height: 32px; padding: 0; justify-content: center; border-radius: var(--radius); }

/* Disabled state — applies to all .btn variants. Greyed out, no hover effect, not-allowed cursor. */
.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  filter: grayscale(0.6);
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
  box-shadow: none !important;
}
.btn-primary:disabled,
.btn-primary[disabled] {
  background: var(--surface3);
  color: var(--text3);
}

/* ════════════════════════════════════════════
   FORM ELEMENTS
════════════════════════════════════════════ */
.input {
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-ui); font-size: 14px; font-weight: 400;
  padding: 10px 13px;
  outline: none; width: 100%;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
.input:focus {
  border-color: var(--gold);
  background: var(--surface3);
  box-shadow: 0 0 0 3px var(--gold-dim);
}
.input::placeholder { color: var(--text4); }
select.input {
  cursor: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%23c8a86b' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 12px 8px;
}
select.input::-ms-expand { display: none; }
textarea.input {
  resize: vertical; min-height: 160px;
  font-family: var(--font-mono); font-size: 12px; line-height: 1.7;
}

.form-group { margin-bottom: 18px; }
.form-label {
  display: block; font-size: 11px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text3); margin-bottom: 7px;
}
.form-label small { font-weight: 400; text-transform: none; letter-spacing: 0; color: var(--text4); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ════════════════════════════════════════════
   TOOLBAR / SEARCH
════════════════════════════════════════════ */
.toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.search-wrap { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search-icon {
  position: absolute; left: 11px; top: 50%; transform: translateY(-50%);
  color: var(--text3); font-size: 14px; pointer-events: none;
}
.input-search { padding-left: 36px; }

/* ════════════════════════════════════════════
   TABS
════════════════════════════════════════════ */
.tabs {
  display: flex; margin-bottom: 22px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 3px; width: fit-content; gap: 2px;
}
.tab {
  padding: 7px 18px; cursor: none; border-radius: 4px;
  font-size: 12px; font-weight: 500; color: var(--text3);
  transition: all 0.16s; letter-spacing: 0.02em;
}
.tab:hover { color: var(--text2); background: rgba(255,255,255,0.04); }
.tab.active { background: var(--surface4); color: var(--text); }

/* ════════════════════════════════════════════
   TABLE
════════════════════════════════════════════ */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--surface2);
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--text3);
  padding: 12px 16px; text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap; cursor: none; user-select: none;
  transition: color 0.16s;
}
thead th:hover, thead th.sorted { color: var(--gold); }
tbody tr { border-bottom: 1px solid var(--border); transition: background 0.12s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.025); }
tbody td { padding: 13px 16px; color: var(--text2); font-size: 13px; vertical-align: middle; }
tbody td:first-child { color: var(--text); font-weight: 500; }
.td-mono { font-family: var(--font-mono); font-size: 12px; }
.td-dim { color: var(--text3); font-size: 12px; }
.td-actions { display: flex; gap: 6px; }

/* ════════════════════════════════════════════
   BADGE
════════════════════════════════════════════ */
.badge {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 500; letter-spacing: 0.04em;
  padding: 3px 10px; border-radius: 20px;
}
.badge-draft { background: rgba(122,116,104,0.15); color: var(--text3); }
.badge-ready { background: var(--green-dim); color: var(--green); }
.badge-sent  { background: var(--gold-dim); color: var(--gold); }

/* ════════════════════════════════════════════
   NEWSLETTER CARDS
════════════════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* Studio toolbar — status tabs + search */
.nl-studio-toolbar {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 22px; flex-wrap: wrap;
}
.nl-studio-search { flex: 1; min-width: 240px; max-width: 360px; }
.nl-status-tabs {
  display: inline-flex; align-items: center;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 4px;
  gap: 2px;
}
.nl-status-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px; font-size: 12px; font-weight: 500;
  letter-spacing: 0.04em;
  background: transparent; color: var(--text3);
  border: 1px solid transparent; border-radius: 6px;
  cursor: none; transition: color 0.15s, background 0.15s, border-color 0.15s;
  font-family: var(--font-ui);
}
.nl-status-tab:hover { color: var(--text); }
.nl-status-tab.active {
  background: var(--surface3);
  color: var(--text);
  border-color: var(--border2);
}
.nl-tab-dot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
}
.nl-tab-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; padding: 1px 7px;
  background: var(--bg); color: var(--text3);
  font-size: 11px; font-weight: 600; font-family: var(--font-mono);
  border-radius: 10px;
}
.nl-status-tab.active .nl-tab-count {
  background: var(--gold-dim); color: var(--gold);
}

.nl-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column; gap: 0;
  transition: border-color 0.22s, box-shadow 0.22s, transform 0.22s;
  opacity: 0; transform: translateY(16px);
  position: relative; overflow: hidden;
}
.nl-card.in { animation: card-in 0.45s var(--ease) forwards; }
.nl-card:hover {
  border-color: var(--border3);
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.3);
}
.nl-card-top {
  position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, var(--gold), rgba(200,168,107,0.3));
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.35s var(--ease);
  z-index: 3;
}
.nl-card:hover .nl-card-top { transform: scaleX(1); }

.nl-card-body { padding: 20px 22px 22px; display: flex; flex-direction: column; flex: 1; }

/* Thumbnail iframe */
.nl-card-thumb {
  position: relative;
  height: 160px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.nl-thumb-frame {
  position: absolute;
  top: 0; left: 0;
  width: 800px; height: 800px;
  border: 0;
  transform: scale(0.25);
  transform-origin: top left;
  pointer-events: none;
  background: #fff;
}
.nl-thumb-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 60%, rgba(0,0,0,0.35) 100%);
  pointer-events: none;
}
.nl-thumb-preview-btn {
  position: absolute; top: 10px; right: 10px;
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  background: rgba(20,20,20,0.6);
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 6px;
  font-size: 13px; cursor: none;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  backdrop-filter: blur(4px);
}
.nl-thumb-preview-btn:hover {
  background: rgba(0,0,0,0.85);
  color: var(--gold);
  border-color: var(--gold);
}

.card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.card-subject {
  font-size: 16px; font-weight: 500; color: var(--text);
  line-height: 1.3; flex: 1;
}
.card-meta {
  font-size: 12px; color: var(--text3); margin-bottom: 14px;
  display: flex; align-items: center; gap: 10px;
}
.card-pre {
  font-size: 13px; font-style: italic; color: var(--text3);
  margin-bottom: 14px; line-height: 1.4;
  border-left: 2px solid var(--border2); padding-left: 10px;
}

/* Metrics row */
.nl-metrics {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 16px;
  padding: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.nl-metric { text-align: center; }
.nl-metric-num {
  font-family: var(--font-display);
  font-size: 22px; font-weight: 400;
  color: var(--text);
  line-height: 1.1;
}
.nl-metric-lbl {
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--text4); margin-top: 4px;
}
.nl-metrics-empty {
  display: block;
  text-align: center;
  color: var(--text4); font-size: 12px; font-style: italic;
  padding: 14px 12px;
  margin-bottom: 16px;
  background: transparent;
  border: 1px dashed var(--border2);
  border-radius: var(--radius);
}

.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: auto; }

/* ════════════════════════════════════════════
   SEND PAGE
════════════════════════════════════════════ */
/* ════════════════════════════════════════════
   SEND PAGE — REDESIGN
════════════════════════════════════════════ */

/* Quota banner */
.quota-banner {
  display: flex; align-items: center; gap: 24px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.quota-left { flex: 1; }
.quota-label {
  font-size: 10px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text3); margin-bottom: 8px;
}
.quota-track {
  height: 6px; background: var(--surface3, #111);
  border-radius: 99px; overflow: hidden; margin-bottom: 8px;
}
.quota-fill {
  height: 100%; border-radius: 99px;
  background: var(--gold);
  transition: width .5s ease;
}
.quota-numbers { font-size: 12px; display: flex; align-items: center; gap: 6px; }
.quota-used   { font-weight: 700; color: var(--gold); }
.quota-avail  { font-weight: 700; color: var(--green); }
.quota-sep    { color: var(--text3); }
.quota-dot    { color: var(--border2); }
.quota-right  { text-align: right; }
.quota-reset-label { font-size: 10px; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 4px; }
.quota-countdown { font-family: var(--font-display); font-size: 22px; font-weight: 400; color: var(--text2); }

/* Queue banner */
.queue-banner {
  display: flex; align-items: flex-start; gap: 16px;
  background: rgba(200,168,107,.06);
  border: 1px solid rgba(200,168,107,.35);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.queue-icon { font-size: 20px; margin-top: 2px; flex-shrink: 0; }
.queue-info { flex: 1; min-width: 0; }
.queue-title { font-size: 13px; font-weight: 600; color: var(--gold); margin-bottom: 8px; }
.queue-list {
  max-height: 110px; overflow-y: auto;
  font-size: 11px; color: var(--text2);
  display: flex; flex-direction: column; gap: 3px;
}
.queue-list-item { display: flex; align-items: center; gap: 6px; padding: 2px 0; }
.queue-actions { display: flex; flex-direction: column; gap: 6px; flex-shrink: 0; }

/* Main 4-column layout: NL | Selection | Queue (tall) | Launch */
.send-layout {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr 1fr;
  grid-template-rows: auto;
  gap: 16px;
  align-items: start;
}
.send-col-nl        { grid-column: 1; grid-row: 1 / 3; }
.send-col-selection { grid-column: 2; grid-row: 1 / 3; }
.send-col-queue     { grid-column: 3; grid-row: 1 / 3; align-self: stretch; }
.send-col-launch    { grid-column: 4; grid-row: 1 / 3; }
.send-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.send-col-header {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.send-step-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold-dim); color: var(--gold);
  font-size: 11px; font-weight: 700; flex-shrink: 0;
}
.send-col-title {
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text3);
}
.send-sel-badge {
  margin-left: auto;
  background: var(--gold-dim); color: var(--gold);
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: 99px;
}

/* Newsletter list */
.send-nl-list { padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.nl-radio {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 11px 12px; cursor: none; transition: background 0.14s;
  border: 1px solid transparent; border-radius: var(--radius);
}
.nl-radio:hover { background: rgba(255,255,255,0.03); }
.nl-radio.selected { border-color: rgba(200,168,107,0.35); background: var(--gold-dim); }
.nl-radio input[type="radio"] { accent-color: var(--gold); margin-top: 3px; flex-shrink: 0; }
.nl-radio-title { font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 2px; }
.nl-radio-date { font-size: 11px; color: var(--text3); }

/* Mode tabs */
.send-mode-tabs {
  display: flex; border-bottom: 1px solid var(--border);
}
.send-mode-tab {
  flex: 1; padding: 10px 6px;
  font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
  background: none; border: none; color: var(--text3);
  cursor: none; transition: color .15s, border-bottom .15s;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.send-mode-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.send-mode-tab:hover:not(.active) { color: var(--text2); }

/* Search input */
.send-search-input { border-radius: 0; border-left: 0; border-right: 0; border-top: 0; }

/* Filter row (category/source) */
.send-filter-row { display: flex; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--border); }
.send-filter-row .btn { flex-shrink: 0; }

/* Contact scroll */
.contact-scroll { overflow-y: auto; flex: 1; }
.send-col-recipients .contact-scroll { max-height: 380px; }
.contact-check {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 14px; cursor: none; transition: background 0.12s;
}
.contact-check:hover { background: rgba(255,255,255,0.025); }
.contact-check input[type="checkbox"] { accent-color: var(--gold); flex-shrink: 0; }
.contact-check label { cursor: none; flex: 1; }
.cc-name { font-size: 13px; font-weight: 500; color: var(--text); }
.cc-mail { font-size: 11px; color: var(--text3); font-family: var(--font-mono); }
.select-all-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 14px;
  font-size: 10px; font-weight: 600; color: var(--text3);
  letter-spacing: .08em; text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.select-all-row input { accent-color: var(--gold); }
.sel-count { margin-left: auto; color: var(--gold); font-weight: 700; font-size: 11px; }
.already-sent { opacity: .4; }
.sent-badge {
  display: inline-block; font-size: 9px; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; background: var(--surface3); color: var(--text3);
  padding: 1px 6px; border-radius: 99px; margin-left: 6px; vertical-align: middle;
}

/* Launch column */
.send-col-launch { }
.launch-summary {
  display: flex; align-items: center; gap: 0;
  padding: 20px 18px; border-bottom: 1px solid var(--border);
}
.launch-stat { flex: 1; text-align: center; }
.launch-stat-num {
  font-family: var(--font-display); font-size: 48px; font-weight: 400;
  color: var(--gold); line-height: 1;
}
.launch-stat-lbl { font-size: 10px; font-weight: 600; color: var(--text3); text-transform: uppercase; letter-spacing: .08em; margin-top: 4px; }
.launch-stat-nl { font-size: 13px; font-weight: 500; color: var(--text); line-height: 1.3; word-break: break-word; }
.launch-divider { width: 1px; background: var(--border); align-self: stretch; margin: 0 4px; }
.launch-info {
  margin: 14px 18px; padding: 10px 12px;
  font-size: 11px; color: var(--text3); line-height: 1.5;
  background: var(--surface2); border-radius: var(--radius);
  border-left: 2px solid var(--gold-dim);
}
.launch-btns { display: flex; flex-direction: column; gap: 8px; padding: 14px 18px; }
.launch-btn {
  width: 100%; justify-content: center;
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; font-size: 13px;
}
.launch-btn-icon { font-size: 15px; }
.prog-bar { height: 3px; background: var(--surface3); border-radius: 2px; overflow: hidden; margin: 0 18px 4px; }
.prog-fill { height: 100%; background: linear-gradient(90deg, var(--gold), var(--gold-lt)); width: 0%; transition: width 0.4s ease; border-radius: 2px; }
.prog-status { font-size: 11px; color: var(--text3); font-family: var(--font-mono); letter-spacing: .04em; padding: 0 18px 10px; }

/* Queue column */
.send-col-queue {
  border: 1px solid rgba(200,168,107,.35) !important;
  background: rgba(200,168,107,.03) !important;
  display: flex; flex-direction: column;
}
.queue-col-header {
  display: flex; align-items: center; gap: 8px;
  padding: 13px 16px;
  background: rgba(200,168,107,.08);
  border-bottom: 1px solid rgba(200,168,107,.2);
  flex-shrink: 0;
}

/* Queue summary (categories breakdown) */
#queue-summary {
  padding: 10px 16px;
  border-bottom: 1px solid rgba(200,168,107,.15);
  display: flex; flex-direction: column; gap: 5px;
  flex-shrink: 0;
}
.queue-summary-row {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 11px;
}
.queue-summary-label { color: var(--text3); }
.queue-summary-count { font-weight: 700; color: var(--text2); }
.queue-summary-waiting { color: var(--gold); font-size: 10px; }

/* Add-to-queue bar */
.add-to-queue-bar {
  display: flex; gap: 6px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}

/* Selection section */
.send-col-selection { display: flex; flex-direction: column; }
.sel-contact-list { max-height: 280px; }
.queue-contact-list { flex: 1; overflow-y: auto; min-height: 0; }

/* Mobile */
@media (max-width: 1100px) {
  .send-layout { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; }
  .send-col-nl        { grid-column: 1; grid-row: 1; }
  .send-col-selection { grid-column: 2; grid-row: 1; }
  .send-col-queue     { grid-column: 1; grid-row: 2; }
  .send-col-launch    { grid-column: 2; grid-row: 2; }
}
@media (max-width: 700px) {
  .send-layout { grid-template-columns: 1fr; }
  .send-col-nl, .send-col-selection, .send-col-queue, .send-col-launch { grid-column: 1; grid-row: auto; }
}

/* ════════════════════════════════════════════
   SETTINGS PAGE
════════════════════════════════════════════ */
.settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; max-width: 960px; }
.settings-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
}
.settings-card-title {
  font-size: 13px; font-weight: 600; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--text);
  margin-bottom: 22px; padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
}
.settings-card-title-icon { color: var(--gold); font-size: 16px; }

.dns-list { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.dns-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  font-size: 13px; color: var(--text2);
  background: var(--surface2);
}
.dns-item.ok .dns-dot { background: var(--green); }
.dns-item.pending .dns-dot { background: var(--surface4); }
.dns-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }

/* ════════════════════════════════════════════
   INFO BOX
════════════════════════════════════════════ */
.info-box {
  background: rgba(200,168,107,0.06);
  border: 1px solid rgba(200,168,107,0.15);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-size: 13px; font-weight: 400; color: var(--text2);
  line-height: 1.7; margin-bottom: 24px;
}
.info-box strong { font-weight: 600; color: var(--gold); }

/* ════════════════════════════════════════════
   DROP ZONE (CSV)
════════════════════════════════════════════ */
.drop-zone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius-lg);
  padding: 40px 24px; text-align: center;
  transition: all 0.22s var(--ease);
  cursor: none; position: relative;
}
.drop-zone:hover, .drop-zone.drag-over {
  border-color: var(--gold); background: var(--gold-dim);
}
.drop-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: none; }
.dz-icon { font-size: 32px; margin-bottom: 12px; display: block; }
.dz-title { font-size: 15px; font-weight: 500; color: var(--text2); margin-bottom: 5px; }
.dz-sub { font-size: 12px; color: var(--text3); }

/* ════════════════════════════════════════════
   MODAL
════════════════════════════════════════════ */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(10,9,8,0.85); backdrop-filter: blur(8px);
  display: none; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-overlay.open { display: flex; }
.modal-overlay.open .modal { animation: modal-in 0.32s var(--ease) forwards; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 560px;
  box-shadow: 0 32px 80px rgba(0,0,0,0.5);
  transform: scale(0.96) translateY(12px); opacity: 0;
  overflow: hidden;
}
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }

.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
}
.modal-title { font-size: 17px; font-weight: 500; color: var(--text); }
.modal-close {
  width: 28px; height: 28px; border-radius: var(--radius);
  background: transparent; border: none; color: var(--text3);
  cursor: none; font-size: 16px; display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.modal-close:hover { background: var(--surface3); color: var(--text); }

.modal-body { padding: 24px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px; border-top: 1px solid var(--border);
  background: var(--surface2);
}

/* ════════════════════════════════════════════
   EMPTY STATE
════════════════════════════════════════════ */
.empty-state {
  text-align: center; padding: 72px 32px;
  color: var(--text3);
}
.empty-icon { font-size: 40px; margin-bottom: 16px; opacity: 0.3; }
.empty-title { font-size: 16px; font-weight: 500; color: var(--text3); margin-bottom: 6px; }
.empty-sub { font-size: 13px; color: var(--text4); }

/* ════════════════════════════════════════════
   TOAST
════════════════════════════════════════════ */
#toast-container {
  position: fixed; bottom: 24px; right: 24px;
  z-index: 9999; display: flex; flex-direction: column; gap: 8px;
}
.toast {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 12px 18px;
  font-size: 13px; font-weight: 500; color: var(--text);
  min-width: 280px; max-width: 380px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.3);
  animation: toast-in 0.3s var(--ease);
}
.toast-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.toast.success .toast-dot { background: var(--green); }
.toast.error   .toast-dot { background: var(--red); }
.toast.default .toast-dot { background: var(--gold); }

/* ════════════════════════════════════════════
   ANIMATIONS
════════════════════════════════════════════ */
@keyframes slide-down  { to { opacity:1; transform:translateY(0); } }
@keyframes slide-right { to { opacity:1; transform:translateX(0); } }
@keyframes fade-up     { to { opacity:1; transform:translateY(0); } }
@keyframes card-in     { to { opacity:1; transform:translateY(0); } }
@keyframes modal-in    { to { opacity:1; transform:scale(1) translateY(0); } }
@keyframes toast-in    { from { opacity:0; transform:translateX(20px); } to { opacity:1; transform:none; } }
@keyframes row-in      { from { opacity:0; transform:translateY(5px); } to { opacity:1; transform:none; } }

.row-anim {
  opacity: 0; transform: translateY(3px);
  animation: row-in 0.15s var(--ease) forwards;
}

/* Divider */
.hr { border: none; border-top: 1px solid var(--border); margin: 28px 0; }

/* ══════════════════════════════════════════
   NEW ELEMENTS — Categories, CSV preview,
   Unsubscribed, Already-sent, Mobile
══════════════════════════════════════════ */

/* ── Category pill in table ── */
.cat-pill {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 500;
  padding: 2px 9px; border-radius: 20px;
  letter-spacing: 0.03em;
}
.badge-unsub {
  background: var(--red-dim); color: var(--red);
  font-size: 10px; padding: 2px 7px; border-radius: 10px;
  margin-left: 6px; font-weight: 500;
}

/* ── Category manager ── */
.cat-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; background: var(--surface2);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color 0.15s, background 0.15s, opacity 0.15s, transform 0.15s;
}
.cat-item.cat-dragging {
  opacity: 0.4; transform: scale(0.98);
  border-color: var(--gold);
}
.cat-item.cat-drag-over {
  border-color: var(--gold);
  background: rgba(200,168,107,0.08);
  box-shadow: 0 -2px 0 var(--gold) inset;
}
.cat-drag-handle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 22px;
  color: var(--text4); font-size: 14px;
  letter-spacing: -2px;
  cursor: grab; user-select: none; flex-shrink: 0;
  transition: color 0.15s;
}
.cat-drag-handle:hover { color: var(--gold); }
.cat-item.cat-dragging .cat-drag-handle { cursor: grabbing; }
.cat-prio-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  background: var(--gold-dim); color: var(--gold);
  font-size: 11px; font-weight: 600; font-family: var(--font-mono);
  border-radius: 4px; flex-shrink: 0;
}
.cat-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.cat-name { flex: 1; font-size: 13px; font-weight: 500; }
.cat-default {
  font-size: 10px; color: var(--text4);
  letter-spacing: 0.08em; text-transform: uppercase;
  border: 1px solid var(--border2); border-radius: 4px;
  padding: 2px 6px;
}
.cat-actions {
  display: flex; align-items: center; gap: 4px; flex-shrink: 0;
}

/* ── CSV preview editable inputs ── */
.input-sm {
  padding: 5px 8px; font-size: 12px;
  border-radius: 4px;
}
.input-error { border-color: var(--red) !important; }

/* ── CSV import preview table ──
   Modal is .modal-xl (900px) so we have room for 4 columns + actions.
   Explicit column proportions so emails are readable without horizontal clipping;
   horizontal scroll kicks in if the viewport is narrower than the modal. */
/* CSV preview wrapper — overrides the global .table-wrap `overflow: hidden`
   which would clip the right edge of the table. */
.table-wrap.csv-preview-wrap {
  max-height: 380px;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.csv-preview-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
/* Override the global `tbody td { padding: 13px 16px }` */
.csv-preview-table thead th,
.csv-preview-table tbody td {
  padding: 6px 8px !important;
  vertical-align: middle;
  font-size: 12px;
  font-weight: normal;
  color: var(--text2);
}
.csv-preview-table thead th {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  text-align: left;
  padding: 10px 8px !important;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  white-space: nowrap;
}
.csv-preview-table tbody td:first-child { font-weight: normal; color: var(--text2); }

/* 4 columns: last name / first name / company / email (with embedded actions) */
.csv-preview-table th:nth-child(1), .csv-preview-table td:nth-child(1) { width: 19%; }
.csv-preview-table th:nth-child(2), .csv-preview-table td:nth-child(2) { width: 19%; }
.csv-preview-table th:nth-child(3), .csv-preview-table td:nth-child(3) { width: 24%; }
.csv-preview-table th:nth-child(4), .csv-preview-table td:nth-child(4) {
  width: 38%;
  padding-right: 14px !important;
}

.csv-preview-table .input-sm {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Email cell with embedded "Exists" badge + ✕ remove button.
   Both overlaid on the right of the input via position: absolute. */
.csv-preview-table td.csv-mail-cell {
  position: relative;
}
.csv-mail-input {
  padding-right: 38px !important;
}
.csv-mail-cell.has-exists .csv-mail-input {
  padding-right: 90px !important;
}

/* Rows that already exist are subtly dimmed */
.csv-preview-table tbody tr.csv-row-existing { background: rgba(200,168,107,0.03); }
.csv-preview-table tbody tr.csv-row-existing td input { opacity: 0.6; }

.csv-exists-badge {
  position: absolute;
  top: 50%;
  right: 40px;
  transform: translateY(-50%);
  padding: 2px 7px;
  background: rgba(200,168,107,0.18);
  color: var(--gold);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 2;
}
.csv-row-remove {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text4);
  font-size: 11px;
  line-height: 1;
  cursor: none;
  user-select: none;
  z-index: 2;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.csv-row-remove:hover {
  background: rgba(229,84,81,0.08);
  color: var(--red);
  border-color: rgba(229,84,81,0.3);
}

/* ════════════════════════════════════════
   Extra emails in contact modal — minimalist
   Same shape as a plain email field, with a small ✕ to remove and a status dot.
════════════════════════════════════════════════ */
.extra-email-row {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.extra-email-input {
  flex: 1;
  padding-left: 30px !important;
  font-family: var(--font-mono);
  font-size: 13px;
}
.extra-email-input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.extra-email-dot {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  pointer-events: auto;
  z-index: 1;
}
.extra-email-bounce .extra-email-dot { background: #ffb450; }
.extra-email-spam .extra-email-dot { background: var(--red); }
.extra-email-inactive .extra-email-dot { background: var(--text4); }
.extra-email-pending .extra-email-dot,
.extra-email-dot-pending { background: var(--gold); }

.extra-email-remove {
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text4);
  font-size: 12px;
  cursor: none;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.extra-email-remove:hover {
  background: rgba(229, 84, 81, 0.08);
  color: var(--red);
  border-color: rgba(229, 84, 81, 0.3);
}

/* "+ another email" — subtle text link, not a heavy button */
.audit-add-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 0;
  margin-top: 4px;
  background: transparent;
  border: none;
  color: var(--text4);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: none;
  transition: color 0.15s;
  font-family: var(--font-ui);
}
.audit-add-link:hover { color: var(--gold); }

/* ════════════════════════════════════════
   AUDIT MODAL — Nav (left) + Pane (right) layout
   One issue at a time, walk through them like a queue.
════════════════════════════════════════════════ */

/* Modal fills more vertical space — fixed height so the right pane scrolls predictably */
.audit-modal {
  height: min(86vh, 780px);
  display: flex;
  flex-direction: column;
}
.audit-modal .modal-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

/* Loading state */
.audit-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 60px 20px;
  color: var(--text3);
  font-size: 13px;
  flex: 1;
}
.audit-spinner {
  width: 28px; height: 28px;
  border: 2px solid var(--surface3);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: audit-spin 0.8s linear infinite;
}
@keyframes audit-spin { to { transform: rotate(360deg); } }

/* All-clean state */
.audit-all-clean {
  text-align: center;
  padding: 60px 20px;
  background: rgba(80,200,120,0.05);
  border: 1px solid rgba(80,200,120,0.2);
  border-radius: var(--radius-lg);
  color: var(--green);
  margin: 24px;
}

/* Main layout: 2 columns */
.audit-main {
  display: grid;
  grid-template-columns: 240px 1fr;
  height: 100%;
  overflow: hidden;
}

/* LEFT NAV ────────── */
.audit-nav {
  background: var(--surface2);
  border-right: 1px solid var(--border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}
.audit-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: none;
  text-align: left;
  font-size: 12px;
  color: var(--text2);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
  font-family: var(--font-ui);
  width: 100%;
}
.audit-nav-item:hover:not(:disabled) {
  background: var(--surface3);
  color: var(--text);
}
.audit-nav-item-active {
  background: var(--surface3);
  border-color: var(--border3);
  color: var(--text);
}
.audit-nav-item-empty {
  opacity: 0.45;
  cursor: default;
}
.audit-nav-icon {
  font-size: 15px;
  width: 22px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.audit-nav-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audit-nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  padding: 1px 8px;
  font-size: 10px;
  font-weight: 600;
  font-family: var(--font-mono);
  border-radius: 10px;
  letter-spacing: 0.04em;
}
.audit-nav-count-critical { background: var(--gold-dim); color: var(--gold); }
.audit-nav-count-warn     { background: rgba(240,200,80,0.15); color: #f0c850; }
.audit-nav-item-empty .audit-nav-count {
  background: rgba(80,200,120,0.12);
  color: var(--green);
}

/* RIGHT PANE ────────── */
.audit-pane {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--surface);
}
.audit-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
}
.audit-pane-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  letter-spacing: 0.01em;
}
.audit-pane-pager {
  display: flex;
  align-items: center;
  gap: 4px;
}
.audit-pager-btn {
  width: 26px; height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 4px;
  cursor: none;
  color: var(--text2);
  font-size: 16px;
  font-family: var(--font-display);
  line-height: 1;
  transition: background 0.15s, color 0.15s;
}
.audit-pager-btn:hover:not(:disabled) {
  background: var(--bg);
  color: var(--gold);
}
.audit-pager-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}
.audit-pager-count {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--text2);
  margin: 0 8px;
  letter-spacing: 0.04em;
}

.audit-pane-body {
  flex: 1;
  padding: 22px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.audit-pane-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
  flex-shrink: 0;
  flex-wrap: wrap;
}
.audit-footer-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Issue header (in pane body) */
.audit-issue-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-bottom: 4px;
}
.audit-group-key {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: 0.02em;
}
.audit-group-meta {
  font-size: 11px;
  color: var(--text3);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.audit-distance {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  background: var(--surface3);
  color: var(--text3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  border-radius: 4px;
  font-family: var(--font-mono);
}

/* Tag chips for company variants */
.audit-group-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.audit-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  background: var(--surface3);
  color: var(--text2);
  font-size: 11px;
  font-weight: 500;
  border-radius: 4px;
  letter-spacing: 0.01em;
}
.audit-tag-count {
  color: var(--text4);
  font-family: var(--font-mono);
  font-size: 10px;
}
.audit-tag-keep {
  background: rgba(80,200,120,0.15);
  color: var(--green);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.05em;
}
.audit-tag-absorb {
  background: rgba(255,180,80,0.12);
  color: #ffb450;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.05em;
}
.audit-tag-empty {
  background: rgba(122,116,104,0.18);
  color: var(--text4);
  font-style: italic;
  border: 1px dashed var(--border2);
}
.audit-row-empty {
  background: rgba(200,168,107,0.04);
  border-color: rgba(200,168,107,0.20);
}

/* Contact rows */
.audit-rows {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px;
  max-height: 320px;
  overflow-y: auto;
}
.audit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 12px;
}
/* Selectable rows (merge tab) — radio-driven, click anywhere on the row to pick */
.audit-rows-selectable .audit-row-pickable {
  cursor: none;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.audit-rows-selectable .audit-row-pickable:hover {
  background: var(--surface3);
  border-color: var(--border2);
}
.audit-rows-selectable .audit-row-picked {
  background: rgba(200,168,107,0.08);
  border-color: rgba(200,168,107,0.35);
  box-shadow: inset 2px 0 0 var(--gold);
}
/* Hide the native radio circle — the keep/absorb tag is the visual indicator */
.audit-rows-selectable .audit-row-pickable input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}
/* Include/exclude checkbox (for 3+ contact merge groups) */
.audit-rows-selectable .audit-include-cb {
  width: 14px; height: 14px;
  accent-color: var(--gold);
  cursor: none;
  flex-shrink: 0;
  margin: 0;
}
.audit-rows-selectable .audit-pick-label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
  cursor: none;
}
/* Row excluded from the current merge — visually dimmed, no gold accent */
.audit-rows-selectable .audit-row-excluded {
  opacity: 0.45;
  box-shadow: none;
  background: var(--surface2);
  border-color: var(--border);
}
.audit-rows-selectable .audit-row-excluded:hover {
  opacity: 0.7;
}
.audit-row-mail {
  color: var(--text2);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}
.audit-row-name {
  color: var(--text3);
  font-size: 11px;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.audit-row-society {
  color: var(--gold);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}
.audit-row-id {
  color: var(--text4);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

/* Action input (canonical name field) — lives in the footer */
.audit-action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 260px;
}
.audit-action-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text4);
  flex-shrink: 0;
}
.audit-action-input {
  flex: 1;
  min-width: 160px;
}

/* Manual-review note for similar-domains tab */
.audit-manual-note {
  font-size: 11px;
  color: var(--text4);
  font-style: italic;
  padding: 10px 14px;
  background: rgba(240,200,80,0.06);
  border: 1px solid rgba(240,200,80,0.18);
  border-radius: var(--radius);
  margin-top: 4px;
}

/* Missing-company info line (in the missing tab pane body) */
.audit-missing-info {
  font-size: 13px;
  color: var(--text2);
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  line-height: 1.6;
}
.audit-missing-info code {
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 1px 6px;
  background: var(--bg);
  border-radius: 3px;
}
.audit-missing-info strong {
  font-weight: 600;
  letter-spacing: 0.01em;
}

/* Responsive: collapse nav under 720px */
@media (max-width: 720px) {
  .audit-main { grid-template-columns: 1fr; }
  .audit-nav {
    flex-direction: row;
    overflow-x: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 10px;
  }
  .audit-nav-item { flex-shrink: 0; }
  .audit-pane-footer { flex-direction: column; align-items: stretch; }
  .audit-footer-buttons { justify-content: flex-end; }
}

/* ── Already-sent contact row ── */
.contact-check.already-sent { opacity: 0.45; cursor: default; }
.sent-badge {
  font-size: 10px; font-weight: 500;
  background: var(--gold-dim); color: var(--gold);
  padding: 1px 7px; border-radius: 10px;
  margin-left: 6px; letter-spacing: 0.04em;
}

/* ══════════════════════════════════════════
   RESPONSIVE — Mobile first
══════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Layout */
  .main-layout { flex-direction: column; }
  .sidebar {
    width: 100%; flex-direction: row; flex-wrap: nowrap;
    overflow-x: auto; overflow-y: hidden;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 0; min-height: unset; transform: none; opacity: 1;
  }
  .sidebar.animate { animation: none; }
  .sidebar-section { display: flex; flex-direction: row; padding: 0; }
  .sidebar-section-label { display: none; }
  .nav-item { padding: 14px 16px; flex-direction: column; gap: 4px; font-size: 10px; border-left: none; border-bottom: 2px solid transparent; white-space: nowrap; min-width: 70px; text-align: center; }
  .nav-item.active { border-left: none; border-bottom-color: var(--gold); }
  .nav-item.active::before { display: none; }
  .nav-icon { font-size: 18px; width: auto; }
  .nav-label { font-size: 10px; letter-spacing: 0.06em; }
  .nav-badge { position: absolute; top: 8px; right: 8px; font-size: 9px; }
  .sidebar-bottom { display: none; }

  /* Content */
  .content { padding: 20px 16px; }

  /* Topbar */
  .topbar { padding: 0 16px; }
  .tb-title { display: none; }
  .tb-divider { display: none; }
  .tb-logo { height: 20px; }
  .tb-user { display: none; }

  /* Page header */
  .page-header { flex-direction: column; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
  .page-title { font-size: 28px; }
  .page-actions { width: 100%; justify-content: flex-start; }

  /* Toolbar */
  .toolbar { flex-direction: column; align-items: stretch; }
  .search-wrap { max-width: 100%; }

  /* Table — scroll horizontally */
  .table-wrap { overflow-x: auto; }
  table { min-width: 520px; }

  /* Cards grid */
  .cards-grid { grid-template-columns: 1fr; }

  /* Send grid */
  .send-layout { grid-template-columns: 1fr; }
  .send-col-launch { order: -1; }

  /* Settings */
  .settings-grid { grid-template-columns: 1fr; }

  /* Login */
  .login-wrap { width: 100%; padding: 24px 20px; }
  .login-card { padding: 28px 24px; }

  /* Modals */
  .modal { max-width: 100%; margin: 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .modal-overlay { align-items: flex-end; padding: 0; }
  .form-row { grid-template-columns: 1fr; }

  /* Hide tabs text, show compact */
  .tabs { overflow-x: auto; }
  .tab { white-space: nowrap; }
}

@media (max-width: 480px) {
  .tb-right { gap: 8px; }
  .lang-btn { padding: 3px 8px; font-size: 10px; }
  .btn { padding: 8px 14px; font-size: 11px; }
  .page-title { font-size: 24px; }
}

/* ═══════════════════════════════════════
   CLICK-TO-COPY & NO-SELECT
═══════════════════════════════════════ */
.td-noselect {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  white-space: nowrap;
}

.td-clickcopy {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  cursor: pointer;
  border-radius: 3px;
  padding: 1px 3px;
  transition: background .15s, color .15s;
  display: inline-block;
}
.td-clickcopy:hover {
  background: var(--gold-dim, rgba(200,168,107,.12));
  color: var(--gold);
}
.td-clickcopy:active {
  opacity: .7;
}


/* ═══════════════════════════════════════
   SOURCE PILL (Added by)
═══════════════════════════════════════ */
.source-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .05em;
  padding: 2px 8px;
  border-radius: 10px;
  text-transform: uppercase;
}
.source-patrick  { background: rgba(99,179,237,.12); color: #63b3ed; border: 1px solid rgba(99,179,237,.3); }
.source-jorge    { background: rgba(104,211,145,.12); color: #68d391; border: 1px solid rgba(104,211,145,.3); }
.source-quentin  { background: rgba(200,168,107,.12); color: #c8a86b; border: 1px solid rgba(200,168,107,.3); }

/* ── Contacts pagination ── */
#contacts-pagination {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  flex-wrap: wrap;
  min-height: 32px;
}
#contacts-pagination .btn-xs {
  min-width: 30px;
  justify-content: center;
}

/* ── Send page: Selection section header ── */
.sel-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface2);
  border-bottom: 1px solid var(--border);
}
.sel-contact-list { max-height: 260px; }

/* ── Send page: Queue section ── */
.queue-section-block {
  border-top: 3px solid rgba(200,168,107,.4);
  background: rgba(200,168,107,.03);
  flex-shrink: 0;
}
.queue-section-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  background: rgba(200,168,107,.07);
  border-bottom: 1px solid rgba(200,168,107,.2);
}
.queue-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--gold);
}
.queue-icon-badge { font-size: 14px; }
.queue-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .05em;
  background: rgba(200,168,107,.2); color: var(--gold);
  padding: 2px 8px; border-radius: 99px;
}
.queue-contact-list { max-height: 200px; padding: 4px 0; }
.queue-item-waiting, .queue-item-sent {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 18px;
}
.queue-item-waiting:hover { background: rgba(255,255,255,.02); }
.queue-dot { font-size: 10px; flex-shrink: 0; }
.queue-dot.waiting { color: var(--gold); }
.queue-dot.sent    { color: var(--green); }

/* ═══════════════════════════════════════════════
   RESPONSIVE FIXES — contacts table + actions
═══════════════════════════════════════════════ */

/* Always show action buttons on touch/non-hover devices */
@media (hover: none), (pointer: coarse) {
  .td-actions { opacity: 1 !important; display: flex !important; }
  .td-actions .btn { opacity: 1 !important; }
}

/* 15" / medium screens: hide less critical columns */
@media (max-width: 1280px) and (min-width: 769px) {
  .col-hide-md { display: none !important; }
  .sidebar { width: 190px; }
  .nav-label { font-size: 12px; }
  .page-actions { flex-wrap: wrap; gap: 6px; }
}

/* Mobile: hide extra columns, always show actions */
@media (max-width: 768px) {
  .col-hide-sm { display: none !important; }
  .col-hide-md { display: none !important; }
  /* Actions always visible */
  .td-actions { opacity: 1 !important; display: flex !important; gap: 4px; }
  /* Make table scroll but keep action column sticky */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  /* Contacts table minimum width reduced */
  #contacts-page table { min-width: 360px; }
  /* Toolbar wrap */
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .search-wrap { min-width: 100%; max-width: 100%; }
  /* Page actions wrap */
  .page-actions { flex-wrap: wrap; gap: 6px; }
  /* Modals full screen on mobile */
  .modal-xl, .modal-lg { max-width: 100%; }
}

@media (max-width: 480px) {
  .td-actions .btn { width: 28px; height: 28px; font-size: 11px; }
  #contacts-page table { min-width: 320px; }
}
