/* ═══════════════════════════════════════════════════════════
   Club des Bâtisseurs CRM — Design System
   Palette : Navy (#0f1f3d) + Or (#c9a84c)
   Polices  : Plus Jakarta Sans + Fraunces
   MOBILE FIRST — Base = mobile, desktop via min-width: 768px
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;0,9..144,800;1,9..144,400;1,9..144,700&display=swap');

/* ── Variables ────────────────────────────────────────────── */
:root {
  /* Or — accent principal */
  --gold:       #c9a84c;
  --gold-dark:  #b8963e;
  --gold-light: #e2c97a;
  --gold-pale:  #f5edd5;

  /* Navy — fonds */
  --bg:   #070f1e;   /* navy-dark  */
  --bg2:  #0f1f3d;   /* navy       */
  --bg3:  #152848;   /* navy-mid   */
  --bg4:  #1a3260;   /* navy-light */

  /* Bordures */
  --border:  rgba(201,168,76,.2);
  --border2: rgba(255,255,255,.07);

  /* Texte */
  --text:  #f5edd5;   /* gold-pale — chaud et lisible */
  --muted: #7b8fad;   /* bleu-gris doux */

  /* Alias utiles */
  --accent: #c9a84c;

  /* Layout */
  --sidebar-w:  220px;
  --bnav-h:     64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

*,*::before,*::after { box-sizing:border-box; margin:0; padding:0 }
html { scroll-behavior:smooth; -webkit-text-size-adjust:100% }
body {
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color:inherit; text-decoration:none }
button,input,select,textarea { font-family:'Plus Jakarta Sans',sans-serif }

/* ── Layout : mobile default ─────────────────────────────── */
.app-layout { min-height:100vh; padding-bottom:calc(var(--bnav-h) + var(--safe-bottom)) }
.sidebar { display:none }
.main { width:100% }

/* ── Bottom navigation (mobile) ──────────────────────────── */
.bottom-nav {
  display:flex;
  position:fixed; bottom:0; left:0; right:0;
  height:calc(var(--bnav-h) + var(--safe-bottom));
  padding-bottom:var(--safe-bottom);
  background:var(--bg2);
  border-top:1px solid var(--border2);
  z-index:200;
}
.bnav-item {
  flex:1; display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap:3px; color:var(--muted); text-decoration:none;
  font-size:.55rem; font-weight:600; letter-spacing:.02em; text-transform:uppercase;
  padding:8px 2px 4px; transition:color .15s;
  border:none; background:none; cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  min-height:44px;
}
.bnav-item svg { flex-shrink:0 }
.bnav-item.active { color:var(--gold) }

/* ── Top bar (mobile header) ─────────────────────────────── */
.top-bar {
  display:flex; align-items:center;
  padding:10px 12px;
  background:var(--bg);
  position:sticky; top:0; z-index:100;
  min-height:56px;
  border-bottom:1px solid var(--border2);
}
.top-bar-title, .top-bar-logo {
  position:absolute; left:50%; transform:translateX(-50%);
  font-family:'Fraunces',serif; font-weight:700;
  white-space:nowrap; pointer-events:none;
}
.top-bar-title { font-size:1.1rem }
.top-bar-logo  { font-size:.95rem; color:var(--gold) }
.top-bar-logo em { font-style:italic; color:var(--text) }
.top-bar-left  { display:flex; align-items:center; gap:6px }
.top-bar-right { display:flex; align-items:center; gap:4px; margin-left:auto }
.top-bar-actions { display:flex; gap:8px; align-items:center }
.mobile-kanban-tabs {
  display:flex; align-items:center; justify-content:space-between;
  padding:8px 14px; border-bottom:1px solid var(--border2); background:var(--bg);
}

/* ── Notification badge ───────────────────────── */
.notif-badge {
  position:absolute; top:2px; right:2px;
  min-width:16px; height:16px; border-radius:100px;
  background:#ef4444; color:#fff;
  font-size:.58rem; font-weight:800;
  display:flex; align-items:center; justify-content:center;
  padding:0 3px; line-height:1;
  pointer-events:none;
}
/* Desktop sidebar badge offset */
.nav-item .notif-badge { top:6px; right:6px }

/* ── Notification panel ───────────────────────── */
.notif-panel {
  position:fixed; top:0; right:0; bottom:0;
  width:320px; max-width:100vw;
  background:var(--bg2); border-left:1px solid var(--border2);
  z-index:500; display:flex; flex-direction:column;
  transform:translateX(100%); transition:transform .25s ease;
  box-shadow:-4px 0 24px rgba(0,0,0,.25);
}
.notif-panel.open { transform:translateX(0) }

.notif-header {
  display:flex; align-items:center; justify-content:space-between;
  padding:18px 16px 14px; border-bottom:1px solid var(--border2);
  flex-shrink:0;
}
.notif-title { font-weight:800; font-size:1rem }
.notif-close {
  background:none; border:none; color:var(--muted);
  cursor:pointer; font-size:1.1rem; padding:4px; line-height:1;
}
.notif-close:hover { color:var(--text) }
.notif-mark-read {
  background:none; border:1px solid var(--border2); border-radius:6px;
  color:var(--muted); cursor:pointer; font-size:.72rem; font-weight:600;
  padding:3px 8px; font-family:'Inter',sans-serif; transition:all .15s;
}
.notif-mark-read:hover { border-color:var(--gold); color:var(--gold) }
.notif-item.notif-read { opacity:.4 }
.notif-item.notif-read .notif-dot { background:var(--muted) !important }

#notifList { overflow-y:auto; flex:1 }

.notif-section-title {
  font-size:.7rem; font-weight:700; color:var(--muted);
  text-transform:uppercase; letter-spacing:.4px;
  padding:12px 16px 6px;
}
.notif-item {
  display:flex; align-items:flex-start; gap:10px;
  padding:10px 16px; border-bottom:1px solid var(--border);
  text-decoration:none; color:var(--text);
  transition:background .12s;
}
.notif-item:hover { background:var(--bg3) }
.notif-dot {
  width:8px; height:8px; border-radius:50%; flex-shrink:0; margin-top:5px;
}
.notif-body { flex:1; min-width:0 }
.notif-text { font-size:.84rem; font-weight:600 }
.notif-sub  { font-size:.72rem; color:var(--muted); margin-top:2px }
.notif-loading, .notif-empty {
  text-align:center; padding:32px 16px;
  font-size:.85rem; color:var(--muted);
}

/* ── Boutons contact mobile (WhatsApp / SMS / Appel) ── */
.mobile-contact-actions {
  display:flex;gap:8px;flex-wrap:wrap;
}
.btn-contact {
  display:inline-flex;align-items:center;gap:6px;
  padding:8px 14px;border-radius:10px;font-size:.8rem;font-weight:600;
  text-decoration:none;font-family:'Inter',sans-serif;transition:opacity .15s;
}
.btn-contact:active { opacity:.7 }
.btn-call      { background:rgba(16,185,129,.15);color:#10b981 }
.btn-sms       { background:rgba(99,102,241,.15);color:#818cf8 }
.btn-whatsapp  { background:rgba(37,211,102,.15);color:#25d366 }
@media(min-width:768px){ .mobile-contact-actions { display:none } }

.topbar-profile {
  display:flex; align-items:center; justify-content:center;
  width:36px; height:36px; border-radius:50%;
  color:var(--muted); text-decoration:none;
  transition:background .15s, color .15s;
  flex-shrink:0; position:relative;
  background:none; border:none; cursor:pointer; padding:0;
  -webkit-appearance:none;
}
.topbar-profile:hover, .topbar-profile.active { color:var(--gold); background:rgba(201,168,76,.1) }

/* ── Page header (desktop only) ──────────────────────────── */
.page-header { display:none }

/* ── Page content ────────────────────────────────────────── */
.page-content { padding:14px 16px }

/* ── Stats grid ──────────────────────────────────────────── */
.stats-grid {
  display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-bottom:20px;
}
.stat-card {
  background:var(--bg2); border:1px solid var(--border2); border-radius:12px;
  padding:14px 16px;
}
.stat-value { font-family:'Fraunces',serif; font-size:1.8rem; font-weight:700 }
.stat-label { font-size:.72rem; color:var(--muted); margin-top:3px }

/* ── Cards ───────────────────────────────────────────────── */
.card {
  background:var(--bg2); border:1px solid var(--border2); border-radius:12px;
  overflow:hidden; margin-bottom:14px;
}
.card-header {
  padding:12px 16px; border-bottom:1px solid var(--border2);
  display:flex; align-items:center; justify-content:space-between;
}
.card-header h3 { font-size:.88rem; font-weight:600 }
.card-body { padding:14px 16px }
.grid-2,.grid-3 { display:flex; flex-direction:column; gap:14px }

/* ── Lead cards (mobile list) ────────────────────────────── */
.lead-row {
  background:var(--bg2); border:1px solid var(--border2); border-radius:12px;
  padding:14px; margin-bottom:8px; cursor:pointer;
  -webkit-tap-highlight-color:transparent;
  transition:background .1s;
  display:flex; align-items:flex-start; gap:12px;
}
.lead-row:active { background:var(--bg3) }
.lead-row-info { flex:1; min-width:0 }
.lead-row-name { font-weight:700; font-size:.92rem; margin-bottom:2px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.lead-row-email { font-size:.75rem; color:var(--muted); margin-bottom:6px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.lead-row-badges { display:flex; flex-wrap:wrap; gap:4px; align-items:center }
.lead-row-right { flex-shrink:0; text-align:right; display:flex; flex-direction:column; align-items:flex-end; gap:4px }

/* ── Table (desktop only) ────────────────────────────────── */
.table-wrap { display:none }

/* ── Badges ──────────────────────────────────────────────── */
.badge { display:inline-block; padding:3px 9px; border-radius:100px; font-size:.7rem; font-weight:600; white-space:nowrap }
.badge-chaud  { background:rgba(239,68,68,.15);  color:#f87171 }
.badge-tiede  { background:rgba(201,168,76,.18); color:#e2c97a }
.badge-froid  { background:rgba(96,165,250,.15); color:#93c5fd }
.badge-gray   { background:rgba(123,143,173,.1); color:var(--muted) }
.badge-blue   { background:rgba(59,130,246,.15); color:#93c5fd }
.badge-purple { background:rgba(139,92,246,.15); color:#c4b5fd }
.badge-green  { background:rgba(16,185,129,.15); color:#6ee7b7 }
.badge-gold   { background:rgba(201,168,76,.18); color:var(--gold-light) }
.badge-dark   { background:rgba(26,50,96,.8);    color:var(--muted) }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display:inline-flex; align-items:center; gap:7px;
  padding:11px 18px; border-radius:10px;
  font-size:.88rem; font-weight:600; cursor:pointer; border:none;
  transition:all .2s; text-decoration:none;
  font-family:'Plus Jakarta Sans',sans-serif;
  min-height:44px; -webkit-tap-highlight-color:transparent;
}
.btn-primary {
  background:linear-gradient(135deg, var(--gold), var(--gold-light));
  color:#0f1f3d;
  box-shadow: 0 4px 16px rgba(201,168,76,.3);
}
.btn-primary:hover { box-shadow:0 6px 24px rgba(201,168,76,.45); transform:translateY(-1px) }
.btn-primary:active { transform:translateY(0); box-shadow:0 2px 8px rgba(201,168,76,.2) }
.btn-secondary { background:var(--bg3); color:var(--text); border:1px solid var(--border2) }
.btn-secondary:active { background:var(--bg4) }
.btn-danger { background:rgba(239,68,68,.1); color:#f87171; border:1px solid rgba(239,68,68,.2) }
.btn-ghost { background:none; color:var(--muted); border:1px solid var(--border2) }
.btn-ghost:hover { color:var(--text); border-color:rgba(201,168,76,.3); background:rgba(201,168,76,.05) }
.btn-ghost:active { background:var(--bg3) }
.btn-sm { padding:8px 14px; font-size:.82rem; min-height:36px }
.btn-xs { padding:5px 10px; font-size:.75rem; min-height:30px; border-radius:7px }
.btn-icon { padding:10px; border-radius:10px; min-height:44px; min-width:44px; justify-content:center }
.btn-full { width:100%; justify-content:center }

/* ── Forms ───────────────────────────────────────────────── */
.form-group { margin-bottom:16px }
.form-group label {
  display:block; font-size:.72rem; font-weight:700; color:var(--muted);
  margin-bottom:6px; text-transform:uppercase; letter-spacing:.05em;
}
.form-control {
  width:100%; background:var(--bg3); border:1px solid var(--border2); border-radius:10px;
  color:var(--text); padding:12px 14px;
  font-size:16px; /* prevents iOS zoom */
  font-family:'Plus Jakarta Sans',sans-serif; outline:none; transition:border-color .15s;
  -webkit-appearance:none; appearance:none;
  min-height:44px;
}
.form-control:focus { border-color:var(--gold); box-shadow:0 0 0 3px rgba(201,168,76,.12) }
.form-control::placeholder { color:rgba(123,143,173,.5) }
select.form-control {
  cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237b8fad' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat:no-repeat; background-position:right 12px center; padding-right:36px;
}
textarea.form-control { resize:vertical; min-height:100px; line-height:1.5; font-size:15px }
.form-row { display:flex; flex-direction:column; gap:0 }
.form-hint { font-size:.72rem; color:var(--muted); margin-top:5px }

/* ── Filter bar ──────────────────────────────────────────── */
.filter-bar {
  display:flex; flex-direction:column; gap:8px;
  padding:10px 16px;
  border-bottom:1px solid var(--border2);
}
.filter-bar .form-control { font-size:14px; padding:8px 12px; min-height:38px; width:100% }
.filter-bar .search-input { width:100% }

/* ── Timeline ────────────────────────────────────────────── */
.timeline { position:relative; padding-left:32px }
.timeline::before { content:''; position:absolute; left:11px; top:0; bottom:0; width:2px; background:var(--border2) }
.timeline-item { position:relative; padding-bottom:18px }
.timeline-dot {
  position:absolute; left:-28px; top:3px; width:24px; height:24px; border-radius:50%;
  background:var(--bg3); border:2px solid var(--border2);
  display:flex; align-items:center; justify-content:center; font-size:.75rem; z-index:1;
}
.timeline-time { font-size:.68rem; color:var(--muted); margin-bottom:3px }
.timeline-card { background:var(--bg3); border:1px solid var(--border2); border-radius:8px; padding:9px 12px }
.timeline-title { font-size:.83rem; font-weight:600; margin-bottom:2px }
.timeline-body { font-size:.8rem; color:var(--muted); line-height:1.5; white-space:pre-wrap }

/* ── Modals (bottom sheet on mobile) ─────────────────────── */
.modal-overlay {
  position:fixed; inset:0; background:rgba(7,15,30,.85);
  display:flex; align-items:center; justify-content:center;
  z-index:1000; opacity:0; pointer-events:none; transition:opacity .2s;
  padding:16px;
}
.modal-overlay.open { opacity:1; pointer-events:all }
.modal {
  background:var(--bg2); border:1px solid var(--border);
  border-radius:18px; width:100%; max-width:500px;
  transform:translateY(16px) scale(.98);
  transition:transform .22s cubic-bezier(.32,.72,0,1);
  max-height:92vh; overflow-y:auto;
}
.modal-overlay.open .modal { transform:translateY(0) scale(1) }
.modal::before { display:none }
.modal-header {
  padding:14px 20px 12px; border-bottom:1px solid var(--border2);
  display:flex; align-items:center; justify-content:space-between;
  position:sticky; top:0; background:var(--bg2); z-index:1;
}
.modal-header h3 { font-family:'Fraunces',serif; font-size:1rem; font-weight:700 }
.modal-close {
  background:none; border:none; color:var(--muted); cursor:pointer;
  font-size:1.1rem; padding:6px; min-height:36px; min-width:36px;
  display:flex; align-items:center; justify-content:center; border-radius:6px;
}
.modal-body { padding:16px 20px }
.modal-footer { padding:10px 20px 16px; display:flex; gap:10px; justify-content:flex-end; border-top:1px solid var(--border2) }

/* ── Toast ───────────────────────────────────────────────── */
.toast {
  position:fixed; bottom:calc(var(--bnav-h) + var(--safe-bottom) + 12px);
  left:50%; transform:translateX(-50%) translateY(12px);
  background:var(--bg3); border:1px solid var(--border); border-radius:20px;
  padding:10px 18px; font-size:.82rem; font-weight:500;
  opacity:0; transition:all .25s; z-index:9999;
  white-space:nowrap; max-width:280px; text-align:center;
}
.toast.show { transform:translateX(-50%) translateY(0); opacity:1 }
.toast-success { border-color:rgba(16,185,129,.35); color:#6ee7b7 }
.toast-error   { border-color:rgba(239,68,68,.35);  color:#f87171 }
.toast-info    { color:var(--muted) }

/* ── Auth pages ──────────────────────────────────────────── */
.auth-page {
  min-height:100vh; display:flex;
  flex-direction:column; justify-content:flex-end;
  background:var(--bg);
}
.auth-bg {
  flex:1; display:flex; align-items:center; justify-content:center;
  padding:24px;
  background:radial-gradient(ellipse 80% 60% at 50% 0%, rgba(201,168,76,.1) 0%, rgba(15,31,61,.4) 50%, transparent 70%);
}
.auth-logo-big {
  font-family:'Fraunces',serif; font-size:2rem; font-weight:700; color:var(--gold);
  text-align:center;
}
.auth-logo-big em { font-style:italic; color:var(--text) }
.auth-tagline { text-align:center; color:var(--muted); font-size:.85rem; margin-top:6px }
.auth-card {
  background:var(--bg2);
  border-radius:24px 24px 0 0;
  border-top:1px solid var(--border);
  padding:28px 24px calc(28px + var(--safe-bottom));
  width:100%;
}
.auth-subtitle { color:var(--muted); font-size:.85rem; margin-bottom:22px }
.auth-links { text-align:center; margin-top:16px; font-size:.8rem; color:var(--muted) }
.auth-links a { color:var(--gold) }
.msg-box { border-radius:10px; padding:10px 14px; font-size:.82rem; margin-bottom:14px; display:none }
.msg-error   { background:rgba(239,68,68,.1);  border:1px solid rgba(239,68,68,.2);  color:#f87171 }
.msg-success { background:rgba(16,185,129,.1); border:1px solid rgba(16,185,129,.2); color:#6ee7b7 }

/* ── Lead avatar ─────────────────────────────────────────── */
.lead-avatar {
  border-radius:50%; background:rgba(201,168,76,.15);
  display:flex; align-items:center; justify-content:center;
  font-family:'Fraunces',serif; font-weight:700; color:var(--gold); flex-shrink:0;
}

/* ── Score badge ─────────────────────────────────────────── */
.score-badge { display:inline-flex; align-items:center; justify-content:center; border-radius:50%; font-weight:700 }

/* ── Info grid ───────────────────────────────────────────── */
.info-grid { display:flex; flex-direction:column; gap:12px }
.info-item label {
  font-size:.68rem; font-weight:700; color:var(--muted);
  text-transform:uppercase; letter-spacing:.05em; display:block; margin-bottom:3px;
}
.info-item .val { font-size:.88rem; font-weight:500 }

/* ── Diagnostic answers ──────────────────────────────────── */
.diag-question { background:var(--bg3); border:1px solid var(--border2); border-radius:8px; padding:11px 14px; margin-bottom:8px }
.diag-q { font-size:.68rem; color:var(--muted); font-weight:700; text-transform:uppercase; letter-spacing:.05em; margin-bottom:3px }
.diag-a { font-size:.85rem; font-weight:500 }

/* ── Empty state ─────────────────────────────────────────── */
.empty { text-align:center; padding:48px 24px; color:var(--muted) }
.empty-icon { font-size:2.2rem; margin-bottom:10px }
.empty h4 { font-size:.9rem; font-weight:600; color:var(--text); margin-bottom:5px }
.empty p { font-size:.8rem }

/* ── Loading ─────────────────────────────────────────────── */
.loading { text-align:center; padding:48px; color:var(--muted) }
.spinner {
  width:26px; height:26px; border:3px solid var(--border2);
  border-top-color:var(--gold); border-radius:50%;
  animation:spin .7s linear infinite; margin:0 auto 10px;
}
@keyframes spin { to { transform:rotate(360deg) } }

/* ── Bulk bar ────────────────────────────────────────────── */
.bulk-bar {
  display:none; position:sticky; top:0; z-index:90;
  background:var(--bg2); border-bottom:1px solid var(--border);
  padding:10px 16px; align-items:center; gap:8px; flex-wrap:wrap;
}
.bulk-bar.show { display:flex }

/* ── Kanban ──────────────────────────────────────────────── */
.kanban-wrap { display:flex; flex-direction:column; gap:16px; padding:14px 16px calc(14px + var(--bnav-h)) }
.kanban-col { width:100% }
.col-header { padding:10px 12px; border-radius:10px 10px 0 0; display:flex; align-items:center; justify-content:space-between }
.col-title { font-size:.75rem; font-weight:700; text-transform:uppercase; letter-spacing:.05em }
.col-count { font-size:.7rem; font-weight:700; background:rgba(255,255,255,.1); padding:2px 7px; border-radius:100px }
.col-body {
  background:var(--bg2); border:1px solid var(--border2); border-top:none;
  border-radius:0 0 10px 10px; min-height:80px; padding:7px;
  display:flex; flex-direction:column; gap:6px; transition:background .15s;
}
.col-body.drag-over { background:rgba(201,168,76,.06); border-color:var(--border) }
.kanban-card {
  background:var(--bg3); border:1px solid var(--border2); border-radius:8px;
  padding:10px 11px; cursor:grab; transition:transform .1s;
  user-select:none; -webkit-tap-highlight-color:transparent;
}
.kanban-card:active { opacity:.7 }
.kanban-card.dragging { opacity:.4 }

/* ── Stats bars ──────────────────────────────────────────── */
.bar-row { display:flex; align-items:center; gap:8px; margin-bottom:8px }
.bar-label { width:110px; font-size:.75rem; color:var(--muted); flex-shrink:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis }
.bar-track { flex:1; background:var(--bg3); border-radius:100px; height:8px; overflow:hidden }
.bar-fill { height:100%; border-radius:100px; transition:width .5s ease }
.bar-val { width:32px; text-align:right; font-size:.78rem; font-weight:600; flex-shrink:0 }

/* ── KPIs ────────────────────────────────────────────────── */
.kpi-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:10px; margin-bottom:20px }
.kpi { background:var(--bg2); border:1px solid var(--border2); border-radius:10px; padding:14px 16px }
.kpi-val { font-family:'Fraunces',serif; font-size:1.7rem; font-weight:700; line-height:1 }
.kpi-label { font-size:.68rem; color:var(--muted); margin-top:4px }

/* ── Next action ─────────────────────────────────────────── */
.next-action-box { background:var(--bg3); border:1px solid var(--border2); border-radius:10px; padding:12px 14px; margin-bottom:4px }
.next-action-box.overdue   { border-color:rgba(239,68,68,.3);  background:rgba(239,68,68,.05) }
.next-action-box.due-soon  { border-color:rgba(201,168,76,.3); background:rgba(201,168,76,.05) }

/* ── Tags ────────────────────────────────────────────────── */
.tags-container { display:flex; flex-wrap:wrap; gap:4px; align-items:center; min-height:28px }
.tag-input-wrap { display:flex; gap:8px; margin-top:10px }
.tag-input {
  background:var(--bg3); border:1px solid var(--border2); border-radius:8px;
  color:var(--text); padding:8px 12px; font-size:16px; outline:none;
  flex:1; font-family:'Plus Jakarta Sans',sans-serif; min-height:40px;
}
.tag-input:focus { border-color:var(--gold) }

/* ── Activity summary ────────────────────────────────────── */
.activity-summary { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:6px }
.act-chip { background:var(--bg3); border:1px solid var(--border2); border-radius:8px; padding:10px 8px; text-align:center }
.act-chip .n { font-family:'Fraunces',serif; font-weight:700; font-size:1.1rem; display:block; color:var(--text) }
.act-chip .l { color:var(--muted); font-size:.62rem; display:block; margin-top:2px }

/* ── Sidebar (desktop only) ──────────────────────────────── */
.sidebar {
  background:var(--bg2);
  border-right:1px solid var(--border);
  flex-direction:column; position:fixed; top:0; left:0; bottom:0;
  z-index:100; overflow-y:auto;
}
.sidebar-logo { padding:22px 20px 18px; border-bottom:1px solid var(--border); flex-shrink:0 }
.logo-text { font-family:'Fraunces',serif; font-size:1.05rem; font-weight:700; color:var(--gold) }
.logo-text em { font-style:italic; color:var(--text) }
.sidebar-nav { padding:14px 10px; flex:1 }
.sidebar-bottom { padding:10px; border-top:1px solid var(--border); flex-shrink:0 }
.nav-item {
  display:flex; align-items:center; gap:10px; padding:9px 12px; border-radius:8px;
  color:var(--muted); font-size:.83rem; font-weight:500;
  transition:background .15s,color .15s; cursor:pointer;
  border:none; background:none; width:100%; text-align:left;
}
.nav-item:hover { background:rgba(201,168,76,.08); color:var(--text) }
.nav-item.active {
  background:rgba(201,168,76,.12);
  color:var(--gold);
  border-left:2px solid var(--gold);
  padding-left:10px;
}
.nav-logout { color:#f87171 !important }
.nav-logout:hover { background:rgba(239,68,68,.08) !important }

/* ── Premium Gate ─────────────────────────────────────────── */
.premium-gated { position:relative; overflow:hidden; border-radius:12px; }
.premium-gated > *:not(.premium-gate-overlay) { filter:blur(3px); opacity:.3; pointer-events:none; user-select:none; }
.premium-gate-overlay {
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  background:rgba(7,15,30,.7); backdrop-filter:blur(6px);
  z-index:10; border-radius:inherit; padding:16px;
}
.premium-gate-box { text-align:center; max-width:260px; }
.premium-gate-box .gate-icon { font-size:2.2rem; margin-bottom:10px; }
.premium-gate-box strong { display:block; font-size:.95rem; font-weight:700; margin-bottom:6px; color:var(--text); }
.premium-gate-box p { font-size:.78rem; color:var(--muted); line-height:1.5; margin-bottom:16px; }

/* Lock badge on buttons */
.btn-locked { opacity:.6; cursor:pointer; }
.btn-locked::after { content:'🔒'; margin-left:5px; font-size:.75em; }

/* ══════════════════════════════════════════════════════════
   DESKTOP  (≥ 768px)
   ══════════════════════════════════════════════════════════ */
@media(min-width:768px) {
  .app-layout { display:flex; padding-bottom:0 }
  .sidebar { display:flex; width:var(--sidebar-w) }
  .main { margin-left:var(--sidebar-w); flex:1 }
  .bottom-nav { display:none }
  .top-bar { display:none }
  .mobile-kanban-tabs { display:none !important }

  .page-header {
    display:flex; align-items:center; justify-content:space-between;
    gap:16px; flex-wrap:nowrap;
    padding:20px 32px 16px; border-bottom:1px solid var(--border2);
  }
  .page-header-left h1 {
    font-family:'Fraunces',serif; font-size:1.5rem; font-weight:700;
  }
  .page-header-left p { color:var(--muted); font-size:.83rem; margin-top:3px }

  .page-content { padding:24px 32px }

  .stats-grid { grid-template-columns:repeat(auto-fit,minmax(160px,1fr)); gap:14px; margin-bottom:28px }
  .stat-card { padding:18px 20px }
  .stat-value { font-size:2rem }

  .grid-2 { display:grid; grid-template-columns:1fr 1fr; gap:20px }
  .grid-3 { display:grid; grid-template-columns:1fr 1fr 1fr; gap:20px }
  .info-grid { grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); display:grid }

  .lead-row { display:none } /* hidden on desktop — use table */
  .table-wrap { display:block; overflow-x:auto }
  table { width:100%; border-collapse:collapse; font-size:.85rem }
  th {
    text-align:left; padding:10px 16px; font-size:.7rem; font-weight:700;
    text-transform:uppercase; letter-spacing:.05em; color:var(--muted);
    border-bottom:1px solid var(--border2); white-space:nowrap;
  }
  td { padding:11px 16px; border-bottom:1px solid var(--border2); vertical-align:middle }
  tr:last-child td { border-bottom:none }
  tbody tr:hover td { background:rgba(201,168,76,.03); cursor:pointer }
  .td-name { font-weight:600; font-size:.87rem }
  .td-muted { color:var(--muted); font-size:.78rem }

  .filter-bar { flex-direction:row; flex-wrap:nowrap; overflow-x:visible; padding:10px 32px; gap:10px }
  .filter-bar .form-control { font-size:.85rem; padding:8px 12px; width:auto }

  .card { margin-bottom:20px }
  .card-header { padding:14px 20px }
  .card-body { padding:20px }

  .modal-body { padding:20px 24px }
  .modal-footer { padding:12px 24px 20px }

  .toast { bottom:24px; right:24px; left:auto; transform:translateY(12px); border-radius:10px }
  .toast.show { transform:translateY(0) }

  .auth-page { flex-direction:row; justify-content:center; align-items:center; padding:24px }
  .auth-bg { display:none }
  .auth-card {
    border-radius:16px; border:1px solid var(--border);
    padding:36px 32px; max-width:420px; width:100%;
  }

  .kanban-wrap {
    display:grid;
    grid-template-columns:repeat(3, 1fr);
    align-items:flex-start; padding:24px 32px 32px;
    min-height:calc(100vh - 140px);
  }
  .kanban-col { width:100% }

  .bulk-bar { padding:10px 20px }

  .form-control { font-size:.88rem; min-height:40px }
  .form-row { flex-direction:row; gap:14px }
  .form-row>.form-group { flex:1; margin-bottom:0 }

  .kpi-grid { grid-template-columns:repeat(auto-fit,minmax(150px,1fr)); gap:12px }
  .kpi { padding:16px 18px }

  .activity-summary { grid-template-columns:repeat(5,1fr) }

  .btn { min-height:38px }
  .btn-sm { min-height:34px }
}

/* ── Theme toggle buttons ─────────────────────────────────── */
.theme-toggle {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.theme-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1.5px solid var(--border2);
  background: var(--bg3);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.theme-btn:hover {
  border-color: var(--gold);
  color: var(--text);
}
.theme-btn.active {
  border-color: var(--gold);
  background: rgba(201,168,76,.15);
  color: var(--gold);
}

/* ── Light theme overrides ───────────────────────────────── */
html[data-theme="light"] {
  --bg:   #f0f4f8;
  --bg2:  #ffffff;
  --bg3:  #e2e8f0;
  --bg4:  #cbd5e1;
  --border:  rgba(100,100,120,.2);
  --border2: rgba(0,0,0,.1);
  --text:  #1a202c;
  --muted: #64748b;
}
