/* High-End Standalone Admin Panel Stylesheet (admin/admin.css) */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700;800&display=swap');

:root {
    --admin-bg-gradient: radial-gradient(ellipse at top, #1c1917 0%, #0c0a09 100%);
    --admin-card-bg: rgba(28, 25, 23, 0.75);
    --admin-card-bg-hover: rgba(44, 40, 37, 0.85);
    --admin-border: rgba(234, 179, 8, 0.18);
    --admin-border-hover: rgba(234, 179, 8, 0.4);
    
    --gold-primary: #eab308;
    --gold-dark: #a16207;
    --gold-light: #fef08a;
    --gold-gradient: linear-gradient(135deg, #f59e0b 0%, #b45309 100%);
    
    --admin-success: #10b981;
    --admin-danger: #ef4444;
    --admin-blue: #3b82f6;
    --admin-purple: #a855f7;
    
    --text-primary: #f5f5f4;
    --text-secondary: #d6d3d1;
    --text-muted: #a8a29e;
    
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 24px;
    
    --shadow-admin: 0 10px 30px -5px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(234, 179, 8, 0.05);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--admin-bg-gradient);
    color: var(--text-primary);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    line-height: 1.5;
    overflow-x: hidden;
}

/* Glassmorphism Panel Component */
.glass-panel {
    background: var(--admin-card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-xl);
    padding: 20px 24px;
    box-shadow: var(--shadow-admin);
    transition: var(--transition);
}

.glass-panel:hover {
    border-color: var(--admin-border-hover);
}

/* Layout Container */
.admin-wrapper {
    max-width: 1360px;
    margin: 0 auto;
    padding: 20px 24px 40px 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* -------------------------------------------------------------
   1. AUTHENTICATION OVERLAY (LOGIN MODAL)
------------------------------------------------------------- */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(12, 10, 9, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.auth-card {
    width: 100%;
    max-width: 420px;
    text-align: center;
    padding: 36px 28px;
    border: 1px solid rgba(234, 179, 8, 0.3);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.7), 0 0 30px rgba(234, 179, 8, 0.15);
}

.auth-icon {
    font-size: 2.8rem;
    margin-bottom: 12px;
}

.auth-card h2 {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: var(--gold-primary);
    margin-bottom: 6px;
}

.auth-card p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.auth-card .input-group {
    margin-bottom: 18px;
}

.auth-error {
    color: var(--admin-danger);
    font-size: 0.85rem;
    margin-top: 12px;
    min-height: 20px;
    font-weight: 600;
}

.back-home-link {
    display: inline-block;
    margin-top: 18px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.85rem;
    transition: var(--transition);
}

.back-home-link:hover {
    color: var(--gold-primary);
}

/* -------------------------------------------------------------
   2. HEADER & BRANDING
------------------------------------------------------------- */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.admin-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--gold-primary);
    box-shadow: 0 0 12px rgba(234, 179, 8, 0.3);
}

.admin-title {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    background: var(--gold-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.admin-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.admin-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

/* -------------------------------------------------------------
   3. BUTTON SYSTEM
------------------------------------------------------------- */
.admin-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--gold-gradient);
    color: #1c1917;
    box-shadow: 0 4px 14px rgba(234, 179, 8, 0.25);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(234, 179, 8, 0.35);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-primary);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(234, 179, 8, 0.3);
    color: var(--gold-light);
}

.btn-success {
    background: rgba(16, 185, 129, 0.15);
    border-color: rgba(16, 185, 129, 0.3);
    color: var(--admin-success);
}

.btn-success:hover {
    background: rgba(16, 185, 129, 0.25);
    color: #ffffff;
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
    color: var(--admin-danger);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #ffffff;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.78rem;
    border-radius: var(--radius-sm);
}

.btn-block {
    width: 100%;
}

/* -------------------------------------------------------------
   4. NAVIGATION TABS
------------------------------------------------------------- */
.admin-tabs {
    display: flex;
    gap: 8px;
    padding: 8px;
    background: rgba(20, 18, 16, 0.8);
    overflow-x: auto;
}

.admin-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.admin-tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.admin-tab-btn.active {
    background: var(--gold-gradient);
    color: #1c1917;
    box-shadow: 0 4px 14px rgba(234, 179, 8, 0.25);
}

/* Tab Content Visibility */
.admin-tab-content {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.admin-tab-content.active {
    display: flex;
}

/* -------------------------------------------------------------
   5. TAB 1: ANALYTICS (KPI CARDS & BARS)
------------------------------------------------------------- */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.metric-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
}

.metric-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.metric-icon.gold { background: rgba(234, 179, 8, 0.15); border: 1px solid rgba(234, 179, 8, 0.3); }
.metric-icon.emerald { background: rgba(16, 185, 129, 0.15); border: 1px solid rgba(16, 185, 129, 0.3); }
.metric-icon.blue { background: rgba(59, 130, 246, 0.15); border: 1px solid rgba(59, 130, 246, 0.3); }
.metric-icon.purple { background: rgba(168, 85, 247, 0.15); border: 1px solid rgba(168, 85, 247, 0.3); }

.metric-details {
    display: flex;
    flex-direction: column;
}

.metric-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1.2;
}

.metric-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 600;
    margin-top: 2px;
}

/* Breakdown Progress Bars */
.analytics-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.analytics-panel h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 16px;
}

.bars-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.bar-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.bar-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.82rem;
}

.bar-name {
    font-weight: 600;
    color: var(--text-secondary);
}

.bar-count {
    color: var(--text-muted);
}

.bar-track {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 100px;
    overflow: hidden;
}

.bar-fill {
    height: 100%;
    border-radius: 100px;
    transition: width 0.8s ease-out;
}

.bar-fill.gold { background: var(--gold-gradient); }
.bar-fill.blue { background: linear-gradient(135deg, #60a5fa 0%, #2563eb 100%); }
.bar-fill.emerald { background: linear-gradient(135deg, #34d399 0%, #059669 100%); }
.bar-fill.purple { background: linear-gradient(135deg, #c084fc 0%, #7e22ce 100%); }

/* -------------------------------------------------------------
   6. TABLES & DATA LISTS
------------------------------------------------------------- */
.margin-top {
    margin-top: 10px;
}

.panel-header-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.panel-header-actions h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-light);
}

.table-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    text-align: left;
}

.admin-table th {
    background: rgba(44, 40, 37, 0.8);
    color: var(--gold-primary);
    font-weight: 700;
    padding: 12px 16px;
    border-bottom: 1px solid var(--admin-border);
    white-space: nowrap;
}

.admin-table td {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    vertical-align: middle;
}

.admin-table tbody tr {
    transition: var(--transition);
}

.admin-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.04);
}

/* Badge Tags inside tables */
.badge-source {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
}

.badge-google { background: rgba(59, 130, 246, 0.15); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.badge-facebook { background: rgba(24, 119, 242, 0.15); color: #4294ff; border: 1px solid rgba(24, 119, 242, 0.3); }
.badge-direct { background: rgba(234, 179, 8, 0.15); color: var(--gold-primary); border: 1px solid rgba(234, 179, 8, 0.3); }
.badge-referral { background: rgba(168, 85, 247, 0.15); color: #c084fc; border: 1px solid rgba(168, 85, 247, 0.3); }

/* -------------------------------------------------------------
   7. FORM INPUTS & CRUD PANELS
------------------------------------------------------------- */
.groups-mgmt-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 20px;
}

.mgmt-form-panel h3, .mgmt-table-panel h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-row {
    display: flex;
    gap: 12px;
}

.form-row .form-group {
    flex: 1;
}

.admin-input, .admin-input-sm {
    background: rgba(12, 10, 9, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: 0.88rem;
    font-family: inherit;
    transition: var(--transition);
    width: 100%;
}

.admin-input-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
}

.admin-input:focus, .admin-input-sm:focus {
    outline: none;
    border-color: var(--gold-primary);
    box-shadow: 0 0 10px rgba(234, 179, 8, 0.2);
    background: rgba(28, 25, 23, 0.9);
}

select.admin-input option {
    background: #1c1917;
    color: #f5f5f4;
}

textarea.admin-input {
    resize: vertical;
}

.checkbox-group {
    margin-top: 8px;
}

.custom-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    user-select: none;
}

.custom-checkbox input {
    accent-color: var(--gold-primary);
    width: 16px;
    height: 16px;
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
}

.panel-divider {
    border: none;
    height: 1px;
    background: rgba(255, 255, 255, 0.08);
    margin: 24px 0;
}

/* District Chips Cloud */
.district-mgmt-box {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.district-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    max-height: 220px;
    overflow-y: auto;
    padding-right: 4px;
}

.district-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 100px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
}

.district-chip:hover {
    border-color: var(--gold-primary);
    color: var(--gold-light);
}

.district-chip.top-chip {
    background: rgba(234, 179, 8, 0.12);
    border-color: rgba(234, 179, 8, 0.35);
    color: var(--gold-primary);
}

.district-chip-del {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    margin-left: 2px;
    transition: var(--transition);
}

.district-chip-del:hover {
    color: var(--admin-danger);
}

/* -------------------------------------------------------------
   8. TAB 3: PROFILE SETTINGS & LIVE PREVIEW
------------------------------------------------------------- */
.profile-mgmt-layout {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 20px;
}

.profile-form-panel h3, .profile-preview-panel h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 18px;
}

.preview-card-wrapper {
    background: rgba(12, 10, 9, 0.8);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-xl);
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* Preview Card Specific Sub-components */
.preview-card-wrapper .profile-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.preview-card-wrapper .avatar-wrapper {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    padding: 3px;
    background: var(--gold-gradient);
}

.preview-card-wrapper .avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ffffff;
}

.preview-card-wrapper .verified-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--gold-primary);
    color: #1c1917;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
}

.preview-card-wrapper .profile-info h1 {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
}

.preview-card-wrapper .profile-subtitle {
    font-size: 0.82rem;
    font-style: italic;
    color: var(--gold-primary);
    margin-top: 4px;
}

.preview-card-wrapper .profile-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 8px;
    line-height: 1.5;
}

.preview-card-wrapper .promo-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.3);
    color: var(--gold-primary);
    font-size: 0.72rem;
    font-weight: 700;
    margin-top: 10px;
}

.preview-card-wrapper .support-cta {
    width: 100%;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--gold-gradient);
    color: #1c1917;
    text-decoration: none;
    font-weight: 800;
    font-size: 0.85rem;
    margin-top: 16px;
    display: block;
}

/* -------------------------------------------------------------
   9. TOAST NOTIFICATION
------------------------------------------------------------- */
.admin-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: rgba(28, 25, 23, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--gold-primary);
    color: var(--text-primary);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 700;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 99999;
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.admin-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* -------------------------------------------------------------
   10. RESPONSIVE BREAKPOINTS
------------------------------------------------------------- */
@media (max-width: 1199px) {
    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .groups-mgmt-layout, .profile-mgmt-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .admin-wrapper {
        padding: 14px 12px;
    }

    .admin-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .admin-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .analytics-row {
        grid-template-columns: 1fr;
    }

    .form-row {
        flex-direction: column;
        gap: 0;
    }
}

/* Trạng thái tự động làm mới số liệu (tab Phân tích) */
.auto-refresh-status {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 14px;
    letter-spacing: 0.2px;
}

.auto-refresh-status.is-stale {
    color: var(--admin-danger);
}

/* Phân trang bảng nhật ký truy cập */
.table-pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
}

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

.pagination-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.page-btn {
    min-width: 36px;
    padding: 6px 10px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    color: var(--gold-light);
    background: var(--admin-card-bg-hover);
    border-color: var(--admin-border-hover);
}

.page-btn.active {
    color: #0c0a09;
    font-weight: 700;
    background: var(--gold-gradient);
    border-color: transparent;
}

.page-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.page-gap {
    color: var(--text-muted);
    padding: 0 2px;
}

/* Sắp xếp & lọc theo cột trong bảng nhật ký truy cập */
.admin-table th .th-inner {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

.th-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 0.7rem;
    line-height: 1;
    color: var(--text-muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.th-icon:hover {
    color: var(--gold-light);
    background: rgba(234, 179, 8, 0.12);
    border-color: var(--admin-border);
}

.th-icon.active {
    color: #0c0a09;
    background: var(--gold-gradient);
    border-color: transparent;
}

.th-icon .filter-count {
    font-size: 0.6rem;
    font-weight: 700;
    margin-left: 1px;
}

.column-filter-popover {
    position: absolute;
    z-index: 200;
    width: 260px;
    padding: 10px;
    background: #1c1917;
    border: 1px solid var(--admin-border-hover);
    border-radius: var(--radius-md);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.column-filter-popover[hidden] {
    display: none;
}

.filter-search {
    width: 100%;
    padding: 7px 10px;
    margin-bottom: 8px;
    font-size: 0.82rem;
    color: var(--text-primary);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-sm);
}

.filter-search:focus {
    outline: none;
    border-color: var(--gold-primary);
}

.filter-options {
    max-height: 240px;
    overflow-y: auto;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 6px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.filter-option:hover {
    background: var(--admin-card-bg-hover);
}

.filter-option input {
    accent-color: var(--gold-primary);
    cursor: pointer;
}

.filter-option .opt-count {
    margin-left: auto;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.filter-empty {
    padding: 10px 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
}

.filter-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--admin-border);
}

.filter-actions button {
    flex: 1;
    padding: 6px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    background: var(--admin-card-bg);
    border: 1px solid var(--admin-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.filter-actions button:hover {
    color: var(--gold-light);
    border-color: var(--admin-border-hover);
}

.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    font-size: 0.76rem;
    color: var(--gold-light);
    background: rgba(234, 179, 8, 0.1);
    border: 1px solid var(--admin-border);
    border-radius: 999px;
}

.filter-chip button {
    padding: 0;
    font-size: 0.8rem;
    line-height: 1;
    color: var(--text-muted);
    background: none;
    border: none;
    cursor: pointer;
}

.filter-chip button:hover {
    color: var(--admin-danger);
}

/* Tách bạch nút lọc khỏi nút sắp xếp: icon phễu + có viền thường trực */
.th-icon svg {
    display: block;
}

.th-icon[data-filter] {
    width: auto;
    min-width: 22px;
    padding: 0 4px;
    gap: 2px;
    margin-left: 2px;
    border-color: var(--admin-border);
    background: rgba(0, 0, 0, 0.25);
}

.th-icon[data-filter].active {
    background: var(--gold-gradient);
    border-color: transparent;
}
