:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #fd7e14;
    --danger-color: #dc3545;
    --dark-color: #1a2332;
    --light-color: #f8f9fa;
    --white: #ffffff;
    --border-radius: 8px;
    --box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
    
    --bg-body: #f0f2f5;
    --bg-card: #ffffff;
    --text-primary: #333;
    --text-secondary: #6c757d;
    --border-color: #e0e0e0;
    --input-bg: #ffffff;
    --input-border: #ddd;
}

body.dark-theme {
    --bg-body: #1a1d23;
    --bg-card: #25292f;
    --text-primary: #e4e6eb;
    --text-secondary: #b0b3b8;
    --border-color: #3a3f47;
    --input-bg: #25292f;
    --input-border: #3a3f47;
    --box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    padding-top: 70px;
}

/* Main Navigation */
.main-nav {
    background-color: var(--dark-color);
    color: var(--white);
    padding: 0;
    box-shadow: var(--box-shadow);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 600;
    color: var(--white);
}

.nav-brand i {
    font-size: 24px;
}

.nav-title {
    display: inline;
}

.nav-links-desktop {
    display: flex;
    gap: 5px;
}

.nav-link {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    padding: 10px 20px;
    border-radius: var(--border-radius);
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

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

.theme-toggle-btn {
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    padding: 10px 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 16px;
}

.theme-toggle-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: var(--white);
    padding: 10px 15px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 18px;
}

.mobile-menu-toggle:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.mobile-nav-menu {
    display: none;
    background-color: var(--dark-color);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-nav-menu.active {
    display: block;
}

.mobile-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.mobile-nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.mobile-nav-link.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

.mobile-nav-link i {
    font-size: 18px;
    width: 24px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
    text-decoration: none;
    display: inline-block;
}

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

.btn-primary:hover {
    background-color: #0b5ed7;
    transform: translateY(-2px);
}

.btn-success {
    background-color: var(--success-color);
    color: var(--white);
}

.btn-success:hover {
    background-color: #157347;
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
}

.btn-secondary:hover {
    background-color: #5c636a;
}

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

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

body.dark-theme .card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--border-color);
}

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

.card-body {
    padding: 10px 0;
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 20px;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

.income-plan-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

/* Stats Cards */
.stat-card {
    text-align: center;
    cursor: pointer;
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin: 10px 0;
}

.stat-label {
    font-size: 14px;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-count {
    font-size: 12px;
    color: var(--secondary-color);
    margin-top: 5px;
}

/* Status Badges */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-primary {
    background-color: rgba(13, 110, 253, 0.1);
    color: var(--primary-color);
}

.badge-success {
    background-color: rgba(25, 135, 84, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background-color: rgba(253, 126, 20, 0.1);
    color: var(--warning-color);
}

.badge-secondary {
    background-color: rgba(108, 117, 125, 0.1);
    color: var(--secondary-color);
}

/* Deal Cards */
.deal-card {
    border-left: 4px solid var(--secondary-color);
    position: relative;
}

.deal-card.status-unmapped {
    border-left-color: var(--secondary-color);
}

.deal-card.status-mapped {
    border-left-color: var(--primary-color);
}

.deal-card.status-locked {
    border-left-color: var(--warning-color);
}

.deal-card.status-installed {
    border-left-color: var(--success-color);
}

.deal-merchant {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.deal-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.deal-sar {
    font-size: 20px;
    font-weight: 700;
    color: var(--success-color);
}

.deal-notes {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 10px 0;
    line-height: 1.5;
}

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

.deal-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

body.dark-theme .modal-overlay {
    background-color: rgba(0, 0, 0, 0.8);
}

.modal-overlay.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    animation: slideUp 0.3s ease;
}

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

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

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 20px;
}

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

/* Form Elements */
.form-group {
    margin-bottom: 15px;
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 15px;
    align-items: center;
}

.form-group.notes-group {
    grid-template-columns: 1fr;
    align-items: stretch;
}

.form-label {
    margin-bottom: 0;
    font-weight: 500;
    color: var(--text-primary);
    text-align: right;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    background-color: var(--input-bg);
    color: var(--text-primary);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.form-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--input-border);
    border-radius: var(--border-radius);
    font-size: 14px;
    background-color: var(--input-bg);
    color: var(--text-primary);
    cursor: pointer;
}

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

/* Monthly Comparison */
.monthly-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.month-card {
    text-align: center;
    padding: 20px;
    transition: var(--transition);
}

.month-card-current {
    border: 2px solid var(--primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.month-card-past {
    opacity: 0.85;
}

body.dark-theme .month-card-current {
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.2);
}

.month-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.month-stats {
    margin: 10px 0;
}

.month-label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.month-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.month-status {
    margin-top: 10px;
    padding: 8px;
    border-radius: var(--border-radius);
    font-size: 14px;
    font-weight: 500;
}

/* Sections */
.section {
    margin-bottom: 40px;
}

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

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-primary) !important;
}

.pipeline-90day {
    background-color: rgba(108, 117, 125, 0.05);
    padding: 20px;
    border-radius: var(--border-radius);
}

body.dark-theme .pipeline-90day {
    background-color: rgba(108, 117, 125, 0.1);
}

.partnership-section {
    background-color: rgba(13, 110, 253, 0.05);
    padding: 20px;
    border-radius: var(--border-radius);
}

body.dark-theme .partnership-section {
    background-color: rgba(13, 110, 253, 0.15);
}

/* Prospecting Form */
.prospecting-form {
    margin-bottom: 20px;
}

.prospecting-inputs {
    display: grid;
    grid-template-columns: 2fr 2fr 1fr 2fr auto;
    gap: 10px;
    align-items: start;
}

.prospecting-contact-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.prospecting-inputs .form-control,
.prospecting-inputs .form-select {
    margin-bottom: 0;
}

.prospecting-inputs textarea.form-control {
    resize: vertical;
    min-height: auto;
}

.prospecting-entry {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin-bottom: 10px;
    background: var(--bg-card);
    transition: var(--transition);
}

.prospecting-entry:hover {
    border-color: var(--primary-color);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

body.dark-theme .prospecting-entry:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

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

.prospecting-name {
    font-weight: 600;
    font-size: 16px;
    color: var(--text-primary);
}

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

.prospecting-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.prospecting-contact {
    color: var(--text-secondary);
}

.prospecting-notes {
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 10px;
}

.prospecting-actions {
    display: flex;
    gap: 10px;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 2000;
}

.toast {
    background: var(--bg-card);
    padding: 15px 20px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-bottom: 10px;
    min-width: 300px;
    animation: slideInRight 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
}

body.dark-theme .toast {
    box-shadow: 0 4px 12px rgba(0,0,0,0.5);
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--danger-color);
}

.toast-icon {
    font-size: 20px;
}

.toast-icon i {
    font-size: 18px;
}

/* Loading Spinner */
.loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.loading.active {
    display: block;
}

.spinner {
    border: 4px solid var(--light-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideInRight {
    from { transform: translateX(100px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .container { 
		padding: 10px;
	}
    .main-container { 
		margin-top: 30px;
		padding: 10px;
	}
    .grid-2, .grid-3, .grid-4 { 
		grid-template-columns: repeat(2, 1fr); 
	}
    
    /* Personal Income Plan - tight 2x3 mobile layout */
    .income-plan-grid { 
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 10px !important;
        margin-top: 0 !important;
    }
    
    .income-plan-grid:first-of-type {
        margin-bottom: 10px !important;
    }
    
    .income-plan-grid > div {
        padding: 10px 8px !important;
        text-align: center;
    }
    
    .income-plan-grid > div > div:first-child {
        font-size: 11px !important;
        margin-bottom: 4px !important;
    }
    
    .income-plan-grid > div .editable-value {
        font-size: 18px !important;
        font-weight: 700 !important;
    }
    
    .monthly-grid { grid-template-columns: repeat(2, 1fr); }
    .modal { width: 95%; }
    .stat-value { font-size: 24px; }
    .prospecting-inputs {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .prospecting-contact-group {
        grid-template-columns: 1fr;
    }
    .month-name { font-size: 14px; }
    .month-value { font-size: 16px; }
    
    /* Mobile Navigation */
    .nav-links-desktop {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .nav-title {
        font-size: 16px;
    }
    
    .nav-brand i {
        font-size: 20px;
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.empty-state-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.empty-state-icon i {
    font-size: 64px;
}

.empty-state-text {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-secondary);
}

/* Editable Value */
.editable-value {
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
    display: inline-block;
}

.editable-value:hover {
    background-color: var(--border-color);
}

/* Filter Pills */
.filter-pills {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-pill {
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    cursor: pointer;
    transition: var(--transition);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.filter-pill:hover {
    border-color: var(--primary-color);
}

.filter-pill.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}