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

:root {
    --bg: #EEF4FF;
    --surface: #ffffff;
    --surface-light: #F5F8FF;
    --border: #DBE7FE;
    --text-primary: #001234;
    --text-secondary: #4A6080;
    --accent: #3362E3;
    --green: #38FFBE;
    --green-text: #0B6E4F;
    --danger: #E5484D;
    --warning: #D29922;
    --purple: #7B61FF;
    --navy: #152C55;
    --deep-blue: #001234;
}

html, body {
    height: 100%;
    width: 100%;
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
}

body {
    overflow: hidden;
}

.view {
    display: none;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

.view.active {
    display: flex;
}

/* ============ REP SELECTOR VIEW ============ */
.rep-selector {
    flex-direction: column;
    padding: 40px;
    gap: 40px;
}

.rep-selector-header {
    text-align: center;
}

.rep-selector-title {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 8px;
}

.rep-selector-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

.rep-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    flex: 1;
    overflow-y: auto;
    padding-right: 12px;
}

.rep-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rep-card:hover {
    background: var(--surface-light);
    border-color: var(--accent);
}

.rep-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    color: white;
}

.rep-card-name {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
}

.rep-card-stats {
    font-size: 13px;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
}

.rep-selector-footer {
    display: flex;
    justify-content: center;
    gap: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.btn-dashboard {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 10px 16px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-dashboard:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ============ SWIPER VIEW ============ */
.swiper {
    flex-direction: column;
    position: relative;
}

.swiper-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    background: var(--navy);
    color: white;
}

.back-button {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px;
    transition: opacity 0.2s ease;
}

.back-button:hover {
    opacity: 0.7;
}

.swiper-header-content {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.swiper-rep-name {
    font-size: 16px;
    font-weight: 600;
}

.swiper-stats {
    display: flex;
    gap: 16px;
    margin-left: auto;
    font-size: 13px;
}

.stat-item {
    display: flex;
    gap: 4px;
    color: rgba(255,255,255,0.6);
}

.stat-item strong {
    color: white;
}

.swiper-container {
    display: flex;
    flex: 1;
    overflow: hidden;
    position: relative;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.card-stack {
    display: flex;
    flex-direction: column;
    width: 740px;
    max-width: calc(100vw - 360px);
    height: min(720px, calc(100vh - 120px));
    gap: 0;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px 12px 0 0;
    padding: 24px;
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow 0.2s ease;
    overflow-y: auto;
    box-shadow: 0 2px 12px rgba(0,18,52,0.08);
}

.card.disabled {
    pointer-events: none;
    opacity: 0.5;
}

.card.animating {
    transition: transform 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.card.swipe-left {
    transform: translateX(-150%) rotateZ(-25deg);
}

.card.swipe-right {
    transform: translateX(150%) rotateZ(25deg);
}

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

.card-header-left {
    flex: 1;
}

.card-name {
    font-size: 20px;
    font-weight: 700;
}

.card-company {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.match-score {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg);
    border: 2px solid var(--accent);
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 4px;
    margin-top: 8px;
}

.badge-b2b {
    background: rgba(88, 166, 255, 0.2);
    color: var(--accent);
}

.badge-b2g {
    background: rgba(21, 44, 85, 0.08);
    color: var(--navy);
}

.card-location {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.card-section {
    margin-top: 4px;
    font-size: 13px;
    line-height: 1.6;
}

.card-section-title {
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.card-section-match {
    background: rgba(51, 98, 227, 0.06);
    border-left: 3px solid var(--accent);
    padding: 12px;
    border-radius: 4px;
    margin-top: 8px;
    color: var(--text-primary);
}

.card-section-context {
    background: #FFF7ED;
    border: 1px solid #FDBA74;
    border-radius: 8px;
    padding: 14px;
    margin-top: 8px;
    color: #78350F;
    white-space: pre-line;
    font-size: 12px;
    line-height: 1.7;
}

.card-section-context .card-section-title {
    color: #C2410C;
    border-bottom: 1px solid #FED7AA;
}

.activity-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 8px;
}

.stat-box {
    background: var(--bg);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.stat-box-label {
    font-size: 11px;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 4px;
}

.stat-box-value {
    font-size: 16px;
    font-weight: 700;
}

.last-conversion {
    background: var(--bg);
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    margin-top: 8px;
    font-size: 12px;
    color: var(--text-secondary);
}

.last-conversion-value {
    color: var(--text-primary);
    font-weight: 600;
    margin-top: 4px;
}

.card-footer {
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 16px 24px;
    width: 100%;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,18,52,0.08);
}

.hubspot-link {
    display: block;
    text-align: center;
    color: #FF7A59;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 10px;
    border: 1.5px solid #FF7A59;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.hubspot-link:hover {
    background: #FF7A59;
    color: white;
}

.card-actions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.btn-skip, .btn-approve {
    flex: 1;
    padding: 12px;
    border: 1px solid var(--border);
    background: transparent;
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
}

.btn-skip:hover {
    background: var(--surface-light);
    border-color: var(--text-secondary);
}

.btn-approve {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    font-weight: 600;
}

.btn-approve:hover {
    opacity: 0.9;
}

.btn-approve.disabled {
    background: var(--bg);
    border-color: var(--border);
    color: var(--text-secondary);
    cursor: not-allowed;
}

/* ============ EMAIL PANEL ============ */
.email-panel {
    width: 420px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 10;
}

.email-panel.open {
    transform: translateX(0);
}

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

.email-panel-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.email-panel-close {
    background: none;
    border: none;
    font-size: 18px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}
.email-panel-close:hover {
    background: var(--surface-light);
    color: var(--text-primary);
}

.email-panel-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

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

.email-field-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.email-field-value {
    font-size: 13px;
    color: var(--text-primary);
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
}

.email-textarea {
    font-size: 13px;
    color: var(--text-primary);
    padding: 8px 12px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    resize: vertical;
    min-height: 80px;
}

.email-panel-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.btn-gmail {
    background: var(--navy);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: opacity 0.2s ease;
}

.btn-gmail:hover {
    opacity: 0.9;
}

.btn-copy, .btn-next-lead {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: var(--surface-light);
    border-color: var(--accent);
}

.btn-next-lead {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    font-weight: 600;
}

.btn-next-lead:hover {
    opacity: 0.9;
}

/* ============ MY LEADS DRAWER ============ */
.my-leads-toggle {
    position: absolute;
    right: 20px;
    bottom: 20px;
    background: var(--navy);
    color: white;
    border: none;
    border-radius: 24px;
    padding: 12px 20px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 16px rgba(0,18,52,0.2);
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.my-leads-toggle:hover {
    box-shadow: 0 6px 24px rgba(0,18,52,0.3);
    transform: translateY(-1px);
}

.my-leads-toggle .badge-count {
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.my-leads-sidebar {
    width: 320px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: absolute;
    right: 0;
    top: 0;
    bottom: 0;
    z-index: 8;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -4px 0 24px rgba(0,18,52,0.1);
}

.my-leads-sidebar.open {
    transform: translateX(0);
}

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

.my-leads-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--navy);
}

.my-leads-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}

.my-leads-count {
    font-size: 12px;
    color: var(--text-secondary);
    padding: 0 16px 12px;
    border-bottom: 1px solid var(--border);
}

.my-leads-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.lead-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.lead-item:hover {
    background: var(--surface-light);
}

.lead-item-name {
    font-weight: 600;
    color: var(--text-primary);
}

.lead-item-company {
    color: var(--text-secondary);
    font-size: 11px;
    margin-top: 2px;
}

.lead-item-score {
    color: var(--accent);
    font-weight: 600;
    margin-top: 4px;
}

.lead-item-status {
    font-size: 10px;
    color: var(--text-secondary);
    margin-top: 4px;
}

.my-leads-export {
    padding: 16px;
    border-top: 1px solid var(--border);
}

.btn-export {
    width: 100%;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-export:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ============ MANAGER DASHBOARD ============ */
.manager-dashboard {
    flex-direction: column;
    padding: 32px 40px;
    gap: 24px;
    overflow-y: auto;
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-title {
    font-size: 28px;
    font-weight: 700;
}

.global-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.global-stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: 0 1px 4px rgba(0,18,52,0.06);
}

.global-stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

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

.global-stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-top: 2px;
    line-height: 1;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.rep-dashboard-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(0,18,52,0.06);
}

.rep-dashboard-card:hover {
    border-color: var(--accent);
    box-shadow: 0 2px 8px rgba(51,98,227,0.12);
}

.btn-start-matching {
    width: 100%;
    padding: 10px;
    background: var(--navy);
    border: none;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    margin-top: 12px;
    transition: opacity 0.2s;
}

.btn-start-matching:hover {
    opacity: 0.85;
}

.rep-dashboard-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.rep-dashboard-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
}

.rep-dashboard-name {
    font-weight: 600;
    font-size: 14px;
}

.rep-dashboard-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.rep-stat {
    background: var(--bg);
    padding: 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    font-size: 12px;
}

.rep-stat-label {
    color: var(--text-secondary);
    font-size: 10px;
    text-transform: uppercase;
    font-weight: 600;
}

.rep-stat-value {
    color: var(--text-primary);
    font-weight: 700;
    font-size: 14px;
    margin-top: 2px;
}

.progress-bar {
    background: var(--surface-light);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin: 8px 0;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    transition: width 0.3s ease;
}

.email-ready-sent {
    display: flex;
    gap: 12px;
    font-size: 12px;
    margin-top: 8px;
}

.email-ready-count {
    color: var(--text-secondary);
}

.email-ready-count strong {
    color: var(--navy);
}

.email-sent-count {
    color: var(--text-secondary);
}

.email-sent-count strong {
    color: var(--accent);
}

.btn-export-all {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-export-all:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-import {
    background: var(--navy);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.btn-import:hover {
    opacity: 0.85;
}

/* ============ IMPORT MODAL ============ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,18,52,0.4);
    backdrop-filter: blur(4px);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: white;
    border-radius: 16px;
    width: 520px;
    max-width: 90vw;
    box-shadow: 0 20px 60px rgba(0,18,52,0.2);
    overflow: hidden;
}

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

.modal-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--navy);
}

.modal-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 4px;
}

.modal-body {
    padding: 24px;
}

.coming-soon-badge {
    display: inline-block;
    background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
    color: #C2410C;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    border: 1px solid #FDBA74;
    letter-spacing: 0.3px;
}

.import-steps {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 24px;
}

.import-step {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.import-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg);
    border: 1.5px solid var(--accent);
    color: var(--accent);
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.import-step-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--navy);
}

.import-step-desc {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
}

.import-upload-area {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--bg);
}

.import-upload-area:hover {
    border-color: var(--accent);
    background: rgba(51,98,227,0.03);
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #C8DBFE;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #A2C2FD;
}
