/* ============================================================
   CINCO E MEIA CRM — Design System v5
   ============================================================ */

:root {
  --bg-dark-from: #102835;
  --bg-dark-to: #050e15;
  --bg-dark: linear-gradient(135deg, #102835 0%, #081a24 50%, #050e15 100%);
  --bg-light: #e1dfdd;
  --bg-light-text: #1a2530;
  --glass-bg: rgba(255,255,255,0.11);
  --glass-bg-hover: rgba(255,255,255,0.17);
  --glass-bg-header: rgba(255,255,255,0.07);
  --glass-blur: blur(16px);
  --glass-blur-header: blur(24px);
  --glass-border: rgba(255,255,255,0.13);
  --glass-border-hover: rgba(255,255,255,0.24);
  --bg-card: rgba(255,255,255,0.11);
  --bg-card-hover: rgba(255,255,255,0.17);
  --text-white: #e1dfdd;
  --text-secondary: #b4b4b5;
  --text-dark: #010811;
  --accent: #2fa7b8;
  --accent-hover: #27909f;
  --accent-light: rgba(47,167,184,0.18);
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --purple: #8b5cf6;
  --border-card: rgba(255,255,255,0.13);
  --border-hover: rgba(255,255,255,0.24);
  --font-main: 'Plus Jakarta Sans', system-ui, sans-serif;
  --w-light: 300;
  --w-regular: 400;
  --w-medium: 500;
  --w-semibold: 600;
  --w-bold: 700;
  --w-extrabold: 800;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-card: 18px;
  --radius-pill: 100px;
  --shadow-card: 0 4px 32px rgba(0,0,0,0.35);
  --ease-fast: 0.18s ease;
  --ease-base: 0.28s ease;
  --ease-slow: 0.5s cubic-bezier(0.4,0,0.2,1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: var(--w-regular);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  background: var(--bg-dark);
  color: var(--text-white);
  min-height: 100vh;
  overflow-x: hidden;
}

#root { min-height: 100vh; }

/* ── SCREEN SYSTEM ── */
.screen { display: none; min-height: 100vh; }
.screen.active { display: flex; flex-direction: column; }

/* ── GRADIENT BACKGROUND ── */
.bg-gradient {
  background: linear-gradient(135deg, #102835 0%, #081a24 50%, #050e15 100%);
  min-height: 100vh;
}

/* ── GLASS CARD ── */
.glass-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  transition: border-color var(--ease-base), background var(--ease-base);
}
.glass-card:hover {
  border-color: var(--glass-border-hover);
  background: var(--glass-bg-hover);
}
.glass-card-dark {
  background: rgba(13,32,48,0.95);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
}

/* ── TOP BAR ── */
.top-bar {
  background: rgba(255,255,255,0.06);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
  padding: 0 20px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 50;
}
.top-bar-title {
  font-size: 16px;
  font-weight: var(--w-semibold);
  color: var(--text-white);
}

/* ── LOGO ── */
.logo-container {
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #1a7a87);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(47,167,184,0.35);
  flex-shrink: 0;
}
.logo-icon svg { width: 22px; height: 22px; }
.logo-text { font-size: 15px; font-weight: var(--w-light); color: var(--text-white); }
.logo-text strong { font-weight: var(--w-extrabold); }
.logo-badge {
  font-size: 9px;
  font-weight: var(--w-bold);
  letter-spacing: 0.15em;
  background: var(--accent);
  color: #010811;
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
}

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: var(--w-medium);
  cursor: pointer;
  border: none;
  text-decoration: none;
  white-space: nowrap;
  transition: all var(--ease-fast);
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

.btn-accent {
  background: var(--accent);
  color: #010811;
  border-radius: var(--radius-pill);
  padding: 13px 28px;
  font-weight: var(--w-semibold);
}
.btn-accent:hover:not(:disabled) { background: var(--accent-hover); }

.btn-outline-dark {
  background: transparent;
  color: var(--text-white);
  border: 1.5px solid rgba(255,255,255,0.28);
  border-radius: var(--radius-pill);
  padding: 11px 22px;
}
.btn-outline-dark:hover { background: rgba(255,255,255,0.07); border-color: rgba(255,255,255,0.5); }

.btn-outline-light {
  background: transparent;
  color: var(--text-dark);
  border: 1.5px solid rgba(26,37,48,0.45);
  border-radius: var(--radius-pill);
  padding: 11px 22px;
}
.btn-outline-light:hover { background: rgba(26,37,48,0.06); }

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
}
.btn-ghost:hover { background: rgba(255,255,255,0.07); color: var(--text-white); }

.btn-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  transition: all var(--ease-fast);
  flex-shrink: 0;
}
.btn-icon:hover { background: rgba(255,255,255,0.08); color: var(--text-white); }
.btn-icon svg { width: 20px; height: 20px; }

.btn-danger {
  background: transparent;
  color: var(--error);
  border: 1.5px solid rgba(239,68,68,0.4);
  border-radius: var(--radius-pill);
  padding: 11px 22px;
}
.btn-danger:hover { background: rgba(239,68,68,0.1); }

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

/* ── FULL WIDTH BUTTON ── */
.btn-full { width: 100%; justify-content: center; }

/* ── SPINNER ── */
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.2);
  border-top-color: currentColor;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── BADGE / STATUS PILL ── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 10px;
  font-weight: var(--w-semibold);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 100px;
}
.badge-active { background: rgba(34,197,94,0.18); color: var(--success); }
.badge-inactive { background: rgba(180,180,181,0.15); color: var(--text-secondary); }
.badge-overdue { background: rgba(239,68,68,0.18); color: var(--error); }
.badge-accent { background: rgba(47,167,184,0.18); color: var(--accent); }
.badge-new { background: rgba(47,167,184,0.18); color: var(--accent); font-size: 9px; }
.badge-qualified { background: rgba(245,158,11,0.18); color: var(--warning); font-size: 9px; }
.badge-warning { background: rgba(245,158,11,0.18); color: var(--warning); }
.badge-error { background: rgba(239,68,68,0.18); color: var(--error); }
.badge-purple { background: rgba(139,92,246,0.18); color: var(--purple); }

/* stage dots */
.stage-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* ── FORMS ── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label {
  font-size: 10px;
  font-weight: var(--w-medium);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.field-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
input[type="tel"],
textarea,
select {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  color: var(--text-white);
  font-family: var(--font-main);
  font-size: 15px;
  font-weight: var(--w-regular);
  padding: 10px 0;
  outline: none;
  transition: border-color var(--ease-base);
  appearance: none;
  border-radius: 0;
  resize: none;
  line-height: 1.6;
}
input:focus, textarea:focus, select:focus {
  border-bottom-color: rgba(255,255,255,0.35);
}
input::placeholder, textarea::placeholder {
  color: rgba(255,255,255,0.2);
}
textarea { min-height: 70px; }
select { cursor: pointer; }
select option { background: #0d2030; color: var(--text-white); }

/* filled input style for sheets */
.input-filled {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text-white);
  font-family: var(--font-main);
  font-size: 14px;
  outline: none;
  transition: border-color var(--ease-fast);
  width: 100%;
}
.input-filled:focus { border-color: var(--accent); }
.input-filled::placeholder { color: rgba(255,255,255,0.25); }
.input-filled option { background: #0d2030; }

/* radio */
input[type="radio"] {
  width: 17px; height: 17px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 50%;
  background: transparent;
  appearance: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  padding: 0;
  transition: border-color var(--ease-fast);
}
input[type="radio"]:checked { border-color: var(--text-white); }
input[type="radio"]:checked::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--text-white);
}

/* checkbox */
input[type="checkbox"] {
  width: 17px; height: 17px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 4px;
  background: transparent;
  appearance: none;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
  padding: 0;
  transition: border-color var(--ease-fast), background var(--ease-fast);
}
input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px; left: 5px;
  width: 5px; height: 8px;
  border-right: 2px solid #010811;
  border-bottom: 2px solid #010811;
  transform: rotate(45deg);
}

/* toggle switch */
.toggle-wrap { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle {
  width: 40px; height: 22px;
  border-radius: 100px;
  background: rgba(255,255,255,0.15);
  position: relative;
  transition: background var(--ease-fast);
  flex-shrink: 0;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: '';
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform var(--ease-fast);
}
.toggle.on::after { transform: translateX(18px); }

/* ── LISTS / TILES ── */
.list-tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  transition: background var(--ease-fast);
  cursor: pointer;
}
.list-tile:hover { background: rgba(255,255,255,0.06); }
.list-tile.active { background: var(--accent-light); }

/* ── AVATAR ── */
.avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: var(--w-semibold);
  flex-shrink: 0;
  color: white;
}
.avatar-sm { width: 34px; height: 34px; font-size: 13px; }
.avatar-lg { width: 56px; height: 56px; font-size: 20px; }

/* ── SCROLLABLE CONTENT ── */
.scroll-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.scroll-content::-webkit-scrollbar { width: 4px; }
.scroll-content::-webkit-scrollbar-track { background: transparent; }
.scroll-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── MODAL / SHEET OVERLAY ── */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.overlay.show { display: flex; }

.bottom-sheet {
  width: 100%;
  max-width: 600px;
  background: #0d2030;
  border-radius: 20px 20px 0 0;
  border-top: 1px solid rgba(255,255,255,0.12);
  padding: 12px 0 0;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s cubic-bezier(0.4,0,0.2,1);
}
@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
.sheet-handle {
  width: 36px; height: 4px;
  background: rgba(255,255,255,0.18);
  border-radius: 2px;
  margin: 0 auto 16px;
}
.sheet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
.sheet-title {
  font-size: 15px;
  font-weight: var(--w-semibold);
  color: var(--text-white);
}
.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}
.sheet-body::-webkit-scrollbar { width: 3px; }
.sheet-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* modal centered */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; }
.modal-box {
  background: #0d2030;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-card);
  padding: 28px;
  width: 100%;
  max-width: 420px;
  animation: fadeScale 0.25s ease;
}
@keyframes fadeScale {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
.modal-title {
  font-size: 16px;
  font-weight: var(--w-semibold);
  margin-bottom: 10px;
}
.modal-body {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.65;
}
.modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* ── NOTIFICATIONS BADGE ── */
.notif-badge {
  position: relative;
  display: inline-flex;
}
.notif-dot {
  position: absolute;
  top: 2px; right: 2px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--error);
  border: 1.5px solid #081a24;
}
.notif-count {
  position: absolute;
  top: -4px; right: -6px;
  background: var(--error);
  color: white;
  font-size: 9px;
  font-weight: var(--w-bold);
  min-width: 16px;
  height: 16px;
  border-radius: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #081a24;
  padding: 0 3px;
}

/* ── TABS ── */
.tab-bar {
  display: flex;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: transparent;
  overflow-x: auto;
  scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  flex: 1;
  min-width: fit-content;
  padding: 11px 16px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-main);
  font-size: 13px;
  font-weight: var(--w-medium);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--ease-fast), border-color var(--ease-fast);
  text-align: center;
}
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── KANBAN STAGE TABS ── */
.stage-tab-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 10px 14px;
  min-width: 90px;
}
.stage-tab-count {
  font-size: 18px;
  font-weight: var(--w-bold);
  color: var(--text-white);
  line-height: 1;
}
.stage-tab-label {
  font-size: 10px;
  color: var(--text-secondary);
}
.stage-tab-btn.active .stage-tab-label { color: var(--accent); }

/* ── LEAD CARD ── */
.lead-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 16px;
  cursor: pointer;
  transition: all var(--ease-fast);
  margin-bottom: 10px;
  position: relative;
}
.lead-card:hover { border-color: var(--glass-border-hover); background: var(--glass-bg-hover); transform: translateY(-1px); }
.lead-card.is-qualified { border-left: 3px solid var(--warning); }
.lead-card-name { font-size: 14px; font-weight: var(--w-semibold); color: var(--text-white); margin-bottom: 4px; }
.lead-card-stage-line { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; }
.lead-card-fields { display: flex; flex-direction: column; gap: 4px; }
.lead-card-field { font-size: 11px; color: var(--text-secondary); }
.lead-card-field span { color: var(--text-white); }
.lead-card-badges { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ── FUNNEL TILE ── */
.funnel-tile {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 10px;
}
.funnel-icon {
  width: 42px; height: 42px; min-width: 42px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  padding: 10px;
  box-sizing: border-box;
}
.funnel-icon svg { color: var(--accent); width: 100%; height: 100%; display: block; }

/* ── DASHBOARD CARDS ── */
.metric-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
  padding: 12px 14px;
  flex: 1;
  min-width: 0;
}
.metric-chip-value {
  font-size: 22px;
  font-weight: var(--w-extrabold);
  color: var(--text-white);
  line-height: 1;
}
.metric-chip-label {
  font-size: 10px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.metric-chip.total .metric-chip-value { color: var(--text-white); }
.metric-chip.qualified .metric-chip-value { color: var(--accent); }
.metric-chip.won .metric-chip-value { color: var(--success); }
.metric-chip.lost .metric-chip-value { color: var(--error); }

/* ── FUNNEL CHART BAR ── */
.funnel-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.funnel-bar-label {
  font-size: 11px;
  color: var(--text-secondary);
  min-width: 90px;
  flex-shrink: 0;
}
.funnel-bar-track {
  flex: 1;
  height: 8px;
  background: rgba(255,255,255,0.07);
  border-radius: 4px;
  overflow: hidden;
}
.funnel-bar-fill { height: 100%; border-radius: 4px; transition: width 0.5s ease; }
.funnel-bar-count {
  font-size: 12px;
  font-weight: var(--w-semibold);
  color: var(--text-white);
  min-width: 24px;
  text-align: right;
  flex-shrink: 0;
}

/* ── ADMIN CLIENT CARD ── */
.client-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-card);
  padding: 18px;
  margin-bottom: 10px;
  transition: border-color var(--ease-fast);
}
.client-card:hover { border-color: var(--glass-border-hover); }

/* ── NOTIFICATION TILE ── */
.notif-tile {
  display: flex;
  gap: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--ease-fast);
}
.notif-tile.unread {
  background: rgba(47,167,184,0.06);
  border-color: rgba(47,167,184,0.15);
}
.notif-tile:hover { background: rgba(255,255,255,0.06); }
.notif-icon {
  width: 38px; height: 38px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.notif-icon.type-newLead { background: rgba(47,167,184,0.18); color: var(--accent); }
.notif-icon.type-reminder { background: rgba(245,158,11,0.18); color: var(--warning); }
.notif-icon.type-system { background: rgba(99,160,220,0.18); color: #63a0dc; }
.notif-icon.type-warning { background: rgba(239,68,68,0.18); color: var(--error); }

/* ── SETTINGS MENU ITEM ── */
.settings-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  margin-bottom: 8px;
  cursor: pointer;
  transition: all var(--ease-fast);
}
.settings-item:hover { background: var(--glass-bg-hover); border-color: var(--glass-border-hover); }
.settings-item-icon {
  width: 38px; height: 38px; min-width: 38px;
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
  overflow: hidden;
  padding: 9px;
  box-sizing: border-box;
}
.settings-item-icon svg,
.settings-item-icon > div > svg {
  width: 100%; height: 100%; display: block;
}
.settings-item-text { flex: 1; min-width: 0; }
.settings-item-label { font-size: 14px; font-weight: var(--w-medium); color: var(--text-white); }
.settings-item-sub { font-size: 12px; color: var(--text-secondary); }

/* ── STEP INDICATOR ── */
.step-indicator {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 16px 20px;
}
.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: var(--w-semibold);
  color: var(--text-secondary);
  flex-shrink: 0;
  transition: all var(--ease-fast);
}
.step-dot.active { background: var(--accent); border-color: var(--accent); color: #010811; }
.step-dot.done { background: rgba(34,197,94,0.2); border-color: var(--success); color: var(--success); }
.step-line { flex: 1; height: 1px; background: rgba(255,255,255,0.1); }
.step-line.done { background: var(--success); }

/* ── IMPERSONATION BANNER ── */
.impersonation-banner {
  background: var(--accent);
  color: #010811;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: var(--w-medium);
  flex-shrink: 0;
}

/* ── ERROR / SUCCESS BANNERS ── */
.alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  margin-bottom: 16px;
}
.alert-error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #ff8080; }
.alert-success { background: rgba(34,197,94,0.15); border: 1px solid rgba(34,197,94,0.3); color: #6ee7a0; }

/* ── SNACKBAR ── */
#snackbar {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: rgba(30,50,65,0.97);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: var(--radius-pill);
  padding: 12px 22px;
  font-size: 13px;
  color: var(--text-white);
  z-index: 9999;
  transition: transform 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
#snackbar.show { transform: translateX(-50%) translateY(0); }
#snackbar.success { border-color: rgba(34,197,94,0.4); color: #6ee7a0; }
#snackbar.error { border-color: rgba(239,68,68,0.4); color: #ff8080; }

/* ── SECTION HEADER ── */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.section-title {
  font-size: 13px;
  font-weight: var(--w-semibold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ── DIVIDER ── */
.divider { height: 1px; background: rgba(255,255,255,0.07); margin: 16px 0; }

/* ── EMPTY STATE ── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  gap: 14px;
}
.empty-icon {
  width: 56px; height: 56px; min-width: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 14px;
  box-sizing: border-box;
  flex-shrink: 0;
}
.empty-icon svg { color: var(--text-secondary); width: 100%; height: 100%; display: block; }
.empty-title { font-size: 15px; font-weight: var(--w-semibold); }
.empty-sub { font-size: 13px; color: var(--text-secondary); }

/* ── FILTER CHIP ── */
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 100px;
  background: rgba(47,167,184,0.18);
  border: 1px solid rgba(47,167,184,0.3);
  color: var(--accent);
  font-size: 11px;
  font-weight: var(--w-medium);
  cursor: pointer;
  transition: all var(--ease-fast);
}
.filter-chip:hover { background: rgba(47,167,184,0.25); }
.filter-chip.inactive {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.1);
  color: var(--text-secondary);
}
.filter-chip.inactive:hover { background: rgba(255,255,255,0.1); color: var(--text-white); }

/* ── STAGE COLOR SELECT ── */
.color-swatch-row { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  width: 26px; height: 26px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color var(--ease-fast);
}
.color-swatch.selected { border-color: white; }

/* ── LOGIN SPECIFIC ── */
.login-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(135deg, #102835 0%, #081a24 50%, #050e15 100%);
}
.login-card {
  width: 100%;
  max-width: 420px;
}
.login-logo { text-align: center; margin-bottom: 36px; }
.login-form-card {
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 24px;
  padding: 32px 28px;
}
.demo-accounts {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 16px;
  margin-top: 20px;
}
.demo-account-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background var(--ease-fast);
}
.demo-account-row:hover { background: rgba(255,255,255,0.07); }

/* ── FADE-IN ANIMATION ── */
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.anim-up { animation: fadeSlideUp 0.45s cubic-bezier(0.4,0,0.2,1) both; }
.delay-1 { animation-delay: 0.06s; }
.delay-2 { animation-delay: 0.12s; }
.delay-3 { animation-delay: 0.18s; }
.delay-4 { animation-delay: 0.24s; }

/* ── UTILITIES ── */
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 12px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mt-8 { margin-top: 32px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.text-center { text-align: center; }
.text-accent { color: var(--accent); }
.text-secondary { color: var(--text-secondary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 13px; }
.text-xs { font-size: 11px; }
.font-semibold { font-weight: var(--w-semibold); }
.font-bold { font-weight: var(--w-bold); }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-4 { padding: 16px; }
.p-5 { padding: 20px; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 8px; }

/* ── RESPONSIVE ── */
@media (min-width: 600px) {
  .bottom-sheet { margin: 0 auto; border-radius: 20px 20px 0 0; }
  .kanban-title-desktop { display: block !important; }
}
@media (max-width: 599px) {
  .kanban-title-desktop { display: none; }
  .grid-4 { grid-template-columns: repeat(2,1fr); }
}

/* ── COPY FEEDBACK ── */
.copy-feedback {
  font-size: 11px;
  color: var(--success);
  opacity: 0;
  transition: opacity 0.2s;
}
.copy-feedback.show { opacity: 1; }

/* ── STATUS PILLS (admin) ── */
.status-pill {
  padding: 4px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: var(--w-medium);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--ease-fast);
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
}
.status-pill.selected-active { background: rgba(34,197,94,0.2); color: var(--success); border-color: rgba(34,197,94,0.3); }
.status-pill.selected-inactive { background: rgba(180,180,181,0.15); color: var(--text-secondary); border-color: rgba(180,180,181,0.2); }
.status-pill.selected-overdue { background: rgba(239,68,68,0.2); color: var(--error); border-color: rgba(239,68,68,0.3); }

/* ── SEARCH BAR ── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  margin: 12px 0;
  transition: border-color var(--ease-fast);
}
.search-bar:focus-within { border-color: rgba(255,255,255,0.22); }
.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-white);
  font-family: var(--font-main);
  font-size: 14px;
  outline: none;
  padding: 0;
}
.search-bar input::placeholder { color: rgba(255,255,255,0.25); }

/* ── FAB ── */
.fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #010811;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(47,167,184,0.4);
  transition: all var(--ease-fast);
  z-index: 100;
}
.fab:hover { background: var(--accent-hover); transform: scale(1.06); }
.fab svg { width: 24px; height: 24px; }

/* ── DRAG HANDLE DOTS ── */
.drag-dots { color: rgba(255,255,255,0.2); font-size: 18px; cursor: grab; padding: 0 4px; }

/* ── TEAM MEMBER ── */
.team-member-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 8px;
}

/* ── KANBAN BOARD ── */
.kanban-board-wrapper {
  flex: 1;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 12px 8px;
  -webkit-overflow-scrolling: touch;
}
.kanban-board {
  display: flex;
  gap: 10px;
  height: 100%;
  min-height: 400px;
  align-items: flex-start;
}
.kanban-column {
  flex-shrink: 0;
  width: 220px;
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  overflow: hidden;
  max-height: calc(100vh - 180px);
  transition: background 0.18s ease, border-color 0.18s ease;
}
.kanban-col-cards {
  flex: 1;
  overflow-y: auto;
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
/* Scrollbar styling for kanban */
.kanban-board-wrapper::-webkit-scrollbar { height: 5px; }
.kanban-board-wrapper::-webkit-scrollbar-track { background: rgba(255,255,255,0.04); border-radius: 3px; }
.kanban-board-wrapper::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
.kanban-col-cards::-webkit-scrollbar { width: 3px; }
.kanban-col-cards::-webkit-scrollbar-track { background: transparent; }
.kanban-col-cards::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Lead card drag state */
.lead-card[draggable="true"] { cursor: grab; }
.lead-card[draggable="true"]:active { cursor: grabbing; }

/* ── FUNNEL CHART BARS ── */
.funnel-bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.funnel-bar-label {
  font-size: 10px;
  color: var(--text-secondary);
  min-width: 80px;
  text-align: right;
}
.funnel-bar-track {
  flex: 1;
  height: 18px;
  background: rgba(255,255,255,0.06);
  border-radius: 4px;
  overflow: hidden;
}
.funnel-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}
.funnel-bar-count {
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  text-align: right;
}

/* ── SCREEN full height for kanban ── */
#screen-kanban {
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

/* ── LEAD DETAIL MODAL (fixed, full-height, scrollable) ── */
.lead-detail-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-height: 92vh;
  max-height: 92dvh;
  background: #0d1f2d;
  border-radius: 20px 20px 0 0;
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Important: container does NOT scroll */
  z-index: 1000;
}
.lead-detail-inner {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}
.lead-detail-scroll-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px 20px 32px;
}
.lead-detail-scroll-body::-webkit-scrollbar { width: 3px; }
.lead-detail-scroll-body::-webkit-scrollbar-track { background: transparent; }
.lead-detail-scroll-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── NOTIFICATION STYLES ── */
.notif-filter-chip {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(255,255,255,0.06);
  color: var(--text-secondary);
  transition: all 0.18s ease;
  white-space: nowrap;
}
.notif-filter-chip.active {
  background: rgba(47,167,184,0.18);
  border-color: rgba(47,167,184,0.35);
  color: var(--accent);
}
.notif-type-pill {
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  flex-shrink: 0;
}
.notif-type-pill.type-newLead { background: rgba(47,167,184,0.15); color: var(--accent); }
.notif-type-pill.type-reminder { background: rgba(245,158,11,0.15); color: var(--warning); }
.notif-type-pill.type-system { background: rgba(34,197,94,0.15); color: var(--success); }
.notif-type-pill.type-warning { background: rgba(239,68,68,0.15); color: var(--error); }
.notif-envelope {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.notif-envelope.unread { background: rgba(47,167,184,0.15); color: var(--accent); }
.notif-envelope.read { background: rgba(255,255,255,0.06); color: var(--text-secondary); }
.notif-tile.unread { background: rgba(47,167,184,0.06); }
.notif-tile.read { opacity: 0.75; }

/* ── INVESTMENT CHIPS ── */
.invest-chip {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  padding: 8px 10px;
}
.invest-chip-value {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-white);
  line-height: 1.2;
}
.invest-chip-label {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.2;
}

/* ── PERIOD SELECTOR ── */
.period-selector {
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 100px;
  padding: 3px;
  border: 1px solid rgba(255,255,255,0.08);
}
.period-btn {
  padding: 4px 11px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  transition: all 0.18s ease;
  display: flex;
  align-items: center;
  gap: 4px;
}
.period-btn.active {
  background: var(--accent);
  color: #010811;
  font-weight: 700;
}

/* ── ICON BOX UTILITY ───────────────────────────────────────── */
/* Universal safe icon container: SVG always fits, never bleeds */
.icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  box-sizing: border-box;
}
.icon-box svg,
.icon-box > div > svg,
.funnel-icon svg,
.empty-icon svg {
  width: 100% !important;
  height: 100% !important;
  display: block;
  max-width: 100%;
  max-height: 100%;
}
