.theme-list-page .page-header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    flex-wrap: wrap;
}

.theme-list-page .page-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* Trash toggle button */
.btn-trash {
    background: var(--surface-2, #f3f3f3);
    color: var(--text-muted, #666);
    border: 1px solid var(--border, #ddd);
}
.btn-trash:hover {
    background: var(--warning-light, #fff3cd);
    color: var(--warning, #856404);
    border-color: var(--warning, #ffc107);
}
.btn-trash.active {
    background: var(--warning, #ffc107);
    color: #333;
    border-color: var(--warning-dark, #e0a800);
}

/* Trash mode indicator */
.trash-mode-banner {
    background: var(--warning-light, #fff3cd);
    border: 1px solid var(--warning, #ffc107);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    margin-bottom: 1rem;
    font-size: 0.875rem;
    color: var(--warning-dark, #856404);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Search panel */
.search-panel {
    margin-bottom: 1rem;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    user-select: none;
}

.search-panel-title {
    font-weight: 600;
    font-size: 0.875rem;
}

.search-panel-arrow {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.search-panel-arrow.collapsed {
    transform: rotate(-90deg);
}

.search-fields {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
}

.search-field-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.search-field-item label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.search-field-row {
    display: flex;
    gap: 0.5rem;
}

.search-field-row select.search-operator {
    width: 100px;
    flex-shrink: 0;
}

.search-field-row input,
.search-field-row select {
    flex: 1;
}

.search-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

/* Batch toolbar */
.batch-toolbar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem 0;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.batch-select-all {
    padding-top: 0 !important;
    font-size: 0.875rem;
}

.batch-count {
    font-size: 0.8125rem;
    color: var(--primary);
    font-weight: 600;
}

.batch-action-select {
    max-width: 200px;
}

/* Data table */
.data-table th {
    white-space: nowrap;
}

.data-table .col-checkbox {
    width: 40px;
}

.data-table th.sortable {
    cursor: pointer;
    user-select: none;
}

.data-table th.sortable:hover {
    background: var(--border);
}

.sort-indicator {
    margin-left: 0.25rem;
    font-size: 0.75rem;
    opacity: 0.5;
}

.sort-indicator.active {
    opacity: 1;
    color: var(--primary);
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.15em 0.5em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius);
}

.status-published {
    background: #d1fae5;
    color: #065f46;
}

.status-draft {
    background: #fef3c7;
    color: #92400e;
}

.status-deleted {
    background: #fee2e2;
    color: #991b1b;
}

.sticky-badge {
    display: inline-block;
    padding: 0.15em 0.5em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius);
    background: #ede9fe;
    color: #5b21b6;
}

/* Pagination */
.pagination-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.pagination-info {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.pagination-pages {
    display: flex;
    gap: 0.25rem;
}

.page-btn {
    min-width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    background: var(--bg-white);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    cursor: pointer;
    color: var(--text);
    text-decoration: none;
}

.page-btn:hover {
    background: var(--bg);
}

.page-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.pagination-perpage {
    font-size: 0.875rem;
}

.pagination-perpage select {
    width: auto;
    display: inline-block;
    padding: 0.25rem 2rem 0.25rem 0.5rem;
}

/* Row actions */
.row-actions {
    display: flex;
    gap: 0.25rem;
    flex-wrap: nowrap;
}

.row-actions .btn {
    white-space: nowrap;
}

.text-ellipsis {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Related theme cell */
.related-cell {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.related-cell-visible {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.related-cell-collapsed {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    max-width: 160px;
    overflow: hidden;
    white-space: nowrap;
}

.related-cell-collapsed:hover {
    flex-wrap: wrap;
    white-space: normal;
    max-width: none;
    overflow: visible;
}

.btn-outline-primary {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid var(--primary);
    color: var(--primary);
    background: transparent;
    border-radius: var(--radius);
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.btn-outline-primary:hover,
.btn-outline-primary:focus {
    background: var(--primary);
    color: #fff;
    text-decoration: none;
}

/* Filter indicator */
.filter-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: var(--radius);
    font-size: 0.8125rem;
}

.filter-indicator .btn-clear-filter {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
}

/* Switch-click (quick toggle) */
.switch-click-badge {
    cursor: pointer;
    display: inline-block;
    padding: 0.15em 0.5em;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius);
    background: #e0e7ff;
    color: #3730a3;
    transition: opacity 0.15s;
    user-select: none;
}

.switch-click-badge:hover {
    opacity: 0.7;
}

@media (max-width: 768px) {
    .theme-list-page .page-header-row {
        flex-direction: column;
    }
    .search-fields {
        grid-template-columns: 1fr;
    }
    .pagination-bar {
        flex-direction: column;
        align-items: flex-start;
    }
}
