/* Insights Section Enhancements */
#insights-section {
    padding: 20px;
}

#insights-section h2 {
    color: #2E7D32;
    font-size: 24px;
    margin-bottom: 24px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e8f5e9;
}

#insights-section h3 {
    color: #333;
    font-size: 18px;
    margin: 30px 0 15px;
    padding-left: 10px;
    border-left: 4px solid #2E7D32;
}

/* Dashboard Cards Enhancement */
#insights-section .dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

#insights-section .card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#insights-section .card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

#insights-section .total-customer-card {
    background: linear-gradient(135deg, #e8f5e9 0%, #fff 100%);
    border-left: 5px solid #2E7D32;
}

#insights-section .total-revenue-card {
    background: linear-gradient(135deg, #fff3e0 0%, #fff 100%);
    border-left: 5px solid #f57c00;
}

#insights-section .total-orders-card {
    background: linear-gradient(135deg, #fff3e0 0%, #fff 100%);
    border-left: 5px solid #7f00f5;
}

#insights-section .card h3 {
    color: #666;
    font-size: 16px;
    margin: 0 0 10px;
    border: none;
    padding: 0;
}

#insights-section .card p {
    color: #2E7D32;
    font-size: 50px;
    font-weight: 600;
    margin: 0;
}

/* Table Enhancements */
#insights-section table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin: 15px 0;
    table-layout: fixed;
}

#insights-section table th {
    background: #f8f9fa;
    color: #2E7D32;
    font-weight: 600;
    padding: 15px;
    text-align: center !important;
    border-bottom: 2px solid #e8f5e9;
    white-space: nowrap;
    width: 50%;
}

#insights-section table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    color: #444;
    text-align: center !important;
    vertical-align: middle;
    word-wrap: break-word;
    width: 50%;
}

#insights-section table tr:hover td {
    background-color: #f8f9fa;
}

#insights-section table td:first-child {
    font-weight: 500;
    color: #333;
    text-align: center !important;
}

#insights-section #top-customers-body td:nth-child(2),
#insights-section #due-customers-body td:nth-child(2) {
    font-family: monospace;
    font-size: 15px;
    font-weight: 600;
    color: #2E7D32;
    text-align: center !important;
}

/* Empty state for tables */
#insights-section tbody:empty::after {
    content: "No data available";
    display: table-cell;
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

/* No data cell styling */
#insights-section .no-data-cell {
    text-align: center !important;
    padding: 20px !important;
    color: #666 !important;
    font-style: italic !important;
    font-size: 14px !important;
}

/* Ensure specificity for table content alignment */
#insights-section table tbody tr td {
    text-align: center !important;
    vertical-align: middle !important;
}

#insights-section table thead tr th {
    text-align: center !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #insights-section {
        padding: 15px;
    }

    #insights-section .dashboard-cards {
        gap: 15px;
    }

    #insights-section .card {
        padding: 20px;
    }

    #insights-section .card p {
        font-size: 24px;
    }

    #insights-section table {
        display: table;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        width: 100%;
        margin: 10px 0;
        border-radius: 8px;
    }
    
    #insights-section table th, 
    #insights-section table td {
        white-space: nowrap;
        padding: 10px 8px;
        text-align: center !important;
    }

    #insights-section table th {
        font-size: 14px;
        padding: 12px 8px;
    }

    #insights-section table td {
        font-size: 13px;
        padding: 10px 8px;
    }

    #insights-section #top-customers-body td:nth-child(2),
    #insights-section #due-customers-body td:nth-child(2) {
        font-size: 13px;
    }

    /* Ensure mobile tables are properly centered */
    #insights-section table tbody tr td {
        text-align: center !important;
    }

    #insights-section table thead tr th {
        text-align: center !important;
    }
}
