* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #48bb78;
    --warning-color: #f6ad55;
    --danger-color: #fc8181;
    --dark: #2d3748;
    --gray: #718096;
    --light-gray: #e2e8f0;
    --white: #ffffff;
    --sidebar-width: 260px;
}

body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f7fafc;
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 25px;
    border-bottom: 1px solid var(--light-gray);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 800;
    color: var(--dark);
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 25px;
    color: var(--gray);
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item:hover {
    background: #f7fafc;
    color: var(--primary-color);
}

.nav-item.active {
    color: var(--primary-color);
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.nav-icon {
    font-size: 20px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid var(--light-gray);
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-profile img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    color: var(--dark);
}

.user-plan {
    font-size: 12px;
    color: var(--gray);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
}

/* Topbar */
.topbar {
    background: var(--white);
    padding: 20px 30px;
    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;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    background: transparent;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--dark);
}

.topbar h1 {
    font-size: 28px;
    color: var(--dark);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.date-range-picker {
    display: flex;
    gap: 10px;
    background: #f7fafc;
    padding: 5px;
    border-radius: 10px;
}

.date-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    color: var(--gray);
    font-weight: 500;
    transition: all 0.3s ease;
}

.date-btn:hover {
    background: var(--white);
}

.date-btn.active {
    background: var(--white);
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.date-btn.custom {
    display: flex;
    align-items: center;
    gap: 5px;
}

.notifications {
    position: relative;
}

.notification-btn {
    background: transparent;
    border: none;
    font-size: 20px;
    cursor: pointer;
    position: relative;
}

.notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger-color);
    color: white;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
}

.export-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

/* Dashboard Content */
.dashboard-content {
    padding: 30px;
}

/* KPI Section */
.kpi-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.kpi-card {
    background: var(--white);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.kpi-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
}

.kpi-period {
    font-size: 12px;
    color: var(--gray);
}

.kpi-content h3 {
    font-size: 14px;
    color: var(--gray);
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 15px;
}

.kpi-change {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

.kpi-change.positive {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success-color);
}

.kpi-change.negative {
    background: rgba(252, 129, 129, 0.1);
    color: var(--danger-color);
}

.kpi-chart {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 100px;
    height: 40px;
    opacity: 0.3;
}

/* Charts Section */
.charts-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    gap: 25px;
    margin-bottom: 30px;
}

.chart-card {
    background: var(--white);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.chart-card.large {
    grid-column: 1;
    grid-row: span 2;
}

.chart-card.medium {
    grid-column: 2;
    grid-row: 1;
}

.chart-card.small {
    grid-column: 2;
    grid-row: 2;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.chart-header h3 {
    font-size: 18px;
    color: var(--dark);
}

.chart-subtitle {
    font-size: 14px;
    color: var(--gray);
}

.chart-controls select {
    padding: 8px 12px;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    background: var(--white);
    color: var(--dark);
    cursor: pointer;
}

.chart-body {
    position: relative;
    height: 300px;
}

.chart-card.large .chart-body {
    height: 400px;
}

.chart-card.small .chart-body {
    height: 200px;
}

/* Success Rate Display */
.success-rate-display {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.rate-circle {
    position: relative;
    width: 150px;
    height: 150px;
}

.rate-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.rate-value {
    display: block;
    font-size: 28px;
    font-weight: 800;
    color: var(--dark);
}

.rate-label {
    display: block;
    font-size: 12px;
    color: var(--gray);
    text-transform: uppercase;
}

.rate-stats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: var(--gray);
}

.stat-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.stat-dot.success {
    background: var(--success-color);
}

.stat-dot.failed {
    background: var(--danger-color);
}

/* Map Section */
.map-section {
    margin-bottom: 30px;
}

.map-card {
    background: var(--white);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.map-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.map-header h3 {
    font-size: 18px;
    color: var(--dark);
}

.map-controls {
    display: flex;
    gap: 10px;
}

.map-btn {
    padding: 8px 16px;
    background: transparent;
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.map-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.map-body {
    height: 400px;
    position: relative;
}

#worldMap {
    width: 100%;
    height: 100%;
}

.map-legend {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--light-gray);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--gray);
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 4px;
}

/* Tables Section */
.tables-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.table-card {
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px;
    border-bottom: 1px solid var(--light-gray);
}

.table-header h3 {
    font-size: 18px;
    color: var(--dark);
}

.view-all {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
}

.view-all:hover {
    transform: translateX(5px);
}

.table-body {
    padding: 15px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

td {
    padding: 15px 12px;
    border-top: 1px solid #f7fafc;
}

.customer-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.customer-info img {
    width: 35px;
    height: 35px;
    border-radius: 50%;
}

.amount {
    font-weight: 600;
    color: var(--dark);
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: rgba(72, 187, 120, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background: rgba(246, 173, 85, 0.1);
    color: var(--warning-color);
}

/* Transaction List */
.transaction-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.transaction-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 10px;
    background: #f7fafc;
    transition: all 0.3s ease;
}

.transaction-item:hover {
    background: #edf2f7;
}

.transaction-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.transaction-icon.success {
    background: var(--success-color);
}

.transaction-icon.failed {
    background: var(--danger-color);
}

.transaction-icon.pending {
    background: var(--warning-color);
}

.transaction-details {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.transaction-id {
    font-weight: 600;
    color: var(--dark);
}

.transaction-time {
    font-size: 12px;
    color: var(--gray);
}

.transaction-amount {
    font-weight: 700;
    font-size: 18px;
}

.transaction-amount.positive {
    color: var(--success-color);
}

.transaction-amount.negative {
    color: var(--danger-color);
}

.transaction-amount.pending {
    color: var(--warning-color);
}

/* Metrics Section */
.metrics-section {
    margin-bottom: 30px;
}

.metrics-card {
    background: var(--white);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.metrics-card h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 25px;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.metric-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.metric-label {
    font-size: 14px;
    color: var(--gray);
}

.metric-bar {
    height: 8px;
    background: var(--light-gray);
    border-radius: 4px;
    overflow: hidden;
}

.metric-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
    transition: width 1s ease;
}

.metric-fill.warning {
    background: linear-gradient(135deg, #f6ad55, #ed8936);
}

.metric-fill.danger {
    background: linear-gradient(135deg, #fc8181, #f56565);
}

.metric-value {
    font-weight: 600;
    color: var(--dark);
}

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
}

.action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 15px;
    background: var(--white);
    border: 2px solid var(--light-gray);
    border-radius: 12px;
    color: var(--gray);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.action-icon {
    font-size: 20px;
}

/* Activity Feed */
.activity-feed {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 320px;
    background: var(--white);
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 100;
    transition: all 0.3s ease;
}

.activity-feed.collapsed {
    height: 50px;
}

.feed-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--light-gray);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    border-radius: 15px 15px 0 0;
}

.feed-header h4 {
    font-size: 14px;
    font-weight: 600;
}

.feed-toggle {
    background: transparent;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
}

.feed-body {
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
}

.feed-item {
    display: flex;
    align-items: start;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    background: #f7fafc;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.feed-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 5px;
}

.feed-content {
    flex: 1;
}

.feed-text {
    font-size: 13px;
    color: var(--dark);
    margin-bottom: 5px;
}

.feed-time {
    font-size: 11px;
    color: var(--gray);
}

/* Responsive Design */
@media (max-width: 1400px) {
    .charts-section {
        grid-template-columns: 1fr;
    }
    
    .chart-card.large {
        grid-column: 1;
        grid-row: 1;
    }
    
    .chart-card.medium {
        grid-column: 1;
        grid-row: 2;
    }
    
    .chart-card.small {
        grid-column: 1;
        grid-row: auto;
    }
}

@media (max-width: 1200px) {
    .tables-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.active {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .menu-toggle {
        display: block;
    }
    
    .topbar h1 {
        font-size: 20px;
    }
    
    .date-range-picker {
        display: none;
    }
    
    .kpi-section {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .activity-feed {
        display: none;
    }
}