/* ===================================================================== */
/* === RETAIL ADMIN TABLES === */
/* Unified Table Design System */
/* ===================================================================== */

/* === UNIFIED TABLE DESIGN SYSTEM === */

/* Standard Table Styles - Applied to All Tables */
.modern-product-table,
.retail-product-table,
.retail-wallet-history-table,
.retail-admin-wrapper .retail-children-table,
.retail-orders-table,
.retail-product-table-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 24px auto;
    animation: slideInUp 0.8s ease-out;
}

/* Standard Table Headers - Applied to All Tables */
.modern-product-table thead th,
.retail-admin-wrapper .modern-product-table th,
.retail-admin-wrapper .retail-product-table th,
.retail-admin-wrapper .retail-wallet-history-table th,
.retail-admin-wrapper .retail-children-table thead th,
.retail-admin-wrapper .retail-orders-table th,
.retail-admin-wrapper .retail-product-table-container th {
    padding: 16px 20px;
    background: var(--gradient-primary);
    color: white;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    text-align: left;
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

/* Standard Table Cells - Applied to All Tables */
.modern-product-table td,
.retail-product-table td,
.retail-wallet-history-table td,
.retail-admin-wrapper .retail-children-table td,
.retail-orders-table td,
.retail-product-table-container td {
    padding: 3px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    text-align: left;
    color: #2d3748;
    font-weight: var(--font-weight-normal);
    transition: all 0.3s ease;
    vertical-align: middle;
}

/* Standard Table Row Hover Effects - Applied to All Tables */
.modern-product-table tbody tr:hover,
.retail-product-table tbody tr:hover,
.retail-wallet-history-table tbody tr:hover,
.retail-admin-wrapper .retail-children-table tr:hover td,
.retail-orders-table tr:hover td,
.retail-product-table-container tr:hover td {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.01);
}

/* === SPECIAL CASE TABLE STYLING === */

/* Special case for children table - use primary gradient header with higher specificity */
.retail-admin-wrapper .retail-children-table thead th {
    background: var(--gradient-primary);
}

/* Special case for children table hover - maintain its blue hover with higher specificity */
.retail-admin-wrapper .retail-children-table tbody tr:hover td {
    background: rgba(79, 172, 254, 0.1);
}

/* === TABLE CONTAINERS === */

/* Premium Table Container with Advanced Glassmorphism */
.retail-product-table-container {
    margin: 0 auto 32px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: var(--border-glass);
    box-shadow: var(--shadow-glass);
    max-width: clamp(600px, 90%, 1000px);
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.8s ease-out;
}

.retail-product-table-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.retail-product-table-container table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: rgba(255, 255, 255, 0.5);
}

.retail-product-table-container th,
.retail-product-table-container td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    text-align: left;
    transition: all 0.3s ease;
}

.retail-product-table-container th {
    background: var(--gradient-primary);
    color: white;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    position: relative;
}

.retail-product-table-container tr:hover td {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.01);
}

/* === CHILDREN TABLE WRAPPER === */

.retail-admin-wrapper .retail-children-table-wrapper {
    max-width: clamp(600px, 90%, 1000px);
    margin: 0 auto;
    margin-top: 24px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: var(--border-glass);
    box-shadow: var(--shadow-glass);
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.8s ease-out;
}

.retail-admin-wrapper .retail-children-table-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.retail-admin-wrapper .retail-children-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.retail-admin-wrapper .retail-children-table thead th {
    background: var(--gradient-primary);
    color: white;
    padding: 16px 20px;
    text-align: left;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
    border: none;
}

.retail-admin-wrapper .retail-children-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    color: #2d3748;
    font-weight: var(--font-weight-normal);
    transition: all 0.3s ease;
}

.retail-admin-wrapper .retail-children-table tr:hover td {
    background: rgba(79, 172, 254, 0.1);
    transform: scale(1.01);
}

/* === ORDERS TABLE === */

.retail-orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-top: 24px;
    animation: slideInUp 0.8s ease-out;
}

.retail-orders-table th,
.retail-orders-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    text-align: left;
    transition: all 0.3s ease;
}

.retail-orders-table th {
    background: var(--gradient-primary);
    color: white;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
}

.retail-orders-table tr:hover td {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.01);
}

/* === ORDERS TABLE WRAPPER === */

.retail-orders-table-wrapper {
    margin: 0 auto 32px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: var(--border-glass);
    box-shadow: var(--shadow-glass);
    max-width: 100%;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.8s ease-out;
}

.retail-orders-table-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.retail-orders-table-wrapper .retail-orders-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 0;
}

/* === WALLET HISTORY TABLE === */

.retail-wallet-history-table {
    width: 100%;
    font-size: 14px;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-top: 24px;
    border: var(--border-glass);
    box-shadow: var(--shadow-glass);
    animation: slideInUp 0.8s ease-out;
}

.retail-wallet-history-table th,
.retail-wallet-history-table td {
    padding: 14px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    text-align: left;
    transition: all 0.3s ease;
}

.retail-wallet-history-table th {
    background: var(--gradient-secondary);
    color: white;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 12px;
}

.retail-wallet-history-table tbody tr:hover {
    background: rgba(240, 147, 251, 0.1);
    transform: scale(1.01);
}

/* === PRODUCT TABLE === */

.retail-product-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: var(--border-glass);
    box-shadow: var(--shadow-glass);
    animation: slideInUp 0.8s ease-out;
}

.retail-product-table th,
.retail-product-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    text-align: left;
    transition: all 0.3s ease;
}

.retail-product-table th {
    background: var(--gradient-primary);
    color: white;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
}

.retail-product-table tbody tr:hover {
    background: rgba(236, 138, 65, 0.1);
    transform: scale(1.01);
}

/* === PRODUCT SUMMARY TABLE === */

.retail-product-summary-wrapper {
    margin: 32px auto;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px;
    border-radius: var(--radius-lg);
    border: var(--border-glass);
    box-shadow: var(--shadow-glass);
    max-width: 100%;
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.8s ease-out;
}

.retail-product-summary-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-secondary);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.retail-product-summary-wrapper h3 {
    color: #2d3748;
    margin: 0 0 20px 0;
    font-size: 1.25rem;
    font-weight: var(--font-weight-bold);
    text-align: center;
}

/* === PRODUCT SUMMARY TABLE STYLING === */

.retail-product-summary-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin: 0;
}

.retail-product-summary-table th {
    padding: 16px 20px;
    background: var(--gradient-primary);
    color: white;
    font-weight: var(--font-weight-bold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: left;
    transition: all 0.3s ease;
}

.retail-product-summary-table td {
    padding: 16px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    text-align: left;
    color: #2d3748;
    font-weight: var(--font-weight-normal);
    transition: all 0.3s ease;
}

.retail-product-summary-table tr:hover td {
    background: rgba(102, 126, 234, 0.1);
    transform: scale(1.01);
}

.retail-product-summary-table .retail-empty-message {
    text-align: center;
    color: #718096;
    font-style: italic;
    padding: 40px 20px;
}

/* === TABLE STYLING ELEMENTS === */

.product-name {
    font-weight: var(--font-weight-bold);
    color: #2d3748;
    font-size: 15px;
    background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-price {
    font-weight: var(--font-weight-bold);
    background: var(--gradient-success);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-size: 16px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* === ORDER DETAILS ROW === */

.retail-order-details-row {
    display: none;
    background: rgba(248, 250, 252, 0.8);
    backdrop-filter: blur(10px);
}

.retail-order-details-cell {
    padding: 20px;
    font-size: 14px;
    line-height: 1.6;
    border-radius: var(--radius-sm);
}

.retail-product-list {
    margin: 0;
    padding-left: 20px;
}

.retail-product-list li {
    margin-bottom: 8px;
    color: #4a5568;
    font-weight: var(--font-weight-normal);
}

.retail-product-list ul {
    list-style: disc;
    margin: 8px 0 8px 20px;
    padding-left: 20px;
}

/* === TABLE ANIMATIONS === */

/* Smooth animations for status change row hiding */
.retail-order-row {
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.retail-order-row.status-changed-hiding {
    opacity: 0;
    transform: translateX(-20px);
    pointer-events: none;
}

/* === TABLE HEADER CONTROLS === */

.table-header-controls {
    display: flex;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 16px;
}

/* === EMPTY STATE STYLING === */

.retail-admin-wrapper .retail-empty-row td {
    text-align: center;
    color: #888;
    font-style: italic;
}

.retail-empty-message {
    margin-top: 30px;
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.retail-no-products-message {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

/* === TABLE CELL STYLING === */

.retail-child-table-cell {
    padding: 6px 10px;
}

.retail-child-dni {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

/* === DYNAMIC AMOUNT COLORS === */

.retail-amount-positive {
    color: #22c55e;
}

.retail-amount-negative {
    color: #ef4444;
}

/* === TITLES === */

.retail-admin-wrapper .retail-orders-title {
    margin-top: 48px;
    font-size: 28px;
    font-weight: var(--font-weight-bold);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-align: center;
}

.retail-admin-wrapper .retail-section-title {
    text-align: center;
    margin: 0 auto 10px;
    max-width: 640px;
    font-size: 20px;
}

.retail-orders-title {
    font-size: 28px;
    margin-top: 40px;
    margin-bottom: 16px;
    text-align: center;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: var(--font-weight-bold);
}

/* === RESPONSIVE DESIGN === */

@media (max-width: 768px) {
    .modern-product-table,
    .retail-product-table,
    .retail-wallet-history-table,
    .retail-admin-wrapper .retail-children-table,
    .retail-orders-table,
    .retail-product-table-container table {
        font-size: 14px;
    }
    
    .modern-product-table thead th,
    .retail-admin-wrapper .modern-product-table th,
    .retail-admin-wrapper .retail-product-table th,
    .retail-admin-wrapper .retail-wallet-history-table th,
    .retail-admin-wrapper .retail-children-table thead th,
    .retail-admin-wrapper .retail-orders-table th,
    .retail-admin-wrapper .retail-product-table-container th {
        padding: 12px 16px;
        font-size: 12px;
    }
    
    .modern-product-table td,
    .retail-product-table td,
    .retail-wallet-history-table td,
    .retail-admin-wrapper .retail-children-table td,
    .retail-orders-table td,
    .retail-product-table-container td {
        padding: 2px 16px;
    }
    
    .retail-product-table-container,
    .retail-admin-wrapper .retail-children-table-wrapper,
    .retail-orders-table-wrapper,
    .retail-product-summary-wrapper {
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .modern-product-table,
    .retail-product-table,
    .retail-wallet-history-table,
    .retail-admin-wrapper .retail-children-table,
    .retail-orders-table,
    .retail-product-table-container table {
        font-size: 13px;
    }
    
    .modern-product-table thead th,
    .retail-admin-wrapper .modern-product-table th,
    .retail-admin-wrapper .retail-product-table th,
    .retail-admin-wrapper .retail-wallet-history-table th,
    .retail-admin-wrapper .retail-children-table thead th,
    .retail-admin-wrapper .retail-orders-table th,
    .retail-admin-wrapper .retail-product-table-container th {
        padding: 10px 12px;
        font-size: 11px;
    }
    
    .modern-product-table td,
    .retail-product-table td,
    .retail-wallet-history-table td,
    .retail-admin-wrapper .retail-children-table td,
    .retail-orders-table td,
    .retail-product-table-container td {
        padding: 2px 12px;
    }
    
    .retail-product-table-container,
    .retail-admin-wrapper .retail-children-table-wrapper,
    .retail-orders-table-wrapper,
    .retail-product-summary-wrapper {
        padding: 12px;
    }
}