/**
 * Admin Styles
 *
 * @package QuarkcodeNeuralCommerce
 * @since 1.0.0
 */

/* General Admin Styles */
.qcnc-dashboard,
.qcnc-product-costs,
.qcnc-order-profitability,
.qcnc-reports,
.qcnc-settings {
    margin-top: 20px;
}

/* Toolbar */
.qcnc-toolbar {
    background: #f8f9fa;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.qcnc-filter-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.qcnc-filter-group label {
    font-weight: 500;
}

.qcnc-filter-group input[type="date"] {
    padding: 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Date Filter */
.qcnc-date-filter {
    background: #ffffff;
    padding: 15px;
    margin: 20px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.qcnc-date-filter form {
    display: flex;
    gap: 15px;
    align-items: center;
}

.qcnc-date-filter label {
    font-weight: 500;
}

.qcnc-date-filter input[type="date"] {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Modal Styles */
.qcnc-modal {
    display: none;
    position: fixed;
    z-index: 100000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.qcnc-modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 30px;
    border: 1px solid #888;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
}

.qcnc-modal-large {
    max-width: 900px;
}

.qcnc-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 20px;
    top: 15px;
}

.qcnc-modal-close:hover,
.qcnc-modal-close:focus {
    color: #000;
    text-decoration: none;
}

.qcnc-modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
}

.qcnc-modal form p {
    margin: 15px 0;
}

.qcnc-modal form label {
    display: inline-block;
    min-width: 140px;
    font-weight: 500;
}

.qcnc-modal form input[type="number"],
.qcnc-modal form input[type="text"],
.qcnc-modal form input[type="email"],
.qcnc-modal form input[type="url"] {
    width: calc(100% - 150px);
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Table Styles */
.qcnc-costs-table-container,
.qcnc-orders-table-container {
    margin-top: 20px;
}

#qcnc-costs-table,
#qcnc-orders-table {
    background: #ffffff;
}

#qcnc-costs-table th,
#qcnc-orders-table th {
    font-weight: 600;
    background: #f8f9fa;
}

#qcnc-costs-table td,
#qcnc-orders-table td {
    vertical-align: middle;
}

.qcnc-loading {
    text-align: center;
    padding: 40px !important;
    color: #999;
}

/* Pagination */
.qcnc-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.qcnc-pagination button {
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #ffffff;
    border-radius: 4px;
    cursor: pointer;
}

.qcnc-pagination button:hover {
    background: #007bff;
    color: #ffffff;
    border-color: #007bff;
}

.qcnc-pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qcnc-pagination button:disabled:hover {
    background: #ffffff;
    color: #333;
    border-color: #ddd;
}

.qcnc-pagination .qcnc-page-info {
    font-weight: 500;
}

/* Action Buttons */
.qcnc-action-btn {
    padding: 5px 10px;
    margin: 0 2px;
    border: none;
    background: #007bff;
    color: #ffffff;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.qcnc-action-btn:hover {
    background: #0056b3;
}

.qcnc-action-btn.qcnc-danger {
    background: #dc3545;
}

.qcnc-action-btn.qcnc-danger:hover {
    background: #c82333;
}

.qcnc-action-btn.qcnc-secondary {
    background: #6c757d;
}

.qcnc-action-btn.qcnc-secondary:hover {
    background: #545b62;
}

/* Badge Styles */
.qcnc-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
}

.qcnc-badge-success {
    background: #d4edda;
    color: #155724;
}

.qcnc-badge-warning {
    background: #fff3cd;
    color: #856404;
}

.qcnc-badge-danger {
    background: #f8d7da;
    color: #721c24;
}

/* Report Navigation */
.qcnc-report-nav {
    margin: 20px 0;
}

.qcnc-report-nav .subsubsub {
    margin: 0;
    padding: 0;
}

.qcnc-report-filters {
    background: #f8f9fa;
    padding: 15px;
    margin: 20px 0;
    border-radius: 4px;
}

.qcnc-report-filters form {
    display: flex;
    gap: 15px;
    align-items: center;
}

.qcnc-report-filters label {
    font-weight: 500;
}

.qcnc-report-filters input[type="date"] {
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Import Progress */
#qcnc-import-progress {
    margin-top: 20px;
}

#qcnc-import-progress progress {
    width: 100%;
    height: 30px;
}

/* Responsive */
@media screen and (max-width: 782px) {
    .qcnc-toolbar,
    .qcnc-date-filter form,
    .qcnc-report-filters form {
        flex-direction: column;
        align-items: flex-start;
    }

    .qcnc-modal-content {
        width: 95%;
        padding: 20px;
    }

    .qcnc-modal form label {
        display: block;
        min-width: auto;
        margin-bottom: 5px;
    }

    .qcnc-modal form input[type="number"],
    .qcnc-modal form input[type="text"],
    .qcnc-modal form input[type="email"],
    .qcnc-modal form input[type="url"] {
        width: 100%;
    }
}

/* Utility Classes */
.qcnc-text-success {
    color: #28a745;
}

.qcnc-text-danger {
    color: #dc3545;
}

.qcnc-text-warning {
    color: #ffc107;
}

.qcnc-text-center {
    text-align: center;
}

.qcnc-mt-20 {
    margin-top: 20px;
}

.qcnc-mb-20 {
    margin-bottom: 20px;
}

/* Order Details Modal */
.qcnc-modal-large .qcnc-modal-content {
    max-width: 900px;
    max-height: 90vh;
    overflow-y: auto;
}

#qcnc-order-details-content table {
    margin-bottom: 15px;
}

#qcnc-order-details-content table td {
    padding: 8px;
}

#qcnc-order-details-content h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    border-bottom: 2px solid #2271b1;
    padding-bottom: 5px;
}

.qcnc-order-info {
    border-radius: 4px;
}

.qcnc-order-info p {
    margin: 5px 0;
}


/* ====================================================================================
   Product Costs Page CSS
==================================================================================== */

/* =========================================
   Variables & Modern Reset
   ========================================= */
:root {
    --qcnc-primary: #2271b1; /* WordPress Blue */
    --qcnc-primary-hover: #135e96;
    --qcnc-success: #00a32a;
    --qcnc-warning: #dba617;
    --qcnc-danger: #d63638;
    --qcnc-bg: #f6f7f7;
    --qcnc-surface: #ffffff;
    --qcnc-text: #3c434a;
    --qcnc-text-light: #646970;
    --qcnc-border: #dcdcde;
    --qcnc-radius: 6px;
    --qcnc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Scoped Wrapper to prevent conflicts */
.qcnc-product-costs {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 100%;
    margin: 20px 20px 0 0;
    color: var(--qcnc-text);
}

/* =========================================
   Header & Toolbar
   ========================================= */
.qcnc-product-costs h1 {
    font-weight: 600;
    color: #1d2327;
    margin-bottom: 25px;
    font-size: 24px;
}

.qcnc-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--qcnc-surface);
    border: 1px solid var(--qcnc-border);
    border-radius: var(--qcnc-radius);
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    align-items: center;
}

/* Modernize WP Buttons */
.qcnc-toolbar .button {
    border-radius: 4px;
    padding: 6px 16px;
    height: auto;
    font-size: 14px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.qcnc-toolbar .button-primary {
    background: var(--qcnc-primary);
    border-color: var(--qcnc-primary);
    box-shadow: 0 2px 4px rgba(34, 113, 177, 0.3);
}

.qcnc-toolbar .button-primary:hover {
    background: var(--qcnc-primary-hover);
    transform: translateY(-1px);
}

/* =========================================
   Data Table Styling
   ========================================= */
#qcnc-costs-table-container {
    background: var(--qcnc-surface);
    border: 1px solid var(--qcnc-border);
    border-radius: var(--qcnc-radius);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    overflow: hidden; /* For rounded corners */
}

table.qcnc-costs-table,
#qcnc-costs-table {
    border: none;
    margin: 0;
    box-shadow: none;
    width: 100%;
}

#qcnc-costs-table thead th {
    background: #f8f9fa;
    color: var(--qcnc-text);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
    padding: 15px 12px;
    border-bottom: 2px solid var(--qcnc-border);
}

#qcnc-costs-table tbody td {
    padding: 14px 12px;
    vertical-align: middle;
    color: var(--qcnc-text);
    border-bottom: 1px solid #f0f0f1;
}

#qcnc-costs-table tbody tr:last-child td {
    border-bottom: none;
}

#qcnc-costs-table tbody tr:hover {
    background-color: #fbfbfb;
}

/* Specific Column Styling */
#qcnc-costs-table td:nth-child(8) { /* Total Cost */
    font-weight: 600;
    color: var(--qcnc-text);
}

#qcnc-costs-table td:nth-child(9) { /* Margin */
    font-weight: 700;
    color: var(--qcnc-primary);
}

.qcnc-loading {
    text-align: center;
    padding: 40px !important;
    color: var(--qcnc-text-light);
    font-style: italic;
}

/* Pagination */
.qcnc-pagination {
    padding: 15px;
    border-top: 1px solid var(--qcnc-border);
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

/* =========================================
   Modals
   ========================================= */
.qcnc-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(29, 35, 39, 0.7); /* WP Admin Dark Overlay */
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

.qcnc-modal-content-cost {
    background-color: #fff;
    margin: 2% auto;
    padding: 30px;
    border: none;
    width: 90%;
    max-width: 700px;
    border-radius: 8px;
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
    position: relative;
    transform: translateY(20px);
    animation: slideUp 0.3s forwards;
    max-height: 90vh; /* Maximum 90% of viewport height */
    overflow-y: auto; /* Scroll if content is too long */
    position: relative;
}

.qcnc-modal-large .qcnc-modal-content-cost {
    max-width: 1000px;
    max-height: 85vh;
}

@keyframes slideUp {
    to { transform: translateY(0); }
}

.qcnc-modal h2 {
    margin-top: 0;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--qcnc-border);
    font-size: 20px;
    color: var(--qcnc-primary);
}

.qcnc-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    transition: color 0.2s;
}

.qcnc-modal-close:hover,
.qcnc-modal-close:focus {
    color: var(--qcnc-danger);
    text-decoration: none;
}




/* =========================================
   Forms within Modals
   ========================================= */
#qcnc-cost-form p, 
#qcnc-import-form p {
    margin-bottom: 15px;
}

#qcnc-cost-form label,
#qcnc-import-form label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--qcnc-text);
}

#qcnc-cost-form input[type="number"],
#qcnc-cost-form input[type="text"],
#qcnc-import-form input[type="file"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--qcnc-border);
    border-radius: 4px;
    box-sizing: border-box;
    transition: border-color 0.2s;
    font-size: 14px;
}

#qcnc-cost-form input:focus {
    border-color: var(--qcnc-primary);
    box-shadow: 0 0 0 1px var(--qcnc-primary);
    outline: none;
}

/* Info Box Override */
#qcnc-product-info {
    background: #f6f8fa !important;
    border: 1px solid #d1d5db !important;
    border-left: 4px solid var(--qcnc-primary) !important;
    border-radius: 4px;
    padding: 15px !important;
    margin-bottom: 20px !important;
    font-size: 13px;
}

/* =========================================
   Warning Box (Products Missing Costs)
   ========================================= */
.qcnc-warning-box {
    background: #fff !important;
    border: 1px solid #f0c33c !important; /* Yellow border */
    border-left: 5px solid #dba617 !important;
    border-radius: var(--qcnc-radius);
    padding: 20px !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.qcnc-warning-box h2 {
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.qcnc-warning-box table {
    margin-top: 15px;
    border: 1px solid var(--qcnc-border);
    border-radius: 4px;
    overflow: hidden;
}

/* =========================================
   Utility / Responsive
   ========================================= */
@media screen and (max-width: 782px) {
    .qcnc-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .qcnc-toolbar .button {
        width: 100%;
        margin-bottom: 5px;
    }
    
    #qcnc-costs-table-container {
        overflow-x: auto;
    }
}

/* ====================================================================================
   Dashboard Page CSS
==================================================================================== */
/* =========================================
   Variables & Scope
   ========================================= */
:root {
    --qcnc-primary: #2271b1;
    --qcnc-success: #00a32a;
    --qcnc-warning: #f0b849;
    --qcnc-danger: #d63638;
    --qcnc-surface: #ffffff;
    --qcnc-bg: #f0f2f4;
    --qcnc-text: #1d2327;
    --qcnc-text-muted: #646970;
    --qcnc-border: #dcdcde;
    --qcnc-radius: 8px;
    --qcnc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.qcnc-dashboard {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 100%;
    margin: 20px 20px 0 0;
    color: var(--qcnc-text);
}

.qcnc-dashboard h1 {
    font-weight: 600;
    margin-bottom: 25px;
    font-size: 24px;
}

/* =========================================
   Alert / Info Boxes
   ========================================= */
/* Override inline styles for consistency */
.qcnc-dashboard > div[style*="background: #fff"] {
    background: var(--qcnc-surface) !important;
    border: 1px solid var(--qcnc-border) !important;
    border-left: 4px solid var(--qcnc-primary) !important;
    box-shadow: var(--qcnc-shadow);
    border-radius: var(--qcnc-radius);
    padding: 20px !important;
    margin-bottom: 25px !important;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.qcnc-dashboard > div[style*="background: #fff"] p {
    margin: 0 !important;
}

/* =========================================
   Date Filter Bar
   ========================================= */
.qcnc-date-filter {
    background: var(--qcnc-surface);
    padding: 20px;
    border-radius: var(--qcnc-radius);
    box-shadow: var(--qcnc-shadow);
    margin-bottom: 25px;
    border: 1px solid var(--qcnc-border);
}

.qcnc-date-filter form {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.qcnc-date-filter label {
    font-weight: 600;
    color: var(--qcnc-text-muted);
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.5px;
}

.qcnc-date-filter input[type="date"] {
    padding: 6px 12px;
    border: 1px solid var(--qcnc-border);
    border-radius: 4px;
    color: var(--qcnc-text);
    min-height: 36px;
}

/* =========================================
   Stats Grid (KPI Cards)
   ========================================= */
.qcnc-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.qcnc-stat-box {
    background: var(--qcnc-surface);
    padding: 24px;
    border-radius: var(--qcnc-radius);
    box-shadow: var(--qcnc-shadow);
    border: 1px solid var(--qcnc-border);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.qcnc-stat-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.qcnc-stat-box h3 {
    margin: 0 0 10px 0;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--qcnc-text-muted);
    font-weight: 600;
}

.qcnc-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--qcnc-text);
    line-height: 1.2;
}

/* Highlight specifically the Net Profit box */
.qcnc-stat-box.qcnc-highlight {
    border-left: 4px solid var(--qcnc-success);
}

.qcnc-stat-box.qcnc-warning {
    border-left: 4px solid var(--qcnc-warning);
}

/* =========================================
   Charts/Tables Section
   ========================================= */
.qcnc-charts-row {
    display: flex;
    gap: 25px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.qcnc-chart-box {
    flex: 1;
    min-width: 400px; /* Prevents squishing on medium screens */
    background: var(--qcnc-surface);
    border-radius: var(--qcnc-radius);
    box-shadow: var(--qcnc-shadow);
    border: 1px solid var(--qcnc-border);
    padding: 0;
    overflow: hidden; /* Contains the table */
}

.qcnc-chart-box h2 {
    padding: 20px 20px 15px;
    margin: 0;
    font-size: 16px;
    border-bottom: 1px solid var(--qcnc-border);
    background: #fcfcfc;
    color: var(--qcnc-text);
}

/* Table Styling inside Cards */
.qcnc-chart-box table.widefat {
    border: none;
    box-shadow: none;
    margin: 0;
}

.qcnc-chart-box table thead th {
    background: #fff;
    border-bottom: 2px solid var(--qcnc-border);
    color: var(--qcnc-text-muted);
    font-size: 12px;
    text-transform: uppercase;
    padding: 15px;
}

.qcnc-chart-box table tbody td {
    padding: 15px;
    vertical-align: middle;
    color: var(--qcnc-text);
    border-bottom: 1px solid #f6f7f7;
}

.qcnc-chart-box table tbody tr:last-child td {
    border-bottom: none;
}

.qcnc-chart-box table tbody tr:hover {
    background-color: #f8f9fa;
}

/* Product Links */
.qcnc-chart-box a {
    text-decoration: none;
    color: var(--qcnc-primary);
    font-weight: 500;
}

.qcnc-chart-box a:hover {
    color: #135e96;
    text-decoration: underline;
}

/* =========================================
   Warning Box (Bottom)
   ========================================= */
.qcnc-warning-box {
    background: #fff !important;
    border: 1px solid #f0c33c !important;
    border-left: 5px solid #dba617 !important;
    border-radius: var(--qcnc-radius);
    padding: 25px !important;
    box-shadow: var(--qcnc-shadow);
}

.qcnc-warning-box h2 {
    font-size: 18px;
    margin-bottom: 15px;
}

.qcnc-warning-box table {
    margin: 15px 0 20px 0;
    border: 1px solid var(--qcnc-border);
    border-radius: 4px;
    overflow: hidden;
}

/* =========================================
   Buttons & Interactions
   ========================================= */
.button.button-primary {
    background: var(--qcnc-primary);
    border-color: var(--qcnc-primary);
    box-shadow: 0 2px 4px rgba(34, 113, 177, 0.3);
    transition: all 0.2s;
}

.button.button-primary:hover {
    background: #135e96;
    transform: translateY(-1px);
}

/* =========================================
   Responsive Design
   ========================================= */
@media screen and (max-width: 960px) {
    .qcnc-charts-row {
        flex-direction: column;
    }
    
    .qcnc-chart-box {
        min-width: 100%;
    }
}

@media screen and (max-width: 782px) {
    .qcnc-dashboard > div[style*="background: #fff"] {
        flex-direction: column;
        align-items: flex-start;
    }

    .qcnc-date-filter form {
        flex-direction: column;
        align-items: stretch;
    }
    
    .qcnc-date-filter input[type="date"],
    .qcnc-date-filter button {
        width: 100%;
    }
}

/* ====================================================================================
   Order Profitability Page CSS
==================================================================================== */

/* =========================================
   Variables & Scope
   ========================================= */
:root {
    --qcnc-primary: #2271b1;
    --qcnc-primary-hover: #135e96;
    --qcnc-success: #00a32a;
    --qcnc-warning: #dba617;
    --qcnc-danger: #d63638;
    --qcnc-surface: #ffffff;
    --qcnc-bg: #f0f2f4;
    --qcnc-text: #1d2327;
    --qcnc-text-muted: #646970;
    --qcnc-border: #dcdcde;
    --qcnc-radius: 8px;
    --qcnc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.qcnc-order-profitability {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 100%;
    margin: 20px 20px 0 0;
    color: var(--qcnc-text);
}

.qcnc-order-profitability h1 {
    font-weight: 600;
    margin-bottom: 25px;
    font-size: 24px;
    color: #1d2327;
}

/* =========================================
   Bulk Process Card (Hero Section)
   ========================================= */
/* !important used to override inline styles in PHP */
.qcnc-bulk-process-section {
    background: var(--qcnc-surface) !important;
    border: 1px solid var(--qcnc-border) !important;
    border-left: 4px solid var(--qcnc-primary) !important;
    border-radius: var(--qcnc-radius);
    padding: 25px !important;
    margin: 0 0 25px 0 !important;
    box-shadow: var(--qcnc-shadow);
}

.qcnc-bulk-process-section h3 {
    font-size: 16px;
    color: var(--qcnc-text);
    margin-bottom: 10px;
}

.qcnc-bulk-process-section p {
    color: var(--qcnc-text-muted);
    font-size: 14px;
    margin-bottom: 20px;
    max-width: 800px;
}

/* Bulk Actions Button Group */
.qcnc-bulk-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.qcnc-bulk-actions .button {
    height: 36px;
    padding: 0 16px;
    font-size: 14px;
}

/* Specific styling for the Reset button to look like a "Danger" ghost button */
#qcnc-reset-all-data {
    color: var(--qcnc-danger) !important;
    border-color: var(--qcnc-danger);
    background: transparent;
    transition: all 0.2s;
}

#qcnc-reset-all-data:hover {
    background: var(--qcnc-danger);
    color: #fff !important;
}

#qcnc-order-count {
    font-weight: 600;
    background: #f0f0f1;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
}

/* =========================================
   Progress Bar Styling
   ========================================= */
#qcnc-bulk-progress > div {
    background: #f8f9fa !important;
    border: 1px solid var(--qcnc-border) !important;
    border-radius: var(--qcnc-radius);
    padding: 20px !important;
    box-shadow: none !important;
}

#qcnc-bulk-progress div[style*="overflow: hidden"] {
    background: #e2e4e7 !important;
    height: 12px !important; /* Slimmer bar */
    border-radius: 6px !important;
    margin: 15px 0;
}

#qcnc-progress-bar {
    background: linear-gradient(90deg, var(--qcnc-primary), #4f94d4) !important;
    border-radius: 6px;
}

#qcnc-progress-text {
    font-weight: 600;
    color: var(--qcnc-text);
}

/* =========================================
   Toolbar & Filters
   ========================================= */
.qcnc-toolbar {
    background: var(--qcnc-surface);
    border: 1px solid var(--qcnc-border);
    border-radius: var(--qcnc-radius);
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.qcnc-filter-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.qcnc-filter-group label {
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    color: var(--qcnc-text-muted);
}

.qcnc-filter-group input[type="date"] {
    border: 1px solid var(--qcnc-border);
    border-radius: 4px;
    padding: 6px 10px;
    color: var(--qcnc-text);
    height: 36px;
}

.qcnc-filter-group .button {
    height: 36px;
    line-height: 34px; /* Vertically center text */
}

/* =========================================
   Data Table
   ========================================= */
#qcnc-orders-table-container {
    background: var(--qcnc-surface);
    border: 1px solid var(--qcnc-border);
    border-radius: var(--qcnc-radius);
    box-shadow: var(--qcnc-shadow);
    overflow: hidden;
}

table#qcnc-orders-table {
    border: none;
    box-shadow: none;
}

#qcnc-orders-table thead th {
    background: #f8f9fa;
    color: var(--qcnc-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 15px 12px;
    border-bottom: 2px solid var(--qcnc-border);
}

#qcnc-orders-table tbody td {
    padding: 14px 12px;
    vertical-align: middle;
    color: var(--qcnc-text);
    border-bottom: 1px solid #f0f0f1;
}

#qcnc-orders-table tbody tr:hover {
    background-color: #fcfcfc;
}

/* Column Specifics */
/* Revenue */
#qcnc-orders-table td:nth-child(5) {
    font-weight: 500;
}

/* Net Profit */
#qcnc-orders-table td:nth-child(8) {
    font-weight: 700;
}

/* Margin */
#qcnc-orders-table td:nth-child(9) {
    font-weight: 600;
}

/* Pagination */
.qcnc-pagination {
    padding: 15px;
    border-top: 1px solid var(--qcnc-border);
    background: #fff;
    display: flex;
    justify-content: flex-end;
    gap: 5px;
}

/* =========================================
   Modals
   ========================================= */
.qcnc-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(29, 35, 39, 0.7);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.qcnc-modal-content {
    background-color: #fff;
    padding: 0;
    border: none;
    width: 90%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    transform: translateY(20px);
    animation: slideUp 0.3s forwards;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.qcnc-modal-large .qcnc-modal-content {
    max-width: 900px;
}

.qcnc-modal-content > h2 {
    margin: 0;
    padding: 20px 25px;
    border-bottom: 1px solid var(--qcnc-border);
    font-size: 18px;
    background: #fcfcfc;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.qcnc-modal-close {
    color: #ccc;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.qcnc-modal-close:hover {
    color: var(--qcnc-danger);
}

#qcnc-order-details-content {
    padding: 25px;
    overflow-y: auto;
}

/* Modal Table Styling (Reuse widefat styles) */
#qcnc-order-details-content table.widefat {
    border: 1px solid var(--qcnc-border);
    border-radius: 4px;
    overflow: hidden;
}

/* =========================================
   Animations
   ========================================= */
@keyframes fadeIn {
    to { opacity: 1; }
}

@keyframes slideUp {
    to { transform: translateY(0); }
}

/* =========================================
   Responsive
   ========================================= */
@media screen and (max-width: 782px) {
    .qcnc-bulk-actions {
        flex-direction: column;
        align-items: stretch;
    }
    
    .qcnc-bulk-actions .button,
    #qcnc-order-count {
        width: 100%;
        margin-left: 0 !important;
        text-align: center;
        margin-bottom: 5px;
    }

    .qcnc-filter-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .qcnc-filter-group input, 
    .qcnc-filter-group button {
        width: 100%;
    }

    #qcnc-orders-table-container {
        overflow-x: auto;
    }
}

/* ====================================================================================
   Reports Page CSS
==================================================================================== */

/* =========================================
   Variables & Scope
   ========================================= */
    :root {
        --qcnc-primary: #2271b1;
        --qcnc-primary-hover: #135e96;
        --qcnc-surface: #ffffff;
        --qcnc-bg: #f0f2f4;
        --qcnc-text: #1d2327;
        --qcnc-text-muted: #646970;
        --qcnc-border: #dcdcde;
        --qcnc-radius: 8px;
        --qcnc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    }

    .qcnc-reports {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        max-width: 100%;
        margin: 20px 20px 0 0;
        color: var(--qcnc-text);
    }

    .qcnc-reports h1 {
        font-weight: 600;
        margin-bottom: 25px;
        font-size: 24px;
        color: #1d2327;
    }

    /* =========================================
    Modern Tab Navigation (Transforms .subsubsub)
    ========================================= */
    .qcnc-report-nav {
        margin-bottom: 25px;
    }

    /* Reset default WP styling */
    .qcnc-report-nav .subsubsub {
        float: none;
        margin: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        font-size: 0; /* Hides the separator pipes */
    }

    .qcnc-report-nav .subsubsub li {
        display: inline-block;
        margin: 0;
    }

    /* Style the links as "Pill" Tabs */
    .qcnc-report-nav .subsubsub a {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        text-decoration: none;
        padding: 8px 20px;
        background: var(--qcnc-surface);
        color: var(--qcnc-text-muted);
        border: 1px solid var(--qcnc-border);
        border-radius: 50px; /* Pill shape */
        transition: all 0.2s ease;
        font-weight: 500;
        box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    }

    /* Hover State */
    .qcnc-report-nav .subsubsub a:hover {
        color: var(--qcnc-primary);
        border-color: var(--qcnc-primary);
        background: #f0f6fc;
        transform: translateY(-1px);
    }

    /* Active State */
    .qcnc-report-nav .subsubsub a.current {
        background: var(--qcnc-primary);
        color: #fff;
        border-color: var(--qcnc-primary);
        box-shadow: 0 4px 6px rgba(34, 113, 177, 0.25);
    }

    /* =========================================
    Filter Bar Card
    ========================================= */
    .qcnc-report-filters {
        background: var(--qcnc-surface);
        padding: 20px 25px;
        border-radius: var(--qcnc-radius);
        box-shadow: var(--qcnc-shadow);
        border: 1px solid var(--qcnc-border);
        margin-bottom: 30px;
    }

    .qcnc-report-filters form {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 15px;
    }

    .qcnc-report-filters label {
        font-weight: 600;
        color: var(--qcnc-text-muted);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .qcnc-report-filters input[type="date"] {
        padding: 6px 12px;
        border: 1px solid var(--qcnc-border);
        border-radius: 4px;
        color: var(--qcnc-text);
        height: 36px;
        min-width: 150px;
        transition: border 0.2s;
    }

    .qcnc-report-filters input[type="date"]:focus {
        border-color: var(--qcnc-primary);
        box-shadow: 0 0 0 1px var(--qcnc-primary);
        outline: none;
    }

    /* Buttons inside filter */
    .qcnc-report-filters .button {
        height: 36px;
        line-height: 1; /* Better vertical alignment */
        display: inline-flex;
        align-items: center;
        padding: 0 20px;
        font-size: 14px;
        margin-left: 5px;
    }

    .qcnc-report-filters .button-primary {
        background: var(--qcnc-primary);
        border-color: var(--qcnc-primary);
        box-shadow: 0 2px 4px rgba(34, 113, 177, 0.3);
    }

    .qcnc-report-filters .button-primary:hover {
        background: var(--qcnc-primary-hover);
        transform: translateY(-1px);
    }

    /* Push the export button to the right if space permits */
    #qcnc-export-report {
        margin-left: auto;
    }

    /* =========================================
    Report Content / Data Tables
    ========================================= */
    /* Container for the included report files */
    #qcnc-report-content {
        background: var(--qcnc-surface);
        border: 1px solid var(--qcnc-border);
        border-radius: var(--qcnc-radius);
        box-shadow: var(--qcnc-shadow);
        overflow: hidden;
        min-height: 200px;
    }

    /* Styling for tables that will load inside the include files */
    #qcnc-report-content table.wp-list-table,
    #qcnc-report-content table.widefat {
        border: none;
        box-shadow: none;
        margin: 0;
    }

    #qcnc-report-content thead th {
        background: #f8f9fa;
        color: var(--qcnc-text-muted);
        font-weight: 600;
        text-transform: uppercase;
        font-size: 11px;
        letter-spacing: 0.5px;
        padding: 15px 12px;
        border-bottom: 2px solid var(--qcnc-border);
    }

    #qcnc-report-content tbody td {
        padding: 14px 12px;
        vertical-align: middle;
        color: var(--qcnc-text);
        border-bottom: 1px solid #f0f0f1;
    }

    #qcnc-report-content tbody tr:last-child td {
        border-bottom: none;
    }

    #qcnc-report-content tbody tr:hover {
        background-color: #fcfcfc;
    }

    /* =========================================
    Responsive Design
    ========================================= */
    @media screen and (max-width: 782px) {
        .qcnc-report-nav .subsubsub {
            justify-content: center;
        }
        
        .qcnc-report-filters form {
            flex-direction: column;
            align-items: stretch;
        }

        .qcnc-report-filters input[type="date"],
        .qcnc-report-filters .button {
            width: 100%;
            margin: 0 0 10px 0;
        }
        
        #qcnc-export-report {
            margin-left: 0;
        }

        #qcnc-report-content {
            overflow-x: auto;
        }
    }

/* ====================================================================================
   Settings Page CSS
==================================================================================== */

 /* =========================================
   Variables & Scope
   ========================================= */
:root {
    --qcnc-primary: #2271b1;
    --qcnc-primary-hover: #135e96;
    --qcnc-success: #00a32a;
    --qcnc-danger: #d63638;
    --qcnc-surface: #ffffff;
    --qcnc-bg: #f0f2f4;
    --qcnc-text: #1d2327;
    --qcnc-text-muted: #646970;
    --qcnc-border: #dcdcde;
    --qcnc-radius: 8px;
    --qcnc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
}

.qcnc-settings {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 100%;
    margin: 20px 20px 0 0;
    color: var(--qcnc-text);
}

.qcnc-settings h1 {
    font-weight: 600;
    margin-bottom: 25px;
    font-size: 24px;
    color: #1d2327;
}

/* =========================================
   Section Headings & Dividers
   ========================================= */
.qcnc-settings h2 {
    font-size: 18px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--qcnc-border);
    margin: 35px 0 20px 0;
    color: var(--qcnc-text);
}

.qcnc-settings h2:first-of-type {
    margin-top: 0;
}

/* Hide the double HRs in the HTML */
.qcnc-settings hr {
    display: none;
}

/* =========================================
   Standard WP Settings Form Modernization
   ========================================= */
.qcnc-settings .form-table {
    margin-bottom: 30px;
}

.qcnc-settings .form-table th {
    padding: 20px 10px 20px 0;
    font-weight: 600;
    width: 250px;
    color: var(--qcnc-text);
}

.qcnc-settings .form-table td {
    padding: 15px 10px;
}

/* Modernize Inputs */
.qcnc-settings input[type="text"],
.qcnc-settings input[type="email"],
.qcnc-settings input[type="number"],
.qcnc-settings input[type="url"],
.qcnc-settings input[type="password"],
.qcnc-settings select, 
.qcnc-settings textarea {
    padding: 8px 12px;
    border: 1px solid var(--qcnc-border);
    border-radius: 4px;
    color: var(--qcnc-text);
    box-shadow: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 300px;
    max-width: 100%;
}

.qcnc-settings input:focus,
.qcnc-settings select:focus,
.qcnc-settings textarea:focus {
    border-color: var(--qcnc-primary);
    box-shadow: 0 0 0 1px var(--qcnc-primary);
    outline: none;
}

/* Checkbox alignment */
.qcnc-settings input[type="checkbox"] {
    margin-top: 2px;
}

.qcnc-settings .description {
    color: var(--qcnc-text-muted);
    font-style: normal;
    margin-top: 6px;
}

/* Save Button Container */
.qcnc-settings p.submit-settings {
    background: var(--qcnc-surface);
    padding: 20px;
    border-radius: var(--qcnc-radius);
    border: 1px solid var(--qcnc-border);
    box-shadow: var(--qcnc-shadow);
    display: flex;
    justify-content: flex-start;
    margin-top: 40px;
}

.qcnc-settings p.submit-settings .button-primary {
    padding: 6px 25px;
    height: auto;
    font-size: 15px;
}

/* =========================================
   Gateway Fees Section
   ========================================= */
#qcnc-gateway-fees-table {
    background: var(--qcnc-surface);
    border: 1px solid var(--qcnc-border);
    border-radius: var(--qcnc-radius);
    box-shadow: var(--qcnc-shadow);
    border-collapse: separate; 
    border-spacing: 0;
    overflow: hidden; /* For rounded corners */
}

#qcnc-gateway-fees-table thead th {
    background: #f8f9fa;
    color: var(--qcnc-text-muted);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
    padding: 15px;
    border-bottom: 2px solid var(--qcnc-border);
    border-top: none;
    border-left: none;
    border-right: none;
}

#qcnc-gateway-fees-table tbody td {
    padding: 15px;
    vertical-align: middle;
    color: var(--qcnc-text);
    border-bottom: 1px solid #f0f0f1;
}

#qcnc-gateway-fees-table tbody tr:last-child td {
    border-bottom: none;
}

#qcnc-gateway-fees-table tbody tr:hover {
    background-color: #fcfcfc;
}

/* Status Badges */
#qcnc-gateway-fees-table td span {
    font-weight: 500;
    font-size: 13px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Action Buttons */
.qcnc-settings .button.button-small {
    margin-right: 4px;
}

/* =========================================
   Modal Styling
   ========================================= */
.qcnc-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(29, 35, 39, 0.7);
    backdrop-filter: blur(2px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

.qcnc-modal-content {
    background-color: #fff;
    padding: 30px;
    border: none;
    width: 90%;
    max-width: 550px;
    border-radius: 8px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    position: relative;
    transform: translateY(20px);
    animation: slideUp 0.3s forwards;
}

.qcnc-modal h2 {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--qcnc-border);
    font-size: 20px;
    border-top: none; /* Override standard H2 style */
}

.qcnc-modal-close {
    position: absolute;
    top: 20px;
    right: 25px;
    color: #ccc;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

.qcnc-modal-close:hover {
    color: var(--qcnc-danger);
}

/* Modal Form Styles */
#qcnc-gateway-form p {
    margin-bottom: 20px;
}

#qcnc-gateway-form label {
    display: block;
    margin-bottom: 8px;
    color: var(--qcnc-text);
}

#qcnc-gateway-form input[type="text"],
#qcnc-gateway-form input[type="number"],
#qcnc-gateway-form select {
    width: 100%;
    max-width: 100%; /* Override standard form styles */
    height: 40px;
}

#qcnc-gateway-form .description {
    display: block;
    margin-top: 5px;
    font-size: 12px;
}

/* Animations */
@keyframes fadeIn { to { opacity: 1; } }
@keyframes slideUp { to { transform: translateY(0); } }

/* =========================================
   Responsive
   ========================================= */
@media screen and (max-width: 782px) {
    .qcnc-settings .form-table th {
        width: 100%;
        padding-bottom: 5px;
    }
    
    .qcnc-settings input[type="text"],
    .qcnc-settings input[type="number"],
    .qcnc-settings select {
        width: 100%;
        min-width: 0;
    }

    /* Make table scrollable on mobile */
    #qcnc-gateway-fees-table {
        display: block;
        overflow-x: auto;
    }
}

/* ====================================================================================
   Others CSS
==================================================================================== */
/* Style the header and the column cells */
.column-qcnc_cost {
    width: 70px; 
    text-align: left;
    font-weight: 600;
    color: #2c3338;
}

/* Optional: change color if you want it to stand out */
td.column-qcnc_cost {
    color: #0073aa; 
}

/* Responsive adjustment for small screens */
@media screen and (max-width: 782px) {
    .column-qcnc_cost {
        display: none; 
    }
}

/* ====================================================================================
   DASHBOARD
==================================================================================== */

    /* =========================================
   Profit Analytics Header
   ========================================= */

:root {
    --qcnc-primary: #667eea;
    --qcnc-primary-dark: #5a67d8;
    --qcnc-text-main: #1e293b;
    --qcnc-text-muted: #64748b;
    --qcnc-bg: #f8fafc;
    --qcnc-border: #e2e8f0;
    --qcnc-white: #ffffff;
    --qcnc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

/* Header Container */
.qcnc-dashboard-header {
    background: var(--qcnc-white);
    border-radius: 12px;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--qcnc-shadow);
    border: 1px solid var(--qcnc-border);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 20px;
}

/* Left Side: Title & Subtitle */
.qcnc-header-left h1 {
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: 800;
    color: var(--qcnc-text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.2;
}

.qcnc-header-left h1 .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: var(--qcnc-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qcnc-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--qcnc-text-muted);
    font-weight: 500;
}

/* Right Side: Action Buttons */
.qcnc-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Button Styling Override */
.qcnc-header-right .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    height: auto;
    line-height: 1;
    transition: all 0.2s ease;
}

.qcnc-header-right .button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    line-height: 1;
}

/* Primary Button */
.qcnc-header-right .button-primary {
    background: var(--qcnc-primary) !important;
    border-color: var(--qcnc-primary) !important;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3) !important;
    text-shadow: none;
}

.qcnc-header-right .button-primary:hover {
    background: var(--qcnc-primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4) !important;
}

/* Secondary Button */
.qcnc-header-right .button-secondary {
    background: #ffffff !important;
    border: 1px solid var(--qcnc-border) !important;
    color: var(--qcnc-text-muted) !important;
    box-shadow: 0 1px 2px rgba(0,0,0,0.02) !important;
}

.qcnc-header-right .button-secondary:hover {
    border-color: #cbd5e1 !important;
    color: var(--qcnc-text-main) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05) !important;
}

/* Responsive Adjustments */
@media screen and (max-width: 768px) {
    .qcnc-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .qcnc-header-right {
        width: 100%;
        flex-direction: column; /* Stack buttons on mobile */
    }
    
    .qcnc-header-right .button {
        width: 100%;
    }
}


    /* =========================================
   Order Profitability - Header & Tools
   ========================================= */

:root {
    --qcnc-primary: #667eea;
    --qcnc-primary-dark: #5a67d8;
    --qcnc-text-main: #1e293b;
    --qcnc-text-muted: #64748b;
    --qcnc-bg: #f8fafc;
    --qcnc-border: #e2e8f0;
}

/* Page Wrapper Adjustments */
.qcnc-order-profitability {
    max-width: 100%;
    margin-right: 20px;
}

/* --- Modern Header --- */
.qcnc-dashboard-header {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--qcnc-border);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 20px;
}

.qcnc-header-left h1 {
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: 800;
    color: var(--qcnc-text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.2;
}

.qcnc-header-left h1 .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: var(--qcnc-primary);
}

.qcnc-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--qcnc-text-muted);
}

.qcnc-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Button Overrides for this section */
.qcnc-header-right .button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    height: auto;
    font-size: 13px;
    border-radius: 6px;
}

.qcnc-header-right .button-primary {
    background: var(--qcnc-primary) !important;
    border-color: var(--qcnc-primary) !important;
    text-shadow: none !important;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3) !important;
}

.qcnc-header-right .button-primary:hover {
    background: var(--qcnc-primary-dark) !important;
    transform: translateY(-1px);
}

/* --- Bulk Process Panel (The gray box redesign) --- */
.qcnc-bulk-process-panel {
    background: #ffffff;
    border: 1px solid var(--qcnc-border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.panel-icon-area {
    width: 48px;
    height: 48px;
    background: #f1f5f9;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.panel-icon-area .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #64748b;
}

.panel-content-area {
    flex: 1;
}

.panel-content-area h3 {
    margin: 0 0 6px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--qcnc-text-main);
}

.panel-content-area p {
    margin: 0 0 16px 0;
    color: var(--qcnc-text-muted);
    font-size: 13px;
}

.qcnc-bulk-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* Specific Button Styles for Panel */
.button-link-delete {
    color: #ef4444 !important;
    border-color: #fca5a5 !important;
    background: transparent !important;
}
.button-link-delete:hover {
    background: #fef2f2 !important;
    border-color: #ef4444 !important;
}

.order-count-badge {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
}

/* Progress Bar Styling */
.qcnc-progress-wrapper {
    margin-top: 20px;
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid var(--qcnc-border);
}

.progress-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--qcnc-text-main);
}

.qcnc-progress-track {
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
}

.qcnc-progress-fill {
    height: 100%;
    background: var(--qcnc-primary);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

#qcnc-progress-status {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: var(--qcnc-text-muted);
}

/* Results Box */
.qcnc-results-box {
    margin-top: 20px;
    background: #ecfdf5;
    border: 1px solid #10b981;
    color: #065f46;
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .qcnc-dashboard-header, 
    .qcnc-bulk-process-panel {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .qcnc-header-right {
        width: 100%;
        flex-wrap: wrap;
    }
    
    .panel-icon-area {
        display: none;
    }
}


    /* =========================================
   Product Costs Header - Advanced Styling
   ========================================= */

:root {
    --qcnc-primary: #667eea;
    --qcnc-primary-dark: #5a67d8;
    --qcnc-text-main: #1e293b; /* Slate 800 */
    --qcnc-text-muted: #64748b; /* Slate 500 */
    --qcnc-bg: #f8fafc;
    --qcnc-border: #e2e8f0;
    --qcnc-white: #ffffff;
    --qcnc-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
}

/* Main Header Container */
.qcnc-dashboard-header {
    background: var(--qcnc-white);
    border-radius: 12px;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--qcnc-shadow);
    border: 1px solid var(--qcnc-border);
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 20px;
}

/* Left Side: Title & Subtitle */
.qcnc-header-left {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.qcnc-header-left h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    color: var(--qcnc-text-main);
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.2;
}

/* Icon Styling in Title */
.qcnc-header-left h1 .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: var(--qcnc-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qcnc-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--qcnc-text-muted);
    font-weight: 500;
}

/* Right Side: Action Buttons */
.qcnc-header-right {
    display: flex;
    align-items: center;
}

.qcnc-quick-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- Button Styling --- */

/* Base Button Style (Resetting WP defaults where needed) */
.qcnc-quick-actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px; /* Space between icon and text */
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
    height: auto;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
}

/* Secondary Buttons (Import, Export, Template) */
.qcnc-quick-actions .button:not(.button-primary) {
    background: #ffffff;
    border: 1px solid var(--qcnc-border);
    color: var(--qcnc-text-muted);
    box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.qcnc-quick-actions .button:not(.button-primary):hover {
    border-color: #cbd5e1;
    color: var(--qcnc-text-main);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

/* Primary Button (Add New Cost) */
.qcnc-quick-actions .button-primary {
    background: var(--qcnc-primary) !important;
    border-color: var(--qcnc-primary) !important;
    color: #ffffff !important;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
    text-shadow: none;
}

.qcnc-quick-actions .button-primary:hover {
    background: var(--qcnc-primary-dark) !important;
    border-color: var(--qcnc-primary-dark) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Icon Alignment fix inside buttons */
.qcnc-quick-actions .button .dashicons {
    font-size: 17px;
    width: 17px;
    height: 17px;
    line-height: 1;
    margin: 0;
}

/* =========================================
   Responsive Adjustments
   ========================================= */
@media screen and (max-width: 960px) {
    .qcnc-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }

    .qcnc-header-right {
        width: 100%;
    }

    .qcnc-quick-actions {
        width: 100%;
        flex-wrap: wrap;
    }

    /* Make buttons flex to fill space on smaller screens */
    .qcnc-quick-actions .button {
        flex: 1 0 45%; /* 2 buttons per row */
        justify-content: center;
    }
}

@media screen and (max-width: 600px) {
    .qcnc-quick-actions .button {
        flex: 1 0 100%; /* 1 button per row on mobile */
    }
}

/* Missing Cost Row Highlight */
.qcnc-missing-cost {
    background-color: #ffebee !important;
}

/* Container */
.qcnc-coming-soon {
    position: relative;
    overflow: hidden;
    background: #fdfdfd;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

/* The Blurred Content */
.qcnc-blur-content {
    filter: blur(1px); /* Adjust blur amount here */
    opacity: 0.6;
    pointer-events: none; /* Prevents clicking */
    user-select: none;    /* Prevents highlighting text */
}

/* Overlay Positioning */
.qcnc-coming-soon-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    background: rgba(255, 255, 255, 0.1); /* Slight white tint */
}

/* The Badge */
.qcnc-coming-soon-badge {
    background: #6366f1; /* Your Primary Purple */
    color: #fff;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

    /* =========================================
   Profit Reports Header & Navigation
   ========================================= */

:root {
    --qcnc-primary: #667eea;
    --qcnc-primary-dark: #5a67d8;
    --qcnc-text-main: #1e293b;
    --qcnc-text-muted: #64748b;
    --qcnc-bg-light: #f8fafc;
    --qcnc-border: #e2e8f0;
}

/* --- 1. Main Header Card --- */
.qcnc-dashboard-header {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02), 0 2px 4px -1px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--qcnc-border);
    margin-bottom: 0; /* No margin bottom because tabs come next */
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-bottom: none; /* Merge visually with tabs */
    flex-wrap: wrap;
    gap: 20px;
}

/* Left: Title & Subtitle */
.qcnc-header-left h1 {
    margin: 0 0 6px 0;
    font-size: 24px;
    font-weight: 800;
    color: var(--qcnc-text-main);
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.2;
}

.qcnc-header-left h1 .dashicons {
    font-size: 28px;
    width: 28px;
    height: 28px;
    color: var(--qcnc-primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.qcnc-subtitle {
    margin: 0;
    font-size: 14px;
    color: var(--qcnc-text-muted);
    font-weight: 500;
}

/* Right: Form Controls */
.qcnc-report-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* --- 2. The Date Picker "Pill" --- */
.qcnc-date-group {
    display: flex;
    align-items: center;
    background: var(--qcnc-bg-light);
    border: 1px solid var(--qcnc-border);
    border-radius: 8px;
    padding: 4px 12px;
    height: 36px; /* Fixed height for alignment */
    box-sizing: border-box;
    transition: all 0.2s ease;
}

.qcnc-date-group:hover {
    border-color: #cbd5e1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.qcnc-date-group .dashicons {
    color: var(--qcnc-text-muted);
    font-size: 18px;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    margin-top: 1px;
}

.qcnc-date-input {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    font-size: 13px;
    font-weight: 500;
    color: var(--qcnc-text-main);
    cursor: pointer;
    font-family: inherit;
    width: auto;
    height: 100% !important;
}

.qcnc-date-input:focus {
    outline: none !important;
    box-shadow: none !important;
}

.qcnc-date-group .separator {
    margin: 0 8px;
    color: var(--qcnc-text-muted);
    font-weight: bold;
}

/* Buttons in Header */
.qcnc-report-controls .button {
    height: 36px !important;
    line-height: 1 !important;
    padding: 0 16px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
}

.qcnc-report-controls .button-primary {
    background: var(--qcnc-primary) !important;
    border-color: var(--qcnc-primary) !important;
    text-shadow: none !important;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3) !important;
}

.qcnc-report-controls .button-primary:hover {
    background: var(--qcnc-primary-dark) !important;
    transform: translateY(-1px);
}

/* --- 3. Tab Navigation Bar --- */
.qcnc-report-tabs-wrapper {
    background: #ffffff;
    border: 1px solid var(--qcnc-border);
    border-top: none; /* Connect to header */
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    padding: 0 32px;
    display: flex;
    gap: 24px;
    margin-bottom: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.02);
}

.qcnc-tab-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 16px 4px;
    text-decoration: none;
    color: var(--qcnc-text-muted);
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid transparent;
    transition: all 0.2s ease;
    margin-bottom: -1px; /* Overlap border */
}

.qcnc-tab-link .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    transition: color 0.2s;
}

/* Hover State */
.qcnc-tab-link:hover {
    color: var(--qcnc-text-main);
}

.qcnc-tab-link:hover .dashicons {
    color: var(--qcnc-primary);
}

/* Active State */
.qcnc-tab-link.active {
    color: var(--qcnc-primary);
    border-bottom-color: var(--qcnc-primary);
}

.qcnc-tab-link.active .dashicons {
    color: var(--qcnc-primary);
}

/* --- 4. Report Card Content --- */
.qcnc-report-card {
    background: #ffffff;
    border: 1px solid var(--qcnc-border);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

/* Fix for standard WP tables inside the card */
.qcnc-report-card .wp-list-table {
    border: none;
    box-shadow: none;
}

.qcnc-report-card .wp-list-table th {
    font-weight: 700;
    color: var(--qcnc-text-main);
    border-bottom: 2px solid #f1f5f9;
}

.qcnc-report-card .wp-list-table td {
    padding: 12px 10px;
    vertical-align: middle;
    color: #475569;
}

/* --- 5. Responsive Adjustments --- */
@media screen and (max-width: 900px) {
    .qcnc-dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        padding: 20px;
    }

    .qcnc-header-right {
        width: 100%;
    }

    .qcnc-report-controls {
        flex-wrap: wrap;
        width: 100%;
    }

    .qcnc-date-group {
        flex: 1 0 100%; /* Full width on mobile */
        justify-content: space-between;
    }

    .qcnc-report-tabs-wrapper {
        padding: 0 20px;
        overflow-x: auto;
        white-space: nowrap;
        gap: 16px;
    }
}

