/* All Sales Section Styles */
.all-sales-section {
    grid-column: 1 / -1;
    /* Span full width of the grid */
    margin-top: 32px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.all-sales-section .table-container {
    margin: 0;
}

/* Success Theme Variation */
.all-sales-section.theme-success .table-header {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.all-sales-section .table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px;
    border-bottom: 1px solid #f3f4f6;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
}

.all-sales-section .table-header h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 12px;
}

.all-sales-section .table-header h3 i {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px;
    border-radius: 8px;
}

.all-sales-section .table-info {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.all-sales-section .data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
    font-size: 0.95rem;
}

.all-sales-section .data-table thead {
    background: #f8fafc;
    border-bottom: 2px solid #e2e8f0;
}

.all-sales-section .data-table th {
    padding: 20px 16px;
    text-align: left;
    font-weight: 700;
    color: #475569;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.all-sales-section .data-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.2s ease;
}

.all-sales-section .data-table tbody tr:hover {
    background: #f8fafc;
    transform: translateX(4px);
}

.all-sales-section .data-table td {
    padding: 20px 16px;
    vertical-align: middle;
}

.all-sales-section .data-table tbody tr td:first-child {
    font-weight: 500;
    color: #64748b;
    font-size: 0.85rem;
}

.all-sales-section .data-table tbody tr td:nth-child(2) {
    font-weight: 500;
    color: #1e293b;
}

.all-sales-section .data-table .profit-positive {
    color: #10b981;
    font-weight: 500;
}

.all-sales-section .data-table .profit-negative {
    color: #ef4444;
    font-weight: 500;
}

.all-sales-section .data-table .totals-row {
    background: #f8fafc;
    font-weight: 600;
    border-top: 2px solid #e2e8f0;
}

.all-sales-section .data-table .totals-row td {
    padding: 22px 16px;
    color: #1e293b;
    font-size: 1rem;
}

/* Button Styles */
.all-sales-section .btn-danger.btn-sm {
    background: #ef4444;
    color: white;
    border: none;
    padding: 8px 12px;
    font-size: 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.all-sales-section .btn-danger.btn-sm:hover {
    background: #dc2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(239, 68, 68, 0.3);
}

/* Pagination */
.all-sales-section .pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 24px;
    background: #f8fafc;
}

.all-sales-section .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: white;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.all-sales-section .page-link:hover {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
    transform: translateY(-1px);
}

.all-sales-section .page-link.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-color: transparent;
    font-weight: 600;
}

/* Empty State */
.all-sales-section .empty-state {
    padding: 60px 40px;
    text-align: center;
    color: #64748b;
}

.all-sales-section .empty-state i {
    font-size: 4rem;
    margin-bottom: 24px;
    opacity: 0.3;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.all-sales-section .empty-state h3 {
    font-size: 1.5rem;
    margin: 0 0 12px;
    color: #1e293b;
    font-weight: 600;
}

.all-sales-section .empty-state p {
    margin: 0 0 32px;
    font-size: 1rem;
    color: #64748b;
}

.all-sales-section .empty-state-actions .btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    font-size: 0.9rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-weight: 500;
}

.all-sales-section .empty-state-actions .btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.4);
}

/* Mobile Responsive - Transform table into cards */
@media (max-width: 768px) {
    .all-sales-section {
        margin-top: 24px;
        border-radius: 8px;
    }

    .all-sales-section .table-header {
        padding: 16px;
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .all-sales-section .table-header h3 {
        font-size: 1.1rem;
        justify-content: center;
    }

    .all-sales-section .table-header h3 i {
        padding: 6px;
        font-size: 0.9rem;
    }

    .all-sales-section .table-info {
        font-size: 0.8rem;
        padding: 6px 12px;
    }

    .all-sales-section .table-container {
        padding: 0;
        overflow-x: hidden;
        /* No more horizontal scroll */
    }

    /* Force table to not be a table */
    .all-sales-section .data-table,
    .all-sales-section .data-table thead,
    .all-sales-section .data-table tbody,
    .all-sales-section .data-table th,
    .all-sales-section .data-table td,
    .all-sales-section .data-table tr {
        display: block;
    }

    /* Hide table headers (but keep for screen readers) */
    .all-sales-section .data-table thead tr {
        position: absolute;
        top: -9999px;
        left: -9999px;
    }

    .all-sales-section .data-table tbody tr {
        border-bottom: 2px solid #f1f5f9;
        padding: 16px;
        margin-bottom: 8px;
        background: white;
        border-radius: 12px;
        margin: 12px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    .all-sales-section .data-table td {
        /* Behave  like a "row" */
        border: none;
        position: relative;
        padding-left: 40% !important;
        /* Reduced from 50% */
        text-align: right !important;
        padding: 8px 0 !important;
        border-bottom: 1px solid #f8fafc;
        min-height: 38px;
        display: flex;
        justify-content: flex-end;
        align-items: center;
    }

    .all-sales-section .data-table td:last-child {
        border-bottom: none;
        justify-content: flex-end;
        padding-left: 0 !important;
        margin-top: 10px;
        background: transparent;
        border-radius: 8px;
        padding: 6px 12px !important;
    }

    .all-sales-section .data-table td:before {
        /* Now like a table header */
        position: absolute;
        /* Top/left values mimic padding */
        left: 0;
        width: 38%;
        /* Reduced from 45% */
        padding-right: 8px;
        white-space: nowrap;
        text-align: left;
        font-weight: 700;
        content: attr(data-label);
        color: #64748b;
        font-size: 0.75rem;
        text-transform: uppercase;
    }

    .all-sales-section .data-table .totals-row {
        display: none;
        /* Hide footer in mobile, use .mobile-totals instead */
    }

    .all-sales-section .btn-danger.btn-sm {
        width: auto;
        min-width: 80px;
        justify-content: center;
        padding: 6px 12px;
        font-size: 0.8rem;
        border-radius: 6px;
    }

    .all-sales-section .pagination {
        padding: 16px;
        flex-wrap: wrap;
    }

    .all-sales-section .page-link {
        width: 35px;
        height: 35px;
        font-size: 0.8rem;
        margin: 2px;
    }

    .all-sales-section .empty-state {
        padding: 32px 16px;
    }

    .all-sales-section .empty-state i {
        font-size: 3rem;
    }

    /* Show mobile totals card */
    .all-sales-section .mobile-totals {
        display: block;
        margin: 12px;
        padding: 20px;
        background: #f8fafc;
        border-radius: 12px;
        border: 1px solid #e2e8f0;
        box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
    }

    .mobile-totals-row {
        display: flex;
        justify-content: space-between;
        padding: 8px 0;
        border-bottom: 1px solid #e2e8f0;
    }

    .mobile-totals-row:last-child {
        border-bottom: none;
        padding-top: 12px;
        font-size: 1.1rem;
    }

    .mobile-totals-label {
        color: #64748b;
        font-weight: 500;
    }

    .mobile-totals-value {
        font-weight: 700;
        color: var(--primary);
    }

    .all-sales-section .empty-state h3 {
        font-size: 1.3rem;
    }

    .all-sales-section .empty-state p {
        font-size: 0.9rem;
    }

    .all-sales-section .empty-state-actions .btn-primary {
        padding: 10px 20px;
        font-size: 0.85rem;
    }
}

/* Hide mobile totals by default */
.all-sales-section .mobile-totals {
    display: none;
}

/* Animations */
@keyframes slideInFromBottom {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.all-sales-section .data-table tbody tr {
    animation: slideInFromBottom 0.3s ease-out;
}

/* Gradient hover effect */
.all-sales-section .data-table tbody tr:hover td:nth-child(2) {
    background: linear-gradient(90deg, #f0f9ff 0%, #e0f2fe 100%);
}
