/* Container Fix */
.mmp-vendor-dashboard {
    display: flex !important;
    flex-direction: row !important; /* Forces side-by-side */
    align-items: stretch;
    width: 100%;
}

/* Sidebar Fix */
.mmp-sidebar-menu {
    width: 260px !important;
	background: #23282d; /* Matches your professional dark theme */
    color: #fff;
    flex-shrink: 0; /* Prevents sidebar from squashing */
}

/* Content & Heading Fix */
.mmp-content-area {
    flex-grow: 1;
    padding: 40px; /* Gives heading space from the sidebar */
    display: block !important;
}

.mmp-content-area h2 {
    margin-top: 0;
    margin-bottom: 30px;
    font-size: 28px;
    color: #23282d;
    border-bottom: 2px solid #eee; /* Adds a clean separator */
    padding-bottom: 10px;
}

/* Grid layout for the 4 stat cards */
.mmp-stats-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important; /* Forces 4 columns */
    gap: 20px !important;
    margin: 25px 0 !important;
    width: 100% !important;
}

/* Card internal alignment */
.mmp-card {
    display: flex !important;
    align-items: center !important;
    padding: 20px !important;
    border-radius: 8px !important;
    color: #fff !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

/* Responsive fix for tablets */
@media (max-width: 1100px) {
    .mmp-stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}


/* 4. Success & Error Notices */
.mmp-dashboard-content .woocommerce-message, 
.mmp-dashboard-content .woocommerce-error {
    background-color: #e6fffa !important;
    border-top: 3px solid #38b2ac !important;
    border-left: 5px solid #38b2ac !important; /* Added for visual impact */
    color: #2c7a7b !important;
    padding: 15px 20px !important;
    margin-bottom: 25px !important; /* Clean spacing from header */
    width: 100% !important;
    box-sizing: border-box !important;
    display: flex !important;
    align-items: center !important;
}



/* 5. Product Form Styling */
#mmp-add-product-form .form-group { 
    margin-bottom: 20px; 
}

#mmp-add-product-form label { 
    display: block !important; 
    font-weight: bold; 
    margin-bottom: 8px; 
}

#mmp-add-product-form input, 
#mmp-add-product-form textarea, 
#mmp-add-product-form select { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #ccc; 
    border-radius: 4px; 
}

#mmp-add-product-form button { 
    background: #0073aa; 
    color: white; 
    border: none; 
    padding: 12px 24px; 
    cursor: pointer; 
    font-size: 16px; 
}

#mmp-add-product-form button:hover { 
    background: #005177; 
}

/* MMP Products Table Image Fix */
.mmp-products-list table img {
    display: block !important; /* Force show */
    width: 50px !important;    /* Force width */
    height: 50px !important;   /* Force height */
    max-width: none !important; 
    border-radius: 4px; 
    border: 1px solid #ddd; 
    margin: 0 auto;
    object-fit: cover; 
}

/* Ensure the column itself has width */
.mmp-products-list table th:first-child,
.mmp-products-list table td:first-child {
    width: 80px !important;
    min-width: 80px !important;
    text-align: center;
}

/* 6. Product List Table Styling */
.wp-list-table {
    border: 1px solid #ddd;
    margin-top: 10px;
}

.wp-list-table th {
    background: #f6f7f7;
    font-weight: 600;
}

/* Force images to display in the vendor table */
.mmp-products-list table .wp-get-attachment-image,
.mmp-products-list table img {
    display: inline-block !important;
    visibility: visible !important;
    width: 50px !important;
    height: 50px !important;
    object-fit: cover;
}

/* Highlights empty required fields */
input:invalid, textarea:invalid {
    border: 1px solid #dc3545 !important;
}
.error-text {
    color: #dc3545;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}
input:invalid + .error-text {
    display: block;
}

/* Ensure the sidebar and content sit side-by-side */
.mmp-vendor-dashboard {
    display: flex !important;
    align-items: flex-start !important;
    width: 100% !important;
    overflow-x: hidden; /* Prevents stray horizontal scrolls */
}

.mmp-dashboard-content {
    flex: 1 !important;
    padding: 20px !important;
    min-width:0; /* Allows content to shrink to fit */
}

/* Header Styling */

.mmp-dashboard-header {
    background: #fff;
    padding: 20px;
    border-radius: 4px;
    margin-bottom: 25px;
    border-bottom: 1px solid #eee;
}
/* Force cards into a single row without overflow */
.mmp-stats-grid {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important; 
    gap: 15px !important;
    margin-top: 20px !important;
    width: 100% !important;
}

.mmp-card {
    flex: 1 !important;
    min-width:0 !important; /* FIXED: Prevents cards from pushing off-screen */
    display: flex !important;
    align-items: center !important;
    padding: 10px !important;
    color: #fff !important;
    border-radius: 5px !important;
}

/* Card Colors */
.mmp-card.red { background: #f05050; }
.mmp-card.blue { background: #23b7e5; }
.mmp-card.yellow { background: #fad733; color: #333; }
.mmp-card.teal { background: #27c24c; }

/* Icon and Text inside cards */
.mmp-card span.dashicons {
    font-size: 20px;
    width: 40px;
    height: 40px;
    margin-right: 15px;
    opacity: 0.8;
}

/* Sidebar Menu Cleanup (Fixes the bullet points in image_87112e) */
.mmp-sidebar-menu ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.mmp-sidebar-menu li a {
    display: block;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    border-bottom: 1px solid #34495e;
}

.mmp-sidebar-menu li a:hover, 
.mmp-sidebar-menu li a.active {
    background: #34495e;
    border-left: 4px solid #23b7e5;
}

/* Tablet and Mobile adjustments */
@media (max-width: 992px) {
    .mmp-stats-grid {
        flex-wrap: wrap !important; /* Allows cards to drop to the next line */
    }
    .mmp-card {
        flex: 0 0 48% !important; /* Shows 2 cards per row on tablets */
    }
}

@media (max-width: 600px) {
    .mmp-vendor-dashboard {
        flex-direction: column !important; /* Moves sidebar above content */
    }
    .mmp-card {
        flex: 0 0 48% !important; /* 1 card per row on small phones */
    }
}

/* Updated Stats Grid for smaller size and correct alignment */
.mmp-stats-grid {
    display: flex !important;
    gap: 10px !important;
    flex-wrap: wrap;
}

.mmp-stats-grid > div {
    flex: 1;
    min-width: 150px;
    padding: 15px !important; /* Reduced padding for smaller height */
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center; /* Centers text horizontally */
    justify-content: center; /* Centers content vertically */
    text-align: center;
    color: #fff;
}

/* Adjusting the large number alignment and size */
.mmp-stats-grid h2, 
.mmp-stats-grid .stats-number {
    font-size: 20px !important; /* Smaller, consistent font size */
    margin: 5px 0 !important;
    font-weight: bold;
    line-height: 1.2;
}

/* Adjusting the label text */
.mmp-stats-grid p,
.mmp-stats-grid .stats-label {
    font-size: 13px !important;
    margin: 0 !important;
    opacity: 0.9;
}

/* Ensuring icons stay proportional */
.mmp-stats-grid i,
.mmp-stats-grid svg {
    font-size: 24px !important;
    margin-bottom: 5px;
}

/* When the 'Add Product' tab is active, hide the dashboard elements */
.mmp-tab-add-product .mmp-dashboard-header,
.mmp-tab-add-product .mmp-stats-grid,
.mmp-tab-add-product .welcome-header,
.mmp-tab-add-product .welcome-section {
    display: none !important;
}

/* Also hide them if we are in 'Edit' mode */
.mmp-tab-edit-product .mmp-dashboard-header,
.mmp-tab-edit-product .mmp-stats-grid,
.mmp-tab-edit-product .welcome-header {
    display: none !important;
}

/* Header Profile Style */
.mmp-welcome-profile {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.mmp-welcome-profile img {
    border-radius: 50%;
    border: 3px solid #f0f0f0;
}

/* Card Icons & Layout */
.mmp-card {
    display: flex !important;
    align-items: center;
    gap: 15px;
    padding: 20px !important;
    color: white !important;
}

.mmp-card .dashicons {
    font-size: 30px;
    width: 30px;
    height: 30px;
    opacity: 0.7;
}

.mmp-card h3 {
    margin: 0;
    font-size: 22px;
    font-weight: bold;
}

.mmp-card p {
    margin: 0;
    font-size: 13px;
    opacity: 0.9;
}