.dashboard-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: calc(100vh - 52px);
    height: calc(100vh - 52px);
    background-color: #ffffff;
    padding: 24px;
    overflow: hidden;
}

.dashboard-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #f0f0f0;
    flex-shrink: 0;
}

.dashboard-header h1 { font-size: 24px; color: #1a1a1a; margin-bottom: 4px; font-weight: 600; }
.dashboard-header p { font-size: 14px; color: #6b7280; }

.dashboard-content-layout {
    display: flex;
    gap: 16px;
    flex: 1;
    overflow: hidden;
    min-width: 0;
}

.dashboard-side-panel {
    width: 250px;
    background-color: #ffffff;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e5e7eb; box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    overscroll-behavior: none;
}

.dashboard-main-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    overscroll-behavior: none;
    padding-right: 12px;
    padding-bottom: 0px;
    min-width: 0;
}

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

.dashboard-card {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 20px;
    border: 1px solid #e5e7eb; box-shadow: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dashboard-card-title { font-size: 13px; color: #6b7280; font-weight: 600; }
.dashboard-card-value { font-size: 28px; font-weight: 700; color: #111827; }
.dashboard-card-desc { font-size: 13px; color: #3b82f6; font-weight: 500; }

.dashboard-section {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 24px;
    border: 1px solid #e5e7eb; box-shadow: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.dashboard-section h2 { font-size: 18px; color: #111827; margin-bottom: 8px; font-weight: 600; }
.dashboard-section > p { font-size: 14px; color: #6b7280; line-height: 1.6; margin-bottom: 24px; }

.dashboard-charts {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    flex: 1;
    min-width: 0;
}

.chart-container {
    background: #ffffff;
    border: 1px solid #f3f4f6;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    box-shadow: rgba(0, 0, 0, 0.02) 0px 2px 4px;
    min-width: 0;
}

.chart-header {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chart-header i { color: #9ca3af; cursor: pointer; }

.chart-body {
    flex: 1;
    background: #f9fafb;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 13px;
    border: 1px dashed #e5e7eb;
    min-width: 0;
    position: relative;
    width: 100%;
}

/* ================= RESPONSIVE STYLES ================= */
/* Tablets / iPads */
@media (max-width: 1100px) {
    .dashboard-container {
        height: auto !important;
        min-height: auto;
        padding: 16px;
    }

    .dashboard-content-layout {
        flex-direction: column;
        overflow: visible;
    }

    .dashboard-side-panel {
        width: 100%;
        padding: 16px;
        overflow: visible;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        box-shadow: none;
        border-radius: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .dashboard-side-panel::-webkit-scrollbar {
        height: 4px;
    }
    .dashboard-side-panel::-webkit-scrollbar-thumb {
        background: #d1d5db;
        border-radius: 4px;
    }

    .dashboard-side-panel h3 {
        display: none !important;
        margin-right: 16px;
        margin-bottom: 0 !important;
    }

    .dashboard-side-panel ul {
        display: inline-flex;
        flex-direction: row !important;
        flex-wrap: nowrap;
        gap: 12px !important;
        flex-wrap: nowrap !important;
        gap: 16px !important;
        margin: 0 !important;
    }

    .dashboard-side-panel ul li {
        margin-right: 12px;
        margin-right: 0;
    }

    .dashboard-main-area {
        overflow-y: visible;
        padding-right: 0;
    }

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

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

/* Mobile Phones */
@media (max-width: 767px) {
    .dashboard-cards {
        grid-template-columns: repeat(2, 1fr); /* user wants 2 columns */
    }

    .dashboard-charts {
        grid-template-columns: 1fr;
    }

    .dashboard-container {
        border-radius: 0 !important;
        box-shadow: none !important;
        padding: 16px !important;
        height: auto !important;
        min-height: auto !important;
        overflow: visible !important;
    }
    
    .dashboard-main-area {
        overflow: visible !important;
        padding-bottom: 120px !important;
    }
}

/* Dashboard Section Full Screen on Mobile */
@media (max-width: 767px) {
    .dashboard-section {
        padding: 0 !important;
        background-color: transparent !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }
}

/* Additional Mobile Tweaks for Table and Fonts */
@media (max-width: 767px) {
    /* Responsive font sizes */
    .dashboard-main-area {
        gap: 12px !important; /* Reduce huge space between cards and table */
    }

    /* Responsive font sizes and layout */
    .dashboard-section h2 {
        font-size: 14px !important;
        font-size: 13px !important;
        text-align: left !important;
        margin-right: auto !important;
    }
    .dashboard-section span {
        font-size: 11px !important;
    }
    
    .dashboard-card-title {
        font-size: 11px !important;
    }
    .dashboard-card-value {
        font-size: 18px !important;
        font-size: 16px !important;
    }
    .dashboard-card-desc {
        font-size: 11px !important;
        font-size: 10px !important;
    }
    
    table {
        font-size: 11px !important; /* Smaller table text */
    }
    
    th, td {
        padding: 5px 8px !important; /* tighter padding on mobile */
        padding: 4px 6px !important; /* tighter padding on mobile */
    }
}

/* Fix for mobile browser navigation bar cutting off content */
@media (max-width: 767px) {
    .dashboard-main-area {
        padding-bottom: 120px !important; 
    }
}


@media (max-width: 767px) {

    .dashboard-side-panel {
        position: sticky !important;
        top: 0 !important;
        z-index: 50 !important;
        background-color: #ffffff !important;
        box-shadow: none !important;
        border-bottom: 1px solid #e5e7eb !important;
        margin: -16px -16px 16px -16px !important;
        padding: 12px 16px !important;
        width: auto !important;
    }

}
