 :root {
  --bg-deep: #0b2a7a;
  --bg-surface: #0d3186;
  --bg-elevated: #123b97;
  --bg-card: #1743a8;
  --blue-electric: #2b63ff;
  --blue-vivid: #6fa7ff;
  --cyan-glow: #00b7c3;
  --cyan-soft: #04cbff;
  --purple-accent: #a78bfa;
  --pink-accent: #ff6adf;
  --text-primary: #f8fbff;
  --text-secondary: #cfe0ff;
  --text-muted: #9bb4ee;
  --glass-white: rgba(255, 255, 255, 0.05);
  --glass-border: rgba(255, 255, 255, 0.12);
  --shadow-deep: 0 28px 80px rgba(0, 0, 0, 0.45);
  --font-main: "Avenir Next", "Helvetica Neue", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  color: var(--text-primary);
  min-height: 100vh;
  background: radial-gradient(ellipse 70% 45% at 12% -10%, rgba(0, 183, 195, 0.22), transparent),
    radial-gradient(ellipse 60% 40% at 85% 12%, rgba(43, 99, 255, 0.22), transparent),
    radial-gradient(ellipse 50% 35% at 10% 85%, rgba(90, 167, 255, 0.18), transparent),
    radial-gradient(ellipse 45% 35% at 90% 85%, rgba(0, 183, 195, 0.12), transparent),
    linear-gradient(blue, darkblue);
  background-attachment: fixed;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255, 255, 255, 0.06) 1px, transparent 1px);
  background-size: 18px 18px;
  opacity: 0.55;
  pointer-events: none;
  z-index: 0;
  animation: drift 14s ease-in-out infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: -10% -10% 0 -10%;
  background:
    radial-gradient(circle at 18% 20%, rgba(0, 183, 195, 0.16), transparent 45%),
    radial-gradient(circle at 70% 20%, rgba(43, 99, 255, 0.14), transparent 45%),
    radial-gradient(circle at 50% 80%, rgba(0, 183, 195, 0.12), transparent 45%);
  filter: blur(24px);
  opacity: 0.9;
  pointer-events: none;
  z-index: 0;
  animation: glow 10s ease-in-out infinite;
}

@keyframes drift {
  0% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
  100% { transform: translateY(0); }
}

@keyframes glow {
  0% { transform: scale(1) translateY(0); }
  50% { transform: scale(1.02) translateY(-6px); }
  100% { transform: scale(1) translateY(0); }
}

@keyframes pulseBorder {
  0% { box-shadow: 0 0 0 0 rgba(0, 183, 195, 0.2); }
  70% { box-shadow: 0 0 0 12px rgba(0, 183, 195, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 183, 195, 0); }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  background: none;
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(0, 203, 255, 0.25);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.12);
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, 0.7);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.35);
  overflow: hidden;
  animation: pulseBorder 4.8s ease-in-out infinite;
}

.logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.title {
  font-weight: 700;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #ffffff;
}

.subtitle {
  font-size: 12px;
  color: var(--text-muted);
}

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

.header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  min-width: 130px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
}

.header-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 203, 255, 1);
  box-shadow: 0 14px 26px rgba(0, 203, 255, 0.25);
}

.file-btn {
  background: rgba(255, 255, 255, 0.08);
}

.file-btn input {
  display: none;
}

.header-btn.active {
  box-shadow: 0 0 0 2px rgba(4, 203, 255, 0.7), 0 14px 26px rgba(4, 203, 255, 0.35);
}

button.ghost {
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.08);
  padding: 10px 14px;
  border-radius: 999px;
  cursor: pointer;
  color: #ffffff;
  transition: transform 0.2s ease, border 0.2s ease;
}

button.ghost:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 203, 255, 0.8);
}

.layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  padding: 22px 32px 32px;
  position: relative;
  z-index: 1;
}

.panel {
  background: linear-gradient(145deg, rgba(6, 12, 32, 0.95), rgba(8, 16, 40, 0.9));
  border-radius: 26px;
  box-shadow: var(--shadow-deep);
  border: 2px solid rgba(0, 203, 255, 1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 520px;
  backdrop-filter: blur(18px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  animation: riseIn 0.55s ease-out;
}

.panel.detail {
  background: rgba(9, 21, 50, 0.65);
  border: 2px solid rgba(0, 203, 255, 1);
  box-shadow: 0 30px 90px rgba(6, 8, 28, 0.7);
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.panel:hover {
  transform: translateY(-2px);
  box-shadow: 0 30px 90px rgba(6, 8, 28, 0.75);
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--glass-border);
  gap: 12px;
  background: rgba(255, 255, 255, 0.08);
}

.panel-header h2 {
  margin: 0;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.muted {
  color: var(--text-secondary);
  font-size: 12px;
}

.panel-tools {
  display: flex;
  align-items: center;
  gap: 16px;
}

.status-filter {
  display: flex;
  align-items: center;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.1);
}

.status-filter select {
  background: transparent;
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  outline: none;
  appearance: none;
  padding-right: 18px;
  background-image: linear-gradient(45deg, transparent 50%, #ffffff 50%), linear-gradient(135deg, #ffffff 50%, transparent 50%);
  background-position: calc(100% - 12px) 55%, calc(100% - 6px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.pipeline-switch,
.pipeline-filter {
  display: none;
  align-items: center;
  gap: 6px;
}

.pipeline-switch .tab-btn,
.pipeline-filter .tab-btn {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(0, 203, 255, 0.45);
  background: rgba(7, 14, 32, 0.35);
  color: #ffffff;
  font-size: 12px;
  font-weight: 600;
}

.pipeline-switch .tab-btn.active,
.pipeline-filter .tab-btn.active {
  background: rgba(0, 183, 195, 0.35);
  border-color: rgba(0, 203, 255, 0.9);
  color: #ffffff;
}

body.pipeline-mode .pipeline-switch {
  display: flex;
}

body.pipeline-mode #statusFilterWrap {
  display: none;
}

body.view-agent #viewToggle,
body.view-agent #leadsBtn,
body.view-agent #accountsBtn,
body.view-agent #pipelineBtn,
body.view-agent #prospectingBtn,
body.view-agent #recentBtn,
body.view-agent #newItemBtn {
  display: none !important;
}

#runProspectingBtn,
#prospectingSettingsBtn {
  display: none;
}

.settings-modal {
  position: fixed;
  inset: 0;
  background: rgba(4, 10, 30, 0.6);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.settings-card {
  width: 420px;
  background: rgba(9, 20, 40, 0.95);
  border: 1px solid rgba(0, 203, 255, 0.6);
  border-radius: 16px;
  padding: 20px;
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.settings-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.settings-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.8);
}

.settings-grid input {
  background: rgba(4, 12, 30, 0.7);
  border: 1px solid rgba(0, 203, 255, 0.4);
  border-radius: 10px;
  padding: 8px 10px;
  color: #ffffff;
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.search {
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 10px 14px;
  min-width: 220px;
  background: rgba(2, 6, 23, 0.65);
  color: var(--text-primary);
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.search:focus {
  outline: none;
  border-color: rgba(0, 183, 195, 0.8);
  box-shadow: 0 0 0 2px rgba(0, 183, 195, 0.25);
}

.search::placeholder {
  color: var(--text-muted);
}

.pager {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pager button.ghost {
  border: 1px solid rgba(255, 255, 255, 0.6);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
}

.pager button.ghost:hover {
  border-color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.18);
}

.table-wrap {
  padding: 10px 16px 16px;
  overflow: auto;
  flex: 1;
}

.table {
  width: 100%;
  min-width: 1100px;
  border-collapse: collapse;
  font-size: 13px;
  color: var(--text-primary);
}

.table th,
.table td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  vertical-align: top;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 300px;
}

.table th {
  color: #04cbff;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.table tr:hover {
  background: rgba(0, 183, 195, 0.06);
}

.table tr.selected {
  background: linear-gradient(90deg, rgba(0, 183, 195, 0.18), rgba(59, 130, 246, 0.16));
  box-shadow: inset 4px 0 0 rgba(0, 183, 195, 0.9);
}

.empty {
  padding: 30px 10px;
  color: var(--text-secondary);
}

.leads-quote-loading-state {
  height: 100%;
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
}

.leads-quote-loading-card {
  width: min(820px, 92%);
  padding: 28px 30px 24px;
  border-radius: 16px;
  border: 1px solid rgba(17, 181, 229, 0.36);
  background: var(--crm-glass-gradient);
  box-shadow: 0 24px 56px rgba(3, 10, 24, 0.45);
  text-align: center;
  display: grid;
  gap: 10px;
}

.leads-quote-loading-text {
  margin: 0;
  color: #e8f6ff;
  font-family: "DM Sans", "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: clamp(1.06rem, 2vw, 1.46rem);
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.1px;
}

.leads-quote-loading-meta {
  color: rgba(198, 219, 244, 0.9);
  font-size: 0.75rem;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.leads-quote-loading-dots {
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.leads-quote-loading-dots > span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--crm-accent);
  opacity: 0.28;
  animation: leadsQuoteDotPulse 1.15s infinite ease-in-out;
}

.leads-quote-loading-dots > span:nth-child(2) {
  animation-delay: 0.18s;
}

.leads-quote-loading-dots > span:nth-child(3) {
  animation-delay: 0.36s;
}

.leads-quote-loading-skip {
  margin: 14px auto 0;
  min-height: 40px;
  border-radius: 11px;
  border: 1px solid rgba(0, 203, 255, 0.86);
  background: linear-gradient(135deg, rgba(8, 140, 217, 0.22), rgba(0, 102, 255, 0.14));
  color: var(--crm-accent);
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.28px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.leads-quote-loading-skip:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(8, 140, 217, 0.25);
  border-color: rgba(0, 203, 255, 0.96);
  background: linear-gradient(135deg, rgba(8, 140, 217, 0.3), rgba(0, 102, 255, 0.18));
}

.leads-quote-loading-skip:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.leads-quote-loading-skip-icon {
  width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 203, 255, 0.78);
  background: rgba(8, 140, 217, 0.18);
}

.leads-quote-loading-skip-icon svg {
  width: 11px;
  height: 11px;
}

.leads-get-started-card {
  gap: 16px;
}

.leads-get-started-text {
  font-size: clamp(1rem, 1.6vw, 1.22rem);
  line-height: 1.52;
}

.leads-get-started-actions {
  margin-top: 2px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.leads-get-started-btn {
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(0, 203, 255, 0.78);
  background: rgba(8, 140, 217, 0.18);
  color: #e7f8ff;
  font-family: "DM Sans", "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.35px;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.leads-get-started-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 203, 255, 0.96);
  background: rgba(8, 140, 217, 0.28);
}

@keyframes leadsQuoteDotPulse {
  0%, 80%, 100% {
    opacity: 0.24;
    transform: scale(0.8);
  }
  40% {
    opacity: 1;
    transform: scale(1);
  }
}

.detail {
  position: sticky;
  top: 96px;
  align-self: start;
  max-height: calc(100vh - 140px);
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: flex-end;
}

.detail-tab-group {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(17, 181, 229, 0.42);
  border-radius: 10px;
  overflow: hidden;
  background: rgba(8, 14, 28, 0.62);
}

.detail-tab-group .tab-btn {
  min-height: 32px;
  border: 0;
  border-right: 1px solid rgba(17, 181, 229, 0.22);
  border-radius: 0;
  background: transparent;
  color: rgba(206, 223, 244, 0.8);
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.2px;
  padding: 6px 8px;
  box-shadow: none;
  text-transform: none;
}

.detail-tab-group .tab-btn:last-child {
  border-right: 0;
}

.detail-tab-group .tab-btn:hover {
  transform: none;
  border-color: rgba(17, 181, 229, 0.22);
  background: rgba(8, 140, 217, 0.14);
  color: #ffffff;
}

.detail-tab-group .tab-btn.active {
  background: rgba(8, 140, 217, 0.28);
  color: #ffffff;
  font-weight: 700;
}

.detail-drawer-close {
  flex-shrink: 0;
}

.tab-btn {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text-primary);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border 0.2s ease;
}

.tab-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(0, 183, 195, 0.8);
}

.tab-btn.active {
  background: linear-gradient(135deg, rgba(0, 183, 195, 0.35), rgba(59, 130, 246, 0.2));
  border-color: rgba(0, 183, 195, 0.9);
  color: #ffffff;
  font-weight: 700;
}

.detail-body {
  padding: 16px 20px 20px;
  overflow: auto;
  flex: 1;
}

.detail-item {
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(7, 14, 32, 0.95), rgba(10, 18, 40, 0.92));
  border: 1px solid rgba(0, 183, 195, 0.25);
  color: var(--text-primary);
}

.detail-item.accent {
  border: 1px solid rgba(0, 183, 195, 0.6);
  box-shadow: 0 0 0 1px rgba(0, 183, 195, 0.2) inset;
}

.detail-item .label {
  font-size: 11px;
  color: #04cbff;
  letter-spacing: 0.6px;
  text-transform: uppercase;
}

.detail-item .value {
  font-size: 14px;
  font-weight: 600;
  word-break: break-word;
  color: var(--text-primary);
}

.detail-input {
  width: 100%;
  border: 1px solid rgba(0, 183, 195, 0.35);
  border-radius: 12px;
  padding: 9px 12px;
  background: rgba(7, 14, 32, 0.95);
  color: var(--text-primary);
  font-size: 14px;
}

.detail-input::placeholder {
  color: rgba(194, 214, 240, 0.72);
}

.detail-input:focus {
  outline: none;
  border-color: rgba(0, 183, 195, 0.8);
  box-shadow: 0 0 0 2px rgba(0, 183, 195, 0.25);
}

.detail-field-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.detail-item-no-label > .label {
  display: none;
}

.detail-dual-row {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  align-items: stretch;
}

.detail-dual-cell {
  min-width: 0;
}

.detail-inline-readonly {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.detail-inline-readonly-cell {
  border: 1px solid rgba(0, 183, 195, 0.24);
  border-radius: 12px;
  padding: 9px 11px;
  background: rgba(8, 18, 36, 0.62);
}

.detail-inline-readonly-cell .label {
  margin-bottom: 4px;
}

.company-field-row {
  align-items: stretch;
}

.company-field-row .detail-input-icon-wrap {
  min-width: 0;
}

.company-field-row .detail-input {
  min-height: 38px;
  height: 38px;
}

.detail-input-icon-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
}

.detail-input-icon-wrap .lead-country-picker {
  width: 100%;
}

.detail-input-icon {
  position: absolute;
  top: 50%;
  left: 11px;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: rgba(0, 203, 255, 0.9);
  pointer-events: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.detail-input-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.detail-input-icon-wrap .detail-input {
  padding-left: 34px;
}

.lead-country-picker {
  position: relative;
}

.lead-country-picker .lead-country-autocomplete {
  top: calc(100% + 6px);
  z-index: 9;
}

.detail-status-touch-row .status-select {
  width: 100%;
  min-height: 38px;
  border-radius: 10px;
}

.detail-status-touch-row .status-dropdown {
  width: 100%;
}

.detail-metrics-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 760px) {
  .detail-dual-row,
  .detail-inline-readonly {
    grid-template-columns: 1fr;
  }
}

.open-link {
  border: 1px solid rgba(0, 183, 195, 0.8);
  background: linear-gradient(135deg, rgba(0, 183, 195, 0.3), rgba(42, 102, 255, 0.2));
  color: var(--text-primary);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.open-link:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 10px 18px rgba(0, 183, 195, 0.35);
}

.open-link svg {
  width: 16px;
  height: 16px;
  display: block;
}

.website-preview {
  margin-top: 10px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(17, 181, 229, 0.34);
  background: rgba(7, 14, 30, 0.78);
  height: 248px;
  box-shadow: inset 0 0 0 1px rgba(17, 181, 229, 0.12);
}

.website-preview iframe {
  width: 1280px;
  height: 720px;
  border: 0;
  transform-origin: top left;
}

.preview-note {
  font-size: 11px;
  color: rgba(199, 220, 243, 0.78);
  margin-top: 6px;
  line-height: 1.4;
}

.notes-wrap,
.attachments-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notes-input {
  width: 100%;
  min-height: 90px;
  border: 1px solid rgba(0, 183, 195, 0.35);
  border-radius: 14px;
  padding: 12px;
  background: rgba(7, 14, 32, 0.95);
  color: var(--text-primary);
  font-size: 14px;
}

.notes-input:focus {
  outline: none;
  border-color: rgba(0, 183, 195, 0.7);
  box-shadow: 0 0 0 2px rgba(0, 183, 195, 0.2);
}

.note-card {
  background: rgba(7, 14, 32, 0.95);
  border-radius: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 183, 195, 0.2);
  color: var(--text-primary);
}

.note-meta {
  font-size: 11px;
  color: rgba(158, 176, 230, 0.8);
  margin-bottom: 6px;
}

.attach-btn {
  border: 1px dashed rgba(0, 183, 195, 0.8);
  background: rgba(7, 14, 32, 0.95);
  color: var(--text-primary);
  padding: 10px 12px;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 700;
  display: inline-flex;
  gap: 8px;
  align-items: center;
  width: fit-content;
}

.attach-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.attach-item {
  background: rgba(7, 14, 32, 0.95);
  border-radius: 14px;
  padding: 10px 12px;
  border: 1px solid rgba(0, 183, 195, 0.2);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.attach-meta {
  font-size: 12px;
  color: rgba(158, 176, 230, 0.85);
}

.attach-link {
  color: #04cbff;
  font-weight: 700;
  text-decoration: none;
}

.footer {
  padding: 12px 32px 28px;
  color: var(--text-secondary);
  font-size: 12px;
  position: relative;
  z-index: 1;
}

@media (max-width: 1000px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .detail {
    position: static;
    max-height: none;
  }
}

.score-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid rgba(4, 203, 255, 0.7);
}

.phone-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.company-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.sms-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.5);
  border: 1px solid rgba(34, 197, 94, 0.9);
  color: #ffffff;
  font-weight: 700;
  font-size: 11px;
}

.stage-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  font-weight: 700;
  font-size: 11px;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  color: #ffffff;
  border: 1px solid rgba(4, 203, 255, 0.9);
  white-space: nowrap;
}

.status-select {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(4, 203, 255, 0.9);
}

.stage-select {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(4, 203, 255, 0.9);
}

.company-stage-select {
  flex: 0 0 170px;
  min-height: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border-color: rgba(0, 183, 195, 0.8);
  background: linear-gradient(135deg, rgba(0, 183, 195, 0.3), rgba(42, 102, 255, 0.2));
}

.company-stage-dropdown {
  width: 100%;
  height: 100%;
  font-size: 12px;
}

.status-dropdown {
  background: transparent;
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 13px;
  outline: none;
  appearance: none;
  padding-right: 18px;
  background-image: linear-gradient(45deg, transparent 50%, #ffffff 50%), linear-gradient(135deg, #ffffff 50%, transparent 50%);
  background-position: calc(100% - 12px) 55%, calc(100% - 6px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.stage-dropdown {
  background: transparent;
  border: none;
  color: #ffffff;
  font-weight: 700;
  font-size: 12px;
  outline: none;
  appearance: none;
  padding-right: 18px;
  background-image: linear-gradient(45deg, transparent 50%, #ffffff 50%), linear-gradient(135deg, #ffffff 50%, transparent 50%);
  background-position: calc(100% - 12px) 55%, calc(100% - 6px) 55%;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.portfolio-select {
  min-width: 220px;
}

.demo-section {
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demo-summary-section {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.demo-summary-toggle {
  font-size: 12px;
}

.demo-summary-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(17, 181, 229, 0.24);
  background: rgba(8, 140, 217, 0.08);
}

.demo-summary-value {
  white-space: pre-wrap;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(236, 246, 255, 0.94);
}

.demo-summary-meta {
  font-size: 11px;
  color: rgba(191, 214, 236, 0.82);
}

.demo-summary-actions {
  display: flex;
  justify-content: flex-end;
}

.demo-summary-generate {
  border: 1px solid rgba(17, 181, 229, 0.8);
  background: rgba(8, 140, 217, 0.18);
  color: #eaf6ff;
  border-radius: 8px;
  min-height: 30px;
  padding: 4px 11px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  cursor: pointer;
}

.demo-summary-generate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.detail-item.detail-item-demo {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
}

.demo-toggle {
  width: 100%;
  border: 1px solid #11b5e5;
  background: rgba(8, 140, 217, 0.15);
  color: #ffffff;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.demo-accordion {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.demo-accordion-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 10px;
  border-radius: 12px;
  border: 1px solid rgba(17, 181, 229, 0.28);
  background: rgba(8, 140, 217, 0.08);
}

body.view-dashboard #pipelineBtn,
body.view-dashboard #prospectingBtn,
body.view-dashboard #recentBtn,
body.view-dashboard #newItemBtn,
body.view-agent #pipelineBtn,
body.view-agent #prospectingBtn,
body.view-agent #recentBtn,
body.view-agent #newItemBtn,
body.view-ticket #pipelineBtn,
body.view-ticket #prospectingBtn,
body.view-ticket #recentBtn,
body.view-ticket #newItemBtn,
body.view-settings #pipelineBtn,
body.view-settings #prospectingBtn,
body.view-settings #recentBtn,
body.view-settings #newItemBtn,
body.view-business-settings #pipelineBtn,
body.view-business-settings #prospectingBtn,
body.view-business-settings #recentBtn,
body.view-business-settings #newItemBtn {
  display: none !important;
}

body:not(.leads-submenu-open) #pipelineBtn,
body:not(.leads-submenu-open) #prospectingBtn,
body:not(.leads-submenu-open) #recentBtn {
  display: none !important;
}

body.view-settings #tierSwitchBtn {
  display: inline-flex !important;
}

.demo-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.demo-action {
  width: 100%;
  border: 1px solid #11b5e5;
  background: rgba(8, 140, 217, 0.15);
  color: #ffffff;
  font-family: "DM Sans", sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.45px;
  text-transform: uppercase;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.demo-toggle {
  text-transform: uppercase;
  letter-spacing: 0.45px;
}

.demo-convert-btn {
  width: 100%;
}

.demo-toggle:hover,
.demo-action:hover {
  background: rgba(8, 140, 217, 0.21);
  border-color: #11b5e5;
  color: #fff;
  transform: translateY(-1px);
}

.demo-action-manual {
  border-color: #11b5e5;
  background: rgba(8, 140, 217, 0.15);
  color: #ffffff;
}

.demo-previews {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.demo-preview {
  border: 1px solid rgba(34, 197, 94, 0.6);
  background: rgba(7, 14, 32, 0.65);
  border-radius: 12px;
  padding: 8px;
  min-height: 110px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #bfece6;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.demo-preview img {
  max-width: 100%;
  max-height: 120px;
  object-fit: contain;
}

.demo-url {
  width: 100%;
  border: 1px solid rgba(34, 197, 94, 0.8);
  border-radius: 12px;
  padding: 9px 12px;
  background: rgba(7, 14, 32, 0.9);
  color: #ffffff;
  font-size: 13px;
}

.demo-url:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}

.save-btn {
  margin-top: 12px;
  align-self: flex-start;
  background: linear-gradient(135deg, rgba(0, 183, 195, 0.7), rgba(43, 99, 255, 0.6));
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: #ffffff;
  font-weight: 700;
  padding: 10px 18px;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.25);
}


.dashboard-frame {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 14px;
  background: rgba(7, 14, 32, 0.65);
}

.dashboard-pane {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  height: 100%;
  min-height: 0;
}

.view-dashboard .panel-header {
  display: none;
}

.view-dashboard .panel {
  padding: 0;
  height: 100%;
}

.view-dashboard .table-wrap,
.view-dashboard .detail-body,
.view-dashboard .dashboard-pane {
  padding: 0;
  height: 100%;
  min-height: 0;
}

.view-dashboard .dashboard-frame {
  border-radius: 0;
  height: 100%;
}

.view-dashboard .layout {
  height: calc(100vh - 90px);
  min-height: calc(100vh - 90px);
  align-items: stretch;
}

.view-agent .layout {
  grid-template-columns: 1fr;
  height: calc(100vh - 90px);
  min-height: calc(100vh - 90px);
  align-items: stretch;
}

.view-agent .detail {
  display: none;
}

.view-agent .panel-header {
  display: none;
}

.view-agent .panel {
  padding: 0;
  height: 100%;
}

.view-agent .table-wrap,
.view-agent .dashboard-pane {
  height: 100%;
  min-height: 0;
}

.agent-widget-wrap {
  position: relative;
}

.agent-switcher {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 5;
  border: 1px solid rgba(0, 203, 255, 0.9);
  background: rgba(0, 203, 255, 0.2);
  color: #ffffff;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.sales-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sales-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.followup-complete {
  display: flex;
  align-items: center;
}

.followup-btn {
  width: 100%;
  border: 1px solid rgba(239, 68, 68, 0.9);
  background: rgba(239, 68, 68, 0.2);
  color: #ffffff;
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
}

.followup-btn.completed {
  border-color: rgba(34, 197, 94, 0.9);
  background: rgba(34, 197, 94, 0.3);
  color: #ffffff;
}

.sales-input,
.sales-select,
.sales-date,
.sales-time,
.sales-text {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(0, 183, 195, 0.4);
  background: rgba(7, 14, 32, 0.7);
  color: #ffffff;
  font-size: 13px;
}

.sales-select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #ffffff 50%),
    linear-gradient(135deg, #ffffff 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 8px) 50%;
  background-size: 6px 6px;
  background-repeat: no-repeat;
}

.sales-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(34, 197, 94, 0.8);
  color: #8ef5a7;
  background: rgba(34, 197, 94, 0.25);
}

.sales-status {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.status-btn {
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 12px;
  border: 1px solid rgba(255,255,255,0.35);
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  cursor: pointer;
}

.status-btn.active {
  border-color: rgba(34, 197, 94, 0.9);
  background: rgba(34, 197, 94, 0.2);
  color: #a7f3d0;
}

.status-btn.lost.active {
  border-color: rgba(239, 68, 68, 0.9);
  background: rgba(239, 68, 68, 0.2);
  color: #fecaca;
}

.status-btn.paused.active {
  border-color: rgba(234, 179, 8, 0.9);
  background: rgba(234, 179, 8, 0.2);
  color: #fef3c7;
}

.followup-complete {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #ffffff;
}

.followup-complete input {
  width: 16px;
  height: 16px;
}

/* ==== CRM SIDEBAR REBUILD OVERRIDES (2026-03-04) ==== */
:root {
  --crm-bg: #090d18;
  --crm-surface: rgba(10, 20, 38, 0.78);
  --crm-surface-strong: rgba(14, 26, 48, 0.84);
  --crm-glass-gradient:
    radial-gradient(ellipse 55% 45% at 16% 8%, rgba(8, 140, 217, 0.26), transparent 72%),
    radial-gradient(ellipse 50% 50% at 86% 8%, rgba(42, 163, 226, 0.14), transparent 72%),
    rgba(14, 22, 38, 0.86);
  --crm-border: rgba(8, 140, 217, 0.2);
  --crm-border-strong: rgba(8, 140, 217, 0.32);
  --crm-text: #f0f0f8;
  --crm-text-soft: rgba(255, 255, 255, 0.5);
  --crm-text-dim: rgba(255, 255, 255, 0.28);
  --crm-accent: #00cbff;
  --crm-accent-main: #088cd9;
  --crm-accent-2: #2aa3e2;
  --sidebar-open-width: 220px;
  --sidebar-collapsed-width: 78px;
  --sidebar-width: var(--sidebar-open-width);
  --header-row-height: 76px;
  --sidebar-open-bg: rgba(7, 14, 28, 0.9);
  --sidebar-closed-bg: rgba(7, 14, 28, 0.9);
}

html,
body {
  width: 100%;
  height: 100%;
  max-width: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

body {
  margin: 0;
  min-height: 100dvh;
  height: 100dvh;
  font-family: "DM Sans", "Avenir Next", "Helvetica Neue", sans-serif;
  color: var(--crm-text);
  background: var(--crm-bg);
}

body.sidebar-collapsed {
  --sidebar-width: var(--sidebar-collapsed-width);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 50% at 10% 20%, rgba(8, 140, 217, 0.09) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 90% 80%, rgba(42, 163, 226, 0.05) 0%, transparent 55%),
    var(--crm-bg);
  pointer-events: none;
  z-index: 0;
}

body::after {
  display: none;
}

.app {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  width: 100vw;
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  position: relative;
  z-index: 1;
  transition: grid-template-columns 0.28s ease;
}

.sidebar {
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: var(--sidebar-open-bg);
  border-right: 1px solid var(--crm-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  backdrop-filter: blur(20px);
  transition: width 0.28s ease;
}

body.sidebar-collapsed .sidebar {
  background: var(--sidebar-closed-bg);
}

.sidebar-logo {
  height: var(--header-row-height);
  padding: 0 12px;
  border-bottom: 1px solid var(--crm-border);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  position: sticky;
  top: 0;
  z-index: 3;
  background: rgba(7, 14, 28, 0.95);
}

.sidebar-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-bottom: 8px;
}

.sidebar-scroll::-webkit-scrollbar {
  width: 4px;
}

.sidebar-scroll::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 2px;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
  height: 48px;
}

.logo-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border: 1px solid rgba(8, 140, 217, 0.35);
  background: rgba(8, 140, 217, 0.08);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.sidebar-brand:hover .logo-mark {
  transform: translateY(-1px);
  border-color: rgba(8, 140, 217, 0.5);
  background: rgba(8, 140, 217, 0.16);
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.logo-text {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #fff;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.sidebar-logo .logo-text {
  font-size: 1.2em !important;
  font-family: "Barlow Semi Condensed", "DM Sans", sans-serif;
  font-weight: 600;
}

.brand-main {
  color: #ffffff;
  line-height: 1;
  font-size: 1.05em;
}

.brand-blue {
  color: #0eb4e4;
}

.brand-badge {  display: inline-flex;  align-items: center;  justify-content: center;  padding: 4px 6px;  border-radius: 6px;  border: 1px solid var(--crm-accent);  background: rgba(8, 140, 217, 0.15);  color: var(--crm-accent);  font-family: "DM Sans", sans-serif;  font-size: 14px;  font-weight: 800;  text-transform: none;  letter-spacing: 0.5px;  line-height: 1;}
.brand-badge.alpha-variant .brand-alpha-glyph { font-size: 1.18em; line-height: 1; }

.sidebar-section {
  padding: 16px 12px 6px;
}

.sidebar-section-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 0;
  margin-bottom: 5px;
  min-height: 44px;
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(7, 14, 28, 0.95);
}

.sidebar-section-label {
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--crm-text-dim);
  padding: 0 8px;
  margin-bottom: 6px;
}

.sidebar-section-head .sidebar-section-label {
  padding: 0;
  margin-bottom: 0;
}

.sidebar-toggle {
  width: 100%;
  min-height: 44px;
  border-radius: 10px;
  border: 1px solid #11b5e5;
  background: rgba(8, 140, 217, 0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 9px 10px;
  font-family: "DM Sans", sans-serif;
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease, color 0.2s ease;
}

.sidebar-toggle:hover {
  background: rgba(8, 140, 217, 0.21);
  border-color: #11b5e5;
  color: #fff;
}

.sidebar-toggle svg {
  color: #11b5e5;
  transition: transform 0.2s ease;
}

.sidebar-toggle .toggle-label {
  white-space: nowrap;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.18s;
  color: var(--crm-text-soft);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 5px;
  border: none;
  background: none;
  width: 100%;
  min-height: 44px;
  text-align: left;
  font-family: "DM Sans", sans-serif;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
}

.nav-item.active {
  background: rgba(8, 140, 217, 0.15);
  color: #ffffff;
  border: 1px solid #11b5e5;
}

.nav-item svg {
  flex-shrink: 0;
  opacity: 0.7;
}

.nav-item.leads-submenu-item {
  margin-left: 12px;
  width: calc(100% - 12px);
}

body.leads-submenu-open .nav-item.leads-submenu-item {
  display: flex !important;
}

body.leads-submenu-open .nav-item.leads-submenu-item:not(.active) {
  color: var(--crm-accent);
}

body.leads-submenu-open .nav-item.leads-submenu-item:not(.active) svg {
  color: var(--crm-accent);
  opacity: 1;
}

body.leads-submenu-open .nav-item.leads-submenu-item:not(.active):hover {
  background: rgba(0, 203, 255, 0.1);
  color: var(--crm-accent);
}

.nav-item.active svg {
  opacity: 1;
  color: #11b5e5;
}

.nav-text {
  white-space: nowrap;
}

.file-btn input {
  display: none;
}

.sidebar-footer {
  margin-top: 0;
  padding: 16px 12px;
  border-top: 1px solid var(--crm-border);
  position: sticky;
  bottom: 0;
  z-index: 3;
  background: rgba(7, 14, 28, 0.95);
}

.agent-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.18s;
}

.agent-card:hover {
  background: rgba(255, 255, 255, 0.04);
}

.agent-ava {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--crm-accent-main), var(--crm-accent-2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  position: relative;
  flex-shrink: 0;
}

.agent-ava .dot {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 9px;
  height: 9px;
  background: #4ade80;
  border-radius: 50%;
  border: 2px solid #0a0a12;
}

.agent-meta {
  flex: 1;
  min-width: 0;
}

.agent-meta strong {
  font-size: 12px;
  font-weight: 600;
  display: block;
}

.agent-meta span {
  font-size: 11px;
  color: var(--crm-text-dim);
}

body.sidebar-collapsed .sidebar {
  width: 78px;
  border-right: 1px solid rgba(17, 181, 229, 1);
}

body.sidebar-collapsed .sidebar-logo,
body.sidebar-collapsed .sidebar-logo + .sidebar-logo {
  height: var(--header-row-height);
  padding: 20px 10px 20px;
  justify-content: flex-start;
}

body.sidebar-collapsed .sidebar-brand {
  justify-content: flex-start;
  width: 48px;
  margin-left: 0;
  padding-left: 6px;
}

body.sidebar-collapsed .logo-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  border-color: rgba(8, 140, 217, 0.35);
  background: rgba(8, 140, 217, 0.08);
}

body.sidebar-collapsed .logo-text {
  width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
}

body.sidebar-collapsed .sidebar-section {
  padding: 12px 8px 6px;
}

body.sidebar-collapsed .sidebar-section-label {
  display: none;
}

body.sidebar-collapsed .sidebar-section-head {
  justify-content: flex-start;
  padding: 0 0 0 5px;
  min-height: 48px;
  margin-bottom: 5px;
}

body.sidebar-collapsed .sidebar-toggle {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  margin-left: 0;
  padding: 0;
  justify-content: center;
  gap: 0;
}

body.sidebar-collapsed .sidebar-toggle .toggle-label {
  display: none;
}

body.sidebar-collapsed .sidebar-toggle svg {
  transform: rotate(180deg);
}

body.sidebar-collapsed .nav-item {
  width: 48px;
  height: 48px;
  margin: 0 auto 5px;
  padding: 0;
  justify-content: center;
  gap: 0;
  border-radius: 14px;
}

body.sidebar-collapsed .nav-text,
body.sidebar-collapsed .agent-meta,
body.sidebar-collapsed .sidebar-footer svg {
  display: none;
}

body.sidebar-collapsed .sidebar-footer {
  padding: 12px 8px;
}

body.sidebar-collapsed .agent-card {
  justify-content: center;
  padding: 6px 0;
}

.main {
  min-width: 0;
  max-width: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.main-header {
  display: flex;
  align-items: center;
  min-height: var(--header-row-height);
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid var(--crm-border);
  background: rgba(8, 14, 28, 0.74);
  backdrop-filter: blur(20px);
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 20;
}

.main-header-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.main-header-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.main-header-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid rgba(17, 181, 229, 0.45);
  background: rgba(8, 140, 217, 0.15);
  color: #ffffff;
  cursor: pointer;
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.main-header-action:hover {
  border-color: rgba(17, 181, 229, 0.9);
  background: rgba(8, 140, 217, 0.26);
  transform: translateY(-1px);
}

.main-header-action svg {
  flex-shrink: 0;
  color: #11b5e5;
}

.main-header-action-text {
  letter-spacing: 0.2px;
}

.main-header-action input {
  display: none;
}

.main-header-action[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
}

.main-header-action[disabled]:hover {
  transform: none;
  border-color: rgba(17, 181, 229, 0.45);
  background: rgba(8, 140, 217, 0.15);
}

#kpiSettingsBtn {
  display: none;
}

body.view-dashboard #kpiSettingsBtn {
  display: inline-flex !important;
}

.main-header-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid rgba(8, 140, 217, 0.42);
  background: rgba(8, 140, 217, 0.14);
  color: var(--crm-accent-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.main-header-icon svg {
  width: 18px;
  height: 18px;
}

.main-header-title {
  font-family: "Barlow Semi Condensed", "DM Sans", sans-serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.2px;
  line-height: 1.05;
  color: #ffffff;
}

.main-header-subtitle {
  margin-top: 3px;
  font-family: "Barlow Semi Condensed", "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: rgba(223, 236, 255, 0.72);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 22px;
  padding: 20px 22px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: calc(100dvh - var(--header-row-height));
  min-height: calc(100dvh - var(--header-row-height));
  overflow-x: hidden;
  overflow-y: hidden;
  overscroll-behavior: contain;
  position: relative;
  z-index: 1;
}

.layout::-webkit-scrollbar {
  width: 5px;
}

.layout::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 3px;
}

.panel {
  background: var(--crm-surface);
  border-radius: 20px;
  box-shadow: 0 22px 70px rgba(4, 8, 22, 0.45);
  border: 1px solid var(--crm-accent);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
  backdrop-filter: blur(16px);
  animation: none;
}

.panel.detail {
  background: var(--crm-surface);
  border: 1px solid var(--crm-accent);
  box-shadow: 0 22px 70px rgba(4, 8, 22, 0.45);
  min-height: 0;
  max-height: none;
  position: relative;
  top: auto;
}

.panel:hover {
  transform: none;
  box-shadow: 0 22px 70px rgba(4, 8, 22, 0.45);
}

.panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(8, 140, 217, 0.26);
  background: rgba(8, 16, 30, 0.74);
}

.panel-header h2 {
  font-family: "Barlow Semi Condensed", "DM Sans", sans-serif;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
  text-transform: none;
}

/* Leads pane polish: SnapFlow-like structure without changing CRM color palette */
.layout > section.panel {
  background: var(--crm-glass-gradient);
  border: 1px solid rgba(8, 140, 217, 0.34);
  border-radius: 16px;
  box-shadow: 0 16px 42px rgba(4, 8, 22, 0.34);
}

.layout > section.panel:hover {
  transform: none;
  box-shadow: 0 16px 42px rgba(4, 8, 22, 0.34);
}

.layout > section.panel .panel-header {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(8, 140, 217, 0.22);
  background: transparent;
}

.layout > section.panel .panel-tools {
  gap: 8px;
  flex-wrap: wrap;
}

.layout > section.panel .table-wrap {
  padding: 6px 10px 10px;
  background: transparent !important;
}

.layout > section.panel .table {
  min-width: 980px;
  font-size: 12px;
}

.layout > section.panel .table th {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(8, 140, 217, 0.18);
  font-size: 10px;
  letter-spacing: 1.2px;
  color: rgba(219, 233, 255, 0.72);
}

.layout > section.panel .table td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 12px;
  vertical-align: middle;
}

.layout > section.panel .table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

.layout > section.panel .table tr.selected {
  background: rgba(8, 140, 217, 0.14);
  box-shadow: inset 2px 0 0 rgba(8, 140, 217, 0.88);
}

.layout > section.panel .search {
  min-width: 220px;
  height: 44px;
  min-height: 44px;
  border-radius: 10px;
  padding: 0 14px;
  border: 1px solid rgba(17, 181, 229, 0.45);
  background: rgba(8, 140, 217, 0.15);
  color: #ffffff;
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 600;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.layout > section.panel .search::placeholder {
  color: rgba(223, 236, 255, 0.72);
}

.layout > section.panel .search:focus {
  outline: none;
  border-color: rgba(17, 181, 229, 0.9);
  background: rgba(8, 140, 217, 0.26);
  box-shadow: 0 0 0 2px rgba(8, 140, 217, 0.22);
}

.layout > section.panel .status-filter {
  height: 44px;
  min-height: 44px;
  border-radius: 10px;
  padding: 0 12px;
  border: 1px solid rgba(17, 181, 229, 0.45);
  background: rgba(8, 140, 217, 0.15);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.layout > section.panel .status-filter:hover {
  border-color: rgba(17, 181, 229, 0.9);
  background: rgba(8, 140, 217, 0.26);
}

.layout > section.panel .status-filter select {
  font-size: 12px;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.2px;
  padding-right: 20px;
  background-image: linear-gradient(45deg, transparent 50%, #11b5e5 50%), linear-gradient(135deg, #11b5e5 50%, transparent 50%);
}

.layout > section.panel .pager {
  gap: 8px;
}

.layout > section.panel .pager button.ghost {
  min-height: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid rgba(17, 181, 229, 0.45);
  background: rgba(8, 140, 217, 0.15);
  color: #ffffff;
  font-family: "DM Sans", sans-serif;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.layout > section.panel .pager button.ghost:hover {
  border-color: rgba(17, 181, 229, 0.9);
  background: rgba(8, 140, 217, 0.26);
  transform: translateY(-1px);
}

.layout > section.panel .pager button.ghost:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.layout > section.panel .pager .nav-arrow {
  color: #11b5e5;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
}

.layout > section.panel .company-cell {
  gap: 6px;
}

.layout > section.panel .stage-tag,
.layout > section.panel .status-pill {
  padding: 2px 8px;
  font-size: 10px;
  line-height: 1.2;
}

/* Keep dashboard left pane aligned with leads left-pane treatment */
.view-dashboard .layout > section.panel {
  background: var(--crm-glass-gradient) !important;
  border: 1px solid rgba(8, 140, 217, 0.34) !important;
}

.view-dashboard .layout > section.panel .table-wrap {
  background: none !important;
}

.view-dashboard .dashboard-pane,
.view-dashboard .dashboard-frame,
.view-dashboard #worldMapFrame {
  background: var(--crm-glass-gradient) !important;
}

.view-dashboard .layout > aside.panel.detail {
  background: var(--crm-glass-gradient) !important;
  border: 1px solid rgba(8, 140, 217, 0.34) !important;
  border-radius: 16px;
  box-shadow: 0 16px 42px rgba(4, 8, 22, 0.34);
}

.muted {
  color: rgba(219, 233, 255, 0.72);
}

.table-wrap {
  padding: 10px 14px 14px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.detail-body {
  padding: 1.5rem;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.search {
  min-width: 220px;
  background: rgba(8, 14, 28, 0.68);
  border-color: rgba(8, 140, 217, 0.32);
}

.status-filter {
  border-color: rgba(8, 140, 217, 0.32);
  background: rgba(8, 14, 28, 0.68);
}

.tab-btn {
  border: 1px solid rgba(8, 140, 217, 0.35);
  background: rgba(8, 140, 217, 0.12);
}

.tab-btn.active {
  background: rgba(8, 140, 217, 0.22);
  border-color: rgba(8, 140, 217, 0.55);
}

.dashboard-frame {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  border: none;
  border-radius: 0;
  background: #0f1c2d;
  overflow: hidden;
}

.view-dashboard .panel-header {
  display: none;
}

.view-dashboard .layout {
  align-items: stretch;
}

.view-dashboard .panel,
.view-dashboard .detail,
.view-dashboard .dashboard-pane,
.view-dashboard .table-wrap,
.view-dashboard .detail-body {
  height: 100%;
  min-height: 0;
}

.view-agent .layout {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.view-agent .detail {
  display: none;
}

.view-agent .panel-header {
  display: none;
}

.view-business-settings .layout {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.view-business-settings .detail {
  display: none;
}

.view-business-settings .panel-header {
  display: none;
}

.view-business-settings .panel {
  padding: 0;
  height: 100%;
}

.view-business-settings .table-wrap,
.view-business-settings .dashboard-pane {
  padding: 0;
  height: 100%;
  min-height: 0;
}

.view-ticket .detail,
.view-settings .detail {
  display: none;
}

.view-ticket .layout {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.view-ticket .panel {
  background: var(--crm-glass-gradient);
  border: 1px solid rgba(8, 140, 217, 0.34);
  border-radius: 16px;
  box-shadow: 0 16px 42px rgba(4, 8, 22, 0.34);
  height: 100%;
}

.view-ticket .table-wrap,
.view-ticket .dashboard-pane {
  padding: 0;
  height: 100%;
  min-height: 0;
}

.view-ticket .dashboard-frame {
  background: transparent;
}

.detail-drawer-close {
  display: none;
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  font-size: 20px;
  line-height: 1;
  align-items: center;
  justify-content: center;
}

.detail-drawer-backdrop {
  display: none;
}

.kpi-settings-backdrop {
  display: none;
}

.kpi-settings-drawer {
  position: fixed;
  top: var(--header-row-height);
  right: 0;
  width: min(500px, 44vw);
  min-width: 380px;
  max-width: calc(100vw - 36px);
  height: calc(100vh - var(--header-row-height));
  border-left: 1px solid rgba(17, 181, 229, 0.24);
  background: var(--crm-glass-gradient);
  box-shadow: 0 30px 58px rgba(3, 10, 24, 0.58);
  transform: translateX(104%);
  transition: transform 0.24s ease;
  z-index: 74;
  display: flex;
  flex-direction: column;
  pointer-events: none;
}

body.view-dashboard .kpi-settings-drawer {
  pointer-events: auto;
}

.kpi-settings-drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(17, 181, 229, 0.18);
  background: rgba(7, 14, 30, 0.64);
  backdrop-filter: blur(12px);
}

.kpi-settings-drawer-header h2 {
  margin: 0;
  font-family: "Barlow Semi Condensed", "DM Sans", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.2;
  color: #f5fbff;
}

.kpi-settings-drawer-header p {
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: rgba(223, 236, 255, 0.7);
}

.kpi-settings-header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.kpi-settings-mode-switch {
  display: inline-flex;
  border: 1px solid rgba(17, 181, 229, 0.38);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(8, 14, 28, 0.62);
}

.kpi-settings-mode-btn {
  min-height: 32px;
  padding: 6px 10px;
  border: 0;
  border-right: 1px solid rgba(17, 181, 229, 0.24);
  background: transparent;
  color: #7e8b9f;
  font-family: "DM Sans", sans-serif;
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.kpi-settings-mode-btn:last-child {
  border-right: 0;
}

.kpi-settings-mode-btn:hover {
  color: #dff6ff;
  background: rgba(17, 181, 229, 0.1);
}

.kpi-settings-mode-btn.active {
  color: #ffffff;
  background: rgba(8, 140, 217, 0.26);
  box-shadow: inset 0 0 0 1px rgba(17, 181, 229, 0.3);
}

.kpi-settings-close-btn {
  width: 32px;
  min-width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid rgba(17, 181, 229, 0.45);
  background: rgba(8, 140, 217, 0.15);
  color: #ffffff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.kpi-settings-close-btn:hover {
  border-color: rgba(17, 181, 229, 0.9);
  background: rgba(8, 140, 217, 0.26);
}

.kpi-settings-drawer-body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 14px 16px 16px;
}

.kpi-settings-mode-panel {
  display: none;
}

.kpi-settings-mode-panel.active {
  display: block;
}

.kpi-settings-switcher {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 1px solid rgba(17, 181, 229, 0.34);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 14px;
  background: rgba(8, 14, 28, 0.62);
}

.kpi-settings-switch-btn {
  min-height: 36px;
  padding: 7px 8px;
  border: 0;
  border-right: 1px solid rgba(17, 181, 229, 0.24);
  background: transparent;
  color: #7e8b9f;
  font-family: "DM Sans", sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.kpi-settings-switch-btn:last-child {
  border-right: 0;
}

.kpi-settings-switch-btn:hover {
  color: #dff6ff;
  background: rgba(17, 181, 229, 0.1);
}

.kpi-settings-switch-btn.active {
  color: #ffffff;
  background: rgba(8, 140, 217, 0.26);
  box-shadow: inset 0 0 0 1px rgba(17, 181, 229, 0.34);
}

.kpi-settings-pane {
  display: none;
}

.kpi-settings-pane.active {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.kpi-settings-field {
  display: grid;
  gap: 6px;
  padding: 10px 11px;
  border-radius: 8px;
  border: 1px solid rgba(17, 181, 229, 0.2);
  background: rgba(8, 14, 28, 0.52);
}

#kpiSettingsRegionsPanel .kpi-settings-field {
  padding-top: 15px;
  padding-bottom: 15px;
}

.kpi-settings-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: #c7dcf3;
}

.kpi-settings-input {
  width: 100%;
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 7px;
  border: 1px solid rgba(17, 181, 229, 0.34);
  background: rgba(6, 12, 26, 0.72);
  color: #ffffff;
  font-family: "DM Sans", sans-serif;
  font-size: 0.88rem;
  box-sizing: border-box;
}

.kpi-settings-input:focus {
  outline: none;
  border-color: rgba(17, 181, 229, 0.9);
  box-shadow: 0 0 0 2px rgba(17, 181, 229, 0.18);
}

.kpi-settings-input:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  color: rgba(216, 232, 250, 0.78);
  border-color: rgba(17, 181, 229, 0.2);
}

.kpi-settings-field-inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.kpi-settings-field-inline > label {
  display: grid;
  gap: 6px;
}

.kpi-region-help {
  margin: 0;
  color: #c7dcf3;
  font-size: 0.75rem;
  line-height: 1.4;
}

.kpi-region-search-wrap {
  position: relative;
}

.kpi-region-autocomplete {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 3;
  display: none;
  max-height: 190px;
  overflow-y: auto;
  border: 1px solid rgba(17, 181, 229, 0.24);
  border-radius: 8px;
  background: rgba(5, 12, 24, 0.96);
  box-shadow: 0 10px 28px rgba(3, 8, 18, 0.45);
}

.kpi-region-autocomplete.active {
  display: block;
}

.kpi-region-autocomplete-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: #e5f2ff;
  padding: 9px 10px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.79rem;
  text-align: left;
  cursor: pointer;
}

.kpi-region-autocomplete-item > span:first-child {
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-region-autocomplete-item > span:last-child {
  white-space: nowrap;
  flex-shrink: 0;
}

.kpi-region-autocomplete-item .kpi-region-autocomplete-meta {
  color: rgba(198, 219, 244, 0.82);
  font-size: 0.68rem;
}

.kpi-region-autocomplete-item:last-child {
  border-bottom: 0;
}

.kpi-region-autocomplete-item:hover,
.kpi-region-autocomplete-item.active {
  background: rgba(0, 102, 255, 0.2);
}

.kpi-region-autocomplete-empty {
  padding: 9px 10px;
  color: rgba(206, 221, 239, 0.82);
  font-size: 0.75rem;
}

.kpi-selected-region-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.kpi-selected-region-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 1px solid rgba(17, 181, 229, 0.34);
  border-radius: 8px;
  background: rgba(7, 15, 30, 0.68);
  color: #edf6ff;
  padding: 9px 11px;
  font-family: "DM Sans", sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
}

.kpi-selected-region-tag > span {
  min-width: 0;
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-selected-region-city-list {
  margin-top: 2px;
}

.kpi-selected-region-city-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  border: 1px solid rgba(17, 181, 229, 0.34);
  border-radius: 8px;
  background: rgba(7, 15, 30, 0.68);
  color: #edf6ff;
  padding: 9px 11px;
  font-family: "DM Sans", sans-serif;
}

.kpi-selected-region-city-copy {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 2px;
}

.kpi-selected-region-city-name {
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-selected-region-city-country {
  font-size: 0.71rem;
  color: rgba(206, 223, 244, 0.84);
}

.kpi-selected-region-tag .remove-btn {
  border: 0;
  background: transparent;
  color: #9ec9ff;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 1;
}

.kpi-selected-region-tag .remove-btn:hover {
  color: #ffffff;
}

.kpi-selected-region-empty {
  border: 1px dashed rgba(17, 181, 229, 0.24);
  border-radius: 8px;
  padding: 10px;
  color: rgba(199, 220, 243, 0.86);
  font-size: 0.74rem;
}

.kpi-settings-drawer-footer {
  border-top: 1px solid rgba(17, 181, 229, 0.18);
  padding: 12px 16px 14px;
  background: rgba(7, 14, 30, 0.64);
}

.kpi-settings-save-btn {
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid rgba(17, 181, 229, 0.56);
  background: rgba(8, 140, 217, 0.22);
  color: #ffffff;
  font-family: "DM Sans", sans-serif;
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
}

.kpi-settings-save-btn:hover {
  border-color: rgba(17, 181, 229, 0.9);
  background: rgba(8, 140, 217, 0.32);
}

body.view-dashboard .kpi-settings-backdrop {
  display: block;
  position: fixed;
  top: var(--header-row-height);
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(4, 9, 20, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 70;
}

body.view-dashboard.kpi-settings-open .kpi-settings-drawer {
  transform: translateX(0);
}

body.view-dashboard.kpi-settings-open .kpi-settings-backdrop {
  opacity: 1;
  pointer-events: auto;
}

body.leads-drawer-mode .layout {
  grid-template-columns: minmax(0, 1fr);
}

body.leads-drawer-mode .layout > section.panel {
  grid-column: 1;
}

body.leads-drawer-mode .layout > aside.panel.detail {
  position: fixed;
  top: var(--header-row-height);
  right: 0;
  width: min(520px, 42vw);
  min-width: 360px;
  max-width: calc(100vw - 40px);
  height: calc(100vh - var(--header-row-height));
  min-height: 0;
  max-height: none;
  border-radius: 0;
  border: 0;
  border-left: 1px solid var(--crm-border);
  background: var(--crm-glass-gradient);
  z-index: 72;
  transform: translateX(104%);
  transition: transform 0.24s ease;
  box-shadow: 0 28px 52px rgba(3, 10, 24, 0.52);
}

body.leads-drawer-mode .layout > aside.panel.detail .panel-header {
  position: sticky;
  top: 0;
  z-index: 2;
  background: transparent;
  backdrop-filter: blur(10px);
}

body.leads-drawer-mode .layout > aside.panel.detail .detail-body {
  background: transparent;
}

body.leads-drawer-mode .layout > aside.panel.detail .detail-actions {
  gap: 8px;
}

body.leads-drawer-mode .layout > aside.panel.detail .detail-actions .detail-tab-group {
  border-color: rgba(17, 181, 229, 0.45);
  background: rgba(8, 14, 28, 0.64);
}

body.leads-drawer-mode .layout > aside.panel.detail .detail-actions .detail-tab-group .tab-btn {
  min-height: 32px;
  font-size: 11px;
}

body.leads-drawer-mode .layout > aside.panel.detail .detail-actions .detail-tab-group .tab-btn.active {
  background: rgba(8, 140, 217, 0.3);
}

body.leads-drawer-mode .layout > aside.panel.detail .detail-body {
  height: 100%;
  min-height: 0;
}

body.leads-drawer-mode .detail-drawer-close {
  display: inline-flex;
}

body.leads-drawer-mode .detail-drawer-backdrop {
  display: block;
  position: fixed;
  top: var(--header-row-height);
  left: var(--sidebar-width);
  right: 0;
  bottom: 0;
  border: 0;
  margin: 0;
  padding: 0;
  background: rgba(4, 9, 20, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.22s ease;
  z-index: 68;
}

body.leads-drawer-mode.detail-drawer-open .layout > aside.panel.detail {
  transform: translateX(0);
}

body.leads-drawer-mode.detail-drawer-open .detail-drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 900px) {
  body.leads-drawer-mode .layout > aside.panel.detail {
    width: min(100vw, 460px);
    min-width: 0;
    max-width: 100vw;
  }

  body.leads-drawer-mode .detail-drawer-backdrop {
    left: 0;
  }

  .kpi-settings-drawer {
    width: min(100vw, 460px);
    min-width: 0;
    max-width: 100vw;
  }

  .kpi-settings-field-inline {
    grid-template-columns: 1fr;
  }

  body.view-dashboard .kpi-settings-backdrop {
    left: 0;
  }
}

#pipelineBtn,
#prospectingBtn,
#recentBtn,
#newItemBtn,
#dashboardBtn,
#leadsBtn,
#accountsBtn,
#ticketBtn,
#businessSettingsBtn,
#settingsBtn,
#viewModeBtn,
#importLabel,
#exportBtn {
  display: flex !important;
}

#exportBtn[disabled] {
  opacity: 0.55;
}

.footer {
  display: none !important;
}

@media (max-width: 1180px) {
  .layout {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .detail {
    min-height: 360px;
  }
}

@media (max-width: 760px) {
  .app {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 50;
    transform: translateX(0);
  }

  body.sidebar-collapsed .sidebar {
    transform: translateX(calc(-1 * var(--sidebar-open-width)));
    width: var(--sidebar-open-width);
  }

  .main {
    margin-left: 0;
  }

  .main-header {
    padding: 12px 16px;
  }

  .main-header-action-text {
    display: none;
  }

  .main-header-actions {
    gap: 8px;
  }

  .main-header-action {
    min-width: 38px;
    padding: 8px;
  }

  .layout {
    padding: 16px;
    gap: 16px;
  }
}

/* TENANT_LITE_NAV */
#accountsBtn,
#ticketBtn,
#settingsBtn,
#viewModeBtn,
#pipelineBtn,
#prospectingBtn,
#recentBtn,
#tierSwitchBtn {
  display: none !important;
}


/* CTRL shell parity override (glass parity) */
body {
  background: var(--crm-bg) !important;
}

body::before {
  display: block !important;
  content: "" !important;
  position: fixed !important;
  inset: 0 !important;
  background:
    radial-gradient(ellipse 70% 50% at 10% 20%, rgba(8, 140, 217, 0.09) 0%, transparent 60%),
    radial-gradient(ellipse 50% 60% at 90% 80%, rgba(42, 163, 226, 0.05) 0%, transparent 55%),
    var(--crm-bg) !important;
  pointer-events: none !important;
  z-index: 0 !important;
}

body::after {
  display: none !important;
  content: none !important;
}

.sidebar {
  background: var(--sidebar-open-bg) !important;
  border-right: 1px solid var(--crm-border) !important;
}

body.sidebar-collapsed .sidebar {
  background: var(--sidebar-closed-bg) !important;
}

.sidebar-logo,
.sidebar-footer,
.sidebar-section-head {
  background: rgba(7, 14, 28, 0.95) !important;
  border-color: var(--crm-border) !important;
}

.main-header {
  background: rgba(8, 14, 28, 0.74) !important;
  border-bottom: 1px solid var(--crm-border) !important;
}

.panel {
  background: var(--crm-surface) !important;
  border: 1px solid var(--crm-accent) !important;
  box-shadow: 0 22px 70px rgba(4, 8, 22, 0.45) !important;
}

.panel.detail {
  background: var(--crm-surface) !important;
  border: 1px solid var(--crm-accent) !important;
  box-shadow: 0 22px 70px rgba(4, 8, 22, 0.45) !important;
}

.layout > section.panel {
  background: var(--crm-glass-gradient) !important;
  background-image: var(--crm-glass-gradient) !important;
  border: 1px solid rgba(8, 140, 217, 0.34) !important;
  box-shadow: 0 16px 42px rgba(4, 8, 22, 0.34) !important;
}

/* lead-panel-bg-override-start */
body.view-leads .layout > section.panel {
  background: var(--crm-glass-gradient) !important;
  background-image: var(--crm-glass-gradient) !important;
}

body.view-leads .layout > section.panel .table-wrap {
  background: transparent !important;
}
/* lead-panel-bg-override-end */
