/* ========== LIST PAGE COMMON STYLES ========== */
/* Shared styles for all list pages (Customers, Users, Inspections, Equipment) */

/* ========== Statistics Cards ========== */
/* Compact one-line style matching Inspection Index */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin: 0.75rem 0 0.5rem 0;
    padding: 0;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 2px;
    height: 100%;
    background: white;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.6875rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 0;
    white-space: nowrap;
}

.stat-label::after {
    content: ':';
    margin-left: 0.125rem;
}

.stat-value {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.2;
}

.stat-suffix {
    color: var(--text-secondary);
    font-size: 0.6875rem;
    margin-left: 0.25rem;
    font-weight: 400;
}

/* ========== Export Actions ========== */
.export-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.export-title {
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.export-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.export-btn {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    color: var(--text-primary);
    padding: 0.375rem 0.75rem;
    border-radius: 6px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.export-btn:hover {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    transform: translateY(-1px);
    text-decoration: none;
}

.export-btn .material-symbols-outlined {
    font-size: 16px;
}

/* Light theme export actions */
.theme-light .export-container,
[data-theme="light"] .export-container {
    background: white;
    border: 1px solid #dee2e6;
}

.theme-light .export-btn,
[data-theme="light"] .export-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    color: #212529;
}

.theme-light .export-btn:hover,
[data-theme="light"] .export-btn:hover {
    background: #1976D2;
    border-color: #1976D2;
    color: white;
}

/* ========== Data Table Container ========== */
.data-table-container {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1rem;
    overflow: hidden;
}

.theme-light .data-table-container,
[data-theme="light"] .data-table-container {
    background: white;
    border: 1px solid #dee2e6;
}

/* ========== Pagination ========== */
.pagination-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (max-width: 768px) {
    .pagination-container {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ========== Dual Scrollbar System ========== */
.table-scroll-wrapper,
.top-scrollbar-container {
    overflow-x: auto;
    width: 100%;
    -webkit-overflow-scrolling: touch;
}

.table-scroll-wrapper {
    overflow-y: visible;
    background: rgba(0, 0, 0, 0.1);
    position: relative;
}

.top-scrollbar-container {
    overflow-y: hidden;
    height: 20px;
    margin-bottom: 10px;
    background: rgba(0, 0, 0, 0.1);
}

.top-scrollbar-inner {
    height: 10px;  /* Increased from 1px to make scrollbar visible */
    min-width: var(--table-min-width, 1000px); /* Use CSS variable if set, fallback to 1000px */
}

/* ========== Scrollbar Styling (Dark Theme) ========== */
.table-scroll-wrapper::-webkit-scrollbar,
.top-scrollbar-container::-webkit-scrollbar {
    height: 18px;
    background: rgba(0, 0, 0, 0.5);
}

.table-scroll-wrapper::-webkit-scrollbar-track,
.top-scrollbar-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb,
.top-scrollbar-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.4);
    border-radius: 10px;
    cursor: grab;
}

.table-scroll-wrapper::-webkit-scrollbar-thumb:hover,
.top-scrollbar-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.6);
}

.table-scroll-wrapper::-webkit-scrollbar-thumb:active,
.top-scrollbar-container::-webkit-scrollbar-thumb:active {
    background: rgba(255, 255, 255, 0.7);
    cursor: grabbing;
}

/* Light theme scrollbar styling */
.theme-light .table-scroll-wrapper,
.theme-light .top-scrollbar-container,
[data-theme="light"] .table-scroll-wrapper,
[data-theme="light"] .top-scrollbar-container {
    background: rgba(0, 0, 0, 0.03);
}

.theme-light .table-scroll-wrapper::-webkit-scrollbar,
.theme-light .top-scrollbar-container::-webkit-scrollbar,
[data-theme="light"] .table-scroll-wrapper::-webkit-scrollbar,
[data-theme="light"] .top-scrollbar-container::-webkit-scrollbar {
    background: rgba(0, 0, 0, 0.05);
}

.theme-light .table-scroll-wrapper::-webkit-scrollbar-track,
.theme-light .top-scrollbar-container::-webkit-scrollbar-track,
[data-theme="light"] .table-scroll-wrapper::-webkit-scrollbar-track,
[data-theme="light"] .top-scrollbar-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
}

.theme-light .table-scroll-wrapper::-webkit-scrollbar-thumb,
.theme-light .top-scrollbar-container::-webkit-scrollbar-thumb,
[data-theme="light"] .table-scroll-wrapper::-webkit-scrollbar-thumb,
[data-theme="light"] .top-scrollbar-container::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(0, 0, 0, 0.2);
}

.theme-light .table-scroll-wrapper::-webkit-scrollbar-thumb:hover,
.theme-light .top-scrollbar-container::-webkit-scrollbar-thumb:hover,
[data-theme="light"] .table-scroll-wrapper::-webkit-scrollbar-thumb:hover,
[data-theme="light"] .top-scrollbar-container::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 0, 0, 0.5);
}

.theme-light .table-scroll-wrapper::-webkit-scrollbar-thumb:active,
.theme-light .top-scrollbar-container::-webkit-scrollbar-thumb:active,
[data-theme="light"] .table-scroll-wrapper::-webkit-scrollbar-thumb:active,
[data-theme="light"] .top-scrollbar-container::-webkit-scrollbar-thumb:active {
    background: rgba(0, 0, 0, 0.6);
}

/* ========== Common Table Styles ========== */
.list-page-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1000px;
    background: var(--bg-card);
}

.list-page-table thead {
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--border);
}

.list-page-table th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border);
}

.list-page-table th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.2s ease;
}

.list-page-table th.sortable:hover {
    color: var(--accent);
}

.sort-indicator {
    margin-left: 0.375rem;
    font-size: 0.75rem;
    color: var(--accent);
}

.list-page-table td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.list-page-table tbody tr {
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.list-page-table tbody tr:hover {
    background: var(--bg-hover);
}

.list-page-table a {
    color: #6ab3ff;
    text-decoration: none;
    transition: color 0.2s ease;
}

.list-page-table a:hover {
    color: #8ac4ff;
    text-decoration: underline;
}

/* Light theme link colors */
.theme-light .list-page-table a,
[data-theme="light"] .list-page-table a {
    color: #1976D2;
}

.theme-light .list-page-table a:hover,
[data-theme="light"] .list-page-table a:hover {
    color: #1565C0;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state p {
    font-size: 1rem;
    margin: 0;
}

/* ========== Status Indicators ========== */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.status-indicator.active {
    background: rgba(76, 175, 80, 0.1);
    color: #4caf50;
}

.status-indicator.inactive {
    background: transparent;
    color: var(--text-secondary);
}

.status-indicator-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.status-indicator.active .status-indicator-dot {
    background: #4caf50;
}

.status-indicator.inactive .status-indicator-dot {
    background: #9e9e9e;
}

/* ========== List Page Container ========== */
.list-page-container {
    padding-left: 0;
    padding-right: 0;
    padding-top: 0;
    padding-bottom: 1rem;
    width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.list-page-container h2 {
    margin-bottom: 1rem;
}
