/* ===== POG TABLE STYLES ===== */

/* ===== BASE TABLE STYLES ===== */
.table {
    width: 100%;
    margin-bottom: 16px;
    color: #323130;
    border-collapse: collapse;
    background-color: #ffffff;
}

.table th,
.table td {
    padding: 12px;
    vertical-align: middle;
    border-bottom: 1px solid #edebe9;
    text-align: left;
}

.table th {
    background-color: #faf9f8;
    font-weight: 600;
    font-size: 14px;
    color: #323130;
    border-top: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

.table td {
    font-size: 14px;
    line-height: 20px;
}

/* ===== TABLE VARIANTS ===== */
.table-striped tbody tr:nth-of-type(odd) {
    background-color: #faf9f8;
}

.table-hover tbody tr:hover {
    background-color: #f3f2f1;
    cursor: pointer;
}

.table-bordered {
    border: 1px solid #edebe9;
}

.table-bordered th,
.table-bordered td {
    border: 1px solid #edebe9;
}

.table-borderless th,
.table-borderless td {
    border: none;
}

/* ===== TABLE SIZES ===== */
.table-sm th,
.table-sm td {
    padding: 8px;
    font-size: 13px;
}

.table-lg th,
.table-lg td {
    padding: 16px;
    font-size: 15px;
}

/* ===== TABLE CONTAINERS ===== */
.table-container {
    background-color: #ffffff;
    border: 1px solid #edebe9;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.table-responsive .table {
    margin-bottom: 0;
    min-width: 600px;
}

/* ===== TABLE CONTROLS ===== */
.table-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #faf9f8;
    border-bottom: 1px solid #edebe9;
    flex-wrap: wrap;
    gap: 8px;
}

.table-title {
    font-size: 16px;
    font-weight: 600;
    color: #323130;
    margin: 0;
}

.table-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* ===== SEARCH AND FILTERS ===== */
.table-search {
    position: relative;
    min-width: 200px;
}

.table-search input {
    padding-left: 32px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%23605e5c' viewBox='0 0 24 24'%3E%3Cpath d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: 8px center;
    background-size: 16px;
}

.table-filter {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-label {
    font-size: 14px;
    font-weight: 600;
    color: #323130;
    white-space: nowrap;
}

/* ===== SORTABLE COLUMNS ===== */
.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 24px;
}

.sortable::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-bottom: 4px solid #8a8886;
    opacity: 0.5;
}

.sortable:hover::after {
    opacity: 0.8;
}

.sortable.sort-asc::after {
    border-bottom: 4px solid #0078d4;
    border-top: none;
    opacity: 1;
}

.sortable.sort-desc::after {
    border-top: 4px solid #0078d4;
    border-bottom: none;
    opacity: 1;
}

/* ===== PAGINATION ===== */
.table-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background-color: #faf9f8;
    border-top: 1px solid #edebe9;
    flex-wrap: wrap;
    gap: 8px;
}

.pagination-info {
    font-size: 14px;
    color: #605e5c;
}

.pagination-controls {
    display: flex;
    gap: 4px;
    align-items: center;
}

.page-btn {
    padding: 4px 8px;
    border: 1px solid #8a8886;
    background-color: #ffffff;
    color: #323130;
    cursor: pointer;
    border-radius: 2px;
    font-size: 14px;
    min-width: 32px;
    text-align: center;
    transition: all 0.1s ease;
}

.page-btn:hover:not(:disabled) {
    background-color: #f3f2f1;
    border-color: #605e5c;
}

.page-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f3f2f1;
}

.page-btn.active {
    background-color: #0078d4;
    border-color: #0078d4;
    color: #ffffff;
}

/* ===== LAYOUT LIST TABLE ===== */
.layout-list {
    max-height: 400px;
    overflow-y: auto;
}

.layout-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #edebe9;
    cursor: pointer;
    transition: background-color 0.1s ease;
}

.layout-item:hover {
    background-color: #f3f2f1;
}

.layout-item:last-child {
    border-bottom: none;
}

.layout-preview {
    width: 48px;
    height: 32px;
    background-color: #f3f2f1;
    border: 1px solid #edebe9;
    border-radius: 2px;
    margin-right: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8a8886;
    font-size: 10px;
}

.layout-info {
    flex: 1;
}

.layout-name {
    font-size: 14px;
    font-weight: 600;
    color: #323130;
    margin-bottom: 2px;
}

.layout-meta {
    font-size: 12px;
    color: #605e5c;
    line-height: 16px;
}

.layout-actions {
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.layout-item:hover .layout-actions {
    opacity: 1;
}

/* ===== ACTION BUTTONS IN TABLES ===== */
.action-btn {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    transition: all 0.1s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 24px;
}

.action-btn-primary {
    background-color: #0078d4;
    color: #ffffff;
}

.action-btn-primary:hover {
    background-color: #106ebe;
}

.action-btn-secondary {
    background-color: #ffffff;
    border-color: #8a8886;
    color: #323130;
}

.action-btn-secondary:hover {
    background-color: #f3f2f1;
    border-color: #605e5c;
}

.action-btn-danger {
    background-color: #d13438;
    color: #ffffff;
}

.action-btn-danger:hover {
    background-color: #b92b2b;
}

/* ===== STATUS INDICATORS ===== */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-success {
    background-color: #c6efce;
    color: #0e5814;
}

.status-warning {
    background-color: #fff2cc;
    color: #8a5400;
}

.status-danger {
    background-color: #ffc7ce;
    color: #9c0e1b;
}

.status-info {
    background-color: #d1ecf1;
    color: #0c5460;
}

.status-neutral {
    background-color: #f3f2f1;
    color: #605e5c;
}

/* ===== EMPTY STATES ===== */
.table-empty {
    text-align: center;
    padding: 48px 16px;
    color: #605e5c;
}

.table-empty-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 16px;
    opacity: 0.5;
}

.table-empty-title {
    font-size: 16px;
    font-weight: 600;
    color: #323130;
    margin-bottom: 8px;
}

.table-empty-text {
    font-size: 14px;
    margin-bottom: 16px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

/* ===== RESPONSIVE TABLE BEHAVIOR ===== */
@media (max-width: 768px) {
    .table-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    .table-actions {
        justify-content: space-between;
        width: 100%;
    }
    
    .table-search {
        min-width: auto;
        flex: 1;
    }
    
    .table-pagination {
        flex-direction: column;
        gap: 12px;
    }
    
    .pagination-controls {
        justify-content: center;
        width: 100%;
    }
    
    .table th,
    .table td {
        padding: 8px;
        font-size: 13px;
    }
    
    .layout-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .layout-actions {
        opacity: 1;
        align-self: stretch;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .table-responsive .table {
        min-width: 400px;
    }
    
    .table th,
    .table td {
        padding: 6px;
        font-size: 12px;
    }
    
    .page-btn {
        min-width: 28px;
        padding: 4px 6px;
        font-size: 12px;
    }
    
    .action-btn {
        padding: 3px 6px;
        font-size: 11px;
        min-height: 20px;
    }
    
    .status-indicator {
        font-size: 10px;
        padding: 1px 6px;
    }
}