/* ==========================================================================
   Tank Tech Sales CRM — Enterprise Design System
   Synthesized from HubSpot, Linear, and Atlassian Design Systems
   ========================================================================== */

:root {
  /* Neutral Atlassian / Linear Foundation */
  --bg-page: #F4F5F7;
  --bg-surface: #FFFFFF;
  --bg-surface-subtle: #FAFBFC;
  --bg-input: #FFFFFF;
  --bg-hover: #EBECF0;
  
  /* Borders */
  --border-subtle: #EBECF0;
  --border-default: #DFE1E6;
  --border-focus: #4C9AFF;
  
  /* Text */
  --text-main: #172B4D;          /* Atlassian deep slate navy */
  --text-muted: #5E6C84;         /* Slate secondary */
  --text-subtle: #8993A4;        /* Slate placeholder/caption */
  
  /* Brand / Action Colors */
  --primary: #0052CC;            /* Atlassian deep blue */
  --primary-hover: #0065FF;
  --primary-subtle: #DEEBFF;
  
  /* Status Colors (Muted & Accessible) */
  --status-high-bg: #E3FCEF;
  --status-high-text: #006644;
  --status-high-dot: #36B37E;
  
  --status-medium-bg: #FFFAE6;
  --status-medium-text: #B76E00;
  --status-medium-dot: #FFAB00;
  
  --status-low-bg: #F4F5F7;
  --status-low-text: #42526E;
  --status-low-dot: #6B778C;
  
  --status-cold-bg: #FFEBE6;
  --status-cold-text: #DE350B;
  --status-cold-dot: #FF5630;
  
  /* Radii */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-full: 9999px;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  /* Shadows */
  --shadow-card: 0 1px 1px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
  --shadow-dropdown: 0 4px 8px -2px rgba(9, 30, 66, 0.25), 0 0 1px rgba(9, 30, 66, 0.31);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-page);
  color: var(--text-main);
  line-height: 1.45;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ─────────────────────────────────────────────────────────────
   ANTI-FLICKER INSTANT STATE MANAGEMENT
   ───────────────────────────────────────────────────────────── */
html.auth-verified #view-login { display: none !important; }
html.auth-verified #app-header { display: block !important; }
html.auth-verified #app-nav { display: block !important; }
html.auth-verified #app-main { display: block !important; }

html.auth-guest #view-login { display: block !important; }
html.auth-guest #app-header { display: none !important; }
html.auth-guest #app-nav { display: none !important; }
html.auth-guest #app-main { display: none !important; }

/* ─────────────────────────────────────────────────────────────
   TOP APP HEADER
   ───────────────────────────────────────────────────────────── */
.app-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-main);
}

.brand-logo-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  display: block;
}

.brand-icon {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--text-main);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.brand-title {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: -0.01em;
}

.brand-divider {
  color: var(--border-default);
  margin: 0 2px;
}

.brand-sub {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

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

.user-tag {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
}

.user-role-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--primary-subtle);
  padding: 1px 5px;
  border-radius: 3px;
}

/* ─────────────────────────────────────────────────────────────
   NAVIGATION BAR (LINEAR-STYLE RESTRAINED TABS)
   ───────────────────────────────────────────────────────────── */
.nav-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-default);
}

.nav-container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.tab-link {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.tab-link:hover {
  color: var(--text-main);
  background: var(--bg-surface-subtle);
}

.tab-link.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* ─────────────────────────────────────────────────────────────
   PAGE MAIN LAYOUT
   ───────────────────────────────────────────────────────────── */
.main-wrapper {
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 20px 48px;
  width: 100%;
  box-sizing: border-box;
}

.tab-panel.hidden {
  display: none !important;
}

/* ─────────────────────────────────────────────────────────────
   CARDS & CONTAINERS
   ───────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
  max-width: 100%;
  overflow: hidden;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}

.card-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.card-body {
  padding: 20px;
}

/* ─────────────────────────────────────────────────────────────
   SEGMENTED CONTROLS (HUBSPOT ACTIVITY SELECTOR)
   ───────────────────────────────────────────────────────────── */
.segmented-control {
  display: flex;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
}

.segment-btn {
  flex: 1;
  background: transparent;
  border: none;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  padding: 7px 12px;
  border-radius: 3px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.segment-btn:hover {
  color: var(--text-main);
}

.segment-btn.active {
  background: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 1px 2px rgba(9, 30, 66, 0.12);
  border: 1px solid rgba(9, 30, 66, 0.08);
}

/* ─────────────────────────────────────────────────────────────
   FORM FIELDSETS & INPUTS
   ───────────────────────────────────────────────────────────── */
.form-section {
  padding-bottom: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-subtle);
}

.form-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.section-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.form-group:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 5px;
}

label .required {
  color: #DE350B;
  margin-left: 2px;
}

.input-text,
.input-select,
.input-textarea {
  width: 100%;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text-main);
  background: var(--bg-input);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 8px 11px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.input-text:focus,
.input-select:focus,
.input-textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(76, 154, 255, 0.2);
}

.input-text::placeholder,
.input-textarea::placeholder {
  color: var(--text-subtle);
}

.input-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235E6C84' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 32px;
}

.input-textarea {
  min-height: 80px;
  resize: vertical;
}

.helper-text {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Location Status Banner */
.location-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.location-indicator {
  display: flex;
  align-items: center;
  gap: 7px;
}

.dot-indicator {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-subtle);
  flex-shrink: 0;
}

.dot-indicator.capturing {
  background: #0065FF;
  animation: pulse-dot 1.2s infinite ease-in-out;
}

.dot-indicator.captured {
  background: #36B37E;
}

.dot-indicator.unavailable {
  background: #FFAB00;
}

@keyframes pulse-dot {
  0% { transform: scale(0.8); opacity: 0.5; }
  50% { transform: scale(1.2); opacity: 1; }
  100% { transform: scale(0.8); opacity: 0.5; }
}

/* ─────────────────────────────────────────────────────────────
   PROGRESSIVE STEPPER WIZARD (MOBILE-FIRST 4-STEP FORM)
   ───────────────────────────────────────────────────────────── */
.wizard-header {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
}

.wizard-steps-indicator {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.wizard-step-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.wizard-step-count {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 600;
}

.wizard-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  height: 4px;
  border-radius: var(--radius-full);
  overflow: hidden;
  background: var(--border-subtle);
}

.wizard-bar-segment {
  height: 100%;
  background: var(--border-subtle);
  border-radius: 2px;
  transition: background-color 0.2s ease;
}

.wizard-bar-segment.active,
.wizard-bar-segment.completed {
  background: var(--primary);
}

.wizard-step {
  display: none;
}

.wizard-step.active {
  display: block;
}

.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
}

/* ─────────────────────────────────────────────────────────────
   INTEREST & OBJECTION SELECTION (RESTRAINED PILLS)
   ───────────────────────────────────────────────────────────── */
.radio-pill-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.radio-pill {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.radio-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-pill:hover {
  background: var(--bg-surface-subtle);
  border-color: #B3BAC5;
}

.radio-pill.selected {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.pill-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 2px;
}

.pill-sub {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.3;
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* Objections Checkbox Grid */
.checkbox-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.checkbox-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  color: var(--text-main);
  cursor: pointer;
  user-select: none;
  transition: all 0.15s ease;
}

.checkbox-pill:hover {
  background: var(--bg-hover);
}

.checkbox-pill.selected {
  background: #EBECF0;
  border-color: #B3BAC5;
  font-weight: 600;
}

.checkbox-pill input {
  cursor: pointer;
}

/* ─────────────────────────────────────────────────────────────
   BUTTONS
   ───────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  text-decoration: none;
}

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

.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-default {
  background: var(--bg-surface);
  border-color: var(--border-default);
  color: var(--text-main);
}

.btn-default:hover {
  background: var(--bg-surface-subtle);
  border-color: #B3BAC5;
}

.btn-subtle {
  background: transparent;
  color: var(--text-muted);
}

.btn-subtle:hover {
  color: var(--text-main);
  background: var(--bg-surface-subtle);
}

.btn-save-visit {
  width: 100%;
  padding: 10px;
  font-size: 14px;
}

/* ─────────────────────────────────────────────────────────────
   DATA TABLES (ATLASSIAN JIRA / LINEAR STYLE)
   ───────────────────────────────────────────────────────────── */
.table-container {
  overflow-x: auto;
}

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

.data-table th {
  background: var(--bg-surface-subtle);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-default);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  vertical-align: middle;
}

.data-table tbody tr:hover {
  background: #FAFBFC;
}

/* Status Tag */
.status-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.tag-high { background: var(--status-high-bg); color: var(--status-high-text); }
.tag-medium { background: var(--status-medium-bg); color: var(--status-medium-text); }
.tag-low { background: var(--status-low-bg); color: var(--status-low-text); }
.tag-cold { background: var(--status-cold-bg); color: var(--status-cold-text); }

.tag-product-galah {
  background: #E3FCEF;
  color: #006644;
}

.tag-product-contructa {
  background: #FFFAE6;
  color: #B76E00;
}

/* ─────────────────────────────────────────────────────────────
   FOUNDER DASHBOARD KPI METRICS
   ───────────────────────────────────────────────────────────── */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 24px;
}

.kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
}

.kpi-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.kpi-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.1;
  margin-bottom: 4px;
}

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

/* ─────────────────────────────────────────────────────────────
   LOGIN VIEW
   ───────────────────────────────────────────────────────────── */
.login-wrap {
  max-width: 360px;
  margin: 80px auto;
}

.login-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  box-shadow: var(--shadow-card);
}

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

.login-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-main);
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.banner-alert {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.banner-error {
  background: #FFEBE6;
  color: #DE350B;
  border: 1px solid #FFBDAD;
}

.banner-success {
  background: #E3FCEF;
  color: #006644;
  border: 1px solid #ABF5D1;
}

/* Team Management Layout */
.team-layout {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: 20px;
}

.dashboard-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

/* Utilities */
.hidden { display: none !important; }

/* Toast Notifications */
.toast-notification {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #091E42;
  color: #FFFFFF;
  padding: 10px 18px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 14px rgba(9, 30, 66, 0.25);
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast-notification.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-notification.toast-success {
  background: #006644;
}

.toast-notification.toast-error {
  background: #DE350B;
}

/* ─────────────────────────────────────────────────────────────
   MOBILE & TABLET RESPONSIVE SYSTEM
   ───────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .team-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .header-container {
    padding: 0 14px;
    height: 52px;
  }

  .brand-sub, .brand-divider {
    display: none;
  }

  .user-tag {
    padding: 3px 8px;
    font-size: 11.5px;
  }

  .nav-container {
    padding: 0 12px;
    gap: 2px;
    scrollbar-width: none;
  }
  .nav-container::-webkit-scrollbar {
    display: none;
  }

  .tab-link {
    padding: 8px 12px;
    font-size: 12.5px;
  }

  .main-wrapper {
    padding: 14px 10px 48px;
  }

  .card-header {
    padding: 14px 16px;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .dashboard-header .btn {
    width: 100%;
    text-align: center;
  }

  /* Compact 2-column KPI grid on mobile */
  .kpi-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 16px;
  }

  .kpi-card {
    padding: 12px 14px;
  }

  .kpi-label {
    font-size: 10.5px;
    margin-bottom: 4px;
  }

  .kpi-value {
    font-size: 22px;
    margin-bottom: 2px;
  }

  .kpi-subtext {
    font-size: 11px;
    line-height: 1.3;
  }

  /* Table horizontal touch scroll */
  .table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-sm);
  }

  .data-table {
    min-width: 600px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
    font-size: 12px;
  }
}

@media (max-width: 640px) {
  .form-row { grid-template-columns: 1fr; }
  .radio-pill-group { grid-template-columns: 1fr; }
  .checkbox-grid { grid-template-columns: 1fr; }
  .card-body { padding: 14px; }
}

@media (max-width: 480px) {
  .segmented-control {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

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

/* ─────────────────────────────────────────────────────────────
   CUSTOMER PROFILE & RELATIONSHIP TIMELINE DRAWER
   ───────────────────────────────────────────────────────────── */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 30, 66, 0.54);
  backdrop-filter: blur(2px);
  z-index: 1000;
  transition: opacity 0.22s ease;
}

.drawer-backdrop.hidden,
.modal-backdrop.hidden {
  display: none !important;
}

.drawer-panel {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 580px;
  max-width: 100vw;
  background: var(--bg-surface);
  z-index: 1001;
  box-shadow: -6px 0 28px rgba(9, 30, 66, 0.22);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.drawer-header {
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
}

.drawer-title {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
  letter-spacing: -0.01em;
}

.drawer-subtitle {
  font-size: 12.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.btn-drawer-close {
  background: transparent;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: var(--text-subtle);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.btn-drawer-close:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}

.drawer-actions-bar {
  padding: 12px 22px;
  background: var(--bg-surface-subtle);
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.drawer-summary-card {
  margin: 18px 22px 8px;
  padding: 16px 18px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}

.drawer-summary-card .summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 18px;
}

.summary-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.summary-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-subtle);
}

.summary-val {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-main);
}

.summary-stage-select {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-default);
  background: #FFFFFF;
  color: var(--text-main);
  font-weight: 600;
  cursor: pointer;
}

.summary-stage-select:focus {
  border-color: var(--primary);
  outline: none;
}

/* Timeline Feed */
.timeline-section {
  padding: 18px 22px 30px;
}

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

.timeline-header h4 {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.timeline-feed {
  position: relative;
  padding-left: 22px;
}

.timeline-feed::before {
  content: '';
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border-default);
}

.timeline-item {
  position: relative;
  margin-bottom: 18px;
}

.timeline-marker {
  position: absolute;
  left: -22px;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--primary);
  border: 3px solid #FFFFFF;
  box-shadow: 0 0 0 1px var(--border-default);
}

.timeline-marker.phone { background: #00B8D9; }
.timeline-marker.whatsapp { background: #25D366; }
.timeline-marker.demo { background: #6554C0; }

.timeline-content {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  box-shadow: 0 1px 3px rgba(9, 30, 66, 0.06);
}

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

.timeline-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.timeline-notes {
  font-size: 13px;
  color: var(--text-main);
  line-height: 1.45;
  margin-bottom: 8px;
  word-break: break-word;
}

.timeline-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-muted);
}

.timeline-rep {
  font-weight: 500;
  color: var(--text-main);
}

/* Modals */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(9, 30, 66, 0.54);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1050;
  padding: 16px;
}

.modal-box {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 36px rgba(9, 30, 66, 0.28);
  width: 100%;
  max-width: 580px;
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 5;
}

.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

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

.modal-body {
  padding: 20px 22px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--border-subtle);
}

/* Clickable Company Link in Data Tables */
.company-link {
  color: var(--primary);
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s ease;
}

.company-link:hover {
  color: var(--primary-hover);
  text-decoration: underline;
}

.company-link::after {
  content: '↗';
  font-size: 11px;
  opacity: 0.6;
}

.btn-action-followup {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid rgba(0, 82, 204, 0.2);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.btn-action-followup:hover {
  background: var(--primary);
  color: #FFFFFF;
}

.btn-action-wa {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: #E3FCEF;
  color: #006644;
  border: 1px solid rgba(54, 179, 126, 0.25);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: all 0.15s ease;
}

.btn-action-wa:hover {
  background: #25D366;
  color: #FFFFFF;
}

/* ─────────────────────────────────────────────────────────────
   MOBILE-FIRST LEADS LIST & SALES PIPELINE
   ───────────────────────────────────────────────────────────── */

/* Desktop vs Mobile Toggle */
.desktop-leads-table {
  display: block;
}

.mobile-leads-container {
  display: none;
}

.mobile-stage-selector {
  display: none;
}

/* Pipeline Container & Board */
.pipeline-view-container {
  padding: 16px;
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.pipeline-view-container::-webkit-scrollbar {
  height: 6px;
}
.pipeline-view-container::-webkit-scrollbar-track {
  background: #F4F5F7;
  border-radius: 3px;
}
.pipeline-view-container::-webkit-scrollbar-thumb {
  background: #DFE1E6;
  border-radius: 3px;
}
.pipeline-view-container::-webkit-scrollbar-thumb:hover {
  background: #C1C7D0;
}

.pipeline-board {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  width: 100%;
  min-width: 1060px;
  box-sizing: border-box;
  transition: all 0.2s ease;
}

.pipeline-board.single-stage-view {
  min-width: 100%;
  justify-content: center;
}

.pipeline-board.single-stage-view .pipeline-col {
  max-width: 480px;
  flex: 0 0 100%;
}

.pipeline-col {
  flex: 1 1 0;
  min-width: 165px;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  box-shadow: 0 1px 2px rgba(9, 30, 66, 0.04);
  box-sizing: border-box;
}

.pipeline-col.stage-hidden,
.pipeline-col.mobile-hidden-stage {
  display: none !important;
}

.pipeline-col-header {
  padding: 10px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid var(--border-subtle);
  background: #FFFFFF;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  gap: 6px;
}

.pipeline-col[data-stage="CONTACTED"] .pipeline-col-header { border-bottom-color: #4C9AFF; }
.pipeline-col[data-stage="QUALIFIED"] .pipeline-col-header { border-bottom-color: #0052CC; }
.pipeline-col[data-stage="DEMO_SCHEDULED"] .pipeline-col-header { border-bottom-color: #6554C0; }
.pipeline-col[data-stage="PROPOSAL_SENT"] .pipeline-col-header { border-bottom-color: #FFAB00; }
.pipeline-col[data-stage="WON"] .pipeline-col-header { border-bottom-color: #36B37E; }
.pipeline-col[data-stage="LOST"] .pipeline-col-header { border-bottom-color: #DE350B; }

.pipeline-col-title {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-main);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pipeline-col-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 1px 7px;
  border-radius: var(--radius-full);
  background: var(--bg-hover);
  color: var(--text-muted);
}

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

.pipeline-card {
  background: #FFFFFF;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 10px 11px;
  box-shadow: 0 1px 2px rgba(9, 30, 66, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.pipeline-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(9, 30, 66, 0.12);
}

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

.pipeline-card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
  display: block;
  margin-bottom: 3px;
  word-break: break-word;
}

.pipeline-card-title:hover {
  text-decoration: underline;
}

.pipeline-card-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.pipeline-card-contact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-bottom: 8px;
  background: var(--bg-surface-subtle);
  padding: 5px 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  gap: 4px;
  flex-wrap: wrap;
}

.pipeline-card-notes {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.35;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pipeline-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-subtle);
  border-top: 1px solid var(--border-subtle);
  padding-top: 7px;
  gap: 4px;
  flex-wrap: wrap;
}

.btn-pipeline-advance {
  padding: 3px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  background: var(--primary-subtle);
  color: var(--primary);
  border: 1px solid rgba(0, 82, 204, 0.2);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-pipeline-advance:hover {
  background: var(--primary);
  color: #FFFFFF;
}

/* ─────────────────────────────────────────────────────────────
   MOBILE CUSTOMER CARDS (DEDICATED FOR SMARTPHONE SCREENS)
   ───────────────────────────────────────────────────────────── */
.mobile-lead-card {
  background: #FFFFFF;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: 0 1px 3px rgba(9, 30, 66, 0.08);
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: box-shadow 0.15s ease;
}

.mobile-lead-card:active {
  background: var(--bg-surface-subtle);
}

.mobile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.mobile-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  line-height: 1.3;
  word-break: break-word;
}

.mobile-card-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

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

.mobile-card-meta-box {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12.5px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mobile-meta-label {
  color: var(--text-subtle);
  font-size: 11.5px;
}

.mobile-meta-val {
  color: var(--text-main);
  font-weight: 500;
}

/* Touch-Friendly Mobile Action Bar */
.mobile-touch-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 4px;
}

.btn-mobile-wa {
  height: 40px;
  background: #25D366;
  color: #FFFFFF !important;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  box-shadow: 0 1px 2px rgba(37, 211, 102, 0.25);
}

.btn-mobile-wa:active {
  background: #1EBE5D;
}

.btn-mobile-followup {
  height: 40px;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-mobile-followup:active {
  background: var(--primary-hover);
}

.mobile-stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border-subtle);
}

.mobile-stage-select {
  height: 38px;
  flex: 1;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-main);
  background: #FFFFFF;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  padding: 0 8px;
}

/* Mobile Stage Filter Bar for Pipeline View */
.mobile-stage-selector {
  display: flex;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  gap: 6px;
  padding: 4px 0 12px;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 14px;
}

.stage-pill-btn {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--radius-full);
  background: var(--bg-surface-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-default);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.stage-pill-btn.active {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.stage-pill-count {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: rgba(0, 0, 0, 0.08);
}

.stage-pill-btn.active .stage-pill-count {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

/* ─────────────────────────────────────────────────────────────
   RESPONSIVE BREAKPOINTS (< 768px SMARTPHONE SCREEN ADAPTATION)
   ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Hide desktop tables that require awkward horizontal scrolling */
  .desktop-leads-table {
    display: none !important;
  }

  /* Show mobile thumb cards */
  .mobile-leads-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 0;
  }

  /* In mobile pipeline view, show single-column cards instead of 6-column horizontal sprawl */
  .pipeline-board {
    min-width: 100% !important;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overflow-x: visible;
  }

  .pipeline-col {
    min-width: 100% !important;
    max-width: 100% !important;
    max-height: none;
  }

  .pipeline-board.single-stage-view .pipeline-col {
    max-width: 100% !important;
  }

  .pipeline-view-container {
    padding: 12px 0;
  }
}




