/* ==========================================================================
   pds Tech CRM — styled to match the pds Tech Brand Guidelines v1.4
   ========================================================================== */

:root {
  --ink: #12203a;
  --paper: #f7f6f2;
  --accent: #1e9e8c;
  --accent-text: #2bb8a3;
  --accent-dark: #147567;
  --muted: #c3c9d6;
  --line: rgba(247, 246, 242, 0.14);
  --line-soft: rgba(247, 246, 242, 0.16);
  --card: rgba(247, 246, 242, 0.045);
  --card-strong: rgba(247, 246, 242, 0.06);

  --font-display: "Poppins", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;

  --radius-xs: 8px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body { width: 100%; min-height: 100vh; }

/* Backstop for iOS rubber-band overscroll, which can reveal a sliver of
   html's own background beyond body's box — without this it's the
   browser's default white, since only body has the themed gradient. */
html { background: #060c18; }

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(ellipse 140% 40% at 50% 0%, #123a3f 0%, rgba(18, 58, 63, 0) 60%),
    linear-gradient(180deg, #060c18 0%, #0a1c2e 30%, #0b2830 62%, #0e332f 100%);
  background-repeat: no-repeat;
  background-attachment: fixed;
  min-height: 100vh;
}

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.01em; color: var(--paper); margin: 0; }
h2 { font-size: clamp(22px, 3vw, 28px); }
h3 { font-size: 16px; font-weight: 700; margin-bottom: 10px; }
p { color: var(--muted); margin: 0; }

.hidden { display: none !important; }

.eyebrow {
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-text);
  letter-spacing: 0.01em;
  margin: 14px 0 4px;
}

.muted { color: var(--muted); font-size: 0.85em; }
.error { color: #f2879e; font-size: 0.9em; min-height: 1.2em; }
.success { color: var(--accent-text); font-size: 0.9em; min-height: 1.2em; }

/* --------------------------------- Modal ---------------------------------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
}

.modal-box,
.card.modal-box {
  width: min(440px, 100%);
  max-width: 100%;
  box-sizing: border-box;
  background: #0d1522 !important;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.8);
  padding: 24px;
}

.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 12px;
}
@media (max-width: 480px) {
  .form-grid-2col { grid-template-columns: 1fr; }
}

.modal-box input,
.modal-box select,
.modal-box textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  margin: 8px 0;
  background: rgba(6, 12, 24, 0.6);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 14px;
}

.modal-box textarea {
  resize: vertical;
  min-height: 90px;
  max-height: 50vh;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.modal-box input:focus-visible,
.modal-box select:focus-visible,
.modal-box textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.modal-box select { cursor: pointer; }

input[type="datetime-local"],
input[type="date"],
input[type="time"] {
  color-scheme: dark;
  cursor: pointer;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator,
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="time"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  filter: invert(1) brightness(1.2);
  opacity: 0.85;
  padding: 4px;
  border-radius: 4px;
  transition: opacity 0.15s, background-color 0.15s;
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover,
input[type="date"]::-webkit-calendar-picker-indicator:hover,
input[type="time"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
  background: rgba(30, 158, 140, 0.25);
}

.btn-time-chip {
  background: rgba(247, 246, 242, 0.06);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  padding: 3px 8px;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s;
}

.btn-time-chip:hover {
  background: rgba(30, 158, 140, 0.18);
  color: var(--accent-text);
  border-color: var(--accent);
}

.textarea-resize-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 8px 0 2px;
  gap: 8px;
}
.text-xs { font-size: 11.5px; }

.resize-pill-group {
  display: flex;
  gap: 4px;
}

.btn-pill {
  background: rgba(247, 246, 242, 0.08);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11px;
  padding: 3px 9px;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1.2;
  font-family: var(--font-body);
}

.btn-pill:hover,
.btn-pill.active {
  background: var(--accent);
  color: #060c18;
  border-color: var(--accent);
  font-weight: 600;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

/* --------------------------------- Card ---------------------------------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 26px;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.attribution-table { width: 100%; border-collapse: collapse; font-size: 13.5px; margin-top: 12px; }
.attribution-table th {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 6px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.attribution-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); color: var(--paper); }
.attribution-table tr:last-child td { border-bottom: none; }

/* -------------------------------- Buttons -------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 15px;
  padding: 12px 22px;
  border-radius: var(--radius-xs);
  border: 1px solid transparent;
  transition: background-color 0.15s var(--ease), border-color 0.15s var(--ease), color 0.15s var(--ease), transform 0.15s var(--ease);
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #0a1220; }
.btn-primary:hover { background: #3dd9c4; }
.btn-outline { background: transparent; color: var(--paper); border-color: var(--line-soft); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
/* Destructive actions (delete/discard) — same red as .error, so "this removes
   something" reads consistently everywhere rather than looking identical to
   a safe action like Edit. */
.btn-danger { background: transparent; color: #f2879e; border-color: rgba(242, 135, 158, 0.35); }
.btn-danger:hover { background: rgba(242, 135, 158, 0.12); border-color: #f2879e; }
.btn-block { width: 100%; margin-top: 14px; }
.btn-sm { padding: 8px 16px; font-size: 13px; }

.link-btn {
  display: inline-block;
  margin-top: 10px;
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-text);
  font-size: 0.85em;
  text-decoration: underline;
  cursor: pointer;
  font-family: var(--font-body);
}
.link-btn:hover { color: var(--accent); }

/* ---------------------------------- Login --------------------------------- */
#login-view, #reset-password-view {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
}

.login-box { width: 340px; text-align: left; }
.login-box .logo-img { margin-bottom: 4px; }

.login-box input {
  width: 100%;
  padding: 11px 12px;
  margin: 8px 0;
  background: rgba(6, 12, 24, 0.6);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  color: var(--paper);
  font-family: var(--font-body);
}
.login-box input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

/* ----------------------------------- Nav ---------------------------------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 500;
  background: rgba(6, 12, 24, 0.72);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.nav-brand:hover {
  opacity: 0.88;
}

.nav-brand:active {
  transform: scale(0.97);
}

.nav-brand:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
  border-radius: var(--radius-xs);
}

/* ------------------------------ Global search ------------------------------ */
.global-search {
  position: relative;
  flex: 1 1 300px;
  max-width: 440px;
  min-width: 180px;
}

.nav-user-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.nav-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: var(--radius-xs);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-btn-icon {
  font-size: 14px;
  line-height: 1;
}

/* -------------------------- User Profile Dropdown ------------------------- */
.user-menu-wrap {
  position: relative;
  display: inline-block;
}

.user-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 5px;
  background: rgba(247, 246, 242, 0.05);
  border: 1px solid var(--line-soft);
  border-radius: 9999px;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  user-select: none;
}

.user-profile-btn:hover,
.user-profile-btn:focus-visible {
  background: rgba(247, 246, 242, 0.1);
  border-color: var(--accent);
  outline: none;
}

.user-avatar-circle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
  color: #060c18;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(30, 158, 140, 0.35);
  flex-shrink: 0;
}

.user-profile-name {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-profile-chevron {
  font-size: 10px;
  color: var(--muted);
  transition: transform 0.2s var(--ease);
  margin-left: 1px;
}

.user-menu-wrap.open .user-profile-chevron {
  transform: rotate(180deg);
}

.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  background: #0b1424;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 0 1px rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 8px 0;
  z-index: 650;
  transform-origin: top right;
  animation: userDropdownAnim 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes userDropdownAnim {
  from { opacity: 0; transform: scale(0.95) translateY(-4px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.user-dropdown-header {
  padding: 10px 16px 12px;
}

.user-dropdown-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--paper);
  line-height: 1.3;
}

.user-dropdown-email {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
  word-break: break-all;
}

.badge-role {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 5px;
  background: rgba(30, 158, 140, 0.15);
  color: var(--accent-text);
  border: 1px solid rgba(30, 158, 140, 0.35);
  margin-top: 6px;
}

.user-dropdown-divider {
  height: 1px;
  background: var(--line);
  margin: 6px 0;
}

.user-dropdown-items {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 0 6px;
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: none;
  background: transparent;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-xs);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  box-sizing: border-box;
}

.user-menu-item:hover,
.user-menu-item:focus-visible {
  background: rgba(247, 246, 242, 0.08);
  color: var(--paper);
  outline: none;
}

.user-menu-item-icon {
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

.user-menu-danger {
  color: #fca5a5;
}

.user-menu-danger:hover,
.user-menu-danger:focus-visible {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
}
.global-search input {
  width: 100%;
  padding: 9px 12px;
  background: rgba(6, 12, 24, 0.6);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 13px;
}
.global-search input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.global-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  width: 360px;
  max-height: 420px;
  overflow-y: auto;
  background: #0d1522;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  z-index: 600;
  padding: 6px 0;
}
.global-search-group-label {
  padding: 8px 14px 4px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.global-search-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 14px;
  background: none;
  border: none;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 13.5px;
  cursor: pointer;
}
.global-search-item:hover, .global-search-item:focus-visible { background: var(--card-strong); }
.global-search-item .gs-sub { display: block; color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.global-search-empty { padding: 12px 14px; color: var(--muted); font-size: 13px; }

/* Contact/company info that opens something (email client, dialer, site,
   Google Meet) reads as a link — same accent used for LinkedIn badges. */
.info-link { color: var(--accent-text); text-decoration: none; }
.info-link:hover { text-decoration: underline; }

.app-title {
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--accent-text);
}

.wrap {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 28px;
  box-sizing: border-box;
}

.section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 12px;
}

.button-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* Splits the funnel toolbar into visually distinct clusters — create actions,
   browse/navigate actions, and occasional utilities — instead of one flat
   row where a "+ Deal" button looks no different from "Sync email". */
.toolbar-group {
  display: flex;
  gap: 8px;
  padding-left: 14px;
  border-left: 1px solid var(--line-soft);
}
.toolbar-group:first-child { padding-left: 0; border-left: none; }
.toolbar-group-utility { margin-left: auto; opacity: 0.85; }

/* --------------------------------- Funnel --------------------------------- */
.funnel-board {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.funnel-col {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  min-height: 220px;
}

.funnel-col h3 {
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.deal-card {
  background: rgba(6, 12, 24, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), transform 0.15s var(--ease);
}

.deal-card:hover { border-color: var(--accent); transform: translateY(-1px); }
.deal-card .amount { color: var(--accent-text); font-size: 0.85em; margin-top: 4px; }

/* --------------------------------- Deal view -------------------------------- */
#deal-section h2 { margin: 6px 0 18px; }

.deal-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.deal-col {
  min-width: 0;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}

/* Quick Note Composer */
.quick-note-composer {
  background: rgba(6, 12, 24, 0.45);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.quick-note-row {
  display: flex;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.quick-note-row select {
  width: 110px;
  flex-shrink: 0;
  padding: 7px 10px;
  background: rgba(6, 12, 24, 0.6);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 13px;
  box-sizing: border-box;
}

.quick-note-row input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  background: rgba(6, 12, 24, 0.6);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 13px;
  box-sizing: border-box;
}

.quick-note-composer textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 60px;
  max-height: 320px;
  padding: 8px 10px;
  background: rgba(6, 12, 24, 0.6);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 13px;
  line-height: 1.45;
  resize: vertical;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.quick-note-composer textarea:focus-visible,
.quick-note-row input:focus-visible,
.quick-note-row select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.quick-note-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.quick-note-msg {
  font-size: 11.5px;
  color: var(--accent-text);
  min-height: 14px;
}

#interaction-list {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.interaction-item,
#interaction-list li {
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
  font-size: 14px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.interaction-item:last-child,
#interaction-list li:last-child {
  border-bottom: none;
}

.interaction-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
  gap: 8px;
  flex-wrap: wrap;
}

.interaction-badge {
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-text);
}

.interaction-subject {
  font-weight: 600;
  color: var(--paper);
  font-size: 13.5px;
  margin-bottom: 4px;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.interaction-body {
  white-space: pre-wrap;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  word-break: break-word;
  overflow-wrap: anywhere;
  max-width: 100%;
  box-sizing: border-box;
}

.ai-output {
  white-space: pre-wrap;
  font-family: var(--font-body);
  background: rgba(6, 12, 24, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-top: 14px;
  min-height: 100px;
  max-height: 550px;
  overflow-y: auto;
  max-width: 100%;
  box-sizing: border-box;
  color: var(--paper);
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
  overflow-wrap: anywhere;
  resize: vertical;
}

/* Structured rendering for AI Deal Intelligence — the brief prompt asks
   Gemini for "### Section Header" markdown, but it used to just get
   dumped as flat text with the literal #'s and *'s showing. renderAiRichText()
   in app.js turns that into real headings/lists/bold; these rules give
   them actual visual hierarchy instead of looking identical to a paragraph. */
.ai-output p { margin: 0 0 10px; white-space: normal; }
.ai-output p:last-child { margin-bottom: 0; }
.ai-output ul, .ai-output ol { margin: 0 0 12px; padding-left: 22px; white-space: normal; }
.ai-output li { margin-bottom: 5px; line-height: 1.5; }
.ai-output li:last-child { margin-bottom: 0; }
.ai-output strong { color: var(--accent-text); font-weight: 700; }
.ai-output-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 20px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--accent-text);
}
.ai-output-heading:first-child { margin-top: 0; }
.ai-output-heading::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-text);
  flex-shrink: 0;
  box-shadow: 0 0 6px var(--accent-text);
}

/* Used by the assistant modal's header and the meeting sidebar's — the
   latter had this class with no matching rule anywhere, so it's been
   rendering as an unstyled default <button> until now. */
.close-x-btn {
  background: transparent;
  border: 1px solid var(--line-soft);
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s var(--ease), color 0.15s var(--ease);
}
.close-x-btn:hover { background: rgba(255, 255, 255, 0.08); color: var(--paper); }

.assistant-modal-box {
  width: min(560px, 100%);
  max-width: 100%;
  height: min(680px, 85vh);
  display: flex;
  flex-direction: column;
  background: #0d1522;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.6);
  padding: 20px;
  box-sizing: border-box;
}
.assistant-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.assistant-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-right: 4px;
}
.assistant-empty-state {
  margin: auto;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  max-width: 320px;
  padding: 20px;
}
.assistant-message { display: flex; }
.assistant-message-user { justify-content: flex-end; }
.assistant-message-bot { justify-content: flex-start; }
.assistant-bubble {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.5;
  word-break: break-word;
  overflow-wrap: anywhere;
}
.assistant-message-user .assistant-bubble {
  background: var(--accent);
  color: #06251f;
  border-bottom-right-radius: 4px;
}
.assistant-message-bot .assistant-bubble {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-soft);
  border-bottom-left-radius: 4px;
}
.assistant-message-bot .assistant-bubble p { margin: 0 0 8px; }
.assistant-message-bot .assistant-bubble p:last-child { margin-bottom: 0; }
.assistant-message-bot .assistant-bubble ul,
.assistant-message-bot .assistant-bubble ol { margin: 0 0 8px; padding-left: 20px; }
.assistant-message-bot .assistant-bubble li { margin-bottom: 3px; }
.assistant-message-bot .assistant-bubble strong { color: var(--accent-text); }
.assistant-typing {
  display: flex;
  gap: 4px;
  padding: 4px 0;
}
.assistant-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
  animation: assistantTypingBounce 1.2s infinite ease-in-out;
}
.assistant-typing span:nth-child(2) { animation-delay: 0.15s; }
.assistant-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes assistantTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
  30% { transform: translateY(-4px); opacity: 1; }
}
.assistant-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
  padding-top: 14px;
  margin-top: 4px;
  border-top: 1px solid var(--line-soft);
  flex-shrink: 0;
}
.assistant-input-row textarea {
  flex: 1;
  resize: none;
  max-height: 120px;
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.4;
  padding: 9px 12px;
}

@media (max-width: 640px) {
  .assistant-modal-box {
    width: 100%;
    height: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }
  .assistant-bubble { max-width: 92%; }
}

.brief-status-pill {
  font-size: 11.5px;
  color: var(--accent-text);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.2s ease;
}

.brief-status-pill.loading {
  color: #38bdf8;
  animation: pulse-brief-status 1.4s infinite ease-in-out;
}

@keyframes pulse-brief-status {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

#back-btn, .back-link {
  background: transparent;
  border: none;
  color: var(--accent-text);
  cursor: pointer;
  padding: 0 0 14px 0;
  font-size: 0.95em;
  font-weight: 600;
  display: inline-block;
}

#leads-section > p { margin-bottom: 18px; }

.lead-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 12px;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease;
  cursor: pointer;
  position: relative;
}
.lead-card:hover {
  border-color: rgba(30, 158, 140, 0.45);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.lead-card.lead-card-highlight {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(30, 158, 140, 0.4), 0 8px 24px rgba(30, 158, 140, 0.25);
  animation: leadCardPulse 2s ease-in-out infinite;
}
@keyframes leadCardPulse {
  0%, 100% {
    box-shadow: 0 0 0 2px rgba(30, 158, 140, 0.4), 0 8px 24px rgba(30, 158, 140, 0.25);
  }
  50% {
    box-shadow: 0 0 0 4px rgba(30, 158, 140, 0.65), 0 12px 32px rgba(30, 158, 140, 0.45);
  }
}
.lead-card .lead-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.lead-card .lead-who { font-weight: 700; color: var(--paper); word-break: break-word; overflow-wrap: anywhere; }
.lead-card .lead-email { color: var(--accent-text); font-size: 0.85em; word-break: break-word; overflow-wrap: anywhere; }
.lead-card .lead-meta { color: var(--muted); font-size: 0.8em; margin-top: 4px; }
.lead-card .lead-preview {
  margin-top: 10px;
  font-size: 13.5px;
  color: var(--muted);
  max-height: 3.4em;
  overflow: hidden;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
  transition: max-height 0.3s ease;
}
.lead-card.expanded .lead-preview {
  max-height: 600px;
  overflow-y: auto;
  color: var(--paper);
}
.lead-card-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  font-size: 12px;
}
.lead-card-click-hint {
  color: var(--accent-text);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.lead-card-click-hint:hover {
  text-decoration: underline;
}
.lead-expand-inline-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 11.5px;
  padding: 3px 8px;
  border-radius: 4px;
  transition: background 0.15s ease, color 0.15s ease;
}
.lead-expand-inline-btn:hover {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.08);
}
.lead-card .lead-enrichment {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--accent);
  background: rgba(30, 158, 140, 0.08);
  font-size: 13px;
  color: var(--paper);
}
.lead-card .lead-enrichment strong { color: var(--accent-text); display: block; margin-bottom: 3px; }
.lead-card .lead-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }

/* Lead Details Modal & Auto-Sync UI */
.lead-details-modal-box,
.card.lead-details-modal-box {
  width: 720px;
  max-width: 95vw;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: #0d1522 !important;
  border: 1px solid rgba(30, 158, 140, 0.4) !important;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.9), 0 0 0 1px rgba(255, 255, 255, 0.08) !important;
}
.lead-modal-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
}
.lead-details-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 14px;
  background: #111a29;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.ld-meta-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.ld-meta-item.ld-meta-full {
  grid-column: span 2;
}
.ld-meta-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ld-meta-val {
  font-size: 13.5px;
  color: var(--paper);
  word-break: break-word;
}
.ld-subject-box {
  background: #0d2226;
  border: 1px solid rgba(30, 158, 140, 0.35);
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.ld-subject-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent-text);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  flex-shrink: 0;
}
.ld-subject-text {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--paper);
  word-break: break-word;
}
.ld-message-box-wrap {
  background: #080e18;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.ld-box-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 16px;
  background: #101926;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ld-message-body {
  padding: 16px 18px;
  font-size: 14px;
  line-height: 1.65;
  color: #f7f6f2;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 340px;
  overflow-y: auto;
  font-family: inherit;
}
.leads-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--accent-text);
  background: rgba(30, 158, 140, 0.12);
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(30, 158, 140, 0.25);
  transition: opacity 0.2s ease;
}
.leads-sync-spinner {
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 2px solid rgba(30, 158, 140, 0.3);
  border-top-color: var(--accent-text);
  border-radius: 50%;
  animation: leadsSpin 0.8s linear infinite;
}
@keyframes leadsSpin {
  to { transform: rotate(360deg); }
}
.lead-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(30, 158, 140, 0.15);
  color: var(--accent-text);
}
.lead-status.discarded { background: rgba(247, 246, 242, 0.08); color: var(--muted); }
.lead-status.converted { background: rgba(30, 158, 140, 0.3); }

.lead-inbox-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(30, 158, 140, 0.15);
  color: #4fd1c5;
  border: 1px solid rgba(79, 209, 197, 0.28);
  padding: 1px 7px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.inline-new-company {
  display: flex;
  gap: 6px;
  margin: -4px 0 10px;
}
.inline-new-company input {
  flex: 1;
  min-width: 0;
  margin: 0 !important;
}
.inline-new-company select {
  flex: 1;
  min-width: 0;
  width: auto !important;
  margin: 0 !important;
}
.inline-new-company button {
  flex-shrink: 0;
  margin: 0 !important;
}
@media (max-width: 480px) {
  .inline-new-company {
    flex-direction: column;
  }
}

/* -------------------- Inline New Attribution Source ------------------- */
.inline-new-attribution {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 4px 0 14px;
  padding: 12px;
  background: rgba(6, 12, 24, 0.65);
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

.inline-new-attribution-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-text);
  margin-bottom: 2px;
}

.inline-new-attribution input {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box;
  font-size: 13.5px;
  padding: 10px 12px;
}

.inline-new-attribution-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inline-new-attribution-row select {
  flex: 1 1 auto;
  min-width: 0;
  width: auto !important;
  margin: 0 !important;
  font-size: 13px;
  padding: 9px 10px;
  box-sizing: border-box;
}

.inline-new-attribution-row button {
  flex-shrink: 0;
  margin: 0 !important;
  padding: 9px 16px;
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 480px) {
  .inline-new-attribution-row {
    flex-direction: column;
    align-items: stretch;
  }
  .inline-new-attribution-row select,
  .inline-new-attribution-row button {
    width: 100% !important;
  }
}

.brief-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
#suggested-matches-section {
  background: rgba(224, 161, 60, 0.06);
  border: 1px solid rgba(224, 161, 60, 0.25);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 20px;
}
#suggested-matches-section h3 { color: #e0a13c; margin-top: 0; }

.suggestion-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  font-size: 14px;
}
.suggestion-row:first-of-type { border-top: none; }
.suggestion-row .suggestion-actions { display: flex; gap: 8px; flex-shrink: 0; }

.funnel-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
#funnel-selector {
  background: rgba(6, 12, 24, 0.6);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  color: var(--accent-text);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 13px;
  padding: 7px 10px;
}

/* Directory navigation tabs */
.directory-toggle-bar {
  display: inline-flex;
  gap: 6px;
  background: rgba(6, 12, 24, 0.6);
  padding: 4px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  margin-bottom: 16px;
}
.dir-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--muted);
  padding: 8px 16px;
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dir-tab-btn:hover {
  color: var(--paper);
  background: rgba(247, 246, 242, 0.05);
}
.dir-tab-btn.active {
  background: rgba(30, 158, 140, 0.2);
  border-color: var(--accent);
  color: var(--accent-text);
  box-shadow: 0 2px 8px rgba(30, 158, 140, 0.2);
}

/* Expandable Master-Detail Lists */
.expandable-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 14px;
}

.expandable-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  transition: border-color 0.2s var(--ease), background-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
  overflow: hidden;
}
.expandable-card:hover {
  border-color: var(--line-soft);
  background: var(--card-strong);
}
.expandable-card.expanded {
  border-color: rgba(30, 158, 140, 0.45);
  background: rgba(10, 24, 38, 0.65);
  box-shadow: 0 8px 24px -6px rgba(0, 0, 0, 0.45);
}

.expandable-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  gap: 12px;
}
.expandable-header:hover .expandable-name {
  color: var(--accent-text);
}

.expandable-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  flex: 1;
}

.expandable-avatar {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.company-avatar {
  background: rgba(30, 158, 140, 0.15);
  border: 1px solid rgba(30, 158, 140, 0.35);
  color: var(--accent-text);
}
.contact-avatar {
  background: rgba(99, 102, 241, 0.18);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc;
  font-size: 13.5px;
  font-family: var(--font-display);
  letter-spacing: 0.02em;
}

.expandable-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 4px;
  flex: 1;
}
.expandable-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.expandable-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--paper);
  transition: color 0.15s ease;
}

.expandable-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.expand-chevron {
  font-size: 15px;
  color: var(--muted);
  transition: transform 0.25s var(--ease), color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-xs);
  background: rgba(247, 246, 242, 0.04);
  flex-shrink: 0;
}
.expandable-card.expanded .expand-chevron {
  transform: rotate(180deg);
  color: var(--accent-text);
  background: rgba(30, 158, 140, 0.18);
}

.pill-chip {
  font-size: 11.5px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(247, 246, 242, 0.06);
  border: 1px solid var(--line);
  color: var(--muted);
  white-space: nowrap;
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pill-company {
  background: rgba(30, 158, 140, 0.12);
  border-color: rgba(30, 158, 140, 0.28);
  color: var(--accent-text);
  font-weight: 600;
}
.pill-website {
  color: #93c5fd;
}
.pill-count {
  color: #cbd5e1;
}
.pill-email {
  color: #e2e8f0;
}
.pill-location {
  color: #fdba74;
  background: rgba(251, 146, 60, 0.1);
  border-color: rgba(251, 146, 60, 0.25);
}
.pill-phone {
  color: #a7f3d0;
  background: rgba(52, 211, 153, 0.1);
  border-color: rgba(52, 211, 153, 0.25);
}
.pill-industry {
  color: #e0e7ff;
  background: rgba(99, 102, 241, 0.1);
  border-color: rgba(99, 102, 241, 0.25);
}

.badge-ai-indicator {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(224, 161, 60, 0.16);
  border: 1px solid rgba(224, 161, 60, 0.38);
  color: #f6c065;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.badge-in-indicator {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  background: #0077b5;
  color: #fff;
  line-height: 1.3;
}

/* Expanded body layout */
.expandable-body {
  border-top: 1px solid var(--line);
  background: rgba(6, 12, 24, 0.38);
  animation: expandSlide 0.22s var(--ease);
}
@keyframes expandSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.expandable-body-inner {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.expandable-actions-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.expandable-details-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
}
.expandable-details-grid > div {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.detail-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}
.detail-val {
  font-size: 13.5px;
  color: var(--paper);
  font-weight: 500;
  word-break: break-word;
}

.detail-notes-box {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.detail-notes-text {
  background: rgba(6, 12, 24, 0.45);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--paper);
  white-space: pre-wrap;
  line-height: 1.5;
}

/* AI Research block in expanded view */
.ai-research-block {
  margin-top: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid #e0a13c;
  background: rgba(224, 161, 60, 0.08);
  font-size: 13px;
  color: var(--paper);
  white-space: pre-wrap;
}
.ai-research-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}
.ai-badge-label {
  color: #f6c065;
  font-weight: 700;
  font-size: 12px;
}
.ai-research-block .ai-disclaimer {
  color: #e0a13c;
  font-weight: 600;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.ai-research-sources {
  margin-top: 8px;
  font-size: 12px;
  word-break: break-all;
}
.ai-research-sources a {
  color: var(--accent-text);
  margin-right: 10px;
  text-decoration: underline;
}
.ai-research-updated {
  color: var(--muted);
  font-size: 11px;
  margin-top: 6px;
}

/* LinkedIn block in expanded view */
.contact-linkedin-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.linkedin-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #0077b5;
  color: #ffffff !important;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s ease;
  width: fit-content;
}
.linkedin-badge-btn:hover {
  background: #005f93;
}
.google-search-badge-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(99, 102, 241, 0.14);
  border: 1px solid rgba(99, 102, 241, 0.35);
  color: #a5b4fc !important;
  padding: 6px 12px;
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease;
  width: fit-content;
}
.google-search-badge-btn:hover {
  background: rgba(99, 102, 241, 0.24);
}
/* Linked Items (Contacts & Deals inside company/contact) */
.linked-section {
  background: rgba(247, 246, 242, 0.02);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.linked-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.linked-section-header h4 {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--paper);
  margin: 0;
}
.link-btn-accent {
  background: none;
  border: none;
  color: var(--accent-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.link-btn-accent:hover {
  text-decoration: underline;
}

.linked-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 8px;
}
.mini-card {
  background: rgba(6, 12, 24, 0.6);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12.5px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.mini-card:hover {
  border-color: var(--line-soft);
  background: rgba(6, 12, 24, 0.85);
}
.mini-card-deal {
  cursor: pointer;
}
.mini-card-deal:hover {
  border-color: var(--accent);
}
.mini-card-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.mini-card-name {
  font-weight: 600;
  color: var(--paper);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.mini-card-meta {
  color: var(--muted);
  font-size: 11.5px;
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.muted-loading {
  color: var(--muted);
  font-size: 12.5px;
  font-style: italic;
  margin: 4px 0;
}

/* Stage badges for deals */
.badge-stage {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  text-transform: capitalize;
  white-space: nowrap;
}
.badge-stage-prospecting { background: rgba(148, 163, 184, 0.15); color: #cbd5e1; border: 1px solid rgba(148, 163, 184, 0.3); }
.badge-stage-qualified { background: rgba(56, 189, 248, 0.15); color: #7dd3fc; border: 1px solid rgba(56, 189, 248, 0.3); }
.badge-stage-proposal { background: rgba(168, 85, 247, 0.15); color: #d8b4fe; border: 1px solid rgba(168, 85, 247, 0.3); }
.badge-stage-negotiation { background: rgba(251, 191, 36, 0.15); color: #fde047; border: 1px solid rgba(251, 191, 36, 0.3); }
.badge-stage-won { background: rgba(34, 197, 94, 0.15); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.3); }
.badge-stage-lost { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }

/* RSVP badges for scheduled meetings on the calendar */
.badge-rsvp { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 6px; text-transform: capitalize; white-space: nowrap; }
.badge-rsvp-pending { background: rgba(251, 191, 36, 0.15); color: #fde047; border: 1px solid rgba(251, 191, 36, 0.3); }
.badge-rsvp-accepted { background: rgba(34, 197, 94, 0.15); color: #86efac; border: 1px solid rgba(34, 197, 94, 0.3); }
.badge-rsvp-declined { background: rgba(239, 68, 68, 0.15); color: #fca5a5; border: 1px solid rgba(239, 68, 68, 0.3); }

.calendar-row-clickable { cursor: pointer; }
.calendar-row-clickable:hover { background: rgba(255, 255, 255, 0.04); }

.calendar-bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--card);
  border: 1px solid var(--line);
}
.calendar-select-all-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}
.calendar-row-checkbox {
  margin-right: 10px;
  cursor: pointer;
}

.deal-meeting-row {
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
.deal-meeting-row:hover {
  background: rgba(255, 255, 255, 0.05) !important;
  border-color: var(--accent, #1e9e8c) !important;
}

.pill-completed {
  background: rgba(34, 197, 94, 0.15) !important;
  color: #86efac !important;
  border: 1px solid rgba(34, 197, 94, 0.3) !important;
}
.pill-cancelled {
  background: rgba(239, 68, 68, 0.15) !important;
  color: #fca5a5 !important;
  border: 1px solid rgba(239, 68, 68, 0.3) !important;
}
.pill-active {
  background: rgba(59, 130, 246, 0.15) !important;
  color: #93c5fd !important;
  border: 1px solid rgba(59, 130, 246, 0.3) !important;
}
.pill-funnel {
  background: rgba(168, 85, 247, 0.15) !important;
  color: #d8b4fe !important;
  border: 1px solid rgba(168, 85, 247, 0.3) !important;
}

.btn-text-link {
  background: none;
  border: none;
  color: var(--accent-text);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-align: left;
  text-decoration: underline;
}
.btn-text-link:hover {
  color: var(--paper);
}

.company-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 10px;
}
.company-row .company-name { font-weight: 700; color: var(--paper); }
.company-row .company-meta { color: var(--muted); font-size: 0.85em; margin-top: 4px; }
.company-row .company-notes { color: var(--muted); font-size: 0.85em; margin-top: 6px; max-width: 480px; word-break: break-word; overflow-wrap: anywhere; }

.list-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.list-controls input,
.list-controls select {
  background: rgba(6, 12, 24, 0.6);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 10px;
}
.list-controls input { min-width: 220px; }

.stat-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.stat-tile { text-align: left; }
.stat-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 8px;
}
.stat-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
  color: var(--paper);
}

.dashboard-charts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.chart-card svg { width: 100%; height: auto; display: block; }
.chart-legend {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}
.chart-legend .swatch { display: inline-flex; align-items: center; gap: 5px; }
.chart-legend .dot { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }

@media (max-width: 860px) {
  .stat-tiles { grid-template-columns: 1fr; }
  .dashboard-charts { grid-template-columns: 1fr; }
}

.deal-info-card { margin-bottom: 20px; }
.deal-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
.deal-info-grid > div { display: flex; flex-direction: column; }
.deal-info-grid .label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 3px;
}
.deal-info-grid > div > span:last-child { font-size: 14px; color: var(--paper); font-weight: 600; text-transform: capitalize; }

.deal-stage-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 2px;
}

.deal-stage-control #di-stage {
  display: inline-flex;
}

.deal-stage-control select.di-stage-select {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--line);
  color: var(--paper);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  height: 28px;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.deal-stage-control select.di-stage-select:hover {
  border-color: var(--accent);
  background: rgba(15, 23, 42, 0.98);
}

.deal-stage-control select.di-stage-select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(30, 158, 140, 0.25);
}

.callout {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 14px;
  border-left: 3px solid var(--accent);
  background: rgba(30, 158, 140, 0.08);
}
.callout strong { color: var(--accent-text); display: block; margin-bottom: 4px; }
.callout p { color: var(--paper); margin: 0; }

.deal-contact-chip {
  display: inline-block;
  background: rgba(6, 12, 24, 0.5);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  margin: 0 8px 8px 0;
  font-size: 13px;
  max-width: 100%;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.mailbox-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.mailbox-row:last-child { border-bottom: none; }

.brief-controls select {
  background: rgba(6, 12, 24, 0.6);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-xs);
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 8px 10px;
}

/* ==========================================================================
   Responsive & Mobile Ergonomics
   ========================================================================== */

@media (max-width: 1080px) and (min-width: 769px) {
  .funnel-board {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    width: 100%;
  }
  .deal-info-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .wrap {
    padding: 20px 16px;
    width: 100%;
  }
  .nav-inner {
    padding: 12px 18px;
    width: 100%;
  }
}

@media (max-width: 768px) {
  html, body {
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100vw;
  }

  body {
    /* background-attachment:fixed is well-documented as unreliable on
       mobile Safari/Chrome during fast/momentum scroll — it can fail to
       repaint in time, flashing the page's raw white beneath it before
       the gradient catches up. "scroll" paints it as part of the normal
       page content instead, which doesn't have this failure mode. */
    background-attachment: scroll;
  }

  #app-view {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }

  /* Prevent automatic iOS/Android text zoom on inputs */
  input, select, textarea {
    font-size: 16px !important;
  }

  .wrap {
    padding: 12px 10px;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
  }

  /* Header Layout on Mobile:
     Row 1: Brand (left) and compact action pills (right)
     Row 2: Full-width search bar
  */
  .nav {
    padding: 0;
    width: 100%;
  }

  .nav-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    gap: 8px 6px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .nav-brand {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
  }

  .nav-brand .logo-img {
    width: 95px;
    height: auto;
  }

  .nav-brand .app-title {
    font-size: 14px;
  }

  .nav-user-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
  }

  .nav-user-actions .btn-sm,
  .nav-pill-btn {
    padding: 5px 8px;
    font-size: 11px;
    border-radius: 6px;
    gap: 4px;
    white-space: nowrap;
  }

  .nav-pill-btn .nav-btn-icon {
    font-size: 13px;
  }

  .user-profile-btn {
    padding: 3px 8px 3px 4px;
    gap: 6px;
    font-size: 12px;
  }

  .user-avatar-circle {
    width: 25px;
    height: 25px;
    font-size: 11px;
  }

  .user-profile-name {
    max-width: 85px;
  }

  .user-menu-dropdown {
    right: 0;
    max-width: calc(100vw - 20px);
    width: 260px;
    z-index: 700;
  }

  @media (max-width: 520px) {
    .nav-pill-btn .nav-btn-label {
      display: none;
    }
    .user-profile-name {
      display: none;
    }
    .user-profile-btn {
      padding: 3px 6px 3px 3px;
      gap: 4px;
    }
  }

  .global-search {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    order: 3;
    margin: 4px 0 0 0;
    flex: 1 1 100%;
  }

  .global-search input {
    width: 100%;
    padding: 8px 12px;
    font-size: 14px;
    box-sizing: border-box;
  }

  .global-search-results {
    width: 100%;
    left: 0;
    right: 0;
  }

  /* Funnel Header & Toolbar:
     Row 1: Title + Selector
     Row 2: 5 Section Navigation Pills (Companies, Contacts, Leads, Dashboard, Calendar)
     Row 3: 3 Creation Buttons (+ Company, + Contact, + Deal)
     Row 4: 2 Utility Buttons (Sync Email, View Trash)
  */
  .section-head-row {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    width: 100%;
    margin-bottom: 12px;
  }

  .funnel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .button-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .toolbar-group {
    padding-left: 0;
    border-left: none;
    margin: 0;
    width: 100%;
  }

  .toolbar-group-nav {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 5px;
    width: 100%;
  }

  .toolbar-group-nav .btn {
    width: 100%;
    padding: 7px 2px;
    font-size: 11.5px;
    text-align: center;
    min-width: 0;
    box-sizing: border-box;
  }

  .toolbar-group-create {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    width: 100%;
  }

  .toolbar-group-create .btn {
    width: 100%;
    padding: 7px 4px;
    font-size: 11.5px;
    text-align: center;
    min-width: 0;
    box-sizing: border-box;
  }

  .toolbar-group-utility {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    width: 100%;
    margin-left: 0;
  }

  .toolbar-group-utility .btn {
    width: 100%;
    padding: 7px 6px;
    font-size: 11.5px;
    text-align: center;
    min-width: 0;
    box-sizing: border-box;
  }

  /* Funnel Pipeline Board:
     2-column grid that fills the full available mobile width
  */
  .funnel-board {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .funnel-col {
    width: 100%;
    min-width: 0;
    padding: 10px 8px;
    min-height: 160px;
    box-sizing: border-box;
  }

  .funnel-col h3 {
    font-size: 11px;
    margin-bottom: 8px;
  }

  .deal-card {
    padding: 8px 10px;
    margin-bottom: 6px;
    width: 100%;
    box-sizing: border-box;
    word-break: break-word;
  }

  .deal-card .amount {
    font-size: 12px;
    font-weight: 600;
  }

  /* Lists & Filters (Contacts, Companies, Leads) */
  .list-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  .list-controls input,
  .list-controls select {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .list-controls button {
    width: 100%;
  }

  /* Directory navigation on mobile */
  .directory-toggle-bar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    box-sizing: border-box;
  }
  .dir-tab-btn {
    justify-content: center;
    padding: 8px 4px;
    font-size: 12.5px;
    width: 100%;
    box-sizing: border-box;
  }

  /* Expandable Cards on mobile */
  .expandable-card {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .expandable-header {
    padding: 12px 10px;
    gap: 10px;
  }
  .expandable-summary {
    gap: 10px;
  }
  .expandable-avatar {
    width: 36px;
    height: 36px;
    font-size: 16px;
  }
  .expandable-body-inner {
    padding: 12px 10px;
    gap: 12px;
  }
  .expandable-actions-bar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    width: 100%;
  }
  .expandable-actions-bar .btn {
    width: 100%;
    padding: 7px 4px;
    font-size: 11.5px;
    text-align: center;
    min-width: 0;
    box-sizing: border-box;
  }
  .expandable-details-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .linked-cards-grid {
    grid-template-columns: 1fr;
  }
  .pill-chip {
    max-width: 180px;
  }

  .company-row, .lead-card {
    padding: 12px 10px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .lead-card .lead-actions {
    display: flex;
    gap: 6px;
    width: 100%;
    margin-top: 8px;
  }

  .lead-card .lead-actions button {
    flex: 1;
    padding: 7px 6px;
    font-size: 12px;
  }

  /* Deal Detail Screen */
  .deal-info-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
  }

  .deal-layout {
    grid-template-columns: 1fr;
    gap: 14px;
    width: 100%;
    max-width: 100%;
  }

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

  .quick-note-row {
    flex-direction: column;
    gap: 6px;
  }
  .quick-note-row select {
    width: 100%;
    font-size: 15px;
  }
  .quick-note-row input {
    font-size: 15px;
  }
  .quick-note-composer textarea {
    font-size: 15px;
    min-height: 70px;
  }

  /* Modals */
  .modal-overlay {
    align-items: flex-start;
    padding: 14px 10px;
  }

  .modal-box {
    width: min(440px, calc(100vw - 20px)) !important;
    max-width: calc(100vw - 20px) !important;
    max-height: 92vh;
    overflow-y: auto;
    padding: 18px 14px;
    margin: 8px auto;
    box-sizing: border-box;
  }

  .modal-box input,
  .modal-box select,
  .modal-box textarea {
    font-size: 16px; /* Prevents mobile browser auto-zoom */
    padding: 10px 12px;
  }

  .modal-box textarea {
    min-height: 100px;
  }

  .modal-actions {
    gap: 6px;
  }

  /* Login / Password Reset View */
  .login-box {
    width: min(340px, calc(100vw - 24px));
    padding: 24px 18px;
    margin: 16px auto;
  }
}

/* ==========================================================================
   Toast Notification System
   ========================================================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 999999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(440px, calc(100vw - 32px));
  pointer-events: none;
}

@media (max-width: 640px) {
  .toast-container {
    top: 14px;
    right: 14px;
    left: 14px;
    max-width: none;
  }
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm, 8px);
  background: rgba(13, 20, 36, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.1);
  color: var(--text, #f1f5f9);
  font-size: 13px;
  line-height: 1.45;
  animation: toast-slide-in 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.25s ease, transform 0.25s ease;
  border-left: 4px solid var(--accent, #6366f1);
}

.toast.toast-hiding {
  opacity: 0;
  transform: translateY(-8px) scale(0.96);
}

@keyframes toast-slide-in {
  from {
    opacity: 0;
    transform: translateY(-14px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.toast-icon {
  font-size: 16px;
  line-height: 1.2;
  flex-shrink: 0;
}

.toast-content {
  flex: 1;
  min-width: 0;
  word-break: break-word;
}

.toast-message {
  font-size: 12.5px;
  color: rgba(241, 245, 249, 0.95);
}

.toast-close {
  background: none;
  border: none;
  color: var(--muted, #94a3b8);
  cursor: pointer;
  padding: 0 4px;
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.15s ease;
}

.toast-close:hover {
  color: #ffffff;
}

.toast-success {
  border-left-color: #10b981;
}
.toast-success .toast-icon {
  color: #10b981;
}

.toast-info {
  border-left-color: #6366f1;
}
.toast-info .toast-icon {
  color: #818cf8;
}

.toast-error {
  border-left-color: #ef4444;
}
.toast-error .toast-icon {
  color: #ef4444;
}

.toast-warning {
  border-left-color: #f59e0b;
}
.toast-warning .toast-icon {
  color: #f59e0b;
}

/* -------------------- Home Priority Row (Actions & Dashboard) -------------------- */
.home-priority-row {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 16px;
  margin: 16px 0 24px;
  align-items: stretch;
}

.priority-panel,
.dashboard-mini-panel {
  display: flex;
  flex-direction: column;
  background: var(--card, #121824);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-md, 12px);
  padding: 16px 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  min-width: 0;
}

.priority-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft, rgba(255, 255, 255, 0.06));
  margin-bottom: 14px;
}

.priority-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.priority-title-wrap > div {
  /* .priority-subheading below is white-space:nowrap with ellipsis
     overflow — that only actually engages if this flex item is allowed
     to shrink below its unbroken text's natural width. Without this,
     the subheading's full sentence forces the whole title area wide
     regardless of viewport, pushing into/overlapping priority-header-
     badges (the "N Actions" pill + refresh button) on narrow screens. */
  min-width: 0;
}

.priority-icon {
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-xs, 6px);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-soft, rgba(255, 255, 255, 0.08));
  flex-shrink: 0;
}

.priority-heading {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: var(--paper, #f8fafc);
  letter-spacing: -0.01em;
}

.priority-subheading {
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--muted, #94a3b8);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.priority-header-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.badge-priority-count {
  background: rgba(57, 135, 229, 0.18);
  border: 1px solid rgba(57, 135, 229, 0.4);
  color: #60a5fa;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 9999px;
  letter-spacing: 0.02em;
}

.btn-icon-refresh {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-soft, rgba(255, 255, 255, 0.1));
  color: var(--muted, #94a3b8);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
}

.btn-icon-refresh:hover {
  color: var(--paper, #f8fafc);
  background: rgba(255, 255, 255, 0.1);
  transform: rotate(45deg);
}

/* Recommended actions list */
.recommended-actions-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 4px;
}

.recommended-actions-list::-webkit-scrollbar {
  width: 5px;
}
.recommended-actions-list::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.action-list-loading,
.action-list-empty {
  padding: 24px;
  text-align: center;
  color: var(--muted, #94a3b8);
  font-size: 13px;
}

.action-item-card {
  background: rgba(6, 12, 24, 0.6);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 8px);
  padding: 12px 14px;
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.action-item-card:hover {
  background: rgba(14, 23, 42, 0.85);
  border-color: rgba(57, 135, 229, 0.5);
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.3);
}

.action-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.action-tag {
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.action-tag.urgent {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.action-tag.high,
.action-tag.ai {
  background: rgba(57, 135, 229, 0.18);
  color: #60a5fa;
  border: 1px solid rgba(57, 135, 229, 0.4);
}

.action-tag.warning {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.action-tag.lead {
  background: rgba(20, 184, 166, 0.18);
  color: #2dd4bf;
  border: 1px solid rgba(20, 184, 166, 0.4);
}

.action-date-pill {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted, #94a3b8);
}

.action-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.action-entity-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--paper, #f8fafc);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

.action-entity-company {
  font-size: 12px;
  color: var(--muted, #94a3b8);
  margin-left: 6px;
  font-weight: normal;
}

.action-entity-amount {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-text, #38bdf8);
  flex-shrink: 0;
}

.action-item-detail {
  font-size: 12px;
  line-height: 1.45;
  color: #cbd5e1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

.action-item-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.action-stage-badge {
  font-size: 11px;
  color: var(--muted, #94a3b8);
  text-transform: capitalize;
}

.action-btn-link {
  font-size: 11.5px;
  font-weight: 600;
  color: #38bdf8;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.action-item-card:hover .action-btn-link {
  text-decoration: underline;
}

/* Home Pipeline Dashboard Panel */
.home-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.home-stat-box {
  background: rgba(6, 12, 24, 0.55);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.07));
  border-radius: var(--radius-sm, 8px);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.home-stat-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted, #94a3b8);
  margin-bottom: 4px;
}

.home-stat-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--paper, #f8fafc);
  font-family: var(--font-display, 'Poppins', sans-serif);
  line-height: 1.15;
}

.text-success { color: #10b981 !important; }
.text-accent { color: #38bdf8 !important; }

/* Stage Distribution bar */
.home-stage-distribution {
  background: rgba(6, 12, 24, 0.4);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.06));
  border-radius: var(--radius-sm, 8px);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.home-stage-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
}

.home-stage-label {
  font-weight: 600;
  color: var(--paper, #f8fafc);
}

.home-stage-sub {
  color: var(--muted, #94a3b8);
}

.home-stage-bar {
  height: 10px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  width: 100%;
}

.home-stage-segment {
  height: 100%;
  transition: width 0.3s ease;
  position: relative;
}

.home-stage-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.home-legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted, #94a3b8);
}

.home-legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* Boards Below Wrapper */
.funnel-board-wrapper {
  margin-top: 8px;
}

.board-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
}

.board-header-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.board-header-title h3 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--paper, #f8fafc);
}

.board-header-hint {
  font-size: 12px;
}

/* Responsive queries */
@media (max-width: 959px) {
  .home-priority-row {
    grid-template-columns: 1fr;
    gap: 14px;
    margin: 14px 0 20px;
  }
}

@media (max-width: 540px) {
  .home-stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .home-stat-val {
    font-size: 17px;
  }
}

/* -------------------- Disapprove / Delete AI Research -------------------- */
.btn-outline-danger {
  background: transparent;
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #f87171;
  font-weight: 600;
  transition: all 0.15s ease;
}
.btn-outline-danger:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: #ef4444;
  color: #ffffff;
}

.btn-disapprove-ai {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

.ai-research-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.disapprove-options-box {
  background: rgba(6, 12, 24, 0.6);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.disapprove-option-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12.5px;
  color: var(--paper);
  cursor: pointer;
  user-select: none;
}

.disapprove-option-row input[type="checkbox"] {
  margin-top: 3px;
  accent-color: #ef4444;
  cursor: pointer;
  width: 15px;
  height: 15px;
}

.disapprove-fields-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* -------------------- Contact AI Intelligence & Confidence -------------------- */
.contact-ai-card {
  background: rgba(8, 16, 32, 0.75);
  border: 1px solid rgba(30, 158, 140, 0.35);
  border-radius: var(--radius-sm, 8px);
  padding: 14px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
  position: relative;
}

.contact-ai-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.contact-ai-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.contact-ai-badge-label {
  font-size: 12px;
  font-weight: 700;
  color: #5eead4;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.confidence-pill {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2.5px 8px;
  border-radius: 9999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1.2;
}

.confidence-pill.confidence-high {
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.confidence-pill.confidence-medium {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.5);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.confidence-pill.confidence-low {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.5);
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.contact-ai-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.contact-ai-body {
  font-size: 13px;
  line-height: 1.55;
  color: #e2e8f0;
  word-break: break-word;
}

.contact-ai-body h3,
.contact-ai-body h4 {
  font-size: 12.5px;
  font-weight: 700;
  color: #5eead4;
  margin: 10px 0 4px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.contact-ai-body p {
  margin: 0 0 8px;
}

.contact-ai-body ul {
  margin: 4px 0 8px 18px;
  padding: 0;
}

.contact-ai-body li {
  margin-bottom: 3px;
}

.contact-ai-sources {
  font-size: 11.5px;
  color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  padding-top: 8px;
  margin-top: 4px;
}

.contact-ai-sources a {
  color: #38bdf8;
  text-decoration: underline;
  margin-right: 8px;
}

.contact-ai-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* ==========================================================================
   pds Tech Laser Scan Design for Searching / Loading Buttons
   Grounded directly in pds-tech.ai identity (teal laser sweep + ptPulse)
   ========================================================================== */

@keyframes ptPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(30, 158, 140, 0.7), 0 0 10px rgba(30, 158, 140, 0.35);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(30, 158, 140, 0), 0 0 18px rgba(30, 158, 140, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(30, 158, 140, 0), 0 0 8px rgba(30, 158, 140, 0);
  }
}

@keyframes pdsLaserSweep {
  0% {
    left: -80%;
    opacity: 0.1;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    left: 140%;
    opacity: 0.1;
  }
}

@keyframes pdsTextGlow {
  0%, 100% {
    text-shadow: 0 0 6px rgba(30, 158, 140, 0.5);
    color: #f1f5f9;
  }
  50% {
    text-shadow: 0 0 12px rgba(94, 234, 212, 0.95), 0 0 20px rgba(30, 158, 140, 0.8);
    color: #ffffff;
  }
}

/* Active searching state on any button */
.btn.is-searching,
.btn.btn-searching,
button.is-searching,
button[data-searching="true"] {
  position: relative !important;
  overflow: hidden !important;
  pointer-events: none !important;
  cursor: wait !important;
  border-color: rgba(30, 158, 140, 0.9) !important;
  background: rgba(8, 16, 32, 0.95) !important;
  color: #ffffff !important;
  animation: ptPulse 2s infinite !important;
  box-shadow: 0 0 16px rgba(30, 158, 140, 0.55), inset 0 0 12px rgba(30, 158, 140, 0.3) !important;
}

/* The glowing laser gradient band sweeping across (pds-tech.ai ptScanGrad inspired) */
.btn.is-searching::before,
.btn.btn-searching::before,
button.is-searching::before,
button[data-searching="true"]::before {
  content: "";
  position: absolute;
  top: -10%;
  bottom: -10%;
  width: 50%;
  left: -50%;
  background: linear-gradient(
    90deg,
    rgba(30, 158, 140, 0) 0%,
    rgba(30, 158, 140, 0.18) 25%,
    rgba(30, 158, 140, 0.55) 50%,
    rgba(94, 234, 212, 0.95) 52%,
    rgba(30, 158, 140, 0.55) 54%,
    rgba(30, 158, 140, 0.18) 75%,
    rgba(30, 158, 140, 0) 100%
  );
  transform: skewX(-20deg);
  animation: pdsLaserSweep 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  z-index: 1;
  pointer-events: none;
}

/* The intense razor laser line at core of beam */
.btn.is-searching::after,
.btn.btn-searching::after,
button.is-searching::after,
button[data-searching="true"]::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2.5px;
  left: -50%;
  margin-left: 25%;
  background: #ffffff;
  box-shadow: 
    0 0 4px #ffffff,
    0 0 10px #5eead4,
    0 0 18px #1e9e8c,
    0 0 28px rgba(30, 158, 140, 0.9);
  transform: skewX(-20deg);
  animation: pdsLaserSweep 1.8s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  z-index: 2;
  pointer-events: none;
}

.btn-searching-text {
  position: relative;
  z-index: 3;
  color: #ffffff;
  font-weight: 600;
  letter-spacing: 0.02em;
  animation: pdsTextGlow 2s infinite;
}

.laser-dot {
  position: relative;
  z-index: 3;
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2dd4bf;
  margin-right: 8px;
  vertical-align: middle;
  box-shadow: 0 0 8px #2dd4bf;
  animation: ptPulse 1.4s infinite;
}

/* Global search bar laser scan (position:relative for this already set
   where .global-search is first declared, near the top of this file) */
.global-search.is-searching::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: -40%;
  height: 2.5px;
  width: 45%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(30, 158, 140, 0.4) 20%,
    #5eead4 50%,
    rgba(30, 158, 140, 0.4) 80%,
    transparent 100%
  );
  box-shadow: 0 0 8px #1e9e8c, 0 0 14px #5eead4;
  animation: pdsLaserSweep 1.6s ease-in-out infinite;
  border-radius: 2px;
  z-index: 10;
  pointer-events: none;
}

.btn-icon-refresh.is-searching {
  width: auto !important;
  padding: 0 10px !important;
  height: 28px !important;
  font-size: 11px !important;
  border-radius: 6px !important;
}

/* ==========================================================================
   8x8 Jitsi as a Service (JaaS) Video Meeting Interface
   ========================================================================== */
.meeting-modal-box {
  width: min(1280px, 96vw);
  height: min(860px, 92vh);
  max-width: 98vw;
  max-height: 96vh;
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: #090e17;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.75), 0 0 24px rgba(30, 158, 140, 0.15);
}

.meeting-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(14, 21, 37, 0.95);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.meeting-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.meeting-live-pulse {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  animation: ptPulse 1.8s infinite;
  flex-shrink: 0;
}

.meeting-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.meeting-modal-body {
  display: flex;
  flex: 1;
  min-height: 0;
  position: relative;
  overflow: hidden;
  background: #000;
}

.jaas-video-container {
  flex: 1;
  min-width: 0;
  height: 100%;
  position: relative;
  background: #05080f;
  display: flex;
  flex-direction: column;
}

.jaas-video-container iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
}

.jaas-loading-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #070d18;
  z-index: 2;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.jaas-loading-state.fade-out {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

/* Meeting Camera Alert Banner */
.meeting-camera-alert {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: rgba(234, 88, 12, 0.15);
  border-bottom: 1px solid rgba(234, 88, 12, 0.4);
  padding: 8px 16px;
  color: #fed7aa;
  font-size: 12px;
  flex-shrink: 0;
  z-index: 10;
  animation: slideDownAlert 0.2s ease-out;
}

.meeting-camera-alert.error-theme {
  background: rgba(239, 68, 68, 0.16);
  border-bottom-color: rgba(239, 68, 68, 0.4);
  color: #fecaca;
}

.meeting-camera-alert.success-theme {
  background: rgba(16, 185, 129, 0.16);
  border-bottom-color: rgba(16, 185, 129, 0.4);
  color: #a7f3d0;
}

@keyframes slideDownAlert {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.meeting-camera-alert .mca-content {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.meeting-camera-alert .mca-icon {
  font-size: 18px;
  flex-shrink: 0;
}

.meeting-camera-alert .mca-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Popped-out meeting placeholder in window */
.jaas-popped-out-state {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #080d19;
  padding: 30px;
  text-align: center;
  z-index: 5;
}

.jaas-popped-out-card {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 24px;
  max-width: 440px;
  width: 100%;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}

.meeting-sidebar {
  width: 340px;
  max-width: 90vw;
  background: #0e1525;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.meeting-sidebar.hidden {
  display: none !important;
}

.meeting-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.meeting-sidebar-content {
  padding: 14px;
  overflow-y: auto;
  flex: 1;
}

.duration-pills-row {
  display: flex;
  gap: 6px;
}

.btn-duration-pill {
  flex: 1;
  padding: 6px 8px;
  background: var(--surface-1, #131d31);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  border-radius: 6px;
  color: var(--text, #f1f5f9);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-duration-pill:hover {
  border-color: var(--accent, #1e9e8c);
  background: rgba(30, 158, 140, 0.12);
}

.btn-duration-pill.active {
  background: var(--accent, #1e9e8c);
  border-color: #5eead4;
  color: #fff;
  box-shadow: 0 0 10px rgba(30, 158, 140, 0.4);
}

/* Split meeting button for cards */
.meeting-btn-group {
  display: inline-flex;
  align-items: stretch;
  border-radius: 6px;
  overflow: hidden;
}

.meeting-btn-group .btn {
  border-radius: 0;
}

.meeting-btn-group .btn:first-child {
  border-top-left-radius: 6px;
  border-bottom-left-radius: 6px;
}

.meeting-btn-group .btn:last-child {
  border-top-right-radius: 6px;
  border-bottom-right-radius: 6px;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
  padding-left: 8px;
  padding-right: 8px;
}

@media (max-width: 768px) {
  .meeting-modal-box {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    border-radius: 0;
    border: none;
  }
  .meeting-modal-header {
    padding: 8px 12px;
    gap: 8px;
  }
  .meeting-title-wrap h3 {
    font-size: 13.5px;
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .meeting-header-actions {
    gap: 4px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .meeting-header-actions .btn {
    padding: 4px 8px;
    font-size: 11px;
  }
  .meeting-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 85vw;
    z-index: 20;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.6);
  }
  .meeting-camera-alert {
    padding: 6px 10px;
    font-size: 11px;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
  .camera-test-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Deal Won Celebration Overlay & Animation Styles
   ========================================================================== */

.celebration-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(10, 28, 46, 0.78) 0%, rgba(6, 12, 24, 0.92) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  cursor: pointer;
  user-select: none;
  animation: celebrationFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes celebrationFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.celebration-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.celebration-card {
  position: relative;
  z-index: 10;
  background: rgba(18, 32, 58, 0.88);
  border: 1.5px solid rgba(43, 184, 163, 0.55);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.7),
    0 0 50px rgba(30, 158, 140, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  border-radius: 24px;
  padding: 40px 48px;
  text-align: center;
  max-width: 520px;
  width: 90%;
  overflow: hidden;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  animation: celebrationCardEnter 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes celebrationCardEnter {
  0% {
    opacity: 0;
    transform: scale(0.65) translateY(30px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.celebration-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(43, 184, 163, 0.25) 0%, rgba(30, 158, 140, 0.08) 100%);
  border: 2px solid rgba(43, 184, 163, 0.6);
  box-shadow: 0 0 24px rgba(43, 184, 163, 0.4);
  margin-bottom: 16px;
  position: relative;
  animation: celebrationBadgePulse 2s infinite ease-in-out;
}

@keyframes celebrationBadgePulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 24px rgba(43, 184, 163, 0.4);
  }
  50% {
    transform: scale(1.08);
    box-shadow: 0 0 38px rgba(52, 211, 153, 0.65);
  }
}

.celebration-trophy {
  font-size: 34px;
  filter: drop-shadow(0 0 8px rgba(245, 158, 11, 0.5));
}

.celebration-tag {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #2bb8a3;
  margin-bottom: 8px;
}

.celebration-title {
  font-family: var(--font-display);
  font-size: 38px;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin: 0 0 8px 0;
  background: linear-gradient(135deg, #ffffff 30%, #a7f3d0 70%, #fde047 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 24px rgba(43, 184, 163, 0.3);
}

.celebration-deal-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--paper);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.celebration-deal-amount {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 800;
  color: #10b981;
  margin-bottom: 14px;
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.5);
}

.celebration-scan-line {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(52, 211, 153, 0.8), transparent);
  box-shadow: 0 0 12px rgba(52, 211, 153, 0.8);
  animation: cardScanSweep 2.8s ease-in-out infinite alternate;
}

@keyframes cardScanSweep {
  0% { top: 0%; opacity: 0.2; }
  50% { opacity: 0.9; }
  100% { top: 100%; opacity: 0.2; }
}

.celebration-hint {
  font-size: 11px;
  color: rgba(247, 246, 242, 0.45);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-top: 18px;
}

.celebration-tier-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 14px;
  background: rgba(43, 184, 163, 0.15);
  border: 1px solid rgba(52, 211, 153, 0.5);
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #34d399;
  margin-bottom: 10px;
  box-shadow: 0 0 16px rgba(52, 211, 153, 0.25);
}

.celebration-quote-box-won {
  background: rgba(30, 158, 140, 0.08);
  border-left: 3px solid #10b981;
  border-radius: 8px;
  padding: 12px 18px;
  margin: 12px 0 16px 0;
  text-align: center;
}

.celebration-quote-box-won .celebration-quote {
  font-size: 13.5px;
  font-style: italic;
  color: #f7f6f2;
  line-height: 1.5;
  margin: 0;
  letter-spacing: 0.01em;
}

.celebration-currency-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 10px 0 16px 0;
}

.celebration-currency-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 5px 12px;
  border-radius: 9999px;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(251, 191, 36, 0.6);
  color: #fef08a;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.4);
  animation: currencyPillPulse 2s infinite ease-in-out;
}

@keyframes currencyPillPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 14px rgba(245, 158, 11, 0.4); }
  50% { transform: scale(1.05); box-shadow: 0 0 24px rgba(253, 224, 71, 0.7); }
}

.celebration-controls {
  margin: 14px 0 4px 0;
}

.celebration-escalate-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 26px;
  border-radius: 9999px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #060c18;
  background: linear-gradient(135deg, #f59e0b 0%, #10b981 100%);
  border: none;
  cursor: pointer;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.6), 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.celebration-escalate-btn:hover {
  transform: translateY(-2px) scale(1.04);
  background: linear-gradient(135deg, #fbbf24 0%, #34d399 100%);
  box-shadow: 0 0 36px rgba(251, 191, 36, 0.85), 0 6px 16px rgba(0, 0, 0, 0.5);
}

.celebration-escalate-btn:active {
  transform: translateY(0) scale(0.98);
}

.celebration-escalate-btn-max {
  background: linear-gradient(135deg, #f59e0b 0%, #f43f5e 50%, #8b5cf6 100%);
  color: #ffffff;
  box-shadow: 0 0 32px rgba(245, 158, 11, 0.75), 0 0 50px rgba(244, 63, 94, 0.5);
  animation: maxOverdrivePulse 1.8s infinite alternate;
}

@keyframes maxOverdrivePulse {
  0% { box-shadow: 0 0 25px rgba(245, 158, 11, 0.7), 0 0 40px rgba(244, 63, 94, 0.4); }
  100% { box-shadow: 0 0 45px rgba(251, 191, 36, 0.95), 0 0 70px rgba(244, 63, 94, 0.75); }
}

/* Tier 10 Holographic & Golden Finale Aura */
.celebration-overlay-tier-10 {
  background: radial-gradient(circle at 50% 50%, rgba(35, 20, 10, 0.84) 0%, rgba(6, 12, 24, 0.96) 100%) !important;
}

.celebration-card-tier-10 {
  border: 2px solid rgba(245, 158, 11, 0.85) !important;
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.85),
    0 0 80px rgba(245, 158, 11, 0.55),
    0 0 140px rgba(30, 158, 140, 0.4),
    inset 0 0 40px rgba(245, 158, 11, 0.25) !important;
  animation: celebrationTier10Enter 0.7s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards !important;
}

@keyframes celebrationTier10Enter {
  0% {
    opacity: 0;
    transform: scale(0.5) translateY(40px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

/* Quick "Mark as Won" button on deal details */
.btn-won {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff !important;
  border: 1px solid rgba(52, 211, 153, 0.6);
  font-weight: 700;
  box-shadow: 0 0 14px rgba(16, 185, 129, 0.35);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-won:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 0 22px rgba(52, 211, 153, 0.65);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Deal Lost — Resilient Momentum Styles
   -------------------------------------------------------------------------- */

.celebration-overlay-lost {
  background: radial-gradient(circle at 50% 50%, rgba(26, 18, 14, 0.82) 0%, rgba(6, 10, 18, 0.94) 100%);
}

.celebration-card-lost {
  border: 1.5px solid rgba(245, 158, 11, 0.55);
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.75),
    0 0 50px rgba(234, 88, 12, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.celebration-badge-lost {
  background: radial-gradient(circle, rgba(245, 158, 11, 0.25) 0%, rgba(234, 88, 12, 0.08) 100%);
  border: 2px solid rgba(245, 158, 11, 0.6);
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.4);
}

.celebration-tag-lost {
  color: #fbbf24;
}

.celebration-title-lost {
  font-size: 32px;
  background: linear-gradient(135deg, #ffffff 25%, #fed7aa 65%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 24px rgba(245, 158, 11, 0.25);
}

.celebration-deal-amount-lost {
  color: #f59e0b;
  font-size: 26px;
  text-decoration: line-through;
  opacity: 0.8;
}

.celebration-quote-box {
  background: rgba(247, 246, 242, 0.045);
  border-left: 3px solid #f59e0b;
  border-radius: 8px;
  padding: 14px 18px;
  margin: 16px 0;
  text-align: left;
}

.celebration-quote {
  font-size: 14px;
  font-style: italic;
  color: var(--paper);
  line-height: 1.55;
  margin: 0;
}

/* Quick "Mark as Lost" button on deal details */
.btn-lost {
  background: rgba(242, 135, 158, 0.08);
  color: #fca5a5 !important;
  border: 1px solid rgba(242, 135, 158, 0.3);
  font-weight: 600;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-lost:hover {
  background: rgba(242, 135, 158, 0.2);
  border-color: #f87171;
  color: #ffffff !important;
  transform: translateY(-1px);
}

.funnel-col.drag-over {
  border-color: var(--accent) !important;
  background: rgba(30, 158, 140, 0.12) !important;
  box-shadow: inset 0 0 20px rgba(30, 158, 140, 0.25);
}

.deal-card.is-dragging {
  opacity: 0.4;
  transform: scale(0.96);
}

.badge-won-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 8px;
  border-radius: 12px;
  background: rgba(16, 185, 129, 0.18);
  border: 1px solid rgba(52, 211, 153, 0.4);
  color: #34d399;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s ease;
}

.badge-won-tag:hover {
  background: rgba(16, 185, 129, 0.35);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.5);
  transform: scale(1.04);
}

/* --------------------------------------------------------------------------
   "do not click" Easter Egg & Rickroll Modal
   -------------------------------------------------------------------------- */
.btn-do-not-click {
  position: fixed;
  bottom: 8px;
  right: 12px;
  z-index: 999;
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: rgba(247, 246, 242, 0.28);
  background: rgba(10, 18, 30, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 3px 8px;
  cursor: pointer;
  opacity: 0.4;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.btn-do-not-click:hover {
  opacity: 0.95;
  color: #f87171;
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: 0 0 14px rgba(239, 68, 68, 0.3);
  transform: translateY(-1px);
}

.rickroll-overlay {
  position: fixed;
  inset: 0;
  z-index: 100005;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, rgba(20, 10, 30, 0.85) 0%, rgba(6, 6, 12, 0.96) 100%);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 20px;
  animation: celebrationFadeIn 0.3s ease forwards;
}

.rickroll-card {
  position: relative;
  background: rgba(18, 22, 38, 0.94);
  border: 1.5px solid rgba(239, 68, 68, 0.55);
  border-radius: 20px;
  padding: 28px 32px;
  max-width: 640px;
  width: 100%;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.8),
    0 0 45px rgba(239, 68, 68, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: center;
}

.rickroll-alert-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: rgba(239, 68, 68, 0.15);
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 9999px;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f87171;
  margin-bottom: 12px;
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.25);
}

.rickroll-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 900;
  letter-spacing: -0.01em;
  margin: 0 0 8px 0;
  background: linear-gradient(135deg, #ffffff 30%, #fca5a5 70%, #ef4444 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.rickroll-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 14px 0;
  line-height: 1.45;
}

.rickroll-subtitle em {
  color: #f87171;
  font-style: normal;
  font-weight: 700;
}

.rickroll-email-pill {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(30, 158, 140, 0.12);
  border: 1px solid rgba(43, 184, 163, 0.35);
  border-radius: 8px;
  font-size: 12px;
  color: #a7f3d0;
  margin-bottom: 18px;
}

.rickroll-video-container {
  position: relative;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: #000;
  margin-bottom: 18px;
}

.rickroll-video-container iframe {
  display: block;
  width: 100%;
  height: 350px;
}

.rickroll-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* ==========================================================================
   Admin & User Management Section
   ========================================================================== */
.admin-table-responsive {
  width: 100%;
  overflow-x: auto;
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13px;
}

.admin-users-table th {
  padding: 12px 18px;
  font-weight: 600;
  color: var(--muted, #94a3b8);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  background: rgba(255, 255, 255, 0.02);
}

.admin-users-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line-soft, rgba(255, 255, 255, 0.06));
  vertical-align: middle;
}

.admin-users-table tr:last-child td {
  border-bottom: none;
}

.admin-users-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.admin-user-cell {
  display: flex;
  align-items: center;
  gap: 12px;
}

.admin-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
  border: 1.5px solid rgba(255, 255, 255, 0.15);
}

.admin-avatar.admin-avatar-super {
  background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%);
  border-color: rgba(251, 191, 36, 0.4);
}

.admin-user-info {
  display: flex;
  flex-direction: column;
}

.admin-user-name {
  font-weight: 600;
  color: var(--paper, #f8fafc);
  display: flex;
  align-items: center;
  gap: 6px;
}

.admin-user-email {
  font-size: 12px;
  color: var(--muted, #94a3b8);
  margin-top: 1px;
}

.badge-you-pill {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 9999px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-role-admin {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
  border-radius: 9999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-role-member {
  background: rgba(57, 135, 229, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(57, 135, 229, 0.35);
  border-radius: 9999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-perm-granted {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-perm-restricted {
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted, #94a3b8);
  border: 1px solid var(--line, rgba(255, 255, 255, 0.1));
  border-radius: 6px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-status-active {
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  border-radius: 9999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-status-inactive {
  background: rgba(239, 68, 68, 0.12);
  color: #f87171;
  border-radius: 9999px;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.admin-actions-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}



