/* -------------------------------------------------------------------------- */
/* 1. Dashboard Layout (Main Structure) - ENHANCED */
/* -------------------------------------------------------------------------- */
.asm-dashboard-container {
    display: flex; 
    flex-wrap: wrap;
    max-width: 1300px; /* मैक्सिमम चौड़ाई सेट करें */
    margin: 20px auto; /* पूरे डैशबोर्ड को सेंटर में करें */
    background: #fff;
    border: 1px solid #e5e5e5;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); /* हल्का शैडो दें */
    border-radius: 8px; /* किनारों को गोल करें */
    overflow: hidden; /* ताकि शैडो अंदर ही रहे */
}

/* -------------------------------------------------------------------------- */
/* 2. Sidebar Menu (बायाँ कॉलम) - ENHANCED */
/* -------------------------------------------------------------------------- */
.asm-dashboard-sidebar {
    width: 250px; /* साइडबार की चौड़ाई थोड़ी बढ़ाएँ (पहले 220px था) */
    background-color: #333; /* गहरा काला बैकग्राउंड (WCFM/Admin style) */
    color: #fff;
    padding: 0; /* कंटेनर का padding हटाएँ */
    flex-shrink: 0; 
    min-height: 600px; 
}

.asm-dashboard-sidebar h3 {
    text-align: center;
    color: #fff;
    background: #222;
    margin: 0;
    padding: 15px 0;
    font-size: 1.4em;
    border-bottom: 1px solid #444;
}

.asm-dashboard-sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Sidebar List Item (Menu Items) */
.asm-dashboard-sidebar li {
    display: block;
    padding: 12px 15px; /* बेहतर पैडिंग */
    color: #f1f1f1;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #444;
    transition: background-color 0.2s, color 0.2s;
    cursor: pointer;
    line-height: 1;
}
.asm-dashboard-sidebar li:hover {
    background-color: #0073aa; /* Hover effect */
    color: #fff;
}

/* Active और Hover स्टेट */
.asm-dashboard-sidebar li.active {
    background-color: #0073aa; /* WordPress का नीला रंग */
    color: #fff;
}

/* Logout link special handling */
.asm-dashboard-sidebar ul li a {
    color: inherit; 
    text-decoration: none;
}
.asm-dashboard-sidebar ul li.active a {
    color: #fff;
}


/* -------------------------------------------------------------------------- */
/* 3. Content Area (दायाँ कॉलम) - CRITICAL SCROLL FIX */
/* -------------------------------------------------------------------------- */
.asm-dashboard-main { 
    flex: 1; 
    padding: 20px 30px; /* बेहतर पैडिंग */
    background: #fcfcfc; /* हल्का ग्रे बैकग्राउंड */
    min-width: 0; 
    
    /* ⭐ CRITICAL FIX: यह ओवरफ्लो टेबल के लिए हॉरिजॉन्टल स्क्रॉलिंग सक्षम करता है */
    overflow-x: auto; 
}

.asm-dashboard-main h2 {
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 20px;
    white-space: normal; 
    word-break: break-word;
}

.asm-tab-content {
    display: none;
}

.asm-tab-content.active {
    display: block;
}

/* -------------------------------------------------------------------------- */
/* 4. Table Responsive Fixes */
/* -------------------------------------------------------------------------- */

/* New wrapper to manage scrolling */
.asm-table-responsive-wrapper {
    overflow-x: auto; 
    -webkit-overflow-scrolling: touch; 
    margin: 15px 0; 
    padding-bottom: 5px; 
}

/* Ensure the table itself is wide enough to cause overflow */
.asm-orders-table,
.asm-orders,
.asm-capability-table,
.wp-list-table { /* WordPress की default tables पर भी लागू */
    min-width: 900px; /* Minimum width set karein taaki table scroll हो सके */
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
    display: table; 
}

/* Default Cell Styling */
.asm-orders th,
.asm-orders td,
.asm-capability-table th,
.asm-capability-table td,
.wp-list-table th,
.wp-list-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    box-sizing: border-box;
    min-width: 120px; 
    white-space: normal; 
    word-break: break-word; 
}

/* Orders Table Header */
.asm-orders th,
.wp-list-table thead th {
    background: #0073aa;
    color: #fff;
}

/* Capability Table Header */
.asm-capability-table th {
    background: #f4f4f4;
    font-weight: 600;
}

/* Alternate Row Colors */
.asm-capability-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.asm-capability-table tr.agent-row td,
.asm-capability-table tr.shopkeeper-row td {
    background-color: #eef6ff;
}

.asm-capability-table td input[type="checkbox"] {
    transform: scale(1.2);
    cursor: pointer;
}

#asm-capabilities-message {
    margin-top: 10px;
    font-weight: 600;
}

/* -------------------------------------------------------------------------- */
/* 5. Mobile Responsiveness */
/* -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .asm-dashboard-container {
        flex-direction: column; 
        margin: 10px;
        box-shadow: none;
        border-radius: 0;
    }
    
    .asm-dashboard-sidebar {
        width: 100%; 
        min-height: auto;
    }

    /* Tabs को मोबाइल पर हॉरिजॉन्टल स्क्रॉलिंग के लिए सेट करें */
    .asm-dashboard-sidebar ul {
        display: flex; 
        overflow-x: auto;
        white-space: nowrap;
        padding-bottom: 10px;
        border-bottom: 1px solid #444;
    }

    .asm-dashboard-sidebar ul li {
        flex-shrink: 0;
        padding: 8px 12px;
        border-right: 1px solid #444;
        border-bottom: none;
        width: auto;
    }

    .asm-dashboard-sidebar h3 {
        display: none; 
    }

    .asm-dashboard-main {
        padding: 15px;
    }
    
    .asm-orders,
    .asm-capability-table {
        /* On small screens, let the width be auto to adjust */
        width: auto !important; 
    }
}

