* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Cairo', sans-serif;
    background: #f5f7fa;
    color: #1a1a1a;
    overflow-x: hidden;
}

/* Dashboard Layout */
.dashboard-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
    color: white;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 100;
}

.logo-section {
    padding: 30px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo-section svg {
    margin-bottom: 15px;
}

.logo-section h2 {
    font-size: 28px;
    font-weight: 700;
}

/* Navigation Menu */
.nav-menu {
    flex: 1;
    padding: 20px 0;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s;
    border-right: 3px solid transparent;
}

[dir="ltr"] .nav-link {
    border-right: none;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.nav-link.active {
    background: rgba(79, 70, 229, 0.2);
    color: white;
    border-right-color: #4F46E5;
}

[dir="ltr"] .nav-link.active {
    border-left-color: #4F46E5;
}

.nav-link svg {
    stroke-width: 2;
}

.nav-link span {
    font-size: 16px;
    font-weight: 500;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 700;
}

.user-name {
    font-size: 15px;
    font-weight: 600;
}

.user-role {
    font-size: 13px;
    opacity: 0.7;
}

.logout-btn {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.2);
    border: none;
    color: #ef4444;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-right: 280px;
    min-height: 100vh;
}

[dir="ltr"] .main-content {
    margin-right: 0;
    margin-left: 280px;
}

/* Top Header */
.top-header {
    background: white;
    padding: 25px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.page-subtitle {
    font-size: 14px;
    color: #666;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f5f7fa;
    padding: 10px 20px;
    border-radius: 12px;
    width: 300px;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    width: 100%;
    font-size: 15px;
}

.icon-button {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: #f5f7fa;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: all 0.3s;
}

.icon-button:hover {
    background: #e5e7eb;
}

.notification-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

[dir="ltr"] .notification-badge {
    left: auto;
    right: 8px;
}

/* Content Sections */
.content-section {
    padding: 30px 40px;
    display: none;
}

.content-section.active {
    display: block;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon.blue {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.stat-icon.green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.stat-icon.purple {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
}

.stat-icon.orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.stat-change {
    font-size: 13px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 6px;
    display: inline-block;
}

.stat-change.positive {
    background: #d1fae5;
    color: #065f46;
}

.stat-change.neutral {
    background: #e0e7ff;
    color: #3730a3;
}

/* Charts Row */
.charts-row {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 25px;
    margin-bottom: 30px;
}

.chart-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.filter-select {
    padding: 8px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    background: white;
}

.chart-placeholder {
    height: 300px;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Top Performers */
.top-performers {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.performer-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 12px;
}

.performer-rank {
    width: 35px;
    height: 35px;
    border-radius: 8px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 16px;
}

.performer-avatar {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.performer-info {
    flex: 1;
}

.performer-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.performer-sales {
    font-size: 13px;
    color: #10b981;
    font-weight: 600;
}

.performer-progress {
    width: 100px;
    height: 6px;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #4F46E5 0%, #7C3AED 100%);
    border-radius: 3px;
}

/* Activity Section */
.activity-section {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.view-all {
    color: #4F46E5;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f9fafb;
    border-radius: 12px;
}

.activity-icon {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.activity-icon.blue {
    background: #dbeafe;
    color: #1e40af;
}

.activity-icon.green {
    background: #d1fae5;
    color: #065f46;
}

.activity-icon.purple {
    background: #ede9fe;
    color: #5b21b6;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.activity-desc {
    font-size: 13px;
    color: #666;
}

.activity-time {
    font-size: 13px;
    color: #999;
    white-space: nowrap;
}

/* Buttons */
.btn-primary {
    padding: 12px 24px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.btn-outline {
    padding: 10px 20px;
    background: transparent;
    color: #4F46E5;
    border: 2px solid #4F46E5;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
}

.btn-outline:hover {
    background: #4F46E5;
    color: white;
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

/* Reps Grid */
.reps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.rep-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: all 0.3s;
}

.rep-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.rep-status {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 2px solid white;
}

[dir="ltr"] .rep-status {
    left: auto;
    right: 20px;
}

.rep-status.online {
    background: #10b981;
}

.rep-status.offline {
    background: #6b7280;
}

.rep-avatar-large {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    margin: 0 auto 15px;
}

.rep-card h3 {
    font-size: 18px;
    margin-bottom: 5px;
}

.rep-role {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
}

.rep-stats-row {
    display: flex;
    justify-content: space-around;
    margin-bottom: 20px;
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
}

.rep-stat {
    text-align: center;
}

.stat-num {
    font-size: 20px;
    font-weight: 700;
    color: #4F46E5;
    margin-bottom: 4px;
}

.stat-lbl {
    font-size: 12px;
    color: #666;
}

/* Tracking Container */
.tracking-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 25px;
    height: calc(100vh - 200px);
}

.map-panel {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.map-view {
    width: 100%;
    height: 100%;
}

.map-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #666;
}

.map-placeholder svg {
    margin-bottom: 15px;
    opacity: 0.5;
}

.tracking-sidebar {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow-y: auto;
}

.tracking-sidebar h3 {
    font-size: 18px;
    margin-bottom: 20px;
}

.active-reps-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 30px;
}

.tracking-rep-item {
    padding: 15px;
    background: #f9fafb;
    border-radius: 12px;
    display: flex;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.tracking-rep-item:hover {
    border-color: #4F46E5;
}

.tracking-rep-item.active {
    background: #ede9fe;
    border-color: #7C3AED;
}

.tracking-rep-avatar {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
    flex-shrink: 0;
}

.tracking-rep-info {
    flex: 1;
}

.tracking-rep-name {
    font-size: 15px;
    font-weight: 600;
    margin-bottom: 4px;
}

.tracking-rep-location {
    font-size: 12px;
    color: #666;
    margin-bottom: 6px;
}

.tracking-rep-status {
    font-size: 12px;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.online {
    background: #10b981;
}

.tracking-rep-orders {
    font-size: 13px;
    font-weight: 600;
    color: #4F46E5;
    background: #ede9fe;
    padding: 6px 12px;
    border-radius: 8px;
    align-self: flex-start;
}

.tracking-stats {
    padding-top: 20px;
    border-top: 1px solid #e5e7eb;
}

.tracking-stats h4 {
    font-size: 16px;
    margin-bottom: 15px;
}

.tracking-stat-item {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f3f4f6;
}

.tracking-stat-item span {
    font-size: 14px;
    color: #666;
}

.tracking-stat-item strong {
    font-size: 15px;
    color: #1a1a1a;
}

/* Responsive */
@media (max-width: 1400px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .sidebar {
        width: 240px;
    }
    
    .main-content {
        margin-right: 240px;
    }
    
    [dir="ltr"] .main-content {
        margin-left: 240px;
    }
    
    .tracking-container {
        grid-template-columns: 1fr;
    }
    
    .tracking-sidebar {
        height: 400px;
    }
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}
