/**
 * جداول - استایل یکپارچه برای همه جداول (ادمین و فرانت)
 * در صفحاتی که جدول دارند این فایل لود شود.
 * UTF-8 encoded
 */

/* Dark Mode - جداول */
[data-theme="dark"] .requests-table,
body.dark-mode .requests-table,
[data-theme="dark"] .users-table,
body.dark-mode .users-table,
[data-theme="dark"] .modules-table,
body.dark-mode .modules-table {
    background: #1C1B1F;
    border-color: #49454F;
}

[data-theme="dark"] .requests-table th,
body.dark-mode .requests-table th,
[data-theme="dark"] .users-table th,
body.dark-mode .users-table th {
    background: var(--admin-primary);
}

[data-theme="dark"] .requests-table tbody tr:hover,
body.dark-mode .requests-table tbody tr:hover,
[data-theme="dark"] .users-table tbody tr:hover,
body.dark-mode .users-table tbody tr:hover {
    background-color: rgba(var(--md-primary-rgb, 59, 130, 246), 0.12);
}

/* Tables - Unified Style */
.requests-table,
.users-table,
.modules-table,
.articles-table,
.products-table,
.orders-table,
.leads-table,
.tickets-table,
.clients-table,
.data-table,
.features-table,
.invoice-table {
    width: 100%;
    max-width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    overflow: hidden;
    table-layout: auto;
}

.table-container,
.table-wrapper,
.table-wrap,
.admin-table-wrap {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.table-container table,
.table-wrapper table,
.table-wrap table,
.admin-table-wrap table {
    min-width: 100%;
}

.admin-table-wrap table,
.table-wrapper table,
.table-wrap table {
    min-width: 600px;
}

@media (max-width: 768px) {
    .dashboard-content .container {
        overflow-x: hidden;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    .table-container,
    .table-wrapper,
    .table-wrap,
    .admin-table-wrap {
        margin-left: -0.5rem;
        margin-right: -0.5rem;
        width: calc(100% + 1rem);
        padding: 0 0.25rem;
        border-radius: 8px;
    }
    .requests-table th,
    .requests-table td,
    .users-table th,
    .users-table td,
    .modules-table th,
    .modules-table td,
    .articles-table th,
    .articles-table td,
    .products-table th,
    .products-table td,
    .orders-table th,
    .orders-table td,
    .leads-table th,
    .leads-table td,
    .tickets-table th,
    .tickets-table td,
    .clients-table th,
    .clients-table td,
    .data-table th,
    .data-table td,
    .features-table th,
    .features-table td,
    .invoice-table th,
    .invoice-table td {
        padding: 0.5rem 0.4rem !important;
        font-size: 0.8rem !important;
    }
    .requests-table th,
    .users-table th,
    .modules-table th,
    .articles-table th,
    .products-table th,
    .orders-table th,
    .leads-table th,
    .tickets-table th,
    .clients-table th,
    .data-table th,
    .features-table th,
    .invoice-table th {
        white-space: nowrap;
        font-size: 0.75rem !important;
    }
    .admin-table-wrap .btn,
    .table-wrapper .btn,
    .table-wrap .btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .requests-table th,
    .requests-table td,
    .users-table th,
    .users-table td,
    .modules-table th,
    .modules-table td,
    .articles-table th,
    .articles-table td,
    .products-table th,
    .products-table td,
    .orders-table th,
    .orders-table td,
    .leads-table th,
    .leads-table td,
    .tickets-table th,
    .tickets-table td,
    .clients-table th,
    .clients-table td,
    .data-table th,
    .data-table td,
    .features-table th,
    .features-table td,
    .invoice-table th,
    .invoice-table td {
        padding: 0.4rem 0.3rem !important;
        font-size: 0.75rem !important;
    }
}

.requests-table th,
.users-table th,
.modules-table th,
.articles-table th,
.products-table th,
.orders-table th,
.leads-table th,
.tickets-table th,
.clients-table th,
.data-table th,
.features-table th,
.invoice-table th,
.requests-table td,
.users-table td,
.modules-table td,
.articles-table td,
.products-table td,
.orders-table td,
.leads-table td,
.tickets-table td,
.clients-table td,
.data-table td,
.features-table td,
.invoice-table td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid var(--md-outline);
    position: relative;
}

.resizable {
    position: relative;
}

.resizable::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 5px;
    height: 100%;
    cursor: col-resize;
    background: transparent;
    z-index: 1;
}

.resizable:hover::after {
    background: var(--admin-primary);
    opacity: 0.3;
}

.resizable.resizing::after {
    background: var(--admin-primary);
    opacity: 0.5;
}

.requests-table th,
.users-table th,
.modules-table th,
.articles-table th,
.products-table th,
.orders-table th,
.leads-table th,
.tickets-table th,
.clients-table th,
.data-table th,
.features-table th,
.invoice-table th {
    background: var(--md-primary);
    color: white;
    font-weight: 600;
    font-size: 0.875rem;
    position: sticky;
    top: 0;
    z-index: 10;
}

.requests-table tr:hover,
.users-table tr:hover,
.modules-table tr:hover,
.articles-table tr:hover,
.products-table tr:hover,
.orders-table tr:hover,
.leads-table tr:hover,
.tickets-table tr:hover,
.clients-table tr:hover,
.data-table tbody tr:hover,
.features-table tbody tr:hover,
.invoice-table tbody tr:hover {
    background-color: var(--md-surface-variant);
    transition: background-color 0.2s ease;
}
