/* Mockup Windows / Mamta Aluminium - CRM Stylesheet */
:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 18px;
  
  --emerald: #10b981;
  --emerald-bg: #ecfdf5;
  --emerald-text: #065f46;
  --amber: #f59e0b;
  --amber-bg: #fffbeb;
  --amber-text: #92400e;
  --rose: #ef4444;
  --rose-bg: #fef2f2;
  --rose-text: #991b1b;
  --indigo: #6366f1;
  --indigo-bg: #eef2ff;
  --purple: #8b5cf6;
  --purple-bg: #f5f3ff;
  --cyan: #06b6d4;
  --cyan-bg: #ecfeff;
  --whatsapp: #25D366;
  --whatsapp-hover: #1ebd58;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.05);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  overflow-x: hidden;
  font-size: 14px;
  line-height: 1.5;
}

/* App Container */
.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.hidden {
  display: none !important;
}

/* Header & Top Nav */
.top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px;
  box-shadow: var(--shadow-sm);
  min-height: 58px;
  gap: 12px;
}

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

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  cursor: pointer;
  flex-shrink: 0;
}

.brand-logo-img {
  height: 36px;
  width: auto;
  object-fit: contain;
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 16px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 10.5px;
  color: #64748b;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.crm-pill {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 4px rgba(37,99,235,0.25);
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: var(--radius-lg);
  flex-shrink: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-center::-webkit-scrollbar {
  display: none;
}

.nav-btn {
  background: transparent;
  border: none;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.nav-btn:hover {
  color: var(--primary);
  background: rgba(255,255,255,0.6);
}

.nav-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 5px rgba(0,0,0,0.06);
}

.badge-count {
  background: var(--rose);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  display: inline-block;
}

.badge-count.zero {
  background: #94a3b8;
}

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

/* Button System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-sm {
  padding: 6px 10px;
  font-size: 12px;
}

.btn-xs {
  padding: 4px 8px;
  font-size: 11px;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 8px rgba(37,99,235,0.25);
}

.btn-whatsapp {
  background: var(--whatsapp);
  color: #ffffff;
}

.btn-whatsapp:hover {
  background: var(--whatsapp-hover);
  box-shadow: 0 4px 8px rgba(37,211,102,0.3);
}

.btn-bridge {
  background: linear-gradient(135deg, #059669, #10b981);
  color: #ffffff;
}

.btn-bridge:hover {
  background: linear-gradient(135deg, #047857, #059669);
  box-shadow: 0 4px 8px rgba(16,185,129,0.3);
}

.btn-outline {
  background: #ffffff;
  border-color: var(--border);
  color: var(--text-main);
}

.btn-outline:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  transition: all 0.15s ease;
}

.btn-icon:hover {
  background: #f1f5f9;
  color: var(--text-main);
}

/* KPI Banner */
.kpi-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  padding: 18px 24px 8px 24px;
}

.kpi-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 14px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.kpi-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.kpi-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.kpi-icon-blue { background: #eff6ff; color: #2563eb; }
.kpi-icon-purple { background: #f5f3ff; color: #8b5cf6; }
.kpi-icon-amber { background: #fffbeb; color: #f59e0b; }
.kpi-icon-emerald { background: #ecfdf5; color: #10b981; }
.kpi-icon-rose { background: #fef2f2; color: #ef4444; }

.kpi-info {
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.kpi-value {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.2;
  margin-top: 2px;
}

.kpi-sub {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}

/* View Sub-Header / Filters */
.toolbar-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 24px;
  flex-wrap: wrap;
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.single-line-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
}

.search-box {
  position: relative;
  min-width: 200px;
  flex: 1;
  max-width: 320px;
}

.search-box input {
  width: 100%;
  padding: 6px 12px 6px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #f8fafc;
  font-size: 12.5px;
  outline: none;
  height: 34px;
  transition: all 0.15s ease;
}

.search-box input:focus {
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
  font-size: 13px;
}

.toolbar-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.select-filter {
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  height: 34px;
  transition: border-color 0.15s ease;
}

.select-filter:focus {
  border-color: var(--primary);
}

.btn-reset-filters {
  height: 34px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.btn-reset-filters:hover {
  background: #f1f5f9;
  color: #0f172a;
  border-color: #94a3b8;
}

/* Kanban Board View */
.kanban-view {
  padding: 12px 24px 30px 24px;
  overflow-x: auto;
  min-height: calc(100vh - 240px);
}

.kanban-board {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  min-width: 1300px;
}

.kanban-column {
  background: #f1f5f9;
  border-radius: var(--radius-md);
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  border: 1px solid #e2e8f0;
}

.kanban-column-header {
  padding: 12px 14px;
  border-bottom: 2px solid transparent;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.col-title-wrap {
  display: flex;
  flex-direction: column;
}

.col-title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

.col-subtitle {
  font-size: 11px;
  color: #64748b;
}

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

.col-count-badge {
  background: #e2e8f0;
  color: #334155;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
}

.col-value-summary {
  padding: 6px 12px;
  background: #e2e8f0;
  font-size: 11px;
  font-weight: 600;
  color: #475569;
  text-align: right;
}

.kanban-cards-container {
  padding: 10px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 120px;
  flex: 1;
}

/* Kanban Lead Card */
.lead-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  cursor: grab;
  transition: all 0.15s ease;
  position: relative;
}

.lead-card:hover {
  box-shadow: 0 4px 10px rgba(0,0,0,0.09);
  transform: translateY(-2px);
  border-color: #cbd5e1;
}

.lead-card.dragging {
  opacity: 0.4;
  transform: scale(0.98);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.lead-code-pill {
  font-size: 11px;
  font-weight: 800;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 6px;
  border-radius: 4px;
}

.priority-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 4px;
  text-transform: uppercase;
}

.priority-hot { background: #fee2e2; color: #b91c1c; }
.priority-warm { background: #fef3c7; color: #b45309; }
.priority-cold { background: #f1f5f9; color: #64748b; }

.card-client-name {
  font-size: 14px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 3px;
  line-height: 1.3;
}

.card-location {
  font-size: 11.5px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}

.card-requirements {
  font-size: 11.5px;
  color: #334155;
  background: #f8fafc;
  padding: 6px 8px;
  border-radius: 4px;
  border: 1px solid #e2e8f0;
  margin-bottom: 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-metrics {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px dashed #e2e8f0;
  padding-top: 8px;
  margin-top: 6px;
}

.card-deal-value {
  font-size: 13.5px;
  font-weight: 800;
  color: #047857;
}

.card-sqft {
  font-size: 11px;
  color: #64748b;
}

.card-followup-alert {
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.card-followup-alert:hover {
  filter: brightness(0.95);
  transform: translateY(-1px);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.alert-today { background: #fff7ed; color: #c2410c; border: 1px solid #ffedd5; }
.alert-overdue { background: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; }
.alert-upcoming { background: #f0fdf4; color: #15803d; border: 1px solid #dcfce7; }
.alert-none {
  background: #f8fafc;
  color: #0284c7;
  border: 1px dashed #94a3b8;
  font-weight: 600;
}
.alert-none:hover {
  background: #f0f9ff;
  border-color: #0284c7;
  color: #0369a1;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 10px;
  padding-top: 6px;
}

.btn-card-wa {
  flex: 1;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 6px;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.1s ease;
}

.btn-card-wa:hover {
  background: #10b981;
  color: #ffffff;
}

.btn-card-more {
  background: #f8fafc;
  color: #475569;
  border: 1px solid #cbd5e1;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
}

.btn-card-more:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.converted-pill {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #6ee7b7;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Table View */
.table-view-container {
  padding: 12px 24px 30px 24px;
}

.table-wrapper {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th {
  background: #f8fafc;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  border-bottom: 1px solid var(--border);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.data-table td {
  padding: 12px 14px;
  font-size: 13px;
  color: #1e293b;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.data-table tr:hover td {
  background: #f8fafc;
}

.stage-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Follow-ups Center */
.followups-view {
  padding: 12px 24px 30px 24px;
  max-width: 1100px;
  margin: 0 auto;
}

.followup-tabs {
  display: flex;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
  margin-bottom: 18px;
}

.fu-tab-btn {
  background: transparent;
  border: 1px solid var(--border);
  padding: 8px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.15s ease;
}

.fu-tab-btn:hover {
  background: #f8fafc;
}

.fu-tab-btn.active {
  background: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
}

.fu-tab-btn.active .badge-count {
  background: #ffffff;
  color: var(--primary);
}

.followup-cards-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fu-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  transition: transform 0.1s ease;
}

.fu-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.fu-left {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
}

.fu-time-pill {
  background: #f1f5f9;
  color: #0f172a;
  padding: 6px 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 800;
  font-size: 13px;
  line-height: 1.2;
  min-width: 80px;
}

.fu-time-pill small {
  display: block;
  font-size: 10px;
  color: #64748b;
  font-weight: 600;
}

.fu-body h4 {
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fu-body p {
  font-size: 12.5px;
  color: #475569;
  margin-top: 3px;
}

.fu-body .fu-note {
  font-size: 12px;
  background: #f8fafc;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  margin-top: 6px;
  color: #334155;
  font-style: italic;
}

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

/* Modals */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(0,0,0,0.25);
  animation: modalFadeIn 0.2s ease-out;
}

.modal-card.modal-lg {
  max-width: 860px;
}

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

.modal-header {
  padding: 16px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-header h3 {
  font-size: 17px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-close {
  background: transparent;
  border: none;
  font-size: 20px;
  color: #64748b;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #f1f5f9;
  color: #0f172a;
}

.modal-body {
  padding: 20px 22px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  background: #f8fafc;
  border-bottom-left-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-lg);
}

/* Forms */
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

.form-group {
  margin-bottom: 14px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 5px;
}

.form-label span.req {
  color: var(--rose);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #ffffff;
  font-size: 13px;
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}

.form-textarea {
  resize: vertical;
  min-height: 70px;
}

/* Window Profiles Tag Selector */
.tags-selector-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

/* Kanban Mode Toggle Switcher */
.kanban-subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 24px 14px 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.kanban-mode-toggle {
  display: inline-flex;
  background: #e2e8f0;
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.kanban-mode-btn {
  border: none;
  background: transparent;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.kanban-mode-btn:hover {
  color: var(--primary);
}

.kanban-mode-btn.active {
  background: #ffffff;
  color: var(--primary);
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
}

.priority-col-hot {
  border-top-color: #ef4444 !important;
  background-color: #fffaf9 !important;
}

.priority-col-warm {
  border-top-color: #f59e0b !important;
  background-color: #fffdf7 !important;
}

.priority-col-cold {
  border-top-color: #64748b !important;
  background-color: #f8fafc !important;
}

/* Window Profiles Master Selector & Chips */
.profile-select-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  min-height: 32px;
  padding: 6px 8px;
  background: #f8fafc;
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}

.profile-chip {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px 3px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 1px 2px rgba(37,99,235,0.08);
}

.chip-remove {
  background: #dbeafe;
  color: #1e40af;
  border: none;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  font-size: 11px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chip-remove:hover {
  background: #ef4444;
  color: #ffffff;
}

.add-profile-inline-box {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  background: #f1f5f9;
  padding: 8px 10px;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
}

.profile-tag-pill {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.1s ease;
  user-select: none;
}

.profile-tag-pill.active {
  background: #eff6ff;
  border-color: #2563eb;
  color: #2563eb;
  font-weight: 700;
}

/* WhatsApp Modal Preview */
.wa-template-box {
  background: #e7f8ef;
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 14px;
  margin-top: 10px;
  position: relative;
}

.wa-bubble {
  background: #ffffff;
  padding: 12px 14px;
  border-radius: 10px;
  border-bottom-left-radius: 2px;
  font-size: 13px;
  line-height: 1.5;
  color: #0f172a;
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
  white-space: pre-wrap;
}

.wa-preview-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: #065f46;
  font-weight: 600;
}

/* SiteFlow Bridge Modal styling */
.bridge-box {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-md);
  padding: 18px;
  margin-bottom: 16px;
}

.bridge-title {
  font-size: 15px;
  font-weight: 800;
  color: #065f46;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.bridge-desc {
  font-size: 12.5px;
  color: #047857;
  line-height: 1.4;
}

.bridge-summary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: #ffffff;
  padding: 12px;
  border-radius: 8px;
  margin-top: 12px;
  border: 1px solid #d1fae5;
}

.bridge-field label {
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
  display: block;
}

.bridge-field span {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
}

/* Lead Detail View Tabs */
.detail-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.detail-tab-btn {
  background: transparent;
  border: none;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #64748b;
  border-bottom: 2px solid transparent;
  cursor: pointer;
}

.detail-tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  font-weight: 700;
}

/* Follow-up History Log in Detail modal */
.history-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.timeline-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.timeline-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.timeline-content {
  flex: 1;
}

.timeline-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 3px;
}

.timeline-title {
  font-size: 12.5px;
  font-weight: 700;
  color: #0f172a;
}

.timeline-time {
  font-size: 11px;
  color: #94a3b8;
}

.timeline-notes {
  font-size: 12.5px;
  color: #334155;
  line-height: 1.4;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: #1e293b;
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 8px;
  animation: toastIn 0.25s ease-out;
}

.toast.toast-success { background: #065f46; border-left: 4px solid #10b981; }
.toast.toast-error { background: #991b1b; border-left: 4px solid #ef4444; }

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

/* Responsive adjustments for 14-inch laptops and compact desktops */
@media (max-width: 1400px) {
  .top-nav {
    padding: 6px 14px;
    gap: 8px;
    min-height: 54px;
  }
  .brand-logo-img {
    height: 32px;
  }
  .brand-title {
    font-size: 15px;
  }
  .nav-center {
    gap: 3px;
    padding: 2px;
  }
  .nav-btn {
    padding: 5px 9px;
    font-size: 12px;
    gap: 4px;
  }
  .user-profile-badge {
    padding: 3px 8px;
    font-size: 11.5px;
    gap: 5px;
  }
  #logged-user-role {
    display: none; /* Hide role on 14-inch screen to save space */
  }
  .btn {
    padding: 6px 10px;
    font-size: 12px;
  }
  .kpi-container {
    padding: 12px 16px 4px 16px;
    gap: 10px;
  }
  .toolbar-container {
    padding: 6px 16px;
  }
  .table-view-container, .kanban-view, .followups-view {
    padding: 10px 16px;
  }
}

@media (max-width: 1150px) {
  .nav-btn span {
    font-size: 11.5px;
  }
  .nav-btn {
    padding: 4px 7px;
  }
  #siteflow-header-link span {
    display: none; /* Icon only on tight viewports */
  }
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .top-nav {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 14px;
    gap: 10px;
  }
  .nav-center {
    order: 3;
    width: 100%;
    justify-content: space-between;
    overflow-x: auto;
  }
  .kpi-container {
    padding: 14px 14px 4px 14px;
    grid-template-columns: 1fr 1fr;
  }
  .toolbar-container {
    padding: 8px 14px;
  }
  .kanban-view, .table-view-container, .followups-view {
    padding: 10px 14px;
  }
  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr;
  }
}

/* ================= NEW ENHANCEMENTS: CONNECTIONS, CHOICE MODAL & UNIFIED KANBAN ================= */

/* Choice Modal Grid */
.choice-cards-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 520px) {
  .choice-cards-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.choice-card {
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: all 0.2s ease;
  background: #ffffff;
}

.choice-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.choice-card.choice-lead:hover {
  border-color: #2563eb;
  background: #f8faff;
}

.choice-card.choice-conn:hover {
  border-color: #0d9488;
  background: #f0fdfa;
}

.choice-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.choice-lead .choice-icon {
  background: #eff6ff;
}

.choice-conn .choice-icon {
  background: #ccfbf1;
}

.choice-info h4 {
  font-size: 15px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 4px;
}

.choice-info p {
  font-size: 12px;
  color: #64748b;
  line-height: 1.45;
  margin-bottom: 10px;
}

.choice-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
  background: #eff6ff;
  color: #1d4ed8;
}

.choice-badge.badge-purple {
  background: #ccfbf1;
  color: #0f766e;
}

/* Wing / Type Filter Toggle */
.type-filter-group {
  display: flex;
  align-items: center;
  gap: 4px;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.type-btn {
  background: transparent;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.type-btn:hover {
  color: #0f172a;
}

.type-btn.active {
  background: #ffffff;
  color: #0f172a;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Kanban Subnav & Legend */
.kanban-subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding: 6px 0 12px 0;
}

.kanban-legend {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #475569;
  background: #ffffff;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

.legend-separator {
  color: #cbd5e1;
  margin: 0 4px;
}

/* Card Face Quick Stage Dropdown */
.card-stage-select {
  width: 100%;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #0f172a;
  margin-top: 8px;
  cursor: pointer;
  outline: none;
  transition: all 0.15s ease;
}

.card-stage-select:hover {
  border-color: #94a3b8;
  background: #ffffff;
}

.card-stage-select:focus {
  border-color: var(--primary);
  background: #ffffff;
}

/* Code Pills & Badges */
.conn-card {
  border-left: 3.5px solid #0d9488 !important;
}

.conn-card:hover {
  border-color: #0d9488 !important;
}

.conn-code-pill {
  background: #ccfbf1;
  color: #0f766e;
  font-size: 11px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  border: 1px solid #99f6e4;
}

.category-pill {
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
}

.type-pill-lead {
  background: #eff6ff;
  color: #1d4ed8;
  font-weight: 800;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid #dbeafe;
}

.type-pill-conn {
  background: #ccfbf1;
  color: #0f766e;
  font-weight: 800;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border: 1px solid #99f6e4;
}

.extra-phones-pill {
  display: inline-block;
  font-size: 10.5px;
  background: #f1f5f9;
  color: #0284c7;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}

/* Extra Phone Numbers Input Row in Form */
.extra-phone-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.extra-phone-row input {
  flex: 2;
}

.extra-phone-row select {
  flex: 1;
}

.btn-remove-phone {
  background: transparent;
  border: none;
  color: #ef4444;
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
}

.btn-remove-phone:hover {
  background: #fee2e2;
}

/* Table Subnav */
.table-subnav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 14px 0;
  flex-wrap: wrap;
}

/* Warm Stage Styles */
.stage-warm {
  background: #fef3c7;
  color: #b45309;
  border-color: #fde68a;
}

/* Role Badges for Team & Users Matrix */
.role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.role-admin { background: #fef2f2; color: #dc2626; border: 1px solid #fee2e2; }
.role-sales-head { background: #eff6ff; color: #2563eb; border: 1px solid #dbeafe; }
.role-sales-exec { background: #f0fdf4; color: #16a34a; border: 1px solid #dcfce7; }
.role-site-team { background: #f5f3ff; color: #7c3aed; border: 1px solid #ede9fe; }

.perm-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 800;
}

.perm-yes { background: #dcfce7; color: #15803d; }
.perm-no { background: #f1f5f9; color: #94a3b8; }

.status-active {
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

.status-inactive {
  background: #f1f5f9;
  color: #64748b;
  border: 1px solid #cbd5e1;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
}

/* ================= 8. FOLLOW-UP HUB EXECUTIVE KPI CARDS (Single Row Layout) ================= */
.followup-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.fu-kpi-card {
  background: #ffffff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  min-width: 0;
}

.fu-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: #cbd5e1;
}

.fu-kpi-card.active {
  border-color: var(--primary);
  background: #f8faff;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.14);
}

.fu-kpi-card.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--primary);
}

.fu-kpi-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.fu-kpi-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.fu-kpi-label {
  font-size: 10.5px;
  font-weight: 800;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fu-kpi-number {
  font-size: 22px;
  font-weight: 900;
  color: #0f172a;
  line-height: 1.15;
  margin-top: 1px;
}

.fu-kpi-sub {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 900px) {
  .followup-kpi-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .followup-kpi-grid {
    grid-template-columns: 1fr;
  }
}

/* ================= 9. SALES PERSON BADGE & STATUS PILLS ================= */
.sales-person-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.siteflow-live-pill {
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
}

.survey-ready-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #99f6e4;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

/* ================= 10. PARTNER PERFORMANCE SCORECARD ================= */
.partner-scorecard-box {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  box-shadow: var(--shadow-sm);
}

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

.scorecard-header-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 6px;
}

.scorecard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.scorecard-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 10px 12px;
  text-align: center;
}

.scorecard-card-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.scorecard-card-val {
  font-size: 17px;
  font-weight: 900;
  color: #0f172a;
  margin-top: 4px;
}

/* ================= 11. SURVEY TABLE & INPUTS ================= */
.survey-table th {
  font-size: 11.5px;
  font-weight: 700;
  border-bottom: 1px solid #e2e8f0;
}

.survey-table td {
  padding: 6px 8px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.survey-input {
  width: 100%;
  padding: 5px 8px;
  font-size: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  outline: none;
  background: #ffffff;
  transition: border-color 0.15s ease;
}

.survey-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.survey-input-num {
  text-align: right;
  font-weight: 600;
}

.modal-xl {
  max-width: 1100px;
  width: 95%;
}

/* ================= 12. AUTHENTICATION & LOGIN SCREEN ================= */
.login-screen-wrapper {
  min-height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  padding: 20px;
  position: relative;
  z-index: 9999;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.1);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  animation: loginCardFadeIn 0.3s ease-out;
}

@keyframes loginCardFadeIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 22px;
}

.login-logo-wrap {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px auto;
  border-radius: 14px;
  background: #eff6ff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.15);
}

.login-logo-img {
  max-width: 52px;
  max-height: 52px;
  object-fit: contain;
}

.login-title {
  font-size: 21px;
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.4px;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
}

.login-error-alert {
  background: #fef2f2;
  border: 1px solid #fecdd3;
  color: #991b1b;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.login-form-group {
  margin-bottom: 16px;
}

.login-label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
}

.login-input {
  width: 100%;
  padding: 11px 14px;
  font-size: 14px;
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  outline: none;
  background: #f8fafc;
  color: #0f172a;
  transition: all 0.2s ease;
}

.login-input:focus {
  background: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.login-toggle-pw {
  font-size: 11.5px;
  color: #2563eb;
  cursor: pointer;
  font-weight: 600;
  user-select: none;
}
.login-toggle-pw:hover {
  text-decoration: underline;
}

.login-options-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.login-remember {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: #475569;
  cursor: pointer;
}

.login-remember input {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.btn-login-submit {
  width: 100%;
  padding: 12px;
  background: #2563eb;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-login-submit:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.35);
}

.btn-login-submit:active {
  transform: translateY(0);
}

.login-footer-info {
  margin-top: 20px;
  text-align: center;
  font-size: 11.5px;
  color: #94a3b8;
}

.user-profile-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 12px;
  border: 1px solid #e2e8f0;
}
