/* Sugar Alchemy Sales - Rep Portal Styles */

:root {
    /* Sugar Alchemy Brand Colors */
    --primary-purple: #3D3B8E;
    --primary-purple-dark: #2e2c6e;
    --primary-purple-light: #5250a8;
    --secondary-purple: #eeeef5;
    
    /* Semantic Colors */
    --success-green: #10B981;
    --warning-orange: #F59E0B;
    --danger-red: #EF4444;
    --info-blue: #3B82F6;
    
    /* Neutral Colors */
    --text-primary: #13142B;
    --text-secondary: #6B7280;
    --text-disabled: #9CA3AF;
    --bg-primary: #FFFFFF;
    --bg-secondary: #f5f7ff;
    --bg-tertiary: #eef2ff;
    --border-color: #e4e7f2;
    
    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(180deg, #f0edff 0%, #f5f3ff 100%);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(6px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 32px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.header-logo {
    display: flex;
    align-items: center;
    justify-self: start;
}

.header-logo-img {
    height: 56px;
    width: auto;
    object-fit: contain;
}

.header-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
    margin: 0;
}

.btn-logout {
    background: var(--danger-red);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: #DC2626;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-self: end;
}

.account-menu {
    position: relative;
}

.account-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #eeeef5;
    color: #13142B;
    border: 1px solid #d1d1e0;
    padding: 8px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.account-btn:hover {
    background: #e2e2ef;
    border-color: #b5b5cc;
}

.account-caret {
    font-size: 11px;
    opacity: 0.8;
}

.account-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 150px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
    padding: 6px;
    display: none;
    z-index: 150;
}

.account-dropdown.open {
    display: block;
}

.account-dropdown-item {
    width: 100%;
    border: none;
    background: transparent;
    text-align: left;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    padding: 9px 10px;
    cursor: pointer;
}

.account-dropdown-item:hover {
    background: #f3f4f6;
}

.account-dropdown-item.logout-item {
    color: #dc2626;
}

.account-dropdown-item.logout-item:hover {
    background: #fef2f2;
}

/* Navigation Tabs (matches admin layout) */
.nav-tabs {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: nowrap;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 12px;
    margin-bottom: 24px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-width: thin;
    scrollbar-color: var(--primary-purple) var(--bg-tertiary);
}

/* Webkit scrollbar styling for navigation */
.nav-tabs::-webkit-scrollbar {
    height: 4px;
}

.nav-tabs::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

.nav-tabs::-webkit-scrollbar-thumb {
    background: var(--primary-purple);
    border-radius: 2px;
}

.nav-tabs::-webkit-scrollbar-thumb:hover {
    background: var(--primary-purple-dark);
}

.nav-tab {
    padding: 10px 18px;
    text-decoration: none;
    color: var(--text-secondary);
    font-weight: 600;
    border-radius: 999px;
    transition: all 0.2s;
    border: 1px solid transparent;
    box-shadow: none;
    white-space: nowrap;
    flex-shrink: 0;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-family: inherit;
}

.nav-tab:hover {
    background: #eeeef5;
    border-color: #d1d1e0;
    color: #13142B;
}

.nav-tab.active {
    color: white;
    background: #3D3B8E;
    border-color: #3D3B8E;
    box-shadow: 0 1px 3px rgba(61, 59, 142, 0.3);
}

/* Mobile responsive navigation */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }
    .rep-main-container {
        padding: 12px;
        max-width: 100%;
        box-sizing: border-box;
    }
    .container {
        padding: 12px;
        max-width: 100%;
        box-sizing: border-box;
    }
    .nav-tabs {
        padding: 6px 10px;
        gap: 4px;
        margin-bottom: 6px;
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    
    .nav-tabs::-webkit-scrollbar {
        display: none;
    }
    
    .nav-tab {
        padding: 8px 14px;
        font-size: 13px;
        flex-shrink: 0;
        white-space: nowrap;
    }
}

/* Buttons */
.btn-primary {
    background: var(--primary-purple);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: var(--primary-purple-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: var(--bg-primary);
    border-color: var(--primary-purple);
}

.btn-success {
    background: var(--success-green);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    display: inline-block;
}

/* Cards */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.card-header {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.status-badge { padding: 3px 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.status-badge.pending { background: #fef3c7; color: #92400e; }
.status-badge.completed { background: #dcfce7; color: #166534; }
.status-badge.overdue { background: #fee2e2; color: #991b1b; }

/* Shared Performance Board Tokens + Utilities (Rep/Admin parity) */
:root {
  --perf-bg: #ffffff;
  --perf-muted: #6b7280;
  --perf-text: #111827;
  --perf-border: #e5e7eb;
  --perf-soft: #f8fafc;
  --perf-danger: #dc2626;
  --perf-danger-soft: #fff7f7;
  --perf-warn: #b45309;
  --perf-warn-soft: #fff7ed;
  --perf-ok: #0f766e;
}

.perf-board-grid-3 { display: grid; grid-template-columns: repeat(3, minmax(120px, 1fr)); gap: 10px; margin-bottom: 10px; }
.perf-board-grid-4 { display: grid; grid-template-columns: repeat(4, minmax(120px, 1fr)); gap: 8px; margin-bottom: 10px; }
.perf-board-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.perf-tile {
  padding: 10px;
  border: 1px solid var(--perf-border);
  border-radius: 8px;
  background: var(--perf-bg);
  text-align: left;
  cursor: pointer;
}
.perf-tile-label { font-size: 11px; color: var(--perf-muted); }
.perf-tile-value { font-size: 20px; font-weight: 800; color: var(--perf-text); }
.perf-tile-sub { font-size: 12px; font-weight: 700; }
.perf-tile-sub.muted { color: var(--perf-muted); }
.perf-tile-sub.warn { color: var(--perf-warn); }
.perf-tile-sub.danger { color: var(--perf-danger); }
.perf-tile-sub.ok { color: var(--perf-ok); }

.perf-box {
  padding: 10px;
  border: 1px solid var(--perf-border);
  border-radius: 8px;
  background: var(--perf-soft);
  margin-bottom: 10px;
}
.perf-box.white { background: var(--perf-bg); }
.perf-box-title { font-size: 12px; font-weight: 700; color: #374151; margin-bottom: 6px; }
.perf-box-text { font-size: 13px; color: #374151; }

.perf-tile-soft-danger { border-color: #fecaca; background: var(--perf-danger-soft); }
.perf-tile-soft-warn { border-color: #ffedd5; background: var(--perf-warn-soft); }

/* Samples table: less cluttered, better spacing */
.samples-table-wrap { padding: 20px 24px; }
.samples-table-title { margin: 0 0 16px 0; font-size: 18px; font-weight: 700; color: var(--text-primary); }
.samples-table { table-layout: fixed; }
.samples-table th, .samples-table td { padding: 14px 16px; }
.samples-table tbody tr { border-bottom: 1px solid #e5e7eb; }
.samples-table tbody tr:last-child { border-bottom: none; }
.samples-table .samp-th-customer { width: 22%; min-width: 140px; }
.samples-table .samp-th-city { width: 12%; min-width: 90px; }
.samples-table .samp-th-product { width: 10%; min-width: 70px; }
.samples-table .samp-th-status { width: 10%; min-width: 85px; }
.samples-table .samp-th-feedback { width: 18%; min-width: 100px; }
.samples-table .samp-th-next { width: 14%; min-width: 110px; }
.samples-table .samp-th-date { width: 9%; min-width: 75px; }
.samples-table .samp-th-actions { width: 12%; min-width: 90px; }
.samples-table .samp-td-customer { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Samples table: scroll horizontally on small screens */
.samples-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    max-width: 100%;
    min-width: 0;
}
.samples-table { min-width: 700px; table-layout: auto; }

/* Legacy metrics (keep for other tabs) */
.metrics-row {
    display: flex;
    gap: 20px;
    margin-bottom: var(--spacing-xl);
}
.metrics-group {
    flex: 1;
    min-width: 0;
    background: #fff;
    border-radius: 14px;
    padding: 16px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.metrics-group-title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.metrics-group-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.metrics-group-cards .stat-card {
    padding: 12px 14px;
    margin: 0;
    box-shadow: none;
    background: #f9fafb;
}
.metrics-group-cards .stat-value {
    font-size: 24px;
}

/* Stars section */
.my-stars-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 10px;
}
.my-stars-badge {
    font-size: 36px;
    line-height: 1;
}
.my-stars-count {
    font-size: 22px;
    font-weight: 700;
    color: #1f2937;
}
.my-stars-label {
    font-size: 13px;
    color: #6b7280;
    margin-top: 2px;
}
.my-stars-latest {
    padding: 10px 14px;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 3px solid #f59e0b;
}
.team-lb-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 14px;
}
.team-lb-row:nth-child(even) {
    background: #f9fafb;
}
.team-lb-me {
    background: #ede9fe !important;
    font-weight: 600;
}
.team-lb-name {
    color: #374151;
}
.team-lb-stars {
    font-weight: 600;
    color: #1f2937;
}

/* Rep dashboard star awards - medal style (like admin) */
/* Rep dashboard: Milestones (left) + Recent Stars (right) */
.rep-dash-milestones-stars-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}
.rep-dash-milestones-card, .rep-dash-stars-card {
    min-height: 120px;
}
.rep-dash-section-title {
    margin: 0 0 12px;
    font-size: 15px;
    color: #374151;
}
.rep-dash-milestones-section {
    margin-bottom: 14px;
}
.rep-dash-milestones-section:last-child { margin-bottom: 0; }
.rep-dash-weekly-report-reminder {
    margin-top: 14px;
    padding: 10px 12px;
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #fbbf24;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #92400e;
}
.rep-dash-weekly-report-reminder a:hover {
    text-decoration: underline !important;
}
.rep-dash-milestones-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6b7280;
    margin-bottom: 6px;
}
#rep-dash-stars {
    max-height: 360px;
    overflow-y: auto;
}
@media (max-width: 768px) {
    .rep-dash-milestones-stars-row { grid-template-columns: 1fr; }
}

.rep-dash-star-item {
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}
.rep-dash-star-item.rep-dash-star-medal {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #fbbf24;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 8px;
    border-bottom: none;
}
.rep-dash-star-item .medal {
    font-size: 28px;
    margin-bottom: 6px;
}
.celebration-item {
    padding: 10px 12px;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}
.celebration-item.celebration-item-medal {
    background: linear-gradient(135deg, #fef3c7, #fde68a);
    border: 1px solid #fbbf24;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 8px;
    border-bottom: none;
}
.celebration-item .medal {
    font-size: 28px;
    margin-bottom: 6px;
}
.lb-period-select {
    padding: 5px 28px 5px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    background: #f9fafb;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 24 24' fill='none' stroke='%236b7280' 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 8px center;
}
.lb-period-select:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99,102,241,0.1);
}
.lb-period-select:hover {
    border-color: #c7d2fe;
    background-color: #fff;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.stat-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border-left: 4px solid var(--primary-purple);
    box-shadow: var(--shadow-sm);
}

.stat-card.warning {
    border-left-color: var(--warning-orange);
}

.stat-card.info {
    border-left-color: var(--info-blue);
}

.stat-card.success {
    border-left-color: var(--success-green);
}

.stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary-purple);
    margin: var(--spacing-sm) 0;
}

.stat-card.warning .stat-value {
    color: var(--warning-orange);
}

.stat-card.info .stat-value {
    color: var(--info-blue);
}

.stat-card.success .stat-value {
    color: var(--success-green);
}

/* Dashboard layout - match admin (spread out) */
#tab-dashboard .stats-grid.dash-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}
@media (min-width: 768px) {
    #tab-dashboard .stats-grid.dash-stats-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}
#tab-dashboard .stats-grid.dash-stats-grid .stat-card {
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-left: none;
}
#tab-dashboard .stats-grid.dash-stats-grid .stat-value {
    font-size: 32px;
    color: #13142B;
}
#tab-dashboard .stats-grid.dash-stats-grid .stat-label {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}
#tab-dashboard .card {
    padding: 18px;
    margin-bottom: 20px;
}
#tab-dashboard .card h2,
#tab-dashboard .section-title {
    font-size: 20px;
    font-weight: 600;
    color: #13142B;
    margin: 0 0 12px 0;
}
#tab-dashboard .section-header {
    margin-bottom: 12px;
}
.act-stat-card {
    background: #f0f9ff;
    padding: 12px 20px;
    border-radius: 10px;
    border: 1px solid #bae6fd;
}
.act-stat-card:nth-of-type(2) {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.act-stat-card:nth-of-type(3) {
    background: #fffbeb;
    border-color: #fde68a;
}
.act-filter-select {
    flex: 1 1 auto;
    min-width: 120px;
    padding: 9px 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    background: #f9fafb;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' 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 12px center;
    padding-right: 32px;
}
.act-filter-select:focus {
    outline: none;
    border-color: #6366f1;
}
#tab-dashboard table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
}
#tab-dashboard thead {
    background: #f1f5f9;
}
#tab-dashboard th {
    padding: 12px 16px;
    text-align: left;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
}
#tab-dashboard table td:last-child {
    min-width: 280px;
}
#tab-dashboard td {
    padding: 14px 16px;
    border-top: 1px solid #e2e8f0;
    font-size: 14px;
}
#tab-dashboard tbody tr:hover {
    background: #f8fafc;
}

.lead-actions-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px;
}
.btn-lead-action {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
    color: #3D3B8E;
    background: #e8e6f0;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    white-space: nowrap;
}
.btn-lead-action:hover {
    background: #3D3B8E;
    color: white;
    border-color: #3D3B8E;
}
.btn-lead-whatsapp {
    background: #dcfce7;
    color: #166534;
    border-color: #86efac;
}
.btn-lead-whatsapp:hover {
    background: #22c55e;
    color: white;
    border-color: #22c55e;
}
.btn-lead-logcall {
    background: #ffedd5;
    color: #c2410c;
    border-color: #fdba74;
}
.btn-lead-logcall:hover {
    background: #ea580c;
    color: white;
    border-color: #ea580c;
}

/* Leads tab - match Dashboard layout */
#tab-leads .container {
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
}
#tab-leads .card {
  padding: 18px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow: hidden;
}
#tab-leads .leads-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  min-width: 0;
  margin-bottom: 16px;
}
#tab-leads .leads-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
#tab-leads .leads-header .section-title { margin: 0; }
#tab-leads .lifecycle-tabs {
  display: flex;
  width: 100%;
  min-width: 0;
  padding: 6px;
  gap: 6px;
  background: #f3f4f6;
  border-radius: 10px;
  box-sizing: border-box;
}
#tab-leads .lifecycle-tab {
  flex: 1;
  padding: 8px 12px !important;
  font-size: 13px !important;
  text-align: center;
}
#tab-leads .leads-search-filters-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  width: 100%;
}
#tab-leads .leads-search-wrap {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 12px;
}
#tab-leads .leads-search-wrap .search-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  height: 38px;
  padding: 0 14px;
  font-size: 14px;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}
#tab-leads .leads-search-wrap .search-input:focus {
  outline: none;
  border-color: var(--primary, #3D3B8E);
}
#tab-leads .leads-filter-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
#tab-leads .leads-filter-label {
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}
#tab-leads .leads-search-filters-row .filter-select {
  height: 36px;
  padding: 0 10px;
  font-size: 13px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: white;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}
#tab-leads .leads-search-filters-row .filter-select:hover {
  border-color: #9ca3af;
}
#tab-leads .leads-search-filters-row .filter-select:focus {
  outline: none;
  border-color: var(--primary, #3D3B8E);
}
#tab-leads .leads-search-wrap .cust-result-count {
  font-size: 13px;
  color: #64748b;
  font-weight: 500;
  flex-shrink: 0;
  white-space: nowrap;
}
#tab-leads #rep-city-workboard,
#tab-leads #rep-city-quick-tags {
  display: block;
  width: 100%;
  max-width: 100%;
}
#tab-leads .rep-city-workboard-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
}
#tab-leads .rep-city-card {
  text-align: left;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  cursor: pointer;
  min-width: 0;
  width: 100%;
  line-height: 1.2;
}
#tab-leads .rep-city-card.active {
  border-color: #3b82f6;
  background: #eff6ff;
}
#tab-leads .rep-city-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}
#tab-leads .rep-city-card-title {
  font-size: 12px;
  font-weight: 800;
  color: #111827;
  word-break: break-word;
  flex: 1;
  min-width: 0;
}
#tab-leads .rep-city-card-total {
  flex-shrink: 0;
  min-width: 26px;
  text-align: center;
  border-radius: 999px;
  padding: 2px 7px;
  background: #f3f4f6;
  color: #111827;
  font-size: 11px;
  font-weight: 800;
}
#tab-leads .rep-city-card.active .rep-city-card-total {
  background: #dbeafe;
  color: #1d4ed8;
}
#tab-leads .rep-city-card-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}
#tab-leads .rep-city-stat-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 2px 6px;
  background: #f8fafc;
  color: #475569;
  font-size: 10px;
  font-weight: 700;
}
#tab-leads .rep-city-quick-tags-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
#tab-leads .rep-city-quick-tag {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
#tab-leads .rep-city-quick-tag.active {
  border-color: #3b82f6;
  background: #dbeafe;
  color: #1d4ed8;
}
#tab-leads table th { padding: 10px 12px; font-size: 13px; }
#tab-leads table td { padding: 10px 12px; font-size: 13px; }
#tab-leads table td:last-child { padding: 8px 12px; white-space: nowrap; }
#tab-leads .tier-select {
  padding: 4px 8px;
  font-size: 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  min-width: 100px;
}
#tab-leads .tier-select:hover { border-color: #3D3B8E; }
#tab-leads .tier-select:focus { outline: none; border-color: #3D3B8E; box-shadow: 0 0 0 2px rgba(61,59,142,0.2); }

.lead-name-link {
    color: var(--primary-purple);
    font-weight: 600;
    text-decoration: none;
}
.lead-name-link:hover {
    text-decoration: underline;
}

/* Customer Portfolio - proper spacing */
.portfolio-container { padding: 24px 20px; }
.portfolio-sub-tab {
    padding: 10px 20px;
    border: none;
    background: #f3f4f6;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
}
.portfolio-sub-tab.active {
    background: var(--primary-purple);
    color: white;
}
.portfolio-sub-tab:hover:not(.active) {
    color: #374151;
    background: #e5e7eb;
}
.portfolio-card { padding: 24px; margin-bottom: 24px; }
.portfolio-table th { padding: 14px 18px; font-size: 14px; }
.portfolio-table td { padding: 16px 18px; font-size: 14px; }
.portfolio-table td:last-child { min-width: 280px; }
.portfolio-detail {
    padding: 24px;
    margin-top: 24px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.portfolio-detail .profile-section { margin-bottom: 28px; }
.portfolio-detail .profile-section:last-child { margin-bottom: 0; }
.portfolio-detail .profile-info > div { margin-bottom: 10px; }
.portfolio-detail .interaction-item,
.portfolio-detail .followup-item { padding: 12px 0; margin-bottom: 8px; }

.profile-section-hint {
  font-size: 13px;
  color: #6b7280;
  margin: -4px 0 12px 0;
}

/* Activity Timeline - unified calls, orders, follow-ups */
.activity-timeline-item {
  padding: 12px 16px;
  margin-bottom: 10px;
  border-radius: 10px;
  border-left: 4px solid #d1d5db;
  background: #f9fafb;
}
.activity-timeline-item.activity-call { border-left-color: #3D3B8E; background: #f5f3ff; }
.activity-timeline-item.activity-order { border-left-color: #059669; background: #f0fdf4; }
.activity-timeline-item.activity-followup { border-left-color: #d97706; background: #fffbeb; }
.activity-timeline-label { font-weight: 600; font-size: 14px; color: #374151; margin-bottom: 4px; }
.activity-timeline-date { font-size: 12px; color: #6b7280; margin-bottom: 4px; }
.activity-timeline-sub { font-size: 13px; color: #4b5563; margin-bottom: 4px; }
.activity-timeline-detail,
.activity-timeline-extra,
.activity-timeline-products { font-size: 13px; color: #6b7280; margin-top: 4px; }
.activity-timeline-products .cust-product-pill-green { margin-right: 6px; }

.stat-description {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Forms */
input[type="text"],
input[type="search"],
input[type="tel"],
input[type="email"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    transition: all 0.2s;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-purple);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* Links */
a {
    color: var(--primary-purple);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-purple-dark);
    text-decoration: underline;
}

/* Container - matches admin layout and margins */
.container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
}
/* rep-main-container: single padding source for nav + tab content (no double padding) */
.rep-main-container {
    padding: 20px;
}
/* Tab inner containers: no side padding (rep-main-container provides it), keep bottom spacing */
#tab-dashboard .container,
#tab-leads .container,
#tab-samples .container,
#tab-orders .container,
#tab-followups .container,
#tab-plan .container {
    max-width: 1800px;
    padding: 0 0 24px 0;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 14px 16px;
    color: var(--text-secondary);
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    font-size: 14px;
    margin-bottom: 4px;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
}

/* Loading State */
.loading {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

/* Error State */
.error-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--danger-red);
}

.error-icon {
    font-size: 48px;
    margin-bottom: var(--spacing-md);
}


/* Customer Cards */
.customer-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
}

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

.customer-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-color);
}

.customer-info {
    flex: 1;
}

.customer-name {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 var(--spacing-xs) 0;
}

.temp-badge {
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.temp-hot {
    background: #FEE2E2;
    color: #DC2626;
}

.temp-warm {
    background: #FEF3C7;
    color: #D97706;
}

.temp-cold {
    background: #DBEAFE;
    color: #2563EB;
}

.customer-details {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.customer-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.customer-actions .btn-secondary,
.customer-actions .btn-primary {
    flex: 1;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
}

/* Search Section */
.cust-toolbar {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}
.cust-toolbar .lifecycle-tabs {
    margin-bottom: 14px;
}
.cust-toolbar .search-input {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 14px;
    box-sizing: border-box;
    margin-bottom: 14px;
    background: var(--bg-secondary);
}
.cust-toolbar .search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(61,59,142,0.1);
}
.cust-toolbar-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}
.cust-result-count {
    margin-top: 12px;
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

.search-section {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
    box-shadow: var(--shadow-sm);
}

.search-input {
    width: 100%;
    margin-bottom: var(--spacing-md);
}

.filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-select {
    width: 100%;
}


/* Click-to-Call Button */
.btn-call {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--success-green);
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
}

.btn-call:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
    color: white;
    text-decoration: none;
}

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


/* WhatsApp Button */
.btn-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    background: #25D366;
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-whatsapp:hover {
    background: #128C7E;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(37, 211, 102, 0.3);
}

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


/* Mobile Responsive Styles for Customer Cards */
@media (max-width: 640px) {
    .customer-card {
        padding: var(--spacing-md);
    }
    
    .customer-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: var(--spacing-xs);
    }
    
    .customer-actions .btn-sm,
    .customer-actions .btn-call,
    .customer-actions .btn-whatsapp {
        width: 100%;
        padding: 10px 12px;
        font-size: 13px;
        white-space: nowrap;
    }
    
    /* Make Call and WhatsApp buttons span full width on first row */
    .customer-actions a:nth-child(1),
    .customer-actions a:nth-child(2) {
        grid-column: span 1;
    }
    
    /* Stack remaining buttons in second row */
    .customer-actions button:nth-child(3),
    .customer-actions button:nth-child(4),
    .customer-actions button:nth-child(5) {
        grid-column: span 1;
    }
}

@media (max-width: 480px) {
    .customer-actions {
        grid-template-columns: 1fr;
        gap: var(--spacing-xs);
    }
    
    .customer-actions .btn-sm,
    .customer-actions .btn-call,
    .customer-actions .btn-whatsapp {
        width: 100%;
        grid-column: span 1;
    }
}


/* Interaction History Temperature Badge */
.interaction-temp-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Temperature-specific colors */
.interaction-temp-badge[data-temp="hot"] {
    background: rgba(239, 68, 68, 0.1);
    color: #DC2626;
}

.interaction-temp-badge[data-temp="warm"] {
    background: rgba(249, 115, 22, 0.1);
    color: #EA580C;
}

.interaction-temp-badge[data-temp="cold"] {
    background: rgba(59, 130, 246, 0.1);
    color: #2563EB;
}

.interaction-temp-badge[data-temp="dormant"] {
    background: rgba(107, 114, 128, 0.1);
    color: #6B7280;
}


/* Follow-up Card Enhancements */
.followup-contact {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.followup-notes-preview {
    font-size: 13px;
    color: var(--text-secondary);
    font-style: italic;
    margin-bottom: 12px;
    padding: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-sm);
    line-height: 1.4;
}

.followup-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.followup-actions .btn-sm {
    flex: 1;
    min-width: fit-content;
}

@media (max-width: 640px) {
    .followup-actions {
        flex-direction: column;
    }
    
    .followup-actions .btn-sm {
        width: 100%;
    }
}


/* Stat Bars */
.stat-bar {
    margin-bottom: 16px;
}

.stat-bar-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-bar-container {
    width: 100%;
    height: 24px;
    background: #f3f4f6;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 4px;
}

.stat-bar-fill {
    height: 100%;
    background: #3D3B8E;
    border-radius: 12px;
    transition: width 0.3s ease;
}

.stat-bar-value {
    font-size: 13px;
    color: #6b7280;
    text-align: right;
}

/* Login Screen Styles */
.login-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(180deg, #f0edff 0%, #f5f3ff 100%);
}

.login-card {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    max-width: 400px;
    width: 100%;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-logo h1 {
    color: var(--primary-purple);
    font-size: 32px;
    margin-bottom: 8px;
}

.login-subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 30px;
    text-align: center;
}

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

.form-label {
    display: block;
    color: #333;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
}

.form-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-purple);
}

.btn-login {
    width: 100%;
    padding: 14px;
    background: var(--primary-purple);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-login:hover {
    background: var(--primary-purple-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.4);
}

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

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.error-message {
    background: #fee;
    color: #c33;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    display: none;
}

.error-message.show {
    display: block;
}

/* App Screen Toggle */
.app-screen {
    display: none;
}

.app-screen.active {
    display: block;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}
.tab-content {
    overflow-x: hidden;
    max-width: 100%;
}

.hidden {
    display: none !important;
}

/* Customer Profile Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    overflow-y: auto;
}

.modal-overlay.active,
.modal-overlay.show {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    margin: 20px auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

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

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.btn-close-modal {
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.btn-close-modal:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.profile-section {
    margin-bottom: 24px;
}

.profile-section h3 {
    font-size: 20px;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.profile-section h4 {
    font-size: 16px;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-weight: 600;
}

.profile-info {
    display: grid;
    gap: 8px;
    padding: 12px;
    background: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.interaction-item, .followup-item {
    padding: 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.interaction-item:hover, .followup-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: #d1d5db;
}

.interaction-date, .followup-date {
    font-weight: 500;
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 8px;
}

.interaction-outcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #13142B;
}

.interaction-notes, .followup-notes {
    color: #4b5563;
    font-size: 14px;
    line-height: 1.5;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
}

/* Follow-up Card Styles */
.followup-item-card {
    padding: 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
}

.followup-item-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-color: #d1d5db;
}

.followup-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 12px;
}

.followup-item-left {
    flex: 1;
    min-width: 0;
}

.followup-business-name {
    font-size: 18px;
    font-weight: 600;
    color: #13142B;
    margin: 0 0 6px 0;
    word-wrap: break-word;
}

.followup-location {
    font-size: 14px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
}

.followup-item-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    flex-shrink: 0;
}

.followup-date-badge {
    background: #dbeafe;
    color: #1e40af;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
}

.followup-contact-info {
    font-size: 13px;
    color: #6b7280;
    display: flex;
    align-items: center;
    gap: 4px;
    text-align: right;
}

.followup-contact-label {
    font-size: 12px;
}

.followup-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}

.followup-btn {
    flex: 1;
    min-width: 100px;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.followup-btn-call {
    background: #10b981 !important;
    color: white;
}

.followup-btn-call:hover {
    background: #059669;
}

.followup-btn-profile {
    background: #3D3B8E;
    color: white;
}

.followup-btn-profile:hover {
    background: #2e2c6e;
}

.followup-btn-complete {
    background: #f59e0b;
    color: white;
}

.followup-btn-complete:hover {
    background: #d97706;
}

/* Contact action buttons in profile */
.contact-action-links {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.contact-call-btn {
    text-decoration: none;
    padding: 4px 8px;
    font-size: 12px;
    background: #10b981 !important;
    color: white;
    border-radius: 4px;
}

.contact-wa-btn {
    text-decoration: none;
    padding: 4px 8px;
    font-size: 12px;
    background: #25d366 !important;
    color: white;
    border-radius: 4px;
}

.contact-edit-btn {
    padding: 4px 8px;
    font-size: 12px;
    background: #6b7280;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

/* Timeline Styles */
.timeline-date-group {
    margin-bottom: 32px;
}

.timeline-date {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--border-color);
}

.timeline-calls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.timeline-call-card {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: white;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.timeline-call-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.timeline-call-indicator {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 18px;
    flex-shrink: 0;
}

.timeline-call-content {
    flex: 1;
}

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

.timeline-call-customer {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.timeline-call-time {
    font-size: 14px;
    color: var(--text-secondary);
}

.timeline-call-outcome {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.timeline-call-notes {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Rep page mobile responsive overrides */
@media (max-width: 768px) {
    .header {
        padding: 8px 12px;
        grid-template-columns: auto 1fr auto;
        gap: 6px;
    }

    .header-logo-img {
        height: 32px;
    }

    .header-title {
        font-size: 15px;
    }

    .account-btn {
        padding: 5px 10px;
        font-size: 11px;
        gap: 4px;
    }



    .followup-actions {
        flex-direction: column;
        gap: 8px;
    }

    .followup-actions button {
        width: 100%;
        justify-content: center;
    }

    .followup-item-card {
        padding: 14px;
    }

    .followup-item-header {
        flex-direction: row;
        gap: 8px;
    }

    .followup-item-right {
        flex-direction: column;
        align-items: flex-end;
        flex-shrink: 0;
    }

    .followup-date-badge {
        padding: 12px 14px;
        font-size: 13px;
    }

    .followup-contact-info {
        font-size: 12px;
    }

    .followup-business-name {
        font-size: 16px;
    }

    .followup-location {
        font-size: 13px;
    }

    .followup-item-actions {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 6px;
    }

    .followup-btn {
        min-width: unset;
        padding: 10px 6px;
        font-size: 12px;
        text-align: center;
    }

    .customer-card {
        padding: 16px;
    }

    .customer-actions {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .customer-actions a,
    .customer-actions button {
        font-size: 13px;
        padding: 10px 8px;
        white-space: nowrap;
    }

    .metrics-row {
        flex-direction: column;
        gap: 12px;
    }

    /* Samples tab: prevent overlapping on mobile (match Orders layout: button left, dropdown right) */
    #tab-samples .container {
        overflow-x: hidden;
        min-width: 0;
        width: 100%;
    }
    #tab-samples .samples-table-wrap {
        padding: 12px 0;
    }
    #tab-samples .samples-table {
        min-width: 600px;
    }
    #tab-samples .card {
        min-width: 0;
        overflow: hidden;
    }
    #tab-samples #samples-container {
        min-width: 0;
        overflow: hidden;
    }
    .metrics-group-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

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

    .stat-card {
        padding: 16px;
    }

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

    .filter-group {
        width: 100%;
    }



    .timeline-call-card {
        gap: 10px;
        padding: 12px;
    }

    .timeline-call-indicator {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .timeline-call-header {
        flex-direction: column;
        gap: 6px;
    }

    .timeline-call-header > div:first-child {
        display: flex;
        align-items: baseline;
        gap: 6px;
        flex-wrap: wrap;
    }

    .timeline-call-header > div:last-child {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: wrap;
        gap: 6px;
    }

    .timeline-call-customer {
        font-size: 15px;
    }

    .timeline-call-time {
        font-size: 11px;
    }
}


/* Log Call button - orange/warning style */
.btn-log-call {
    background: #F59E0B;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-log-call:hover {
    background: #D97706;
    transform: translateY(-1px);
}

.customer-actions .btn-log-call {
    flex: 1;
}


/* Icon buttons for call/whatsapp */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

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

/* ── Plan Mobile ── */
@media (max-width: 768px) {
    .plan-sub-tabs {
        margin-bottom: 8px;
    }
    .plan-sub-tab {
        padding: 8px 12px;
        font-size: 13px;
    }
    .section-card {
        padding: 14px;
        border-radius: 10px;
        margin-bottom: 10px;
    }
    .section-header {
        margin-bottom: 12px;
        gap: 6px;
    }
    .section-title {
        font-size: 17px;
    }
    .day-toggle {
        padding: 2px;
    }
    .day-toggle-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
    .plan-stat {
        padding: 8px 10px;
    }
    .plan-stat-value {
        font-size: 18px;
    }
    .call-card {
        padding: 10px 12px;
        flex-direction: column;
        gap: 10px;
    }
    .call-card-title {
        flex-wrap: wrap;
    }
    .call-card-meta {
        flex-wrap: wrap;
        gap: 4px 10px;
        margin-left: 22px;
    }
    .call-card-actions {
        display: flex;
        gap: 8px;
        margin-left: 22px;
    }
    .call-card-actions .btn-sm {
        padding: 8px 14px;
        font-size: 13px;
        min-height: 36px;
    }
    .goal-card {
        padding: 12px;
    }
    .goal-row {
        gap: 6px;
    }
    .goal-row select,
    .goal-row input {
        padding: 7px 10px;
        font-size: 13px;
    }
    .goal-row .goal-tier {
        min-width: 100px;
    }
    .goal-row .goal-city {
        min-width: 110px;
    }
    .goal-row .goal-count {
        width: 65px;
    }
    .plan-empty {
        padding: 24px 16px;
    }
    .plan-empty .plan-empty-icon {
        font-size: 36px;
        margin-bottom: 8px;
    }
    .plan-empty .plan-empty-title {
        font-size: 16px;
    }
    .picker-item {
        padding: 8px 10px;
    }
}

/* ── Plan Sub-tabs ── */
.plan-sub-tabs {
    display: flex;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 3px;
    margin-bottom: 16px;
    gap: 2px;
}
.plan-sub-tab {
    flex: 1;
    padding: 10px 16px;
    border: none;
    background: transparent;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}
.plan-sub-tab.active {
    background: white;
    color: #13142B;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.plan-sub-tab:hover:not(.active) {
    color: #374151;
}
.plan-sub-content {
    display: none;
}
.plan-sub-content.active {
    display: block;
}

/* Day toggle (Today / Tomorrow) */
.day-toggle {
    display: flex;
    background: #eff6ff;
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
}
.day-toggle-btn {
    flex: 1;
    padding: 8px 14px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
}
.day-toggle-btn.active {
    background: #3D3B8E;
    color: white;
    box-shadow: 0 1px 3px rgba(61, 59, 142, 0.25);
}
.day-toggle-btn:hover:not(.active) {
    color: #3D3B8E;
}

/* ── Plan Tab ── */

/* Empty state */
.plan-empty {
    text-align: center;
    padding: 40px 20px;
}
.plan-empty .plan-empty-icon {
    font-size: 48px;
    margin-bottom: 12px;
}
.plan-empty .plan-empty-title {
    font-size: 18px;
    font-weight: 600;
    color: #13142B;
    margin-bottom: 8px;
}
.plan-empty .plan-empty-desc {
    color: #6b7280;
    margin-bottom: 20px;
}

/* Overall progress summary */
.plan-progress {
    margin-bottom: 16px;
}
.plan-progress-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}
.plan-progress-label {
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
}
.plan-progress-pct {
    font-size: 22px;
    font-weight: 800;
    color: #13142B;
}
.plan-progress-pct.complete {
    color: #10b981;
}
.plan-progress-bar {
    background: #f3f4f6;
    border-radius: 999px;
    height: 10px;
    overflow: hidden;
}
.plan-progress-bar .bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s;
}
.plan-progress-meta {
    display: flex;
    gap: 16px;
    margin-top: 6px;
    font-size: 12px;
    color: #6b7280;
}

/* Goal card */
.goal-card {
    background: #fafbff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
}
.goal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.goal-card-info {
    display: flex;
    align-items: center;
    gap: 8px;
}
.goal-card-emoji {
    font-size: 20px;
}
.goal-card-tier {
    font-weight: 700;
    text-transform: capitalize;
    font-size: 15px;
}
.goal-card-sep {
    color: #9ca3af;
    font-size: 13px;
}
.goal-card-city {
    font-weight: 600;
    color: #374151;
    font-size: 14px;
}
.goal-card-count {
    font-weight: 800;
    font-size: 18px;
    color: #13142B;
}
.goal-card-count.complete {
    color: #10b981;
}
.goal-card-count .of-total {
    color: #9ca3af;
    font-weight: 400;
    font-size: 14px;
}
.goal-card-bar {
    background: #f3f4f6;
    border-radius: 999px;
    height: 8px;
    overflow: hidden;
}
.goal-card-bar .bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s;
}
.goal-card-notes {
    margin-top: 8px;
    font-size: 12px;
    color: #6b7280;
}

/* Goal editor row */
.goal-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.goal-row select,
.goal-row input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
}
.goal-row .goal-tier {
    min-width: 120px;
}
.goal-row .goal-city {
    min-width: 130px;
}
.goal-row .goal-count {
    width: 80px;
}
.goal-row .goal-notes {
    flex: 1;
    min-width: 100px;
}
.goal-row .btn-remove {
    padding: 6px 10px;
    background: #fee2e2;
    color: #ef4444;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
}

/* Daily plan stats */
.plan-stats {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}
.plan-stat {
    flex: 1;
    border-radius: 8px;
    padding: 10px 14px;
    text-align: center;
}
.plan-stat-value {
    font-size: 20px;
    font-weight: 700;
}
.plan-stat-label {
    font-size: 11px;
    color: #6b7280;
    font-weight: 600;
}
.plan-stat.planned {
    background: #eff6ff;
}
.plan-stat.planned .plan-stat-value {
    color: #2563eb;
}
.plan-stat.done {
    background: #f0fdf4;
}
.plan-stat.done .plan-stat-value {
    color: #16a34a;
}

/* Daily call card */
.call-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 12px 14px;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}
.call-card.status-completed {
    opacity: 0.6;
    border-left: 3px solid #10b981;
    border-color: #10b981;
}
.call-card.status-overdue {
    border-left: 3px solid #ef4444;
    background: #fef2f2;
}
.overdue-badge {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #fee2e2;
    color: #dc2626;
    border-radius: 10px;
    margin-left: 6px;
}
.overdue-date {
    color: #dc2626;
    font-weight: 500;
}
.call-card-icon.overdue {
    color: #ef4444;
    font-weight: 700;
    font-size: 16px;
}
.overdue-section-label,
.today-section-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 0 4px;
    margin-top: 4px;
}
.overdue-section-label {
    color: #dc2626;
}
.today-section-label {
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    padding-top: 12px;
    margin-top: 12px;
}
.plan-stat.overdue .plan-stat-value {
    color: #dc2626;
}
.plan-stat.overdue .plan-stat-label {
    color: #dc2626;
}
.call-card-body {
    flex: 1;
}
.call-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}
.call-card-icon {
    font-size: 14px;
}
.call-card-icon.done {
    color: #10b981;
    font-size: 16px;
}
.call-card-name {
    font-weight: 600;
    color: #13142B;
    font-size: 15px;
}
.call-card-name.done {
    text-decoration: line-through;
}
.call-card-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #6b7280;
    margin-left: 24px;
}
.call-card-actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* Shared small action buttons */
.btn-sm-primary {
    background: #3D3B8E;
    color: white;
}
.btn-sm-success {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #bbf7d0;
}
.btn-sm-muted {
    background: #f9fafb;
    color: #6b7280;
    border: 1px solid #e5e7eb;
}
.btn-sm-danger {
    background: transparent;
    color: #ef4444;
    border: none;
    padding: 6px 8px;
    font-size: 14px;
}

/* Tier badge */
.tier-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Picker row */
.picker-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 6px;
}
.picker-item-name {
    font-weight: 600;
    color: #13142B;
    font-size: 14px;
}
.picker-item-sub {
    font-size: 12px;
    color: #6b7280;
}

/* Muted text / empty */
.text-muted-center {
    text-align: center;
    padding: 20px;
    color: #9ca3af;
}
.text-error-center {
    text-align: center;
    padding: 20px;
    color: #ef4444;
}

/* Reusable section card */
.section {
    margin-bottom: 20px;
}
.section-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}
.section-title {
    margin: 0;
    font-size: 20px;
    color: #13142B;
}
.section-subtitle {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}
.week-nav {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
}
.week-nav .section-subtitle {
    margin-top: 0;
    min-width: 180px;
    text-align: center;
    font-weight: 500;
}
.week-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #d1d5db;
    background: #fff;
    color: #374151;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.15s;
    padding: 0;
    line-height: 1;
}
.week-nav-btn:hover {
    background: var(--primary-purple);
    color: #fff;
    border-color: var(--primary-purple);
}
.section-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

/* Goal editor */
.goal-editor {
    display: none;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    margin-top: 16px;
}
.goal-editor h4 {
    margin: 0 0 12px;
    color: #13142B;
    font-size: 15px;
}
.goal-editor-actions {
    display: flex;
    gap: 8px;
    margin-top: 14px;
}

/* Filter select */
.filter-select {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    cursor: pointer;
    height: 36px;
    box-sizing: border-box;
}

/* Btn styles for editor */
.btn-outline {
    padding: 8px 16px;
    background: white;
    color: #3D3B8E;
    border: 1px solid #3D3B8E;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
    height: 36px;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}
.btn-primary {
    padding: 12px;
    background: #3D3B8E;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}
.btn-add-goal {
    margin-top: 10px;
    padding: 8px 16px;
    background: white;
    border: 1px solid #d1d5db;
    color: #374151;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
}

/* ── Activity Tab (Call History) ── */
.act-stats {
    margin-bottom: 24px;
}
.act-contact-info {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
}
.act-product-pills {
    margin-top: 6px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.act-product-pills-right {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    justify-content: flex-end;
}
.act-product-pill {
    display: inline-block;
    padding: 2px 8px;
    background: #ffedd5;
    color: #c2410c;
    border: 1px solid #fdba74;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 600;
}
.act-location {
    color: var(--text-disabled);
    font-size: 12px;
    white-space: nowrap;
}
.act-left-col {
    min-width: 0;
    flex: 1;
}
.act-right-col {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.act-outcome-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.act-outcome {
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    margin: 0;
    white-space: nowrap;
}
.act-duration {
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 4px;
}

/* ── Sample / Order Cards (shared so-* classes) ── */
.so-section {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
}
.so-section:last-child {
    margin-bottom: 0;
}
.so-section-requested {
    border-left: 4px solid #f59e0b;
    background: linear-gradient(135deg, #fffbeb 0%, #ffffff 40%);
}
.so-section-fulfilled {
    border-left: 4px solid #10b981;
    background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 40%);
}
.so-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
}
.so-section-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #13142B;
}
.so-section-requested .so-section-title {
    color: #92400e;
}
.so-section-fulfilled .so-section-title {
    color: #065f46;
}
.so-badge-requested {
    background: #fef3c7;
    color: #92400e;
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
}
.so-badge-inprogress {
    background: #dbeafe;
    color: #1e40af;
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
}
.so-badge-fulfilled {
    background: #dcfce7;
    color: #166534;
    padding: 4px 12px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
}
.so-empty {
    text-align: center;
    padding: 20px;
    color: #9ca3af;
    font-size: 13px;
}
.so-card {
    border: 1px solid #f3f4f6;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
}
.so-card:last-child {
    margin-bottom: 0;
}
.so-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.so-card-name {
    font-weight: 600;
    color: #13142B;
    font-size: 14px;
}
.so-status {
    padding: 2px 8px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
}
.so-card-detail {
    font-size: 13px;
    color: #6b7280;
    margin-top: 4px;
}
.so-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 6px;
}
.so-card-date {
    font-size: 12px;
    color: #9ca3af;
}
.so-card-feedback {
    font-size: 12px;
    color: #059669;
    font-style: italic;
}
.so-card-amount {
    font-size: 13px;
    font-weight: 600;
    color: #13142B;
}
.so-card-clickable {
    cursor: pointer;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.so-card-clickable:hover {
    border-color: #c7d2fe;
    box-shadow: 0 2px 8px rgba(61,59,142,0.08);
}
.so-card-city {
    font-size: 12px;
    color: #6b7280;
    margin-top: 1px;
}
.so-card-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f3f4f6;
}
.so-card-actions .btn-sm {
    flex: 1;
}
.so-card-dates {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.so-card-date-tag {
    font-size: 11px;
    color: #6b7280;
    background: #f3f4f6;
    padding: 1px 6px;
    border-radius: 4px;
}

/* ── Customer tab / profile elements (cust-*) ── */
.cust-header-left { flex: 1; }
/* Lifecycle sub-tabs */
.lifecycle-tabs {
    display: flex;
    gap: 0;
    background: #f3f4f6;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 16px;
}
.lifecycle-tab {
    flex: 1;
    padding: 10px 8px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.2s;
    text-align: center;
    white-space: nowrap;
}
.lifecycle-tab.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.lifecycle-tab:hover:not(.active) {
    color: #374151;
}
.lc-count {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    color: inherit;
    opacity: 0.7;
    margin-left: 2px;
}

.cust-header-right { text-align: right; }
.lifecycle-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 12px;
    margin-bottom: 4px;
}
.lifecycle-lead {
    background: #f3f4f6;
    color: #6b7280;
}
.lifecycle-prospect {
    background: #dbeafe;
    color: #1e40af;
}
.lifecycle-customer {
    background: #dcfce7;
    color: #166534;
}
.cust-location { font-size: 12px; color: var(--text-disabled); margin-top: 2px; }
.cust-tier-select {
    margin-top: 4px; display: inline-block; width: auto; max-width: 130px;
    padding: 3px 20px 3px 8px; font-size: 11px; line-height: 1.3; font-weight: 700;
    text-transform: uppercase; letter-spacing: 0.5px;
    border: none; border-radius: 999px; cursor: pointer;
    appearance: none; -webkit-appearance: none;
    background-repeat: no-repeat; background-position: right 6px center;
    background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%228%22 height=%225%22 viewBox=%220 0 8 5%22%3E%3Cpath fill=%22%23fff%22 d=%22M4 5 0 0h8z%22/%3E%3C/svg%3E');
    vertical-align: middle;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.cust-outcome { font-size: 11px; color: var(--text-primary); font-weight: 600; margin-top: 4px; }
.cust-product-pills { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.cust-product-pills-left { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 4px; }
.cust-product-pill { display: inline-block; padding: 2px 8px; background: #ffedd5; color: #c2410c; border: 1px solid #fdba74; border-radius: 10px; font-size: 10px; font-weight: 600; }
.cust-product-pill-green { display: inline-block; padding: 2px 8px; background: #f0fdf4; color: #16a34a; border-radius: 10px; font-size: 10px; font-weight: 600; }
.cust-contact-name { font-size: 14px; color: #4b5563; margin-bottom: 4px; }
.cust-role-muted { font-size: 11px; color: var(--text-disabled); font-weight: 400; }
.cust-phone { font-size: 14px; color: var(--text-secondary); }
.cust-interactions { font-size: 12px; color: var(--text-disabled); margin-top: 6px; }
.cust-actions-row { display: flex; gap: 8px; margin-top: 12px; }
.cust-actions-row a, .cust-actions-row button {
    flex: 1; padding: 12px; border: none; border-radius: var(--radius-md);
    font-size: 15px; font-weight: 600; cursor: pointer; text-align: center;
    text-decoration: none; display: block;
}
.cust-actions-row .btn-call { background: var(--success-green); color: white; }
.cust-actions-row .btn-whatsapp { background: #25D366; color: white; }
.cust-actions-row .btn-profile { background: var(--primary-purple); color: white; }
.cust-actions-row .btn-log-call { background: var(--warning-orange); color: white; }
.cust-profile-section-space { margin-top: 32px; }
.cust-section-header-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.cust-section-header-row h4 { margin: 0; }
.cust-add-contact-btn { background: var(--primary-purple); color: white; padding: 8px 16px; border: none; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; }
.cust-badge-purple { background: var(--primary-purple); color: white; padding: 4px 8px; border-radius: 4px; font-size: 12px; }
.cust-interaction-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 8px; }
.cust-interaction-temp-wrap { margin-top: 6px; }
.cust-interaction-right { text-align: right; }
.cust-duration { color: var(--text-secondary); font-size: 13px; font-weight: 500; margin-bottom: 6px; }
.cust-outcome-row { display: flex; align-items: center; gap: 6px; justify-content: flex-end; font-size: 15px; font-weight: 600; color: var(--text-primary); }
.cust-called-row { color: #4b5563; font-size: 14px; margin-top: 6px; }
.cust-contacts-empty { color: var(--text-disabled); }
.cust-contacts-error { color: var(--danger-red); }
.cust-contacts-none { color: var(--text-secondary); }
.cust-table { width: 100%; border-collapse: collapse; background: white; border: 1px solid #e5e7eb; border-radius: var(--radius-md); }
.cust-table thead tr { background: #f9fafb; border-bottom: 1px solid #e5e7eb; }
.cust-table th { padding: 12px; text-align: left; font-weight: 600; font-size: 14px; }
.cust-table th.cust-th-center { text-align: center; }
.cust-table tbody tr { border-bottom: 1px solid #e5e7eb; }
.cust-table td { padding: 12px; font-weight: 500; }
.cust-table td.cust-td-muted { color: var(--text-secondary); }
.cust-table td.cust-td-center { text-align: center; }

@media (max-width: 768px) {
    .lifecycle-tabs {
        padding: 3px;
        margin-bottom: 10px;
        gap: 0;
    }
    .lifecycle-tab {
        padding: 8px 4px;
        font-size: 12px;
    }
    .lc-count {
        font-size: 10px;
    }
    .cust-actions-row {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }
    .cust-actions-row a,
    .cust-actions-row button {
        font-size: 13px;
        padding: 10px 8px;
        white-space: nowrap;
    }
    .cust-toolbar {
        padding: 12px;
    }
    .cust-toolbar-filters {
        flex-direction: column;
        gap: 8px;
    }
    .cust-toolbar-filters .filter-group {
        width: 100%;
    }
    #tab-leads .container { width: 100%; max-width: 100%; box-sizing: border-box; }
    #tab-leads .card,
    #tab-leads .leads-header {
        min-width: 0;
    }
    #tab-leads .leads-search-filters-row {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    #tab-leads .rep-city-workboard-grid {
        display: flex;
        grid-template-columns: none;
        overflow-x: auto;
        overflow-y: hidden;
        padding-bottom: 4px;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
    }
    #tab-leads .rep-city-card {
        flex: 0 0 170px;
        scroll-snap-align: start;
    }
    #tab-leads .leads-filter-wrap .filter-select {
        padding: 8px 10px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    #tab-leads .rep-city-card {
        flex-basis: 155px;
    }
    #tab-leads .rep-city-quick-tags-row {
        gap: 5px;
    }
    #tab-leads .rep-city-quick-tag {
        padding: 4px 9px;
        font-size: 10px;
    }
}

/* ── Request Forms (Samples / Orders) ── */
.request-form {
    display: none;
    background: linear-gradient(135deg, #fafbff 0%, #f5f3ff 100%);
    border: 1px solid #e0ddf5;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(61, 59, 142, 0.06);
}
.request-form h3 {
    margin: 0 0 18px;
    font-size: 17px;
    font-weight: 700;
    color: #13142B;
    display: flex;
    align-items: center;
    gap: 8px;
}
.request-form h3 .form-icon {
    font-size: 20px;
}
.request-form .form-field {
    margin-bottom: 14px;
}
.request-form .form-field label {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
    margin-bottom: 6px;
}
.request-form select,
.request-form textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    box-sizing: border-box;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.request-form select:focus,
.request-form textarea:focus {
    outline: none;
    border-color: #3D3B8E;
    box-shadow: 0 0 0 3px rgba(61, 59, 142, 0.1);
}
.request-form textarea {
    resize: vertical;
    min-height: 48px;
}
.request-form .form-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}
.request-form .btn-submit {
    flex: 1;
    padding: 12px;
    background: linear-gradient(135deg, #3D3B8E, #4f4db0);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
}
.request-form .btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(61, 59, 142, 0.25);
}
.request-form .btn-cancel {
    padding: 12px 22px;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s;
}
.request-form .btn-cancel:hover {
    background: #f3f4f6;
}

/* Product entries */
.product-entry {
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 6px;
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.product-entry.checked {
    border-color: #3D3B8E;
    box-shadow: 0 0 0 1px rgba(61, 59, 142, 0.15);
    background: #fafaff;
}
.product-entry .product-header {
    display: flex;
    align-items: center;
    gap: 8px;
}
.product-entry .product-header label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    margin: 0;
    text-transform: none;
    letter-spacing: normal;
}
.product-entry .product-header label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #3D3B8E;
    cursor: pointer;
}
.product-entry .unit-badge {
    font-size: 11px;
    font-weight: 600;
    color: #6b7280;
    background: #f3f4f6;
    padding: 2px 8px;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.product-entry .qty-input {
    width: 90px;
    padding: 7px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    background: white;
    transition: border-color 0.2s;
    display: none;
}
.product-entry .qty-input:focus {
    outline: none;
    border-color: #3D3B8E;
}

/* Color rows section */
.color-rows {
    display: none;
    margin-top: 10px;
    padding: 10px 12px 8px;
    background: #f9fafb;
    border-radius: 8px;
    border: 1px dashed #e5e7eb;
}
.color-rows .color-row {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.color-rows .color-row input[type="text"] {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    background: white;
    transition: border-color 0.2s;
}
.color-rows .color-row input[type="number"] {
    width: 80px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    text-align: center;
    background: white;
    transition: border-color 0.2s;
}
.color-rows .color-row input:focus {
    outline: none;
    border-color: #3D3B8E;
}
.color-rows .btn-remove-color {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: #ef4444;
    border: 1px solid #fecaca;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
    transition: background 0.15s;
}
.color-rows .btn-remove-color:hover {
    background: #fee2e2;
}
.color-rows .btn-add-color {
    margin-top: 2px;
    padding: 6px 14px;
    background: white;
    border: 1px dashed #c7c6e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    color: #3D3B8E;
    transition: background 0.15s, border-color 0.15s;
}
.color-rows .btn-add-color:hover {
    background: #f0eeff;
    border-color: #3D3B8E;
}

.so-status-form {
    padding: 10px 12px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}
.so-status-select {
    flex: 1;
    min-width: 120px;
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: white;
}
.so-status-date {
    padding: 6px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    background: white;
}
.so-status-form-btns {
    display: flex;
    gap: 6px;
}
@media (max-width: 480px) {
    .so-status-form {
        flex-direction: column;
        align-items: stretch;
    }
    .so-status-form-btns {
        justify-content: flex-end;
    }
}
.cust-autocomplete-list {
    display: none;
    position: absolute;
    left: 0; right: 0; top: 100%;
    z-index: 100;
    background: white;
    border: 1px solid #d1d5db;
    border-top: none;
    border-radius: 0 0 8px 8px;
    max-height: 220px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.cust-autocomplete-list.active { display: block; }
.cust-ac-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    border-bottom: 1px solid #f3f4f6;
}
.cust-ac-item:last-child { border-bottom: none; }
.cust-ac-item:hover, .cust-ac-item.active {
    background: #eef2ff;
}
.cust-ac-item small {
    color: #9ca3af;
    font-size: 12px;
}

/* Rep orders: cancelled/rejected stay visible, struck through (not the More column) */
tr.rep-order-row-closed > td:nth-child(-n+6) {
    text-decoration: line-through;
    color: #787878;
}
tr.rep-order-row-closed .rep-order-keep-plain {
    text-decoration: none;
    color: #991b1b;
}
